浏览代码

工作室兑换次数消耗显示

zhaoyang 2 年之前
父节点
当前提交
244ab717fe

+ 17 - 7
FGUIProject/assets/Studio/StudioBuyNumUI.xml

@@ -1,18 +1,28 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="962,574">
+  <controller name="c1" pages="0,,1," selected="0"/>
   <displayList>
     <component id="n26_eiwu" name="loaBg" src="si5ztih" fileName="components/ComBg.xml" pkg="mk0fwx0x" xy="0,0" size="962,574"/>
     <image id="n32_kqhd" name="n32" src="9cth8y" fileName="imagesExport/tctc_xiant_1.png" pkg="eg2y0ldp" xy="57,120"/>
-    <component id="n27_n3xh" name="comCostItem" src="ojlz61" fileName="components/ComCostCurrencyWithHas.xml" pkg="eg2y0ldp" xy="113,364"/>
-    <component id="n28_n3xh" name="comCostCurrent" src="ojlz61" fileName="components/ComCostCurrencyWithHas.xml" pkg="eg2y0ldp" xy="553,364"/>
-    <text id="n30_n3xh" name="txtTitle" xy="431,30" pivot="0.5,0" size="100,64" fontSize="48" color="#9b7853" text="提示"/>
-    <text id="n29_n3xh" name="txtTips" xy="310,150" pivot="0.5,0" size="342,51" fontSize="38" color="#917961" text="请选择获取次数方式"/>
-    <text id="n31_n3xh" name="txtNum" xy="334,220" pivot="0.5,0" size="294,44" fontSize="32" color="#917961" text="(今日已兑换0/10次)"/>
-    <component id="n7_hinb" name="btnExchange" src="r9ritjh" fileName="components/Button18.xml" pkg="mk0fwx0x" xy="88,420">
+    <text id="n30_n3xh" name="txtTitle" xy="432,30" pivot="0.5,0" size="98,64" fontSize="48" color="#9b7853" text="提示"/>
+    <text id="n29_n3xh" name="txtTips" xy="312,150" pivot="0.5,0" size="337,51" fontSize="38" color="#917961" text="请选择获取次数方式"/>
+    <text id="n31_n3xh" name="txtNum" xy="337,220" pivot="0.5,0" size="287,44" fontSize="32" color="#917961" text="(今日已兑换0/10次)"/>
+    <component id="n27_n3xh" name="comCostItem" src="ojlz61" fileName="components/ComCostCurrencyWithHas.xml" pkg="eg2y0ldp" xy="335,364" group="n33_f2bf"/>
+    <component id="n7_hinb" name="btnExchange" src="r9ritjh" fileName="components/Button18.xml" pkg="mk0fwx0x" xy="310,420" group="n33_f2bf">
       <Button title="兑换"/>
     </component>
-    <component id="n6_hinb" name="btnBuy" src="wonody" fileName="components/Button19.xml" pkg="mk0fwx0x" xy="529,420">
+    <group id="n33_f2bf" name="n33" xy="310,364" size="342,152" group="n35_f2bf" advanced="true">
+      <gearDisplay controller="c1" pages="0,1"/>
+    </group>
+    <component id="n28_n3xh" name="comCostCurrent" src="ojlz61" fileName="components/ComCostCurrencyWithHas.xml" pkg="eg2y0ldp" xy="775,364" group="n34_f2bf"/>
+    <component id="n6_hinb" name="btnBuy" src="wonody" fileName="components/Button19.xml" pkg="mk0fwx0x" xy="751,420" group="n34_f2bf">
       <Button title="购买"/>
     </component>
+    <group id="n34_f2bf" name="n34" xy="751,364" size="344,153" group="n35_f2bf" advanced="true">
+      <gearDisplay controller="c1" pages="1"/>
+    </group>
+    <group id="n35_f2bf" name="n35" xy="310,364" size="342,152" advanced="true" layout="hz" colGap="99" excludeInvisibles="true">
+      <relation target="" sidePair="center-center"/>
+    </group>
   </displayList>
 </component>

+ 9 - 6
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Studio/UI_StudioBuyNumUI.cs

@@ -7,13 +7,14 @@ namespace UI.Studio
     public partial class UI_StudioBuyNumUI
     {
         public GComponent target;
+        public Controller m_c1;
         public GComponent m_loaBg;
-        public GComponent m_comCostItem;
-        public GComponent m_comCostCurrent;
         public GTextField m_txtTitle;
         public GTextField m_txtTips;
         public GTextField m_txtNum;
+        public GComponent m_comCostItem;
         public GButton m_btnExchange;
+        public GComponent m_comCostCurrent;
         public GButton m_btnBuy;
         public const string URL = "ui://xz8kxrecn3xhh";
         public const string PACKAGE_NAME = "Studio";
@@ -62,24 +63,26 @@ namespace UI.Studio
 
         private void Init(GComponent comp)
         {
+            m_c1 = comp.GetController("c1");
             m_loaBg = (GComponent)comp.GetChild("loaBg");
-            m_comCostItem = (GComponent)comp.GetChild("comCostItem");
-            m_comCostCurrent = (GComponent)comp.GetChild("comCostCurrent");
             m_txtTitle = (GTextField)comp.GetChild("txtTitle");
             m_txtTips = (GTextField)comp.GetChild("txtTips");
             m_txtNum = (GTextField)comp.GetChild("txtNum");
+            m_comCostItem = (GComponent)comp.GetChild("comCostItem");
             m_btnExchange = (GButton)comp.GetChild("btnExchange");
+            m_comCostCurrent = (GComponent)comp.GetChild("comCostCurrent");
             m_btnBuy = (GButton)comp.GetChild("btnBuy");
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_c1 = null;
             m_loaBg = null;
-            m_comCostItem = null;
-            m_comCostCurrent = null;
             m_txtTitle = null;
             m_txtTips = null;
             m_txtNum = null;
+            m_comCostItem = null;
             m_btnExchange = null;
+            m_comCostCurrent = null;
             m_btnBuy = null;
             if(disposeTarget && target != null)
             {

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

@@ -59,11 +59,13 @@ namespace GFGGame
             _studioData = StudioDataManager.Instance.GetStudioDataById(_chapterId);
             _studioCfg = StudioCfgArray.Instance.GetCfg(_chapterId);
 
-
+            _ui.m_c1.selectedIndex = 0;
             _ui.m_txtNum.text = string.Format("(今天已兑换{0}/{1}次)", _studioData.BuyTimes, _studioCfg.buyNum);
 
             ItemUtil.SetItemNumAndNeedNum(_ui.m_comCostItem, _studioCfg.itemID, _studioCfg.itemNum, true);
 
+            if (_studioCfg.moneyId <= 0) return;
+            _ui.m_c1.selectedIndex = 1;
             StudioCfgArray.Instance.GetMoneyIdAndNum(_studioCfg.id, _studioData.BuyTimes, 1, out int moneyId, out int moneyNum);
             ItemUtil.SetItemNumAndNeedNum(_ui.m_comCostCurrent, _studioCfg.moneyId, moneyNum, true);
 

二进制
GameClient/Assets/ResIn/UI/Studio/Studio_fui.bytes