From 8edabb4bd6892df62eeed23eaa88003e2e9670fe Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期一, 13 八月 2018 20:16:33 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 Fight/PreFightMission.cs                                        |    5 +
 Core/GameEngine/Model/TelPartialConfig/tagItemCompoundConfig.cs |   22 +++++++
 System/OpenServerActivity/OpenServerActivityWin.cs              |   40 +++++++++++++
 System/FindPrecious/DemonJarWin.cs                              |    2 
 System/WindowBase/WindowAsyncLoad.cs                            |   22 ++++++
 UI/HUD/LifeBar.cs                                               |    1 
 UI/HUD/HeadUpName.cs                                            |   17 +++++
 System/Dungeon/DungeonSuppliesLackWin.cs                        |   50 ++++++++++++++++
 8 files changed, 154 insertions(+), 5 deletions(-)

diff --git a/Core/GameEngine/Model/TelPartialConfig/tagItemCompoundConfig.cs b/Core/GameEngine/Model/TelPartialConfig/tagItemCompoundConfig.cs
index d217067..502a075 100644
--- a/Core/GameEngine/Model/TelPartialConfig/tagItemCompoundConfig.cs
+++ b/Core/GameEngine/Model/TelPartialConfig/tagItemCompoundConfig.cs
@@ -6,7 +6,7 @@
     public partial class ItemCompoundConfig : ConfigBase, IConfigPostProcess
     {
         private static Dictionary<int, Dictionary<int, Dictionary<int, List<ItemCompoundConfig>>>> allComposeModelDict = new Dictionary<int, Dictionary<int, Dictionary<int, List<ItemCompoundConfig>>>>();
-
+        static Dictionary<int, List<ItemCompoundConfig>> ticketComposeDict = new Dictionary<int, List<ItemCompoundConfig>>();
         public void OnConfigParseCompleted()
         {
             if (!allComposeModelDict.ContainsKey(firstType))
@@ -43,6 +43,21 @@
                     }
                 }
 
+            }
+
+            if (firstType == (int)ComposeFuncType.Ticket)
+            {
+                var makeItemArray = ConfigParse.GetMultipleStr<int>(makeID);
+                for (int i = 0; i < makeItemArray.Length; i++)
+                {
+                    List<ItemCompoundConfig> list = null;
+                    if (!ticketComposeDict.TryGetValue(makeItemArray[i], out list))
+                    {
+                        list = new List<ItemCompoundConfig>();
+                        ticketComposeDict.Add(makeItemArray[i], list);
+                    }
+                    list.Add(this);
+                }
             }
         }
 
@@ -105,6 +120,11 @@
             return null;
         }
 
+        public static bool TryGetTicketCompose(int _ticketId, out List<ItemCompoundConfig> list)
+        {
+            return ticketComposeDict.TryGetValue(_ticketId, out list);
+        }
+
     }
 }
 
diff --git a/Fight/PreFightMission.cs b/Fight/PreFightMission.cs
index 54979b5..c735e82 100644
--- a/Fight/PreFightMission.cs
+++ b/Fight/PreFightMission.cs
@@ -1526,6 +1526,11 @@
     private bool mDestroy = false;
     public void Destroy()
     {
+        if (IsFinished())
+        {
+            return;
+        }
+
         mDestroy = true;
         if (m_FuncNpc != null)
         {
diff --git a/System/Dungeon/DungeonSuppliesLackWin.cs b/System/Dungeon/DungeonSuppliesLackWin.cs
index df054dc..e5000ca 100644
--- a/System/Dungeon/DungeonSuppliesLackWin.cs
+++ b/System/Dungeon/DungeonSuppliesLackWin.cs
@@ -23,11 +23,14 @@
         [SerializeField] TextEx m_TicketNeed;
         [SerializeField] Text m_LackContentTip;
         [SerializeField] Text m_LackMoneyTip;
+        [SerializeField] Text m_ConfirmLabel;
         [SerializeField] Button m_Confirm;
         [SerializeField] Button m_Close;
+        [SerializeField] Button m_TicketCompose;
 
         DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
         PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
+        ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
 
         #region Built-in
         protected override void BindController()
@@ -38,6 +41,7 @@
         {
             m_Confirm.AddListener(Confirm);
             m_Close.AddListener(CloseClick);
+            m_TicketCompose.AddListener(TicketCompose);
         }
 
         protected override void OnPreOpen()
@@ -50,9 +54,11 @@
             m_TicketOwn.text = own.ToString();
             m_TicketNeed.text = StringUtility.Contact("/", lackItem.count);
             m_TicketOwn.colorType = own >= lackItem.count ? TextColType.White : TextColType.Red;
+            m_TicketCompose.gameObject.SetActive(own < lackItem.count && CanComposeTicket(lackType));
 
             m_LackContentTip.text = GetLackContentTip(lackType);
             m_LackMoneyTip.gameObject.SetActive(own < lackItem.count);
+            m_ConfirmLabel.text = GetConfirmLabel(lackType);
 
             if (own < lackItem.count)
             {
@@ -117,6 +123,22 @@
             else
             {
                 ConfirmTodo(lackType);
+            }
+        }
+
+        private void TicketCompose()
+        {
+            switch (lackType)
+            {
+                case LackType.ElderGodArea:
+                    WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.ComposeTicketIce);
+                    break;
+                case LackType.FairyLand:
+                    WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.ComposeTicketFairy);
+                    break;
+                case LackType.SingleIceCrystal:
+                    WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.ComposeTicketGod);
+                    break;
             }
         }
 
