浏览代码

道具tips添加标签

zhaoyang 2 年之前
父节点
当前提交
a06f29e322

+ 2 - 2
FGUIProject/assets/ClothingShop/components/ComClothingShopItemInfo.xml

@@ -8,7 +8,7 @@
   </controller>
   <displayList>
     <image id="n7_hinb" name="n7" src="hinb3" fileName="images/fzd_diban_1.png" xy="0,0"/>
-    <text id="n8_hinb" name="txtName" xy="57,41" size="323,62" font="ui://eg2y0ldpwonotjc" fontSize="46" color="#b59158" text="衣服名字·名字"/>
+    <text id="n8_hinb" name="txtName" xy="57,41" size="323,61" font="ui://eg2y0ldpwonotjc" fontSize="46" color="#b59158" text="衣服名字·名字"/>
     <text id="n30_hinb" name="txtDesc" xy="64,143" size="336,39" fontSize="28" color="#af9a7d" autoSize="height" autoClearText="true" text="赵钱孙李周吴郑王"/>
     <loader id="n43_hinb" name="rarity" xy="379,20" size="44,94" visible="false" url="ui://eg2y0ldpd4iw52" autoSize="true"/>
     <text id="n32_hinb" name="txtOwned" xy="170,610" size="119,36" fontSize="26" color="#c97f7a" align="center" ubb="true" vars="true" text="[color=#B39B75]已拥有:[/color]{v1=0}"/>
@@ -27,7 +27,7 @@
     <group id="n46_hinb" name="n46" xy="182,662" size="76,49" advanced="true" layout="hz" colGap="10" excludeInvisibles="true">
       <relation target="" sidePair="center-center,middle-middle"/>
     </group>
-    <list id="n53_ih75" name="listTag" xy="52,498" size="333,102" layout="flow_hz" lineGap="12" colGap="22" defaultItem="ui://eg2y0ldpih7566" autoClearItems="true">
+    <list id="n53_ih75" name="listTag" xy="43,498" size="375,102" layout="flow_hz" lineGap="12" colGap="10" defaultItem="ui://eg2y0ldpu2u3tkr" autoClearItems="true">
       <item/>
       <item/>
       <item/>

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

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="962,1137" opaque="false">
   <displayList>
-    <component id="n21_si5z" name="comBg" src="si5ztih" fileName="components/ComBg.xml" xy="0,0" size="962,1137" pkg="mk0fwx0x">
+    <component id="n21_si5z" name="comBg" src="si5ztih" fileName="components/ComBg.xml" pkg="mk0fwx0x" xy="0,15" size="962,1106">
       <relation target="n17_ohbx" sidePair="height-height,middle-middle"/>
     </component>
-    <component id="n2_s2cc" name="comTipsBase" src="ohbxti3" fileName="components/ComTipsBase.xml" xy="0,15" group="n17_ohbx"/>
-    <component id="n19_ohbx" name="comTipsApproach" src="ohbxti6" fileName="components/ComTipsApproach.xml" xy="0,505" size="962,596" group="n17_ohbx"/>
-    <group id="n17_ohbx" name="grpTips" xy="0,15" size="962,1086" advanced="true" layout="vt" excludeInvisibles="true">
+    <component id="n2_s2cc" name="comTipsBase" src="ohbxti3" fileName="components/ComTipsBase.xml" xy="0,30" group="n17_ohbx"/>
+    <component id="n19_ohbx" name="comTipsApproach" src="ohbxti6" fileName="components/ComTipsApproach.xml" xy="0,489" size="962,596" group="n17_ohbx"/>
+    <group id="n17_ohbx" name="grpTips" xy="0,30" size="962,1055" advanced="true" layout="vt" excludeInvisibles="true">
       <relation target="" sidePair="middle-middle"/>
     </group>
   </displayList>

+ 24 - 17
FGUIProject/assets/CommonGame/components/ComTipsBase.xml

@@ -1,21 +1,28 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="962,490">
+<component size="962,520">
   <displayList>
