zhaoyang 3 жил өмнө
parent
commit
5afe5e816d

+ 1 - 1
FGUIProject/assets/CommonGame/components/Button5.xml

@@ -3,7 +3,7 @@
   <controller name="button" pages="0,up,1,down" selected="0"/>
   <controller name="c1" pages="0,,1," selected="0"/>
   <displayList>
-    <loader id="n4_10not" name="icon" xy="70,9" size="60,60" group="n5_10not" url="ui://eg2y0ldpq08x4" autoSize="true">
+    <loader id="n4_10not" name="loaIcon" xy="70,9" size="60,60" group="n5_10not" url="ui://eg2y0ldpq08x4" autoSize="true">
       <gearDisplay controller="c1" pages="1"/>
     </loader>
     <text id="n2_dmsi" name="n2" xy="74,7" size="52,64" group="n5_10not" fontSize="48" color="#8b6540" text="¥">

+ 17 - 0
FGUIProject/assets/RechargeStore/components/Component2.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="264,79">
+  <controller name="c1" pages="0,,1," selected="1"/>
+  <displayList>
+    <loader id="n15_iftf" name="loaIcon" xy="78,19" size="60,60" group="n17_iftf" url="ui://eg2y0ldpq08x4" autoSize="true">
+      <gearDisplay controller="c1" pages="0"/>
+    </loader>
+    <text id="n16_iftf" name="n16" xy="82,17" size="52,64" group="n17_iftf" fontSize="48" color="#8b6540" text="¥">
+      <gearDisplay controller="c1" pages="1"/>
+    </text>
+    <group id="n17_iftf" name="n17" xy="78,17" size="60,64" group="n19_iftf" advanced="true"/>
+    <text id="n18_iftf" name="txtTitle" xy="138,17" size="64,64" group="n19_iftf" fontSize="48" color="#8b6540" align="center" vAlign="middle" vars="true" singleLine="true" text="60">
+      <relation target="" sidePair="width-width,height-height"/>
+    </text>
+    <group id="n19_iftf" name="n19" xy="78,17" size="124,64" advanced="true" layout="hz" excludeInvisibles="true"/>
+  </displayList>
+</component>

+ 1 - 1
FGUIProject/assets/RechargeStore/components/StoreListItem.xml

@@ -7,7 +7,7 @@
     <text id="n16_d4iw" name="txtName" xy="76,140" pivot="0.5,0" size="149,51" fontSize="38" color="#906d4b" align="center" text="钻石600">
       <relation target="" sidePair="center-center,middle-middle"/>
     </text>
-    <component id="n14_d4iw" name="btnBuy" src="d4iw59" fileName="components/Button5.xml" pkg="eg2y0ldp" xy="19,433"/>
+    <component id="n14_d4iw" name="btnBuy" src="iftftaf" fileName="components/Component2.xml" xy="19,433"/>
     <text id="n18_dmsi" name="txtDesc" xy="6,380" pivot="0.5,0" size="290,49" font="ui://eg2y0ldpk1kha2" fontSize="36" color="#bb674e" letterSpacing="-2" text="首充赠送+6000钻石"/>
   </displayList>
 </component>

+ 1 - 0
FGUIProject/assets/RechargeStore/package.xml

@@ -47,6 +47,7 @@
     <image id="iftftac" name="sc_cwcw_3.png" path="/images/"/>
     <image id="iftftad" name="jinbi_1(1).png" path="/imagesExport/"/>
     <image id="iftftae" name="sc_xtxtxt(1).png" path="/images/" scale="9grid" scale9grid="12,0,44,2"/>
+    <component id="iftftaf" name="Component2.xml" path="/components/"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\RechargeStore" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_Button5.cs

