Browse Source

工作室优化

zhaoyang 2 years ago
parent
commit
cebdedf704

+ 1 - 1
FGUIProject/assets/Studio/components/ListItem.xml

@@ -2,7 +2,7 @@
 <component size="1009,161">
   <controller name="star" pages="0,,1,,2,,3," selected="0"/>
   <displayList>
-    <image id="n16_n3xh" name="n16" src="kqhds" fileName="images/gzsdi_1.png" xy="-6,4"/>
+    <loader id="n19_wono" name="loaBg" xy="334,0" size="675,161" url="ui://xz8kxreckqhds" align="right" fillMethod="hz"/>
     <image id="n18_kqhd" name="n18" src="kqhdt" fileName="images/gzsdi_2.png" xy="194,11"/>
     <loader id="n6_rbxq" name="loaIcon" xy="202,19" size="120,120" url="ui://xz8kxrecrbxq3" fill="scale"/>
     <image id="n17_kqhd" name="imgLock" src="kqhdy" fileName="images/gzssuo.png" xy="196,13"/>

+ 7 - 6
FGUIProject/assets/Studio/components/ListLevelItem.xml

@@ -18,12 +18,13 @@
     <component id="n32_v482" name="comFlower" src="rqo41r" fileName="components/CompFlower.xml" xy="581,160" size="156,45">
       <gearXY controller="c1" pages="1" values="212,160" default="581,160"/>
     </component>
-    <image id="n33_v482" name="imgLock" src="rbxq4" fileName="images/zhuxian_shuoto.png" xy="421,108" size="71,37" group="n35_v482"/>
-    <image id="n34_v482" name="n34" src="v4822b" fileName="images/cyjd_di_3.png" xy="0,0" pivot="0.5,0" group="n35_v482">
-      <gearSize controller="c1" pages="1" values="913,254,-1,1" default="913,254,1,1"/>
-    </image>
-    <group id="n35_v482" name="grpLock" xy="0,0" size="913,254" advanced="true">
+    <image id="n34_v482" name="imgLockBg" src="v4822b" fileName="images/cyjd_di_3.png" xy="0,0" pivot="0.5,0" group="n45_wono">
       <gearXY controller="c1" pages="1" values="47,0" default="0,0"/>
-    </group>
+      <gearSize controller="c1" pages="0,1" values="913,254,1,1|913,254,-1,1"/>
+    </image>
+    <image id="n33_v482" name="imgLock" src="rbxq4" fileName="images/zhuxian_shuoto.png" xy="90,108" group="n45_wono">
+      <gearXY controller="c1" pages="0,1" values="90,108|800,108"/>
+    </image>
+    <group id="n45_wono" name="grpLock" xy="0,0" size="913,254" advanced="true"/>
   </displayList>
 </component>

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Studio/UI_ListItem.cs

