Forráskód Böngészése

货币消耗颜色

zhaoyang 2 éve
szülő
commit
5b34dc4f34

+ 6 - 3
GameClient/Assets/Game/HotUpdate/Utils/ItemUtil.cs

@@ -221,11 +221,11 @@ namespace GFGGame
             return "png";
         }
 
-        public static void SetItemNumAndNeedNum(GObject obj, int itemId, int needNum, string color = "#D27869")
+        public static void SetItemNumAndNeedNum(GObject obj, int itemId, int needNum)
         {
             UI_ComCostCurrencyWithHas com = UI_ComCostCurrencyWithHas.Proxy(obj);
             int hasNum = ItemDataManager.GetItemNum(itemId);
-            string strHasNum = StringUtil.GetColorText(hasNum.ToString(), hasNum < needNum ? color : "#FFFFFF"); hasNum.ToString();
+            string strHasNum = StringUtil.GetColorText(hasNum.ToString(), hasNum < needNum ? "#D0A09B" : "#8E7C6B"); hasNum.ToString();
             // com.m_txtNeed.text = needNum.ToString();
             com.m_txtCount.text = string.Format("{0}/{1}", strHasNum, needNum);
             ItemCfg cfg1 = ItemCfgArray.Instance.GetCfg(itemId);
@@ -235,7 +235,10 @@ namespace GFGGame
         public static void SetItemNeedNum(GObject obj, int itemId, int needNum)
         {
             UI_ComCostCurrency com = UI_ComCostCurrency.Proxy(obj);
-            com.m_txtNeed.text = needNum.ToString();
+            int hasNum = ItemDataManager.GetItemNum(itemId);
+            string strNeedNum = StringUtil.GetColorText(needNum.ToString(), hasNum < needNum ? "#D0A09B" : "#8E7C6B"); needNum.ToString();
+            com.m_txtNeed.text = strNeedNum;
+
 
             ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemId);
             com.m_loaIcon.url = ResPathUtil.GetCommonGameResPath(cfg.res);

+ 3 - 2
GameClient/Assets/Game/HotUpdate/Views/ClothingFoster/ClothingView.cs

@@ -346,10 +346,11 @@ namespace GFGGame
             _ui.m_listRenewMaterial.numItems = renewCfg.materialsArr.Length;
 
             _canRenew = true;
-            UI_ComCostCurrency comConsumeCurrency = UI_ComCostCurrency.Proxy(_ui.m_comRenewCost);
+            // UI_ComCostCurrency comConsumeCurrency = UI_ComCostCurrency.Proxy(_ui.m_comRenewCost);
             int has = ItemDataManager.GetItemNum(renewCfg.costId);
             int need = renewCfg.costNum;
-            comConsumeCurrency.m_txtNeed.text = StringUtil.GetColorText(need.ToString(), has >= need ? "#FFF8EA" : "#C9F1A5");
+            // comConsumeCurrency.m_txtNeed.text = StringUtil.GetColorText(need.ToString(), has >= need ? "#FFF8EA" : "#C9F1A5");
+            ItemUtil.SetItemNeedNum(_ui.m_comRenewCost, renewCfg.costId, renewCfg.costNum);
             if (_canRenew && has < need) _canRenew = false;
             UI_ComCostCurrency.ProxyEnd();
         }