@@ -271,6 +293,34 @@
             }
         }
 
+        private string GetConfirmLabel(LackType _lackType)
+        {
+            switch (_lackType)
+            {
+                case LackType.PersonalBoss:
+                case LackType.Kylin:
+                case LackType.IceCrystal:
+                    return Language.Get("ConfirmTarget");
+                case LackType.ElderGodArea:
+                case LackType.FairyLand:
+                case LackType.SingleIceCrystal:
+                    return Language.Get("W_CertainInto");
+                default:
+                    return Language.Get("ConfirmTarget");
+            }
+        }
+
+        private bool CanComposeTicket(LackType _lackType)
+        {
+            var lackItem = GetLackItem(lackType);
+            List<ItemCompoundConfig> list;
+            if (ItemCompoundConfig.TryGetTicketCompose(lackItem.id, out list))
+            {
+                return composeModel.IsComposeTicketByType(list[0].secondType);
+            }
+            return false;
+        }
+
         public enum LackType
         {
             PersonalBoss,
diff --git a/System/FindPrecious/DemonJarWin.cs b/System/FindPrecious/DemonJarWin.cs
index c4d20bc..4efc31e 100644
--- a/System/FindPrecious/DemonJarWin.cs
+++ b/System/FindPrecious/DemonJarWin.cs
@@ -65,6 +65,7 @@
         {
             model.bossSelectedEvent += OnBossSelected;
             findPreciousModel.bossSubscribeChangeEvent += OnSubscribeBoss;
+            dungeonModel.dungeonRecordChangeEvent += OnRemaintimeUpdate;
             dungeonModel.countRemainTimeChangeEvent += OnRemaintimeUpdate;
             dungeonModel.updateDungeonBuyCnt += OnBuyTimesOk;
             model.doubleAwardChangeEvent += OnDoubleAwardChange;
@@ -75,6 +76,7 @@
             guideChallenge = false;
             model.bossSelectedEvent -= OnBossSelected;
             findPreciousModel.bossSubscribeChangeEvent -= OnSubscribeBoss;
+            dungeonModel.dungeonRecordChangeEvent -= OnRemaintimeUpdate;
             dungeonModel.countRemainTimeChangeEvent -= OnRemaintimeUpdate;
             dungeonModel.updateDungeonBuyCnt -= OnBuyTimesOk;
             model.doubleAwardChangeEvent -= OnDoubleAwardChange;
diff --git a/System/OpenServerActivity/OpenServerActivityWin.cs b/System/OpenServerActivity/OpenServerActivityWin.cs
index 1f3b9b8..2a38f16 100644
--- a/System/OpenServerActivity/OpenServerActivityWin.cs
+++ b/System/OpenServerActivity/OpenServerActivityWin.cs
@@ -68,6 +68,7 @@
         {
             TimeUtility.OnServerOpenDayRefresh += OnStepServerDayEvent;
             OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent;
+            OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
             for (int i = 0; i < m_SortArray.Count; i++)
             {
                 m_ActivitySpreadDict[m_SortArray[i]] = false;
@@ -119,6 +120,7 @@
         {
             TimeUtility.OnServerOpenDayRefresh -= OnStepServerDayEvent;
             OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent;
+            OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent;
             CloseOtherWin();
             WindowCenter.Instance.Open<MainInterfaceWin>();
             impactRankModel.gotoImpactRankType = 0;
@@ -478,6 +480,44 @@
                 m_ActivityCtrl.m_Scorller.RefreshActiveCellViews();
             }
         }
+
+        private void OperationStartEvent(Operation type, int state)
+        {
+            switch (type)
+            {
+                case Operation.MultipleExp:
+                    if (state == 1 && !alreadyOpenActivitys.Contains(5))
+                    {
+                        alreadyOpenActivitys.Add(5);
+                        UpdateFunctionBtns();
+                    }
+                    break;
+                case Operation.ConsumeRebate:
+                    if (state == 0 && !alreadyOpenActivitys.Contains(1))
+                    {
+                        alreadyOpenActivitys.Add(1);
+                        UpdateFunctionBtns();
+                    }
+                    break;
+                case Operation.FlashSale:
+                    if (state == 0 && !alreadyOpenActivitys.Contains(4))
+                    {
+                        alreadyOpenActivitys.Add(4);
+                        UpdateFunctionBtns();
+                    }
+                    break;
+                case Operation.BossReborn:
+                    break;
+                case Operation.GiftPackage:
+                    break;
+                case Operation.FairyCeremony:
+                    break;
+                case Operation.MultipRealmPoint:
+                    break;
+                case Operation.max:
+                    break;
+            }
+        }
     }
 }
 
diff --git a/System/WindowBase/WindowAsyncLoad.cs b/System/WindowBase/WindowAsyncLoad.cs
index e4769a6..c4dd49c 100644
--- a/System/WindowBase/WindowAsyncLoad.cs
+++ b/System/WindowBase/WindowAsyncLoad.cs
@@ -45,6 +45,7 @@
                 var task = taskQueue[i];
                 if (task.windowName == _name)
                 {
+                    task.Dispose();
                     taskQueue.Remove(task);
                     break;
                 }
@@ -66,6 +67,11 @@
                 currentTask = null;
             }
 
