From 04f2d6989fbf40473d233490c224083a95f2efdc Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期二, 13 十一月 2018 10:28:33 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 Fight/GameActor/GActorNpcNoFight.cs       |    2 
 System/KnapSack/Logic/VipOverdueWin.cs    |  131 +++++++++++++++++++++++--------------------
 System/KnapSack/Logic/GuardOverdueWin.cs  |    2 
 System/KnapSack/Logic/ItemOverdueModel.cs |   10 +-
 System/KnapSack/ItemOverdueBehaviour.cs   |    3 
 5 files changed, 79 insertions(+), 69 deletions(-)

diff --git a/Fight/GameActor/GActorNpcNoFight.cs b/Fight/GameActor/GActorNpcNoFight.cs
index 8cd150f..c1f1fd0 100644
--- a/Fight/GameActor/GActorNpcNoFight.cs
+++ b/Fight/GameActor/GActorNpcNoFight.cs
@@ -165,7 +165,7 @@
             {
                 GAMgr.Instance.AddNeedDestroyPrefab(_prefab);
             }
-            if (this is GA_Guard)
+            if (this is GA_Guard || NpcConfig.MODE.Contains("A_Zs") || NpcConfig.MODE.Contains("A_Fs"))
             {
                 GAMgr.Instance.RemoveNeedDestroyPrefab(_prefab);
             }
diff --git a/System/KnapSack/ItemOverdueBehaviour.cs b/System/KnapSack/ItemOverdueBehaviour.cs
index 679ee9a..47ac444 100644
--- a/System/KnapSack/ItemOverdueBehaviour.cs
+++ b/System/KnapSack/ItemOverdueBehaviour.cs
@@ -64,7 +64,6 @@
                         WindowCenter.Instance.Open<GuardOverdueWin>();
                         break;
                 }
-                model.ReportConfirmUseItem(model.currentShowItem);
             }
         }
 
@@ -87,7 +86,7 @@
 
         private void CloseItemShow()
         {
-            model.ReportConfirmUseItem(model.currentShowItem);
+            model.ReportConfirmUseItem(model.currentShowItem.guid);
         }
 
         private void DrawItem(string guid,int itemId)
diff --git a/System/KnapSack/Logic/GuardOverdueWin.cs b/System/KnapSack/Logic/GuardOverdueWin.cs
index 834f530..538179a 100644
--- a/System/KnapSack/Logic/GuardOverdueWin.cs
+++ b/System/KnapSack/Logic/GuardOverdueWin.cs
@@ -81,6 +81,7 @@
 
         protected override void OnPreClose()
         {
+            itemOverdue.ReportConfirmUseItem(guid);
             guid = string.Empty;
         }
 
@@ -92,6 +93,7 @@
         private void InitUI()
         {
             itemOverduelist = null;
+            DebugEx.LogFormat("itemOverdue.currentShowItem.guid is null?", itemOverdue.currentShowItem.guid == null);
             guid = string.IsNullOrEmpty(guid) || guid == "" ? itemOverdue.currentShowItem.guid : guid;
             itemModel = playerPack.GetItemModelByGUID(guid);
             if (itemModel == null) return;
diff --git a/System/KnapSack/Logic/ItemOverdueModel.cs b/System/KnapSack/Logic/ItemOverdueModel.cs
index d4b67cd..78bdd1d 100644
--- a/System/KnapSack/Logic/ItemOverdueModel.cs
+++ b/System/KnapSack/Logic/ItemOverdueModel.cs
@@ -100,16 +100,16 @@
             return itemStack.TryGetValue(_guid, out _itemModel);
         }
 
-        public void ReportConfirmUseItem(OverdueItem _UseItem)
+        public void ReportConfirmUseItem(string guid)
         {
-            if (itemGuids.Contains(_UseItem.guid))
+            if (itemGuids.Contains(guid))
             {
-                itemGuids.Remove(_UseItem.guid);
+                itemGuids.Remove(guid);
             }
 
-            if (itemStack.ContainsKey(_UseItem.guid))
+            if (itemStack.ContainsKey(guid))
             {
-                itemStack.Remove(_UseItem.guid);
+                itemStack.Remove(guid);
             }
 
             RefreshCurrrentShowUseItem();
diff --git a/System/KnapSack/Logic/VipOverdueWin.cs b/System/KnapSack/Logic/VipOverdueWin.cs
index 2929b7f..19e8c6f 100644
--- a/System/KnapSack/Logic/VipOverdueWin.cs
+++ b/System/KnapSack/Logic/VipOverdueWin.cs
@@ -1,61 +1,70 @@
-锘縰sing UnityEngine;
-using UnityEngine.UI;
-
-namespace Snxxz.UI
-{
-    public class VipOverdueWin : Window
-    {
-        [SerializeField]
-        Button closeBtn;
-        [SerializeField]
-        Text vipDesText;
-        [SerializeField]
-        Button renewalBtn;
-
-        protected override void BindController()
-        {
-            closeBtn.AddListener(CloseWin);
-            renewalBtn.AddListener(OnClickRenewal);
-        }
-
-        protected override void AddListeners()
-        {
-           
-        }
-
-        protected override void OnPreOpen()
-        {
-            InitUI();
-        }
-
-        protected override void OnAfterOpen()
-        {
-
-        }
-
-        protected override void OnAfterClose()
-        {
-
-        }
-
-        protected override void OnPreClose()
-        {
-           
-        }
-
-        private void InitUI()
-        {
-            vipDesText.text = Language.Get("VipExperience3");
-        }
-
-        private void OnClickRenewal()
-        {
-            WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.VipRechargeFunc4);
-        }
-
-        private void CloseWin()
-        {
-            CloseImmediately();
-        }
-    }
-}
+锘縰sing UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+    public class VipOverdueWin : Window
+    {
+        [SerializeField]
+        Button closeBtn;
+        [SerializeField]
+        Text vipDesText;
+        [SerializeField]
+        Button renewalBtn;
+
+        ItemOverdueModel _itemOverdue;
+        ItemOverdueModel itemOverdue
+        {
+            get { return _itemOverdue ?? (_itemOverdue = ModelCenter.Instance.GetModel<ItemOverdueModel>()); }
+        }
+
+        protected override void BindController()
+        {
+            closeBtn.AddListener(CloseWin);
+            renewalBtn.AddListener(OnClickRenewal);
+        }
+
+        protected override void AddListeners()
+        {
+           
+        }
+
+        protected override void OnPreOpen()
+        {
+            InitUI();
+        }
+
+        protected override void OnAfterOpen()
+        {
+
+        }
+
+        protected override void OnAfterClose()
+        {
+
+        }
+
+        protected override void OnPreClose()
+        {
+            if(itemOverdue.currentShowItem != default(ItemOverdueModel.OverdueItem))
+            {
+                itemOverdue.ReportConfirmUseItem(itemOverdue.currentShowItem.guid);
+            }
+        }
+
+        private void InitUI()
+        {
+            vipDesText.text = Language.Get("VipExperience3");
+        }
+
+        private void OnClickRenewal()
+        {
+            WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.VipRechargeFunc4);
+        }
+
+        private void CloseWin()
+        {
+            CloseImmediately();
+        }
+    }
+}

--
Gitblit v1.8.0