Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "DisplayLevelUpError", _m_DisplayLevelUpError); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "ContainsSkill", _m_ContainsSkill); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "ExistAnyActiveExpert", _m_ExistAnyActiveExpert); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "SatisfyActiveExpert", _m_SatisfyActiveExpert); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetAlreadyRemind", _m_SetAlreadyRemind); |
| | | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "selectRefresh", _e_selectRefresh); |
| | |
| | | int _skillId = LuaAPI.xlua_tointeger(L, 2); |
| | | |
| | | bool gen_ret = gen_to_be_invoked.ExistAnyActiveExpert( _skillId ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_SatisfyActiveExpert(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.TreasureSkillModel gen_to_be_invoked = (Snxxz.UI.TreasureSkillModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | int _skillId = LuaAPI.xlua_tointeger(L, 2); |
| | | |
| | | bool gen_ret = gen_to_be_invoked.SatisfyActiveExpert( _skillId ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | |
| | | |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, May 15, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class ReikiGotoSkillLevelUpWin : Window
|
| | | {
|
| | | [SerializeField] Button m_Goto;
|
| | | [SerializeField] Button m_Close;
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Goto.AddListener(() =>
|
| | | {
|
| | | CloseImmediately();
|
| | | ModelCenter.Instance.GetModel<TreasureSkillModel>().selectActivePriority = true;
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.TreasureSkill);
|
| | | });
|
| | | m_Close.AddListener(CloseClick);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 58a4a60cca331e44e8bb3086ddfdf896 |
| | | timeCreated: 1557891431 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | Dictionary<int, List<int>> m_PreLimitReikiRoots = new Dictionary<int, List<int>>();
|
| | |
|
| | | public Dictionary<int, int> lastReikiRootPoints = new Dictionary<int, int>();
|
| | | public Dictionary<int, int> afterReikiRootPoints = new Dictionary<int, int>();
|
| | |
|
| | | public List<int> reikiRoots = new List<int>();
|
| | |
|
| | |
| | |
|
| | | public int resetCostItemId { get; private set; }
|
| | |
|
| | | public int[] reikiRootGetWays { get; private set; }
|
| | |
|
| | | public bool isServerPrepare { get; private set; }
|
| | |
|
| | | public bool displayOpenAnimation
|
| | |
| | |
|
| | | public bool resetReikiRootRecord { get; set; }
|
| | | public bool resetReikiRemind { get; set; }
|
| | | public int resetReikiLimitLevel { get; private set; }
|
| | |
|
| | | public int selectReikiRoot { get; set; }
|
| | |
|
| | | public readonly Redpoint redpoint = new Redpoint(101, 10103); |
| | |
|
| | |
| | | m_ReikiQualityMapColors = ConfigParse.GetDic<int, int>(funcConfig.Numerical2);
|
| | | redpointRequirePoint = int.Parse(funcConfig.Numerical3);
|
| | |
|
| | | reikiRootGetWays = ConfigParse.GetMultipleStr<int>(funcConfig.Numerical4);
|
| | |
|
| | | funcConfig = FuncConfigConfig.Get("LVUPAddPoint");
|
| | | freeResetLevel = int.Parse(funcConfig.Numerical4);
|
| | | resetCostItemId = int.Parse(funcConfig.Numerical5);
|
| | |
| | | var job = int.Parse(jobKey);
|
| | | m_PreLimitReikiRoots.Add(job, new List<int>(LitJson.JsonMapper.ToObject<int[]>(json[jobKey].ToJson())));
|
| | | }
|
| | | resetReikiLimitLevel = int.Parse(funcConfig.Numerical2);
|
| | |
|
| | | var config = ReikiRootConfig.GetValues()[0];
|
| | | maxQuality = config.qualityArea.Length;
|
| | |
| | | foreach (var id in reikiRoots)
|
| | | {
|
| | | lastReikiRootPoints[id] = GetReikiRootPoint(id);
|
| | | afterReikiRootPoints[id] = GetReikiRootPoint(id);
|
| | | }
|
| | |
|
| | | for (int i = 0; i < package.PointAttrIDCount; i++)
|
| | |
| | | var point = package.PointValueList[i];
|
| | | m_ReikiRootFreePoints[id] = point;
|
| | |
|
| | | afterReikiRootPoints[id] = m_ReikiRootPoints[id] - lastFreePoint + point;
|
| | |
|
| | | if (GetReikiRootQuality(id, lastReikiRootPoints[id]) <
|
| | | GetReikiRootQuality(id, m_ReikiRootPoints[id] - lastFreePoint + point))
|
| | | GetReikiRootQuality(id, afterReikiRootPoints[id]))
|
| | | {
|
| | | isReikiQualityChange = true;
|
| | | }
|
| | |
| | | {
|
| | | if (!WindowCenter.Instance.IsOpen<ReikiRootQualityPromoteWin>())
|
| | | {
|
| | | Clock.AlarmAfter(1f, () =>
|
| | | {
|
| | | if (WindowCenter.Instance.IsOpen<ReikiRootWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<ReikiRootQualityPromoteWin>();
|
| | | }
|
| | | });
|
| | | if (WindowCenter.Instance.IsOpen<ReikiRootWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<ReikiRootQualityPromoteWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | [SerializeField] Button m_OpenKeyboard;
|
| | | [SerializeField] UIEffect m_QualityEffect;
|
| | | [SerializeField] UIEffect m_ResetEffect;
|
| | | [SerializeField] UIEffect m_SelectEffect;
|
| | |
|
| | | public int id { get; private set; }
|
| | |
|
| | |
| | | model.onReikiRootPointRefresh += OnReikiRootPointRefresh;
|
| | | model.onReikiRootPointReset += OnReikiRootPointReset;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | }
|
| | |
|
| | | public void DisplaySelectEffect(bool selected)
|
| | | {
|
| | | m_SelectEffect.gameObject.SetActive(selected);
|
| | | }
|
| | |
|
| | | void DisplayPoint(bool showQualityEffect = false)
|
| | |
| | |
|
| | | void DisplayButtonState()
|
| | | {
|
| | | var isResetOpen = FuncOpen.Instance.IsFuncOpen(175);
|
| | | var isResetOpen = PlayerDatas.Instance.baseData.LV >= model.resetReikiLimitLevel;
|
| | | var isPreReikiRoot = model.IsPreReikiRoot(id);
|
| | | if (!isResetOpen && !isPreReikiRoot)
|
| | | {
|
| | |
| | |
|
| | | private void OnAddDown(GameObject go)
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen(175)
|
| | | if (PlayerDatas.Instance.baseData.LV < model.resetReikiLimitLevel
|
| | | && !model.IsPreReikiRoot(id))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("NotSatisfyPreReikiRoot", FuncOpen.Instance.GetLimitLv(175));
|
| | | SysNotifyMgr.Instance.ShowTip("NotSatisfyPreReikiRoot", model.resetReikiLimitLevel);
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | private void OnSubDown(GameObject go)
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen(175)
|
| | | && !model.IsPreReikiRoot(id))
|
| | | if (PlayerDatas.Instance.baseData.LV < model.resetReikiLimitLevel
|
| | | && !model.IsPreReikiRoot(id))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("NotSatisfyPreReikiRoot", FuncOpen.Instance.GetLimitLv(175));
|
| | | SysNotifyMgr.Instance.ShowTip("NotSatisfyPreReikiRoot", model.resetReikiLimitLevel);
|
| | | return;
|
| | | }
|
| | | if (m_Coroutine != null)
|
| | |
| | |
|
| | | private void OnMax()
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen(175)
|
| | | && !model.IsPreReikiRoot(id))
|
| | | if (PlayerDatas.Instance.baseData.LV < model.resetReikiLimitLevel
|
| | | && !model.IsPreReikiRoot(id))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("NotSatisfyPreReikiRoot", FuncOpen.Instance.GetLimitLv(175));
|
| | | SysNotifyMgr.Instance.ShowTip("NotSatisfyPreReikiRoot", model.resetReikiLimitLevel);
|
| | | return;
|
| | | }
|
| | | point += model.cacheFreePoint;
|
| | |
| | |
|
| | | private void PlayerDataRefreshEvent(PlayerDataType dataType)
|
| | | {
|
| | | if (dataType == PlayerDataType.FreePoint)
|
| | | if (dataType == PlayerDataType.FreePoint || dataType == PlayerDataType.LV)
|
| | | {
|
| | | DisplayButtonState();
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void OnFuncStateChangeEvent(int funcId)
|
| | | {
|
| | | if (funcId == 175)
|
| | | {
|
| | | DisplayButtonState();
|
| | | }
|
| | | }
|
| | |
|
| | | public void Dispose()
|
| | | {
|
| | | model.onReikiRootPointRefresh -= OnReikiRootPointRefresh;
|
| | | model.onReikiRootPointReset -= OnReikiRootPointReset;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshEvent;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
|
| | |
|
| | | if (m_Coroutine != null)
|
| | | {
|
| | |
| | | foreach (var id in model.lastReikiRootPoints.Keys)
|
| | | {
|
| | | if (model.GetReikiRootQuality(id, model.lastReikiRootPoints[id])
|
| | | < model.GetReikiRootQuality(id, model.GetReikiRootPoint(id)))
|
| | | < model.GetReikiRootQuality(id, model.afterReikiRootPoints[id]))
|
| | | {
|
| | | displayIds.Add(id);
|
| | | }
|
| | |
| | | {
|
| | | m_ReikiRootBehaviours[i].gameObject.SetActive(true);
|
| | | m_ReikiRootBehaviours[i].Display(displayIds[i], model.lastReikiRootPoints[displayIds[i]]
|
| | | , model.GetReikiRootPoint(displayIds[i]), i == displayIds.Count - 1);
|
| | | , model.afterReikiRootPoints[displayIds[i]], i == displayIds.Count - 1);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | ReikiRootModel model { get { return ModelCenter.Instance.GetModel<ReikiRootModel>(); } }
|
| | | TreasureSkillModel treasureSkillModel { get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | |
| | | {
|
| | | m_ReikiRootPoints[i].Display(this, model.reikiRoots[i]);
|
| | | m_ReikiRootPoints[i].gameObject.SetActive(!model.displayOpenAnimation);
|
| | | m_ReikiRootPoints[i].DisplaySelectEffect(model.selectReikiRoot == model.reikiRoots[i]);
|
| | | }
|
| | | }
|
| | |
|
| | | model.selectReikiRoot = 0;
|
| | |
|
| | | m_NumKeyboard.gameObject.SetActive(false);
|
| | |
|
| | |
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent;
|
| | | ReikiFuncOpenWin.onFlyComplete += OnFlyComplete;
|
| | | model.onReikiRootPointRefresh += OnReikiRootPointRefresh;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | |
|
| | | Display();
|
| | | }
|
| | |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshEvent;
|
| | | ReikiFuncOpenWin.onFlyComplete -= OnFlyComplete;
|
| | | model.onReikiRootPointRefresh -= OnReikiRootPointRefresh;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
|
| | | for (int i = 0; i < m_ReikiRootPoints.Count; i++)
|
| | | {
|
| | | m_ReikiRootPoints[i].Dispose();
|
| | |
| | | Clock.Stop(resetPointClock);
|
| | | resetPointClock = null;
|
| | | }
|
| | |
|
| | | treasureSkillModel.newSatisfyActiveExpertDirty = false;
|
| | |
|
| | | StopAllCoroutines();
|
| | | }
|
| | |
|
| | |
| | | if (propertyRefreshDirty)
|
| | | {
|
| | | DisplayProperty();
|
| | | }
|
| | | }
|
| | |
|
| | | if (treasureSkillModel.newSatisfyActiveExpertDirty)
|
| | | {
|
| | | if (!WindowCenter.Instance.IsOpen<ReikiRootQualityPromoteWin>())
|
| | | {
|
| | | treasureSkillModel.newSatisfyActiveExpertDirty = false;
|
| | | WindowCenter.Instance.Open<ReikiGotoSkillLevelUpWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | void DisplayButtonState()
|
| | | {
|
| | | var isResetOpen = FuncOpen.Instance.IsFuncOpen(175);
|
| | | var isResetOpen = PlayerDatas.Instance.baseData.LV >= model.resetReikiLimitLevel;
|
| | | m_Reset.SetColorful(m_ResetLabel, isResetOpen);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | private void OnReset()
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen(175))
|
| | | if (PlayerDatas.Instance.baseData.LV < model.resetReikiLimitLevel)
|
| | | {
|
| | | FuncOpen.Instance.ProcessorFuncErrorTip(175);
|
| | | SysNotifyMgr.Instance.ShowTip("FuncLimit_WXLGCZ",
|
| | | Language.Get("OpenFunc2", model.resetReikiLimitLevel));
|
| | | return;
|
| | | }
|
| | | if (model.GetTotalWashPoint() <= 0)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void OnFuncStateChangeEvent(int id)
|
| | | {
|
| | | if (id == 175)
|
| | | {
|
| | | DisplayButtonState();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnCacheFreePointRefresh()
|
| | | {
|
| | | DisplayFreePoint();
|
| | |
| | | }
|
| | | model.cacheFreePoint = model.freePoint;
|
| | | }
|
| | | else if (dataType == PlayerDataType.LV)
|
| | | {
|
| | | DisplayButtonState();
|
| | | }
|
| | | else
|
| | | {
|
| | | propertyRefreshDirty = true;
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, May 15, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class ExpertSkillActiveRemindWin : Window
|
| | | {
|
| | | [SerializeField] Text m_Remind;
|
| | | [SerializeField] Button m_GotoReiki;
|
| | | [SerializeField] Button m_GetPath;
|
| | | [SerializeField] Button m_Close;
|
| | |
|
| | | public static int skillId = 0;
|
| | |
|
| | | ReikiRootModel reikiRootModel { get { return ModelCenter.Instance.GetModel<ReikiRootModel>(); } }
|
| | | TreasureSkillModel model { get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_GotoReiki.AddListener(GotoReiki);
|
| | | m_GetPath.AddListener(GetPath);
|
| | | m_Close.AddListener(CloseClick);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | Display();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void Display()
|
| | | {
|
| | | TreasurePotential expert;
|
| | | if (model.TryGetPotential(skillId, out expert))
|
| | | {
|
| | | var level = 0;
|
| | | model.TryGetExpertActiveLevel(skillId, out level);
|
| | | var skillConfig = SkillConfig.Get(skillId + level);
|
| | | var requireProperty = skillConfig.RequireProperty();
|
| | | var requireValue = skillConfig.RequirePropertyValue();
|
| | | var propertyConfig = PlayerPropertyConfig.Get(requireProperty);
|
| | | m_Remind.text = Language.Get("ExpertSkillActiveRemind", propertyConfig.Name, requireValue);
|
| | |
|
| | | if (reikiRootModel.freePoint + reikiRootModel.GetReikiRootPoint(requireProperty) >= requireValue)
|
| | | {
|
| | | m_GotoReiki.gameObject.SetActive(true);
|
| | | m_GetPath.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_GotoReiki.gameObject.SetActive(false);
|
| | | m_GetPath.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void GetPath()
|
| | | {
|
| | | CloseImmediately();
|
| | | RealmRecommandEquipGetWayWin.equipGetWays.Clear();
|
| | | RealmRecommandEquipGetWayWin.equipGetWays.AddRange(reikiRootModel.reikiRootGetWays);
|
| | | WindowCenter.Instance.Open<RealmRecommandEquipGetWayWin>();
|
| | | }
|
| | |
|
| | | private void GotoReiki()
|
| | | {
|
| | | CloseImmediately();
|
| | | WindowCenter.Instance.CloseImmediately("ExpertSkillSelectWin");
|
| | | var skillConfig = SkillConfig.Get(skillId);
|
| | | reikiRootModel.selectReikiRoot = skillConfig.RequireProperty();
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.RolePoint);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ae221976dabae6842b2e31e22b5b72a7 |
| | | timeCreated: 1557884880 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | [SerializeField] UIAlphaTween m_AlphaTween;
|
| | | [SerializeField] Image m_SkillIcon;
|
| | | [SerializeField] Text m_SkillName;
|
| | | [SerializeField] Text m_Reiki;
|
| | | [SerializeField] Image m_ReikiIcon;
|
| | | [SerializeField] Text m_ReikiPoint;
|
| | | [SerializeField] ExpertSkillCyclicScroll m_CyclicScroll;
|
| | | [SerializeField] LayoutElement m_LayoutElement;
|
| | | [SerializeField] Button m_Active;
|
| | | [SerializeField] Text m_ActiveLabel;
|
| | | [SerializeField] UIEffect m_ActiveEffect;
|
| | | [SerializeField] Button m_Select;
|
| | | [SerializeField] Button m_Close1;
|
| | | [SerializeField] Button m_Close2;
|
| | |
| | |
|
| | | var property = skillConfig.RequireProperty();
|
| | | var propertyConfig = PlayerPropertyConfig.Get(property);
|
| | | m_Reiki.text = propertyConfig.Name;
|
| | | m_Reiki.color = UIHelper.GetPropertyColor(property);
|
| | | m_ReikiIcon.SetSprite("XT_LG_" + property);
|
| | |
|
| | | var propertyValueLabel = UIHelper.AppendColor(TextColType.Green, UIHelper.GetPropertyValue((PropertyType)property).ToString());
|
| | | m_ReikiPoint.text = string.Format("我的{0}:{1}",
|
| | |
| | | TreasurePotential expert;
|
| | | if (model.TryGetPotential(selectExpert, out expert))
|
| | | {
|
| | | var satisfyActive = model.SatisfyActiveExpert(selectExpert);
|
| | | var error = 0;
|
| | | var satisfyActive = model.SatisfyActiveExpert(selectExpert, out error);
|
| | | var activeLevel = 0;
|
| | | model.TryGetExpertActiveLevel(selectExpert, out activeLevel);
|
| | | m_Select.gameObject.SetActive(activeLevel > 0 && !satisfyActive && !used);
|
| | | m_Active.gameObject.SetActive(satisfyActive);
|
| | | m_Active.gameObject.SetActive(satisfyActive || error == 3);
|
| | |
|
| | | m_Active.SetColorful(m_ActiveLabel, satisfyActive);
|
| | |
|
| | | if (satisfyActive || error == 3)
|
| | | {
|
| | | if (satisfyActive && !m_ActiveEffect.IsPlaying)
|
| | | {
|
| | | m_ActiveEffect.Play();
|
| | | }
|
| | | else if (!satisfyActive && m_ActiveEffect.IsPlaying)
|
| | | {
|
| | | m_ActiveEffect.StopImediatly();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | if (m_CyclicScroll.IsPlaying)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var error = 0;
|
| | | var satisfyActive = model.SatisfyActiveExpert(selectExpert, out error);
|
| | | if (!satisfyActive)
|
| | | {
|
| | | ExpertSkillActiveRemindWin.skillId = selectExpert;
|
| | | WindowCenter.Instance.Open<ExpertSkillActiveRemindWin>();
|
| | | return;
|
| | | }
|
| | | var pak = new CA516_tagCMSelectSkillElement();
|
| | |
| | | [SerializeField] ImageEx m_Icon;
|
| | | [SerializeField] Text m_SkillName;
|
| | | [SerializeField] ImageEx m_ReikiBottom;
|
| | | [SerializeField] Text m_Reiki;
|
| | | [SerializeField] Transform m_ContainerSelect;
|
| | | [SerializeField] Text m_Use;
|
| | | [SerializeField] Text m_Limit;
|
| | |
| | | m_SkillName.text = skillConfig.SkillName;
|
| | |
|
| | | var property = skillConfig.RequireProperty();
|
| | | var propertyConfig = PlayerPropertyConfig.Get(property);
|
| | | m_Reiki.text = propertyConfig.Name;
|
| | | m_Reiki.color = unlock ? UIHelper.GetPropertyColor(property) : UIHelper.s_Gray;
|
| | | m_ReikiBottom.SetSprite("XT_LGDT_" + property);
|
| | |
|
| | | var selectExpertSkill = 0;
|
| | | model.TryGetExpertSkill(ExpertSkillSelectWin.selectSkillId, out selectExpertSkill);
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, May 14, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class TreasureSkillLevelUpWin : Window
|
| | | {
|
| | | [SerializeField] Text m_SkillLevel;
|
| | | [SerializeField] Text m_SkillCoolDown;
|
| | | [SerializeField] Text m_SkillDesc;
|
| | | [SerializeField] ItemBehaviour m_Item;
|
| | | [SerializeField] Button m_LevelUp;
|
| | | [SerializeField] Button m_Close;
|
| | |
|
| | | public static int skillId = 0;
|
| | |
|
| | | TreasureSkillModel model { get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_LevelUp.AddListener(LevelUp);
|
| | | m_Close.AddListener(CloseClick);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | Display();
|
| | |
|
| | | model.treasureSkillRefresh += TreasureSkillRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | model.treasureSkillRefresh -= TreasureSkillRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void Display()
|
| | | {
|
| | | TreasureSkill treasureSkill;
|
| | | model.TryGetSkill(skillId, out treasureSkill);
|
| | | var level = treasureSkill.level + 1;
|
| | |
|
| | | m_SkillLevel.text = Language.Get("SkillActLevel", level);
|
| | |
|
| | | var skillConfig = treasureSkill.GetSkillConfig(level);
|
| | | m_SkillCoolDown.text = skillConfig.CoolDownTime == 0 ? string.Empty
|
| | | : Language.Get("L1065", skillConfig.CoolDownTime / 1000);
|
| | | m_SkillDesc.text = skillConfig.Description;
|
| | |
|
| | | m_Item.SetItem(skillConfig.ExAttr4, skillConfig.ExAttr5);
|
| | | }
|
| | |
|
| | | private void LevelUp()
|
| | | {
|
| | | var error = 0;
|
| | | if (model.TryLevelUpTreasureSkill(skillId, out error))
|
| | | {
|
| | | var pak = new C0304_tagCAddSkillPoint();
|
| | | pak.SkillID = (ushort)skillId;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | else
|
| | | {
|
| | | model.DisplayLevelUpError(error);
|
| | | }
|
| | | }
|
| | |
|
| | | private void TreasureSkillRefresh(int id)
|
| | | {
|
| | | if (skillId == id)
|
| | | {
|
| | | TreasureSkill skill;
|
| | | if (model.TryGetSkill(skillId, out skill))
|
| | | {
|
| | | bool isMax = skill.level >= skill.maxLevel;
|
| | | if (isMax)
|
| | | {
|
| | | CloseClick();
|
| | | }
|
| | | else
|
| | | {
|
| | | Display();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a15d94c3d7058214faabdc737436defb |
| | | timeCreated: 1557826217 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | |
|
| | | bool serverInited = false;
|
| | |
|
| | | public int skillLevelUpLimitLevel { get; private set; }
|
| | |
|
| | | public bool requireRemind { get; private set; }
|
| | |
|
| | | public bool newSatisfyActiveExpertDirty { get; set; }
|
| | |
|
| | | public bool selectActivePriority { get; set; }
|
| | |
|
| | | public readonly Redpoint redpoint = new Redpoint(103, 10304);
|
| | | public const int REDPOINTID_BASE = 10304000;
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | if (dataType == PlayerDataType.LV
|
| | | || dataType == PlayerDataType.CDBPlayerRefresh_Mater
|
| | | if (dataType == PlayerDataType.CDBPlayerRefresh_Mater
|
| | | || dataType == PlayerDataType.CDBPlayerRefresh_Wood
|
| | | || dataType == PlayerDataType.CDBPlayerRefresh_Water
|
| | | || dataType == PlayerDataType.CDBPlayerRefresh_Fire
|
| | | || dataType == PlayerDataType.CDBPlayerRefresh_Earth)
|
| | | {
|
| | | UpdateRedpoint();
|
| | |
|
| | | var requireVerifyNewActive = true;
|
| | | if (dataType == PlayerDataType.CDBPlayerRefresh_Mater
|
| | | && reikiRootModel.GetReikiRootFreePoint((int)PropertyType.Mater) == 0)
|
| | | {
|
| | | requireVerifyNewActive = false;
|
| | | }
|
| | | if (dataType == PlayerDataType.CDBPlayerRefresh_Wood
|
| | | && reikiRootModel.GetReikiRootFreePoint((int)PropertyType.Wood) == 0)
|
| | | {
|
| | | requireVerifyNewActive = false;
|
| | | }
|
| | | if (dataType == PlayerDataType.CDBPlayerRefresh_Water
|
| | | && reikiRootModel.GetReikiRootFreePoint((int)PropertyType.Water) == 0)
|
| | | {
|
| | | requireVerifyNewActive = false;
|
| | | }
|
| | | if (dataType == PlayerDataType.CDBPlayerRefresh_Fire
|
| | | && reikiRootModel.GetReikiRootFreePoint((int)PropertyType.Fire) == 0)
|
| | | {
|
| | | requireVerifyNewActive = false;
|
| | | }
|
| | | if (dataType == PlayerDataType.CDBPlayerRefresh_Earth
|
| | | && reikiRootModel.GetReikiRootFreePoint((int)PropertyType.Earth) == 0)
|
| | | {
|
| | | requireVerifyNewActive = false;
|
| | | }
|
| | |
|
| | | if (requireVerifyNewActive)
|
| | | {
|
| | | foreach (var skill in treasureSkills.Values)
|
| | | {
|
| | | if (skill.expertRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | if (WindowCenter.Instance.IsOpen<ReikiRootWin>()
|
| | | && !WindowCenter.Instance.IsOpen<ReikiGotoSkillLevelUpWin>())
|
| | | {
|
| | | newSatisfyActiveExpertDirty = true;
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | else if (dataType == PlayerDataType.LV)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | var funcConfig = FuncConfigConfig.Get("TreasureSkillLevelUp");
|
| | | skillLevelUpLimitLevel = int.Parse(funcConfig.Numerical1);
|
| | | }
|
| | |
|
| | | public bool TryGetSkills(out List<int> skills)
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | public bool SatisfyActiveExpert(int skillId)
|
| | | public bool SatisfyActiveExpert(int skillId, out int error)
|
| | | {
|
| | | error = 0;
|
| | | TreasurePotential expert;
|
| | | if (!TryGetPotential(skillId, out expert))
|
| | | {
|
| | |
| | | }
|
| | | if (PlayerDatas.Instance.baseData.LV < expert.limitLevel)
|
| | | {
|
| | | error = 1;
|
| | | return false;
|
| | | }
|
| | | var level = 0;
|
| | | TryGetExpertActiveLevel(skillId, out level);
|
| | | if (expert.maxLevel <= level)
|
| | | {
|
| | | error = 2;
|
| | | return false;
|
| | | }
|
| | | var skillConfig = SkillConfig.Get(skillId + level);
|
| | | var requireProperty = skillConfig.RequireProperty();
|
| | | var requireValue = skillConfig.RequirePropertyValue();
|
| | | return UIHelper.GetPropertyValue((PropertyType)requireProperty) >= requireValue;
|
| | | if (UIHelper.GetPropertyValue((PropertyType)requireProperty) < requireValue)
|
| | | {
|
| | | error = 3;
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | public void SetAlreadyRemind()
|
| | |
| | | skill.expertSelectRedpoint.state = RedPointState.None;
|
| | | }
|
| | |
|
| | | var errorCode = 0;
|
| | | foreach (var expert in skill.potentials)
|
| | | {
|
| | | if (funcOpen && skill.level > 0 && SatisfyActiveExpert(expert.id))
|
| | | if (funcOpen && skill.level > 0 && SatisfyActiveExpert(expert.id, out errorCode))
|
| | | {
|
| | | expert.activeRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | |
| | | {
|
| | | [SerializeField] ScrollerController m_Controller;
|
| | |
|
| | | [SerializeField] Text m_SkillName;
|
| | | [SerializeField] SkillWidget m_SkillNow;
|
| | | [SerializeField] SkillWidget m_SkillNext;
|
| | | [SerializeField] SkillExpertWidget m_SkillExpert;
|
| | | [SerializeField] Button m_ExpertSelect;
|
| | | [SerializeField] Transform m_ContainerMax;
|
| | |
|
| | | [SerializeField] ItemBehaviour m_Item;
|
| | | [SerializeField] Button m_LevelUp;
|
| | | [SerializeField] Text m_LevelUpLabel;
|
| | | [SerializeField] RedpointBehaviour m_LevelRedpoint;
|
| | | [SerializeField] RedpointBehaviour m_ExpertRedpoint;
|
| | |
|
| | |
| | | {
|
| | | SetDefaultSelect();
|
| | |
|
| | | model.selectActivePriority = false;
|
| | |
|
| | | Display();
|
| | |
|
| | | List<int> list;
|
| | |
| | | model.skillLevelUpRefresh += SkillLevelUpRefresh;
|
| | | packModel.refreshItemCountEvent += RefreshItemCountEvent;
|
| | | model.expertSkillRefresh += ExpertSkillRefresh;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | model.skillLevelUpRefresh -= SkillLevelUpRefresh;
|
| | | packModel.refreshItemCountEvent -= RefreshItemCountEvent;
|
| | | model.expertSkillRefresh -= ExpertSkillRefresh;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshEvent;
|
| | | model.SetAlreadyRemind();
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | _skill = skillId;
|
| | | }
|
| | | if (model.selectActivePriority && skill.expertRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | _skill = skillId;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | if (_skill == 0)
|
| | |
| | | DisplaySkills();
|
| | | DisplaySkillDetial();
|
| | | DisplayExpertSkill();
|
| | | DisplayButtonState();
|
| | | }
|
| | |
|
| | | private void DisplaySkills()
|
| | |
| | | m_Controller.Restart();
|
| | | }
|
| | |
|
| | | void DisplayButtonState()
|
| | | {
|
| | | m_LevelUp.SetColorful(m_LevelUpLabel, PlayerDatas.Instance.baseData.LV >= model.skillLevelUpLimitLevel);
|
| | | }
|
| | |
|
| | | void DisplaySkillDetial()
|
| | | {
|
| | | TreasureSkill skill;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | m_SkillName.text = config.SkillName;
|
| | |
|
| | | m_SkillNow.Display(skill.skillId, skill.level);
|
| | |
|
| | | bool isMax = skill.level >= skill.maxLevel;
|
| | | m_SkillNext.SetActive(!isMax);
|
| | | m_ContainerMax.gameObject.SetActive(isMax);
|
| | |
|
| | | if (!isMax)
|
| | | {
|
| | | var upConfig = SkillConfig.Get(skill.skillId + skill.level);
|
| | | m_Item.SetItem(upConfig.ExAttr4, upConfig.ExAttr5);
|
| | | m_SkillNext.Display(skill.skillId, skill.level + 1);
|
| | | }
|
| | | m_LevelUp.gameObject.SetActive(!isMax);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | private void LevelUp()
|
| | | {
|
| | | var error = 0;
|
| | | if (model.TryLevelUpTreasureSkill(model.selectSkill, out error))
|
| | | if (PlayerDatas.Instance.baseData.LV < model.skillLevelUpLimitLevel)
|
| | | {
|
| | | var pak = new C0304_tagCAddSkillPoint();
|
| | | pak.SkillID = (ushort)model.selectSkill;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | SysNotifyMgr.Instance.ShowTip("FuncLimit_JNSJ", model.skillLevelUpLimitLevel);
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | model.DisplayLevelUpError(error);
|
| | | }
|
| | | TreasureSkillLevelUpWin.skillId = model.selectSkill;
|
| | | WindowCenter.Instance.Open<TreasureSkillLevelUpWin>();
|
| | | }
|
| | |
|
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshEvent(PlayerDataType dataType)
|
| | | {
|
| | | if (dataType == PlayerDataType.LV)
|
| | | {
|
| | | DisplayButtonState();
|
| | | }
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public class SkillWidget
|
| | | {
|
| | |
| | | {
|
| | | [SerializeField] Image m_SkillIcon;
|
| | | [SerializeField] Text m_SkillName;
|
| | | [SerializeField] Transform m_ContainerReiki;
|
| | | [SerializeField] Text m_Reiki;
|
| | | [SerializeField] Transform m_ContainerReikiIcon;
|
| | | [SerializeField] Image[] m_ReikiIcons;
|
| | | [SerializeField] Text m_UnSelectRemind;
|
| | | [SerializeField] Text m_SwitchRemind;
|
| | | [SerializeField] Text m_Description;
|
| | |
| | | m_UnSelectRemind.gameObject.SetActive(skillId == 0);
|
| | | m_SwitchRemind.gameObject.SetActive(skillId != 0);
|
| | | m_Description.gameObject.SetActive(skillId != 0);
|
| | | m_ContainerReiki.gameObject.SetActive(skillId != 0);
|
| | |
|
| | |
|
| | | m_ContainerReikiIcon.gameObject.SetActive(skillId != 0);
|
| | |
|
| | | if (skillId != 0)
|
| | | {
|
| | |
| | |
|
| | | var property = skillConfig.RequireProperty();
|
| | | var propertyConfig = PlayerPropertyConfig.Get(property);
|
| | | m_Reiki.text = propertyConfig.Name;
|
| | | m_Reiki.color = UIHelper.GetPropertyColor(property);
|
| | |
|
| | | m_ReikiIcons[0].gameObject.SetActive(property == (int)PropertyType.Mater);
|
| | | m_ReikiIcons[1].gameObject.SetActive(property == (int)PropertyType.Wood);
|
| | | m_ReikiIcons[2].gameObject.SetActive(property == (int)PropertyType.Water);
|
| | | m_ReikiIcons[3].gameObject.SetActive(property == (int)PropertyType.Fire);
|
| | | m_ReikiIcons[4].gameObject.SetActive(property == (int)PropertyType.Earth);
|
| | |
|
| | | if (level == 0)
|
| | | {
|
| | | var conditionLabel = string.Format("({0}{1}激活)", propertyConfig.Name, skillConfig.RequirePropertyValue());
|