@@ -8,6 +8,7 @@ namespace UI.CommonGame
     {
         public GButton target;
         public Controller m_c1;
+        public GLoader m_loaIcon;
         public const string URL = "ui://eg2y0ldpd4iw59";
         public const string PACKAGE_NAME = "CommonGame";
         public const string RES_NAME = "Button5";
@@ -56,10 +57,12 @@ namespace UI.CommonGame
         private void Init(GComponent comp)
         {
             m_c1 = comp.GetController("c1");
+            m_loaIcon = (GLoader)comp.GetChild("loaIcon");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_c1 = null;
+            m_loaIcon = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 77 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RechargeStore/UI_Component2.cs

@@ -0,0 +1,77 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.RechargeStore
+{
+    public partial class UI_Component2
+    {
+        public GComponent target;
+        public Controller m_c1;
+        public GLoader m_loaIcon;
+        public GTextField m_txtTitle;
+        public const string URL = "ui://vlgobc15iftftaf";
+        public const string PACKAGE_NAME = "RechargeStore";
+        public const string RES_NAME = "Component2";
+        private static UI_Component2 _proxy;
+
+        public static UI_Component2 Create(GObject gObject = null)
+        {
+            var ui = new UI_Component2();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_Component2 Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_Component2();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_c1 = comp.GetController("c1");
+            m_loaIcon = (GLoader)comp.GetChild("loaIcon");
+            m_txtTitle = (GTextField)comp.GetChild("txtTitle");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_c1 = null;
+            m_loaIcon = null;
+            m_txtTitle = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RechargeStore/UI_Component2.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 52e355a37a6617d4eba78578a75d2bb7
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 3 - 2
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RechargeStore/UI_StoreListItem.cs

@@ -10,7 +10,7 @@ namespace UI.RechargeStore
         public GImage m_imgDouble;
         public GLoader m_icon;
         public GTextField m_txtName;
-        public GButton m_btnBuy;
+        public UI_Component2 m_btnBuy;
         public GTextField m_txtDesc;
         public const string URL = "ui://vlgobc15d4iwr";
         public const string PACKAGE_NAME = "RechargeStore";
@@ -62,7 +62,7 @@ namespace UI.RechargeStore
             m_imgDouble = (GImage)comp.GetChild("imgDouble");
             m_icon = (GLoader)comp.GetChild("icon");
             m_txtName = (GTextField)comp.GetChild("txtName");
-            m_btnBuy = (GButton)comp.GetChild("btnBuy");
+            m_btnBuy = (UI_Component2)UI_Component2.Create(comp.GetChild("btnBuy"));
             m_txtDesc = (GTextField)comp.GetChild("txtDesc");
         }
         public void Dispose(bool disposeTarget = false)
@@ -70,6 +70,7 @@ namespace UI.RechargeStore
             m_imgDouble = null;
             m_icon = null;
             m_txtName = null;
+            m_btnBuy.Dispose();
             m_btnBuy = null;
             m_txtDesc = null;
             if(disposeTarget && target != null)

+ 33 - 6
GameClient/Assets/Game/HotUpdate/Views/RechargeStore/RechargeStoreView.cs

@@ -36,6 +36,7 @@ namespace GFGGame
 
             _ui.m_list.itemRenderer = ListItemRenderer;
             _ui.m_listGift.itemRenderer = ListGiftItemRenderer;
+            _ui.m_listExchange.itemRenderer = ListExchangeItemRenderer;
 
             _ui.m_comTab.m_c1.onChanged.Add(OnComTabChange);
             _ui.m_c1.onChanged.Add(OnTabChange);
@@ -89,15 +90,16 @@ namespace GFGGame
         {
             RechargeCfg itemData = RechargeCfgArray.Instance.dataArray[index];
             UI_StoreListItem item = UI_StoreListItem.Proxy(obj);
-            item.m_btnBuy.text = itemData.price.ToString();
-            if (item.m_btnBuy.data == null)
+            item.m_btnBuy.m_c1.selectedIndex = 1;
+            item.m_btnBuy.m_txtTitle.text = itemData.price.ToString();
+            if (item.m_btnBuy.target.data == null)
             {
-                item.m_btnBuy.onClick.Add(() =>
+                item.m_btnBuy.target.onClick.Add(() =>
                 {
                     RechargeSProxy.ReqRecharge(itemData.id).Coroutine();
                 });
             }
-            item.m_btnBuy.data = index;
+            item.m_btnBuy.target.data = index;
             item.m_txtName.text = string.Format("{0}{1}", itemData.itemNum, itemData.name);
             item.m_txtDesc.text = string.Format("首充赠送+{0}{1}", itemData.itemNum, itemData.name);
             item.m_imgDouble.visible = RechargeDataManager.Instance.GetRechargeBuyNumById(itemData.id) <= itemData.doubleTimes;
@@ -153,7 +155,7 @@ namespace GFGGame
                     else
                     {
                         ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.costId);
-                        item.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
+                        item.m_loaIcon.url = ResPathUtil.GetCommonGameResPath(itemCfg.res);
                         item.m_loaIcon.visible = true;
                         item.m_txtIcon.visible = false;
                     }
@@ -171,12 +173,37 @@ namespace GFGGame
                 item.target.onClick.Add(OnBtnBuyClick);
             }
             item.target.data = cfg.id;
-
+            UI_ListGiftItem.ProxyEnd();
         }
         private void OnBtnBuyClick(EventContext context)
         {
             GObject btn = context.sender as GObject;
             ViewManager.Show<GiftBagBuyView>(btn.data);
         }
+
+        private void ListExchangeItemRenderer(int index, GObject obj)
+        {
+            ShopExchangeCfg cfg = ShopExchangeCfgArray.Instance.dataArray[index];
+            UI_StoreListItem item = UI_StoreListItem.Proxy(obj);
+            item.m_btnBuy.m_c1.selectedIndex = 0;
+            item.m_btnBuy.m_txtTitle.text = cfg.costNum.ToString();
+            if (item.m_btnBuy.target.data == null)
+            {
+                item.m_btnBuy.target.onClick.Add(() =>
+                {
+                    // RechargeSProxy.ReqRecharge(cfg.id).Coroutine();
+                });
+            }
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.itemId);
+            item.m_btnBuy.target.data = cfg.id;
+            item.m_btnBuy.m_loaIcon.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(cfg.costId).res);
+            item.m_txtName.text = itemCfg.name;
+            item.m_txtDesc.text = string.Format("剩余:{0}", cfg.maxLimit - RechargeDataManager.Instance.GetExchangeBuyNumById(cfg.id));
+            item.m_imgDouble.visible = false;
+            item.m_txtDesc.visible = false;
+            item.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
+
+            UI_StoreListItem.ProxyEnd();
+        }
     }
 }

BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0.png


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


BIN
GameClient/Assets/ResIn/UI/RechargeStore/RechargeStore_fui.bytes