少年修仙传客户端代码仓库
client_linchunjie
2018-12-20 d2639f3142aa65f8fad93e56fbae11b2dd41170d
【1.4】聚魂功能
7个文件已修改
92 ■■■■■ 已修改文件
Fight/MapTransferUtility.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GatheringSoul/GatherSoulBuildBehaviour.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GatheringSoul/GatherSoulDungeonBehaviour.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GatheringSoul/GatherSoulDungeonGetItemWin.cs 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GatheringSoul/GatherSoulDungeonItemCell.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GatheringSoul/GatherSoulDungeonModel.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GatheringSoul/GatherSoulDungeonStepHintWin.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/MapTransferUtility.cs
@@ -940,7 +940,10 @@
                if (!UserInputHandler.isTouched
                && (_hero.SkillMgr.CurCastSkill == null || _hero.SkillMgr.CurCastSkill.SkillCompelete))
                {
                    NPCInteractProcessor.InvokeEvent(E_NpcType.Func, NpcID, _npc.ServerInstID);
                    if (NpcID != GeneralDefine.GatherSoulDZ)
                    {
                        NPCInteractProcessor.InvokeEvent(E_NpcType.Func, NpcID, _npc.ServerInstID);
                    }
                    Clear();
                }
            }
System/GatheringSoul/GatherSoulBuildBehaviour.cs
@@ -17,6 +17,21 @@
        int collectNpcId = 0;
        uint serverInstanceId = 0;
        static bool m_SatisfyBuild = false;
        public static event Action defendBuildRefresh;
        public static bool satisfyBuild
        {
            get { return m_SatisfyBuild; }
            set
            {
                m_SatisfyBuild = value;
                if (defendBuildRefresh != null)
                {
                    defendBuildRefresh();
                }
            }
        }
        GatherSoulDungeonModel model
        {
            get { return ModelCenter.Instance.GetModel<GatherSoulDungeonModel>(); }
@@ -43,6 +58,7 @@
            model.missionHelpUpdate -= MissionHelpUpdate;
            collectNpcId = 0;
            serverInstanceId = 0;
            satisfyBuild = false;
        }
        void DisplayBase()
@@ -51,6 +67,8 @@
            var iceDefendCount = model.GetDefendNpcCount(model.iceDefendNpcId);
            m_AttackDefend.gameObject.SetActive(attackDefendCount < model.attackDefendCountLimit);
            m_IceDefend.gameObject.SetActive(iceDefendCount < model.iceDefendCountLimit);
            satisfyBuild = iceDefendCount < model.iceDefendCountLimit || attackDefendCount < model.attackDefendCountLimit;
        }
        private void BuildAttackDefend()
System/GatheringSoul/GatherSoulDungeonBehaviour.cs
@@ -95,7 +95,7 @@
        {
            var count = model.GetDefendNpcCount(model.attckDefendNpcId);
            m_AttackDefendCount.text = Language.Get("GatherSoulDefendRemain", model.attackDefendCountLimit - count);
            count = model.GetDefendNpcCount(model.iceDefendCountLimit);
            count = model.GetDefendNpcCount(model.iceDefendNpcId);
            m_IceDefendCount.text = Language.Get("GatherSoulDefendRemain", model.iceDefendCountLimit - count);
        }
System/GatheringSoul/GatherSoulDungeonGetItemWin.cs
@@ -29,6 +29,8 @@
        protected override void AddListeners()
        {
            m_ScrollerControl.OnRefreshCell += OnRefreshCell;
            m_ScrollerControl.OnGetDynamicSize += OnGetDynamicSize;
            m_ScrollerControl.lockType = EnhanceLockType.KeepVertical;
        }
        protected override void OnPreOpen()
@@ -51,6 +53,31 @@
        }
        #endregion
        private bool OnGetDynamicSize(ScrollerDataType type, int index, out float height)
        {
            height = 0;
            if (type == ScrollerDataType.Normal)
            {
                var weel = index / 100;
                var line = index % 100;
                bool requireLine = false;
                if (weel < model.mission.wheel)
                {
                    List<GatherSoulDungeonModel.ItemInfo> list;
                    if (model.TryGetDungeonItems(weel, out list))
                    {
                        if (line == list.Count / m_LineCount)
                        {
                            requireLine = true;
                        }
                    }
                }
                height = requireLine ? 92 : 82;
                return true;
            }
            return false;
        }
        private void OnRefreshCell(ScrollerDataType type, CellView cell)
        {
            if (type == ScrollerDataType.Header)
@@ -63,7 +90,20 @@
                var itemCell = cell as GatherSoulDungeonItemCell;
                var weel = cell.index / 100;
                var line = cell.index % 100;
                itemCell.Display(weel, line);
                bool requireLine = false;
                if (weel < model.mission.wheel)
                {
                    List<GatherSoulDungeonModel.ItemInfo> list;
                    if (model.TryGetDungeonItems(weel, out list))
                    {
                        if (line == list.Count / m_LineCount)
                        {
                            requireLine = true;
                        }
                    }
                }
                itemCell.Display(weel, line, requireLine);
            }
        }
System/GatheringSoul/GatherSoulDungeonItemCell.cs
@@ -9,14 +9,14 @@
    public class GatherSoulDungeonItemCell : CellView
    {
        [SerializeField] GatherSoulItemBehaviour[] m_Items;
        [SerializeField] Image m_Cutline;
        [SerializeField] RectTransform m_Cutline;
        GatherSoulDungeonModel model
        {
            get { return ModelCenter.Instance.GetModel<GatherSoulDungeonModel>(); }
        }
        public void Display(int weel, int line)
        public void Display(int weel, int line, bool requireLine)
        {
            List<GatherSoulDungeonModel.ItemInfo> list;
            if (model.TryGetDungeonItems(weel, out list))
@@ -28,7 +28,7 @@
                    {
                        m_Items[i].gameObject.SetActive(true);
                        m_Items[i].Display(list[index].ItemID, 1);
                        m_Items[i].DisplayCount(list[index].ItemCount);
                        m_Items[i].DisplayCount(list[index].Count);
                    }
                    else
                    {
@@ -37,7 +37,7 @@
                }
            }
            m_Cutline.gameObject.SetActive(model.mission.wheel < weel);
            m_Cutline.gameObject.SetActive(requireLine);
        }
    }
}
System/GatheringSoul/GatherSoulDungeonModel.cs
@@ -186,7 +186,7 @@
        public struct ItemInfo
        {
            public int ItemID;
            public int ItemCount;
            public int Count;
        }
    }
System/GatheringSoul/GatherSoulDungeonStepHintWin.cs
@@ -14,7 +14,7 @@
    [XLua.Hotfix]
    public class GatherSoulDungeonStepHintWin : Window
    {
        [SerializeField] RectTransform m_Container;
        #region Built-in
        protected override void BindController()
        {
@@ -26,6 +26,8 @@
        protected override void OnPreOpen()
        {
            GatherSoulBuildBehaviour.defendBuildRefresh += DefendBuildRefresh;
            Display();
        }
        protected override void OnAfterOpen()
@@ -34,6 +36,7 @@
        protected override void OnPreClose()
        {
            GatherSoulBuildBehaviour.defendBuildRefresh -= DefendBuildRefresh;
        }
        protected override void OnAfterClose()
@@ -41,6 +44,16 @@
        }
        #endregion
        void Display()
        {
            m_Container.gameObject.SetActive(!GatherSoulBuildBehaviour.satisfyBuild);
        }
        private void DefendBuildRefresh()
        {
            Display();
        }
    }
}