@@ -8,6 +8,7 @@ namespace UI.Studio
     {
         public GComponent target;
         public Controller m_star;
+        public GLoader m_loaBg;
         public GLoader m_loaIcon;
         public GImage m_imgLock;
         public GTextField m_txtTitle;
@@ -59,6 +60,7 @@ namespace UI.Studio
         private void Init(GComponent comp)
         {
             m_star = comp.GetController("star");
+            m_loaBg = (GLoader)comp.GetChild("loaBg");
             m_loaIcon = (GLoader)comp.GetChild("loaIcon");
             m_imgLock = (GImage)comp.GetChild("imgLock");
             m_txtTitle = (GTextField)comp.GetChild("txtTitle");
@@ -66,6 +68,7 @@ namespace UI.Studio
         public void Dispose(bool disposeTarget = false)
         {
             m_star = null;
+            m_loaBg = null;
             m_loaIcon = null;
             m_imgLock = null;
             m_txtTitle = null;

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Studio/UI_ListLevelItem.cs

@@ -13,6 +13,7 @@ namespace UI.Studio
         public GLoader m_loaItem;
         public GTextField m_txtName;
         public UI_CompFlower m_comFlower;
+        public GImage m_imgLockBg;
         public GImage m_imgLock;
         public GGroup m_grpLock;
         public const string URL = "ui://xz8kxrecv4822p";
@@ -68,6 +69,7 @@ namespace UI.Studio
             m_loaItem = (GLoader)comp.GetChild("loaItem");
             m_txtName = (GTextField)comp.GetChild("txtName");
             m_comFlower = (UI_CompFlower)UI_CompFlower.Create(comp.GetChild("comFlower"));
+            m_imgLockBg = (GImage)comp.GetChild("imgLockBg");
             m_imgLock = (GImage)comp.GetChild("imgLock");
             m_grpLock = (GGroup)comp.GetChild("grpLock");
         }
@@ -80,6 +82,7 @@ namespace UI.Studio
             m_txtName = null;
             m_comFlower.Dispose();
             m_comFlower = null;
+            m_imgLockBg = null;
             m_imgLock = null;
             m_grpLock = null;
             if(disposeTarget && target != null)

+ 21 - 6
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioBaseView.cs

@@ -45,7 +45,7 @@ namespace GFGGame
             _valueBarController = new ValueBarController(_ui.m_valueBar);
 
             _ui.m_list.itemRenderer = ListItemRender;
-            _ui.m_list.onClickItem.Add(OnCliclListItem);
+            // _ui.m_list.onClickItem.Add(OnCliclListItem);
             _ui.m_list.SetVirtual();
 
             _ui.m_btnBuy.onClick.Add(OnCliclBtnBuy);
@@ -107,13 +107,22 @@ namespace GFGGame
             item.m_imgLock.visible = canFight ? false : true;
             item.m_txtTitle.text = canFight ? storyLevelCfgs[index].name : content;
             if (canFight) curIndex = index;
-            item.target.data = index;
+            if (item.m_loaIcon.data == null)
+            {
+                item.m_loaIcon.onClick.Add(OnLoaItemClick);
+            }
+            item.m_loaIcon.data = index;
+            if (item.m_loaBg.data == null)
+            {
+                item.m_loaBg.onClick.Add(OnCliclListItem);
+            }
+            item.m_loaBg.data = index;
             UI_ListItem.ProxyEnd();
         }
         private void OnCliclListItem(EventContext context)
         {
-            UI_ListItem item = UI_ListItem.Proxy(context.data as GObject);
-            int index = (int)item.target.data;
+            GObject obj = context.sender as GObject;
+            int index = (int)obj.data;
             StoryLevelCfg storyLevelCfg = storyLevelCfgs[index];
             StudioDataManager.Instance.IsCanFight(storyLevelCfgs, index, out bool canFight, out string content);
             if (!canFight)
@@ -124,9 +133,15 @@ namespace GFGGame
             StudioDataManager.Instance.PROPERTY_SELECT_INDEX = _ui.m_listProperty.selectedIndex;
             StudioDataManager.Instance.TYPE_SELECT_INDEX = _ui.m_c1.selectedIndex;
             InstanceZonesController.ShowLevelView(storyLevelCfg.id, StudioDataManager.Instance.OnFinishStudioStoryLevel);
-            UI_ListItem.ProxyEnd();
         }
-
+        private void OnLoaItemClick(EventContext context)
+        {
+            GObject obj = context.sender as GObject;
+            int index = (int)obj.data;
+            ItemData itemData = StoryBonusDataCache.GetBonusData(storyLevelCfgs[index].id).bonusBase[0];
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemData.id);
+            GoodsItemTipsController.ShowItemTips(itemCfg.id);
+        }
 
         private void OnCliclBtnBuy()
         {

+ 19 - 11
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioFilingView.cs

@@ -38,7 +38,6 @@ namespace GFGGame
             _valueBarController = new ValueBarController(_ui.m_comValueBar);
 
             _ui.m_list.itemRenderer = RenderListItem;
-            _ui.m_list.onClickItem.Add(OnListItemClick);
 
             _ui.m_btnBack.onClick.Add(Hide);
             _ui.m_btnChange.onClick.Add(OnBtnChangeClick);
@@ -124,6 +123,11 @@ namespace GFGGame
                 StoryFightCfg storyFightCfg = StoryFightCfgArray.Instance.GetCfg(_storyLevelCfgs[index].fightID);
                 ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(storyFightCfg.bonusBaseArr[0][0]);
                 item.m_loaItem.url = ResPathUtil.GetIconPath(itemCfg);
+                if (item.m_loaItem.data == null)
+                {
+                    item.m_loaItem.onClick.Add(OnLoaItemClick);
+                }
+                item.m_loaItem.data = index;
             }
             else
             {
@@ -131,17 +135,20 @@ namespace GFGGame
                 item.m_loaItem.visible = false;
                 item.m_loaIcon.visible = true;
                 item.m_loaIcon.url = string.Format("ui://Studio/{0}", _filingCfg.res);
-
             }
             item.m_grpLock.visible = index > 0 && !InstanceZonesDataManager.CheckLevelPass(_storyLevelCfgs[index - 1].id);
             item.m_comFlower.m_c1.selectedIndex = InstanceZonesDataManager.GetStarCountHistory(_storyLevelCfgs[index].id);
-            item.target.data = index;// _storyLevelCfgs[_index];
+            if (item.m_loaBg.data == null)
+            {
+                item.m_loaBg.onClick.Add(OnListItemClick);
+            }
+            item.m_loaBg.data = index;
             UI_ListLevelItem.ProxyEnd();
         }
 
         private void OnListItemClick(EventContext context)
         {
-            GObject obj = context.data as GObject;
+            GObject obj = context.sender as GObject;
             int index = (int)obj.data;
             StoryLevelCfg storyLevelCfg = _storyLevelCfgs[index];
             if (index > 0 && !InstanceZonesDataManager.CheckLevelPass(_storyLevelCfgs[index - 1].id))
@@ -151,14 +158,15 @@ namespace GFGGame
             }
 
             MainStoryDataManager.currentLevelCfgId = storyLevelCfg.id;
-            // if (!string.IsNullOrEmpty(storyLevelCfg.storyStartID))
-            // {
-            //     StoryController.ShowFilingStoryDialog(storyLevelCfg);
-            // }
-            // else
-            // {
             InstanceZonesController.ShowLevelView(storyLevelCfg.id, StudioDataManager.Instance.OnFinishFilingStoryLevel);
-            // }
+        }
+        private void OnLoaItemClick(EventContext context)
+        {
+            GObject obj = context.sender as GObject;
+            int index = (int)obj.data;
+            StoryFightCfg storyFightCfg = StoryFightCfgArray.Instance.GetCfg(_storyLevelCfgs[index].fightID);
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(storyFightCfg.bonusBaseArr[0][0]);
+            GoodsItemTipsController.ShowItemTips(itemCfg.id);
         }
         private void OnBtnChangeClick()
         {

BIN
GameClient/Assets/ResIn/UI/Studio/Studio_fui.bytes