-    <text id="n1_s2cc" name="txtName" xy="65,50" size="186,61" fontSize="46" color="#8a7253" autoClearText="true" text="物品名字"/>
-    <text id="n3_s2cc" name="txtOwned" xy="742,72" pivot="1,0" size="139,41" fontSize="30" color="#90877f" vars="true" text="已拥有:{count=20}"/>
-    <image id="n7_si5z" name="n7" src="si5ztig" fileName="imgnew/tc_xiant.png" xy="56,122"/>
-    <loader id="n8_si5z" name="loaIcon" xy="187,270" pivot="0.5,0.5" anchor="true" size="200,200" aspect="true" autoSize="true"/>
-    <loader id="n6_ohbx" name="loaRarity" xy="249,156" size="44,94" url="ui://eg2y0ldpd4iw4z" autoSize="true"/>
-    <image id="n20_r9ri" name="n20" src="r9ritjl" fileName="imgnew/tc_kuangk.png" xy="354,162"/>
-    <text id="n9_si5z" name="txtDesc" xy="375,181" size="506,166" fontSize="30" color="#998a79" ubb="true" autoSize="none" autoClearText="true" text="手机课程很快就要开课咯!!同学们有没有很期待哇过 几天课上见昂!!28节课希望大家都可以跟下来一起度 过有趣儿的两个月吧。"/>
-    <image id="n11_si5z" name="n11" src="842s6h" fileName="imagesExport/kp_sx_1.png" xy="75,400" size="50,50" group="n19_si5z"/>
-    <image id="n12_si5z" name="n12" src="842s6i" fileName="imagesExport/kp_sx_2.png" xy="300,400" size="50,50" group="n19_si5z"/>
-    <image id="n13_si5z" name="n13" src="842s6j" fileName="imagesExport/kp_sx_3.png" xy="525,400" size="50,50" group="n19_si5z"/>
-    <image id="n14_si5z" name="n14" src="842s6k" fileName="imagesExport/kp_sx_4.png" xy="750,400" size="50,50" group="n19_si5z"/>
-    <text id="n15_si5z" name="txtGong" xy="135,404" size="77,41" group="n19_si5z" fontSize="30" color="#aa865f" autoClearText="true" text="5000"/>
-    <text id="n16_si5z" name="txtShang" xy="360,404" size="77,41" group="n19_si5z" fontSize="30" color="#aa865f" autoClearText="true" text="5000"/>
-    <text id="n17_si5z" name="txtJue" xy="585,404" size="77,41" group="n19_si5z" fontSize="30" color="#aa865f" autoClearText="true" text="5000"/>
-    <text id="n18_si5z" name="txtZhi" xy="810,404" size="77,41" group="n19_si5z" fontSize="30" color="#aa865f" autoClearText="true" text="5000"/>
-    <group id="n19_si5z" name="grpScore" xy="75,400" size="812,50" advanced="true"/>
+    <text id="n1_s2cc" name="txtName" xy="65,50" size="184,61" group="n24_u2u3" fontSize="46" color="#8a7253" autoClearText="true" text="物品名字"/>
+    <text id="n3_s2cc" name="txtOwned" xy="744,72" pivot="1,0" size="137,41" group="n24_u2u3" fontSize="30" color="#90877f" vars="true" text="已拥有:{count=20}"/>
+    <image id="n7_si5z" name="n7" src="si5ztig" fileName="imgnew/tc_xiant.png" xy="56,122" group="n24_u2u3"/>
+    <loader id="n8_si5z" name="loaIcon" xy="187,270" pivot="0.5,0.5" anchor="true" size="200,200" group="n24_u2u3" aspect="true" autoSize="true"/>
+    <loader id="n6_ohbx" name="loaRarity" xy="249,156" size="44,94" group="n24_u2u3" url="ui://eg2y0ldpd4iw4z" autoSize="true"/>
+    <image id="n20_r9ri" name="n20" src="r9ritjl" fileName="imgnew/tc_kuangk.png" xy="354,162" group="n24_u2u3"/>
+    <text id="n9_si5z" name="txtDesc" xy="375,181" size="506,166" group="n24_u2u3" fontSize="30" color="#998a79" ubb="true" autoSize="none" autoClearText="true" text="手机课程很快就要开课咯!!同学们有没有很期待哇过 几天课上见昂!!28节课希望大家都可以跟下来一起度 过有趣儿的两个月吧。"/>
+    <group id="n24_u2u3" name="n24" xy="56,50" size="850,320" group="n25_u2u3" advanced="true"/>
+    <image id="n11_si5z" name="n11" src="842s6h" fileName="imagesExport/kp_sx_1.png" xy="75,390" size="50,50" group="n19_si5z"/>
+    <image id="n12_si5z" name="n12" src="842s6i" fileName="imagesExport/kp_sx_2.png" xy="300,390" size="50,50" group="n19_si5z"/>
+    <image id="n13_si5z" name="n13" src="842s6j" fileName="imagesExport/kp_sx_3.png" xy="525,390" size="50,50" group="n19_si5z"/>
+    <image id="n14_si5z" name="n14" src="842s6k" fileName="imagesExport/kp_sx_4.png" xy="750,390" size="50,50" group="n19_si5z"/>
+    <text id="n15_si5z" name="txtGong" xy="135,394" size="72,41" group="n19_si5z" fontSize="30" color="#aa865f" autoClearText="true" text="5000"/>
+    <text id="n16_si5z" name="txtShang" xy="360,394" size="72,41" group="n19_si5z" fontSize="30" color="#aa865f" autoClearText="true" text="5000"/>
+    <text id="n17_si5z" name="txtJue" xy="585,394" size="72,41" group="n19_si5z" fontSize="30" color="#aa865f" autoClearText="true" text="5000"/>
+    <text id="n18_si5z" name="txtZhi" xy="810,394" size="72,41" group="n19_si5z" fontSize="30" color="#aa865f" autoClearText="true" text="5000"/>
+    <group id="n19_si5z" name="grpScore" xy="75,390" size="807,50" group="n25_u2u3" advanced="true"/>
+    <list id="n21_u2u3" name="listTag" xy="71,460" size="377,41" group="n25_u2u3" layout="row" colGap="20" defaultItem="ui://eg2y0ldpu2u3tkr">
+      <item/>
+      <item/>
+    </list>
+    <group id="n25_u2u3" name="n25" xy="56,50" size="850,451" advanced="true" layout="vt" lineGap="20" excludeInvisibles="true"/>
   </displayList>
