少年修仙传客户端代码仓库
client_linchunjie
2018-09-20 a40df3532380b0c02f4542e45f73254731f8850d
3610 法宝之魂添加新获得红点
3个文件已修改
45 ■■■■ 已修改文件
System/Treasure/TreasureModel.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureSoulModel.cs 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureSoulWin.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureModel.cs
@@ -17,7 +17,6 @@
        public const int TREASURE_DATAMAPID = 41110;
        public const int TREASURE_MAPID = 41110;
        public const int TREASURE_GUIDE_ID = 102;
        public const int TREASURE_SOUL_ID = 115;
        const int TREASURE_REDPOINTID = 7000;
        readonly static int[] CATEGORY_REDPOINTIDS = { 7001, 7002, 7003, 7004, 7005 };
@@ -33,7 +32,6 @@
        Redpoint zergRedpoint = new Redpoint(TREASURE_REDPOINTID, CATEGORY_REDPOINTIDS[(int)TreasureCategory.Zerg - 1]);
        public Redpoint stoveRedpoint = new Redpoint(CATEGORY_REDPOINTIDS[(int)TreasureCategory.Fairy - 1], 7200);
        public Redpoint treasureSoulRedpoint = new Redpoint(1, TREASURE_SOUL_ID);
        public event Action<int> treasureCollectProgressUpdateEvent;
        public event Action<int> treasureSelectedEvent;
System/Treasure/TreasureSoulModel.cs
@@ -8,6 +8,10 @@
{
    public class TreasureSoulModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
    {
        public const int TREASURE_SOUL_ID = 115;
        Redpoint treasureSoulRedpoint = new Redpoint(1, TREASURE_SOUL_ID);
        Redpoint treasureSoulNewGotRedpoint = new Redpoint(TREASURE_SOUL_ID, 115100);
        Dictionary<int, TreasureSpecialData> treasureSoulDict = new Dictionary<int, TreasureSpecialData>();
        List<int> treasureSouls = new List<int>();
        public Dictionary<int, int> signAddProperty = new Dictionary<int, int>();
@@ -32,6 +36,8 @@
        public int gotoSoul { get; set; }
        public int newGotSoul { get; set; }
        public bool serverInited { get; private set; }
        PlayerPackModel packModel { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
@@ -41,6 +47,7 @@
        {
            packModel.RefreshItemCountAct += RefreshItemCountAct;
            PlayerStrengthengDatas.RefreshEquipUpgradLvAct += RefreshEquipSTRLv;
            FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
            ParseConfig();
        }
@@ -54,6 +61,7 @@
                special.itemGet = false;
                special.active = false;
            }
            treasureSoulNewGotRedpoint.state = RedPointState.None;
        }
        public void OnPlayerLoginOk()
@@ -66,6 +74,7 @@
        {
            packModel.RefreshItemCountAct -= RefreshItemCountAct;
            PlayerStrengthengDatas.RefreshEquipUpgradLvAct -= RefreshEquipSTRLv;
            FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
        }
        void ParseConfig()
@@ -88,6 +97,11 @@
            {
                signAddProperty.Add(int.Parse(_key), int.Parse(jsonData[_key].ToString()));
            }
        }
        public void SetViewTreasureNewGot()
        {
            treasureSoulNewGotRedpoint.state = RedPointState.None;
        }
        public List<int> GetTreasureSouls()
@@ -152,6 +166,14 @@
            }
        }
        private void OnFuncStateChangeEvent(int func)
        {
            if (func == 126)
            {
                UpdateRedpoints();
            }
        }
        public void UpdateTreasurePrivilege(HA353_tagMCMWPrivilegeDataInfo package)
        {
            for (int i = 0; i < package.Count; i++)
@@ -164,12 +186,12 @@
                }
                bool beforeActived = special.active;
                special.active = _data.State == 1;
                //if (!beforeActived && special.active && serverInited && WindowCenter.Instance.CheckOpen<TreasureSoulWin>()
                //    && !WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>() && !NewBieCenter.Instance.inGuiding)
                //{
                //    TreasureSoulActiveWin.treasureSoulId = (int)_data.PriID;
                //    WindowCenter.Instance.Open<TreasureSoulActiveWin>();
                //}
                if (!beforeActived && special.active && serverInited
                    && !WindowCenter.Instance.CheckOpen<TreasureSoulWin>())
                {
                    treasureSoulNewGotRedpoint.state = RedPointState.Simple;
                    newGotSoul = (int)_data.PriID;
                }
                if ((TreasurePrivilege)_data.PriID == TreasurePrivilege.StrengthenAdd)
                {
                    if (treasureSoulEvent != null)
@@ -363,7 +385,7 @@
                totalProgress = configs[configs.Count - 1].countNeed;
            }
            redpoint = new Redpoint(TreasureModel.TREASURE_SOUL_ID, TreasureModel.TREASURE_SOUL_ID * 100 + (int)type);
            redpoint = new Redpoint(TreasureSoulModel.TREASURE_SOUL_ID, TreasureSoulModel.TREASURE_SOUL_ID * 100 + (int)type);
            switch (_type)
            {
                case TreasurePrivilege.DemonJarAtk:
System/Treasure/TreasureSoulWin.cs
@@ -83,6 +83,7 @@
            model.treasureSoulEvent += TreasureSoulEvent;
            m_TreasureSoulBtn.state = TitleBtnState.Click;
            Display();
            model.SetViewTreasureNewGot();
        }
        protected override void OnActived()
@@ -113,6 +114,7 @@
                m_TreasureSouls[i].Dispose();
            }
            m_SelectSoul = model.selectSoul;
            model.newGotSoul = 0;
        }
        protected override void OnAfterClose()
@@ -179,6 +181,11 @@
                    _select = sortSouls[i];
                }
            }
            if (model.newGotSoul != 0 && sortSouls.Contains(model.newGotSoul))
            {
                _select = model.newGotSoul;
                model.newGotSoul = 0;
            }
            _select = _select == 0 ? sortSouls[0] : _select;
            return _select;
        }