+            for (int i = 0; i < taskQueue.Count; i++)
+            {
+                var task = taskQueue[i];
+                task.Dispose();
+            }
             taskQueue.Clear();
             NetLinkWin.Hide();
         }
@@ -116,6 +122,14 @@
                 }
             }
 
+            public void RemoveTask(Task _task)
+            {
+                if (tasks.Contains(_task))
+                {
+                    tasks.Remove(_task);
+                }
+            }
+
             public void NotifyTaskState(Task _task)
             {
                 bool allReady = true;
@@ -155,9 +169,9 @@
                 callBack = _callBack;
             }
 
-            public void Bind(TaskGroup _task)
+            public void Bind(TaskGroup _taskGroup)
             {
-                taskGroup = _task;
+                taskGroup = _taskGroup;
             }
 
             public void Report(bool _ok, UnityEngine.Object _object)
@@ -179,6 +193,10 @@
             public void Dispose()
             {
                 callBack = null;
+                if (taskGroup != null)
+                {
+                    taskGroup.RemoveTask(this);
+                }
             }
 
             public void Done()
diff --git a/UI/HUD/HeadUpName.cs b/UI/HUD/HeadUpName.cs
index 015cfc3..0b6dae5 100644
--- a/UI/HUD/HeadUpName.cs
+++ b/UI/HUD/HeadUpName.cs
@@ -102,6 +102,19 @@
             }
         }
 
+        public void SetFunctionalNpcRealm(int _realm)
+        {
+            m_Realm.gameObject.SetActive(true);
+            m_PlayerName.alignment = TextAnchor.MiddleLeft;
+
+            var realmConfig = ConfigManager.Instance.GetTemplate<RealmConfig>(_realm);
+            if (realmConfig != null)
+            {
+                m_Realm.SetSprite(realmConfig.Img);
+                SetImageMaterialTexture(realmConfig.Img);
+            }
+        }
+
         public void SetTitle(uint _titleId)
         {
             titleId = _titleId;
@@ -180,7 +193,7 @@
 
         public void SetNPCName(string _name)
         {
-            SetRealm(0);
+            SetFunctionalNpcRealm(0);
             m_PlayerName.text = _name;
             SyncPosition(true);
         }
@@ -190,7 +203,7 @@
             var config = ConfigManager.Instance.GetTemplate<NPCConfig>(_id);
             if (config != null)
             {
-                SetRealm(config.Realm);
+                SetFunctionalNpcRealm(config.Realm);
                 m_PlayerName.text = config.charName;
             }
 
diff --git a/UI/HUD/LifeBar.cs b/UI/HUD/LifeBar.cs
index 96e2edb..a3cb8b7 100644
--- a/UI/HUD/LifeBar.cs
+++ b/UI/HUD/LifeBar.cs
@@ -133,6 +133,7 @@
             this.transform.localScale = Vector3.one;
             hideTime = Time.time + hideInterval;
             multipleSlider.ResetValue(value);
+            SyncPosition(true);
         }
 
         public void Show(ulong _hp, ulong _maxHp)

--
Gitblit v1.8.0