+  <relation target="n25_u2u3" sidePair="height-height"/>
 </component>

+ 7 - 0
FGUIProject/assets/CommonGame/components/ListTagItem.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="182,41">
+  <displayList>
+    <component id="n22_u2u3" name="comTag" src="ih7566" fileName="components/ComTag.xml" xy="0,3"/>
+    <text id="n23_u2u3" name="txtTagScore" xy="110,0" size="72,41" fontSize="30" color="#aa865f" autoClearText="true" text="5000"/>
+  </displayList>
+</component>

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

@@ -242,6 +242,7 @@
     <image id="jcej2i" name="jjsy_bqdi.png" path="/imagesExport/" exported="true"/>
     <image id="jcej2h" name="jjsy_zldi.png" path="/imagesExport/" exported="true" scale="9grid" scale9grid="68,14,136,28"/>
     <image id="u2u3tkq" name="testBig.png" path="/imgItemIcon/" exported="true"/>
+    <component id="u2u3tkr" name="ListTagItem.xml" path="/components/" exported="true"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\CommonGame" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

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

@@ -17,6 +17,7 @@ namespace UI.CommonGame
         public GTextField m_txtJue;
         public GTextField m_txtZhi;
         public GGroup m_grpScore;
+        public GList m_listTag;
         public const string URL = "ui://eg2y0ldpohbxti3";
         public const string PACKAGE_NAME = "CommonGame";
         public const string RES_NAME = "ComTipsBase";
@@ -74,6 +75,7 @@ namespace UI.CommonGame
             m_txtJue = (GTextField)comp.GetChild("txtJue");
             m_txtZhi = (GTextField)comp.GetChild("txtZhi");
             m_grpScore = (GGroup)comp.GetChild("grpScore");
