From e8fef6c83238990fc56000a439a17b7df3704af3 Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期二, 16 四月 2019 14:25:16 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/ItemTip/EquipTipUtility.cs |   44 +++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/System/ItemTip/EquipTipUtility.cs b/System/ItemTip/EquipTipUtility.cs
index 16e830a..56b349d 100644
--- a/System/ItemTip/EquipTipUtility.cs
+++ b/System/ItemTip/EquipTipUtility.cs
@@ -231,7 +231,7 @@
                 legendProperty = GetLegendProperty(guid),
                 skillInfo = GetSkillInfo(item.itemId),
                 suitInfo = GetSuitInfo(guid),
-                starInfo = GetStarInfo(item.itemId),
+                starInfo = GetStarInfo(guid),
                 strengthenProperty = GetStrengthenProperty(guid),
                 gemInfo = GetGemInfo(guid),
 
@@ -392,7 +392,7 @@
                 levelLimit = item.isAuction ? 0 : item.config.UseLV,
                 realmLimit = item.isAuction ? 0 : item.config.RealmLimit,
                 star = isEquiped ? star : -1,
-                strengthenLevel = Mathf.Min(placeStrengthenLevel, maxStrengthenLevel)
+                strengthenLevel = isEquiped ? Mathf.Min(placeStrengthenLevel, maxStrengthenLevel) : 0
             };
 
             return baseInfo;
@@ -608,7 +608,30 @@
             var starInfo = new StarInfo();
             starInfo.equipPosition = new Int2(config.LV, config.EquipPlace);
             starInfo.maxLevel = EquipStarModel.GetMaxStarLevel(config.ItemColor, config.LV);
-            starInfo.starLevel = starModel.GetStarLevel(new Int2(config.LV, config.EquipPlace));
+            starInfo.starLevel = 0;
+
+            return starInfo;
+        }
+
+        private static StarInfo GetStarInfo(string guid)
+        {
+            var item = packModel.GetItemByGuid(guid);
+            if (item == null)
+            {
+                return default(StarInfo);
+            }
+
+            if (!EquipModel.IsRealmEquip(item.config.EquipPlace))
+            {
+                return default(StarInfo);
+            }
+
+            var starInfo = new StarInfo();
+            var equipPosition = new Int2(item.config.LV, item.config.EquipPlace);
+            var equiped = equipModel.GetEquip(equipPosition) == guid;
+            starInfo.equipPosition = equipPosition;
+            starInfo.maxLevel = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV);
+            starInfo.starLevel = equiped ? starModel.GetStarLevel(equipPosition) : 0;
 
             return starInfo;
         }
@@ -623,6 +646,12 @@
 
             var level = item.config.LV;
             var place = item.config.EquipPlace;
+            var equiped = equipModel.GetEquip(new Int2(level, place)) == guid;
+            if (!equiped)
+            {
+                return default(StrengthenProperty);
+            }
+
             var data = new StrengthenProperty();
 
             var strengthenLevel = strengthenModel.GetStrengthLevel(level, place);
@@ -658,8 +687,8 @@
 
             var level = item.config.LV;
             var place = item.config.EquipPlace;
-            var gemInfo = new GemInfo();
 
+            var gemInfo = new GemInfo();
             var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV);
             gemInfo.activeStates = new Dictionary<int, bool>();
             for (int i = 0; i < 4; i++)
@@ -692,8 +721,13 @@
             }
 
             var equipPosition = new Int2(item.config.LV, item.config.EquipPlace);
-            var trainProperty = new TrainProperty();
+            var equiped = equipModel.GetEquip(equipPosition) == guid;
+            if (!equiped)
+            {
+                return default(TrainProperty);
+            }
 
+            var trainProperty = new TrainProperty();
             var star = Mathf.Min(EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV), starModel.GetEquipStarLevel(equipPosition));
             var type = EquipTrainModel.GetTrainType(equipPosition.y);
             var maxConfig = WashLevelMaxConfig.Get(type, star);

--
Gitblit v1.8.0