Browse Source

替换货币弹窗资源

zhaoyang 3 years ago
parent
commit
41824c1b58

+ 7 - 7
FGUIProject/assets/CommonGame/GoodsItemTips.xml

@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="714,422">
+<component size="936,668">
   <displayList>
-    <image id="n0_s2cc" name="n0" src="q08x4" fileName="images/di_1.png" xy="0,0" size="714,422" pkg="mk0fwx0x"/>
-    <text id="n1_s2cc" name="txtName" xy="265,57" size="156,51" fontSize="38" color="#8781e7" autoClearText="true" text="物品名字"/>
-    <component id="n2_s2cc" name="goodsItem" src="s2cc4i" fileName="components/GoodsIconItem.xml" xy="49,49"/>
-    <text id="n3_s2cc" name="txtOwned" xy="269,129" size="148,36" fontSize="26" color="#f29295" vars="true" autoSize="none" text="已拥有:{count=0}"/>
-    <image id="n4_s2cc" name="n4" src="s2cc4h" fileName="images/zx_tsk_xian.png" xy="15,218"/>
-    <text id="n5_s2cc" name="txtDesc" xy="51,274" size="611,102" fontSize="28" color="#837fbe" ubb="true" autoSize="none" autoClearText="true" text="这是一个物品。"/>
+    <image id="n0_s2cc" name="n0" src="lwri5u" fileName="imagesExport/hc_kuang_6.png" pkg="mk0fwx0x" xy="0,0" size="936,668"/>
+    <text id="n1_s2cc" name="txtName" xy="332,74" size="186,62" fontSize="46" color="#8d754e" autoClearText="true" text="物品名字"/>
+    <component id="n2_s2cc" name="goodsItem" src="j48o98" fileName="components/ComItem.xml" xy="58,58" size="192,199"/>
+    <text id="n3_s2cc" name="txtOwned" xy="338,168" size="148,46" fontSize="34" color="#a38e66" vars="true" autoSize="none" text="已拥有:{count=0}"/>
+    <image id="n4_s2cc" name="n4" src="s2cc4h" fileName="imagesExport/zx_tsk_xian.png" xy="44,309"/>
+    <text id="n5_s2cc" name="txtDesc" xy="60,352" size="815,133" fontSize="34" color="#9f8e70" ubb="true" autoSize="height" autoClearText="true" text="手机课程很快就要开课咯!!同学们有没有很期待哇过 几天课上见昂!!28节课希望大家都可以跟下来一起度 过有趣儿的两个月吧。"/>
   </displayList>
 </component>

+ 3 - 2
FGUIProject/assets/CommonGame/components/ComItem.xml

@@ -3,12 +3,13 @@
   <displayList>
     <image id="n11_ehs9" name="n11" src="j48o99" fileName="images/kp_sjsj_di_3.png" xy="0,0"/>
     <loader id="n12_ehs9" name="loaIcon" xy="96,96" pivot="0.5,0.5" anchor="true" size="150,150" aspect="true" url="ui://eg2y0ldpm9wm8v" fill="scale"/>
-    <image id="n13_ehs9" name="n13" src="j48o9a" fileName="images/kp_sjsj_di_4.png" xy="16,162"/>
     <text id="n14_ehs9" name="txtName" xy="95,194" pivot="0.5,0" anchor="true" size="105,46" fontSize="34" color="#9b7f61" text="赵钱孙"/>
-    <text id="n15_ehs9" name="txtCount" xy="95,159" pivot="0.5,0" anchor="true" size="32,34" fontSize="24" color="#fff8ea" vars="true" text="x{count=0}"/>
     <image id="n16_j8b3" name="imgGot" src="j48o9b" fileName="images/yx_yilq.png" xy="7,80"/>
     <text id="n17_j48o" name="txtHasCount" xy="96,243" pivot="0.5,0" anchor="true" size="105,36" fontSize="26" color="#a28d77" vars="true" text="已拥有:{count=0}"/>
     <loader id="n18_j48o" name="loaRarity" xy="148,0" size="44,94" url="ui://eg2y0ldpd4iw52" autoSize="true"/>
     <loader id="n19_tc53" name="loaShouTongReward" xy="16,81" size="160,40" url="ui://eg2y0ldptc539z" autoSize="true"/>
+    <image id="n13_ehs9" name="n13" src="j48o9a" fileName="images/kp_sjsj_di_4.png" xy="16,162" group="n20_ox5b"/>
+    <text id="n15_ehs9" name="txtCount" xy="95,159" pivot="0.5,0" anchor="true" size="32,34" group="n20_ox5b" fontSize="24" color="#fff8ea" vars="true" text="x{count=0}"/>
+    <group id="n20_ox5b" name="grpCount" xy="16,159" size="160,34" advanced="true"/>
   </displayList>
 </component>

+ 6 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_ComItem.cs

@@ -9,11 +9,12 @@ namespace UI.CommonGame
         public GComponent target;
         public GLoader m_loaIcon;
         public GTextField m_txtName;
-        public GTextField m_txtCount;
         public GImage m_imgGot;
         public GTextField m_txtHasCount;
         public GLoader m_loaRarity;
         public GLoader m_loaShouTongReward;
+        public GTextField m_txtCount;
+        public GGroup m_grpCount;
         public const string URL = "ui://eg2y0ldpj48o98";
         public const string PACKAGE_NAME = "CommonGame";
         public const string RES_NAME = "ComItem";
@@ -63,21 +64,23 @@ namespace UI.CommonGame
         {
             m_loaIcon = (GLoader)comp.GetChild("loaIcon");
             m_txtName = (GTextField)comp.GetChild("txtName");
-            m_txtCount = (GTextField)comp.GetChild("txtCount");
             m_imgGot = (GImage)comp.GetChild("imgGot");
             m_txtHasCount = (GTextField)comp.GetChild("txtHasCount");
             m_loaRarity = (GLoader)comp.GetChild("loaRarity");
             m_loaShouTongReward = (GLoader)comp.GetChild("loaShouTongReward");
+            m_txtCount = (GTextField)comp.GetChild("txtCount");
+            m_grpCount = (GGroup)comp.GetChild("grpCount");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_loaIcon = null;
             m_txtName = null;
-            m_txtCount = null;
             m_imgGot = null;
             m_txtHasCount = null;
             m_loaRarity = null;
             m_loaShouTongReward = null;
+            m_txtCount = null;
+            m_grpCount = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 2 - 2
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_GoodsItemTips.cs

@@ -8,7 +8,7 @@ namespace UI.CommonGame
     {
         public GComponent target;
         public GTextField m_txtName;
-        public UI_GoodsIconItem m_goodsItem;
+        public UI_ComItem m_goodsItem;
         public GTextField m_txtOwned;
         public GTextField m_txtDesc;
         public const string URL = "ui://eg2y0ldps2cc4g";
@@ -59,7 +59,7 @@ namespace UI.CommonGame
         private void Init(GComponent comp)
         {
             m_txtName = (GTextField)comp.GetChild("txtName");
-            m_goodsItem = (UI_GoodsIconItem)UI_GoodsIconItem.Create(comp.GetChild("goodsItem"));
+            m_goodsItem = (UI_ComItem)UI_ComItem.Create(comp.GetChild("goodsItem"));
             m_txtOwned = (GTextField)comp.GetChild("txtOwned");
             m_txtDesc = (GTextField)comp.GetChild("txtDesc");
         }

+ 12 - 3
GameClient/Assets/Game/HotUpdate/Views/CommonGame/GoodsItemTipsView.cs

@@ -6,7 +6,7 @@ namespace GFGGame
     public class GoodsItemTipsView : BaseWindow
     {
         private UI_GoodsItemTips _ui;
-
+        private ItemView itemView;
         protected override void OnInit()
         {
             base.OnInit();
@@ -23,9 +23,18 @@ namespace GFGGame
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemID);
             _ui.m_txtOwned.SetVar("count", "" + ItemDataManager.GetItemNum(itemID)).FlushVars();
             _ui.m_txtName.text = itemCfg.name;
-            _ui.m_goodsItem.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
+            // _ui.m_goodsItem.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
+            if (itemView == null)
+            {
+                itemView = new ItemView(_ui.m_goodsItem.target);
+            }
+            ItemData itemData = ItemUtil.createItemData(new int[] { itemCfg.id, 1 });
+            itemView.SetData(itemData);
+            itemView.ShowCount = false;
+            itemView.ShowTips = false;
+
             _ui.m_txtDesc.text = itemCfg.desc;
-            RarityIconController.UpdateRarityIcon(_ui.m_goodsItem.m_rarity, itemID, true);
+            // RarityIconController.UpdateRarityIcon(_ui.m_goodsItem.m_rarity, itemID, true);
         }
 
         protected override void OnHide()

+ 32 - 1
GameClient/Assets/Game/HotUpdate/Views/CommonGame/ItemView.cs

@@ -11,6 +11,7 @@ namespace GFGGame
         private GTextField _txtHasCount;
         private GImage _imgGot;
         private GLoader _loaShouTongRewardVisble;
+        private GGroup _grpCount;
 
         private ItemData _itemData;
 
@@ -24,12 +25,17 @@ namespace GFGGame
             _txtHasCount = obj.GetChild("txtHasCount") as GTextField;
             _imgGot = obj.GetChild("imgGot") as GImage;
             _loaShouTongRewardVisble = obj.GetChild("loaShouTongReward") as GLoader;
+            _grpCount = obj.GetChild("grpCount") as GGroup;
             AddClickListener();
         }
 
         private void AddClickListener()
         {
-            _obj.onClick.Add(() => { GoodsItemTipsController.ShowItemTips(_itemData.id); });
+            _obj.onClick.Add(() =>
+            {
+                if (!ShowTips) return;
+                GoodsItemTipsController.ShowItemTips(_itemData.id);
+            });
         }
 
         public void SetData(ItemData itemData)
@@ -44,6 +50,8 @@ namespace GFGGame
             RarityIconController.UpdateRarityIcon(_loaRarity, _itemData.id, false);
             _imgGot.visible = false;
             _loaShouTongRewardVisble.visible = false;
+            _grpCount.visible = true;
+            _showTips = true;
 
             _txtName.text = itemCfg.name;
             _txtCount.SetVar("count", _itemData.num.ToString()).FlushVars();
@@ -93,5 +101,28 @@ namespace GFGGame
                 _loaShouTongRewardVisble.visible = value;
             }
         }
+        /// <summary>
+        /// 显示数量
+        /// </summary>
+        /// <value></value>
+        public bool ShowCount
+        {
+            set
+            {
+                _grpCount.visible = value;
+            }
+        }
+        private bool _showTips = true;
+        public bool ShowTips
+        {
+            get
+            {
+                return _showTips;
+            }
+            set
+            {
+                _showTips = value;
+            }
+        }
     }
 }

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