+            m_listTag = (GList)comp.GetChild("listTag");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -87,6 +89,7 @@ namespace UI.CommonGame
             m_txtJue = null;
             m_txtZhi = null;
             m_grpScore = null;
+            m_listTag = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 75 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_ListTagItem.cs

@@ -0,0 +1,75 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.CommonGame
+{
+    public partial class UI_ListTagItem
+    {
+        public GComponent target;
+        public UI_ComTag m_comTag;
+        public GTextField m_txtTagScore;
+        public const string URL = "ui://eg2y0ldpu2u3tkr";
+        public const string PACKAGE_NAME = "CommonGame";
+        public const string RES_NAME = "ListTagItem";
+        private static UI_ListTagItem _proxy;
+
+        public static UI_ListTagItem Create(GObject gObject = null)
+        {
+            var ui = new UI_ListTagItem();
+            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_ListTagItem Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ListTagItem();
+            }
+            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_comTag = (UI_ComTag)UI_ComTag.Create(comp.GetChild("comTag"));
+            m_txtTagScore = (GTextField)comp.GetChild("txtTagScore");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_comTag.Dispose();
+            m_comTag = null;
+            m_txtTagScore = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_ListTagItem.cs.meta

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

+ 7 - 6
GameClient/Assets/Game/HotUpdate/Views/ClothingShop/ClothingShopView.cs

@@ -359,13 +359,14 @@ namespace GFGGame
 
         private void RenderListTagItem(int index, GObject obj)
         {
-            UI_ComTag item = UI_ComTag.Proxy(obj);
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_cfgSelected.itemID);
-            string tag = itemCfg.tagsArr[index][0];
-            int tagType = TagCfgArray.Instance.GetCfg(tag).type;
-            item.m_txtTag.text = tag;
-            item.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tagType);
-            UI_ComTag.ProxyEnd();
+
+            UI_ListTagItem item = UI_ListTagItem.Proxy(obj);
+
+            ItemUtil.UpdateTag(item.m_comTag.target, itemCfg.tagsArr[index][0]);
+            item.m_txtTagScore.text = itemCfg.tagsArr[index][1].ToString();
+
+            UI_ListTagItem.ProxyEnd();
         }
         private void CheckGuide(object param)
         {

+ 15 - 0
GameClient/Assets/Game/HotUpdate/Views/CommonGame/GoodsItemTipsView.cs

@@ -36,6 +36,8 @@ namespace GFGGame
 
             approachView = new ApproachView();
             approachView.OnInit(_ui.m_comTipsApproach.target);
+
+            _ui.m_comTipsBase.m_listTag.itemRenderer = RenderListTagItem;
         }
         protected override void AddEventListener()
         {
@@ -51,6 +53,7 @@ namespace GFGGame
 
             UpdateBase();
             UpdateScore();
+            UpdateTags();
             UpdateSourec(sourceDatas);
             // this.viewCom.height = _ui.m_grpTips.height;
             // this.viewCom.Center();
@@ -99,6 +102,18 @@ namespace GFGGame
             _ui.m_comTipsBase.m_txtJue.text = "" + itemCfg.score3;
             _ui.m_comTipsBase.m_txtZhi.text = "" + itemCfg.score4;
         }
+        private void UpdateTags()
+        {
+            _ui.m_comTipsBase.m_listTag.visible = itemCfg.tagsArr.Length > 0;
+            _ui.m_comTipsBase.m_listTag.numItems = itemCfg.tagsArr.Length;
+        }
+        private void RenderListTagItem(int index, GObject obj)
+        {
+            UI_ListTagItem item = UI_ListTagItem.Proxy(obj);
+            ItemUtil.UpdateTag(item.m_comTag.target, itemCfg.tagsArr[index][0]);
+            item.m_txtTagScore.text = itemCfg.tagsArr[index][1].ToString();
+            UI_ListTagItem.ProxyEnd();
+        }
         private void UpdateSourec(object[] sourceDatas)
         {
             _ui.m_comTipsApproach.target.visible = sourceDatas != null;

二进制
GameClient/Assets/ResIn/UI/ClothingShop/ClothingShop_fui.bytes


二进制
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes