Răsfoiți Sursa

消耗道具字体颜色

zhaoyang 2 ani în urmă
părinte
comite
304e177d52

+ 6 - 4
FGUIProject/assets/CommonGame/components/ComCostCurrencyWithHas.xml

@@ -1,9 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="280,42">
   <displayList>
-    <image id="n4_a713" name="n4" src="a71377" fileName="imagesExport/kp_dikuang_3.png" xy="60,3" size="247,36"/>
-    <text id="n2_ojlz" name="n2" xy="0,0" size="65,42" fontSize="30" color="#7d634a" autoSize="none" text="消耗"/>
-    <loader id="n1_ojlz" name="loaIcon" xy="70,-9" size="60,60" url="ui://eg2y0ldpq08x3" autoSize="true"/>
-    <text id="n11_r9ri" name="txtCount" xy="147,0" pivot="0.5,0" size="125,39" fontSize="28" color="#ffffff" align="center" vAlign="middle" ubb="true" autoClearText="true" text="999/999"/>
+    <text id="n2_ojlz" name="n2" xy="7,0" size="65,42" group="n12_nasr" fontSize="30" color="#7d634a" autoSize="none" text="消耗"/>
+    <loader id="n1_ojlz" name="loaIcon" xy="82,-9" size="60,60" group="n12_nasr" url="ui://eg2y0ldpq08x3" autoSize="true"/>
+    <text id="n11_r9ri" name="txtCount" xy="152,0" size="121,42" group="n12_nasr" fontSize="30" color="#fdeed4" vAlign="middle" ubb="true" autoClearText="true" text="999/999"/>
+    <group id="n12_nasr" name="n12" xy="7,-9" size="266,60" advanced="true" layout="hz" colGap="10" excludeInvisibles="true">
+      <relation target="" sidePair="center-center"/>
+    </group>
   </displayList>
 </component>

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

@@ -221,13 +221,14 @@ namespace GFGGame
             return "png";
         }
 
-        public static void SetItemNumAndNeedNum(GObject obj, int itemId, int needNum)
+        public static void SetItemNumAndNeedNum(GObject obj, int itemId, int needNum, bool ChangeColor = false)
         {
             UI_ComCostCurrencyWithHas com = UI_ComCostCurrencyWithHas.Proxy(obj);
             int hasNum = ItemDataManager.GetItemNum(itemId);
-            string strHasNum = StringUtil.GetColorText(hasNum.ToString(), hasNum < needNum ? "#D0A09B" : "#FBC1BD"); hasNum.ToString();
+            string needStrColor = ChangeColor ? "#B99F7B" : "#FDEED4";
+            string strHasNum = StringUtil.GetColorText(hasNum.ToString(), hasNum < needNum ? "#C5645A" : needStrColor); hasNum.ToString();
             // com.m_txtNeed.text = needNum.ToString();
-            com.m_txtCount.text = string.Format("{0}/{1}", strHasNum, needNum);
+            com.m_txtCount.text = string.Format("{0}{1}{2}", strHasNum, StringUtil.GetColorText("/", needStrColor), StringUtil.GetColorText(needNum.ToString(), needStrColor));
             ItemCfg cfg1 = ItemCfgArray.Instance.GetCfg(itemId);
             com.m_loaIcon.url = ResPathUtil.GetCommonGameResPath(cfg1.res);
 

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioBuyNumView.cs

@@ -62,10 +62,10 @@ namespace GFGGame
 
             _ui.m_txtNum.text = string.Format("(今天已兑换{0}/{1}次)", _studioData.BuyTimes, _studioCfg.buyNum);
 
-            ItemUtil.SetItemNumAndNeedNum(_ui.m_comCostItem, _studioCfg.itemID, _studioCfg.itemNum);
+            ItemUtil.SetItemNumAndNeedNum(_ui.m_comCostItem, _studioCfg.itemID, _studioCfg.itemNum, true);
 
             StudioCfgArray.Instance.GetMoneyIdAndNum(_studioCfg.id, _studioData.BuyTimes, 1, out int moneyId, out int moneyNum);
-            ItemUtil.SetItemNumAndNeedNum(_ui.m_comCostCurrent, _studioCfg.moneyId, moneyNum);
+            ItemUtil.SetItemNumAndNeedNum(_ui.m_comCostCurrent, _studioCfg.moneyId, moneyNum, true);
 
         }
 

BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes