浏览代码

修改搜索界面滑动方式

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

+ 2 - 46
FGUIProject/assets/DressUp/DressFilterUI.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="962,1092">
-  <controller name="c1" pages="0,,1," selected="1"/>
+  <controller name="c1" pages="0,,1," selected="0"/>
   <displayList>
     <component id="n0_ih75" name="n0" src="si5ztih" fileName="components/ComBg.xml" pkg="mk0fwx0x" xy="0,0" size="962,1092"/>
     <image id="n17_ih75" name="n17" src="ih753l" fileName="images/sxsx_ssdi.png" xy="97,68" size="644,66"/>
@@ -13,50 +13,6 @@
     <component id="n14_ih75" name="btnReset" src="r9ritjh" fileName="components/Button18.xml" pkg="mk0fwx0x" xy="88,941">
       <Button title="重置"/>
     </component>
-    <component id="n5_ih75" name="n5" src="ih7596" fileName="components/ComFilterType.xml" pkg="eg2y0ldp" xy="68,204" group="n6_ih75">
-      <property target="txtName" propertyId="0" value="品质筛选"/>
-    </component>
-    <list id="n3_ih75" name="listRarity" xy="72,262" size="833,142" group="n6_ih75" layout="row" selectionMode="multipleSingleClick" colGap="84" defaultItem="ui://mbo439wbih753i">
-      <item/>
-      <item/>
-      <item/>
-      <item/>
-    </list>
-    <group id="n6_ih75" name="grpRarity" xy="68,204" size="837,200" group="n19_n0js" advanced="true"/>
-    <component id="n8_ih75" name="n8" src="ih7596" fileName="components/ComFilterType.xml" pkg="eg2y0ldp" xy="68,449" group="n10_ih75">
-      <property target="txtName" propertyId="0" value="属性筛选"/>
-    </component>
-    <list id="n7_ih75" name="listScore" xy="72,507" size="842,142" group="n10_ih75" layout="row" selectionMode="multipleSingleClick" colGap="84" defaultItem="ui://mbo439wbih753j">
-      <item/>
-      <item/>
-      <item/>
-      <item/>
-    </list>
-    <group id="n10_ih75" name="grpScore" xy="68,449" size="846,200" group="n19_n0js" advanced="true">
-      <gearDisplay controller="c1" pages="0"/>
-    </group>
-    <component id="n9_ih75" name="n9" src="ih7596" fileName="components/ComFilterType.xml" pkg="eg2y0ldp" xy="68,449" group="n12_ih75">
-      <property target="txtName" propertyId="0" value="风格筛选"/>
-    </component>
-    <list id="n11_ih75" name="listTag" xy="72,507" size="854,272" group="n12_ih75" layout="flow_hz" selectionMode="multipleSingleClick" overflow="scroll" lineGap="27" colGap="60" defaultItem="ui://mbo439wbih753k" autoClearItems="true">
-      <gearSize controller="c1" pages="0" values="854,124,1,1" default="854,272,1,1"/>
-      <item/>
-      <item/>
-      <item/>
-      <item/>
-      <item/>
-      <item/>
-      <item/>
-      <item/>
-      <item/>
-      <item/>
-      <item/>
-      <item/>
-      <item/>
-      <item/>
-      <item/>
-    </list>
-    <group id="n12_ih75" name="grpTags" xy="68,449" size="858,330" group="n19_n0js" advanced="true"/>
-    <group id="n19_n0js" name="n19" xy="68,204" size="858,575" advanced="true" layout="vt" lineGap="45" excludeInvisibles="true"/>
+    <component id="n5_ih75" name="comSearch" src="ozulfb" fileName="components/ComSearch.xml" xy="68,167" size="858,730"/>
   </displayList>
 </component>

+ 51 - 0
FGUIProject/assets/DressUp/components/ComSearch.xml

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="858,730" overflow="scroll">
+  <controller name="c1" pages="0,,1," selected="0"/>
+  <displayList>
+    <component id="n5_ih75" name="n5" src="ih7596" fileName="components/ComFilterType.xml" pkg="eg2y0ldp" xy="0,0" group="n6_ih75">
+      <property target="txtName" propertyId="0" value="品质筛选"/>
+    </component>
+    <list id="n3_ih75" name="listRarity" xy="4,58" size="833,142" group="n6_ih75" layout="row" selectionMode="multipleSingleClick" colGap="84" defaultItem="ui://mbo439wbih753i">
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+    </list>
+    <group id="n6_ih75" name="grpRarity" xy="0,0" size="837,200" group="n19_n0js" advanced="true"/>
+    <component id="n8_ih75" name="n8" src="ih7596" fileName="components/ComFilterType.xml" pkg="eg2y0ldp" xy="0,245" group="n10_ih75">
+      <property target="txtName" propertyId="0" value="属性筛选"/>
+    </component>
+    <list id="n7_ih75" name="listScore" xy="4,303" size="842,142" group="n10_ih75" layout="row" selectionMode="multipleSingleClick" colGap="84" defaultItem="ui://mbo439wbih753j">
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+    </list>
+    <group id="n10_ih75" name="grpScore" xy="0,245" size="846,200" group="n19_n0js" advanced="true">
+      <gearDisplay controller="c1" pages="0"/>
+    </group>
+    <component id="n9_ih75" name="n9" src="ih7596" fileName="components/ComFilterType.xml" pkg="eg2y0ldp" xy="0,490" group="n12_ih75">
+      <property target="txtName" propertyId="0" value="风格筛选"/>
+    </component>
+    <list id="n11_ih75" name="listTag" xy="4,548" size="854,172" group="n12_ih75" layout="flow_hz" selectionMode="multipleSingleClick" lineGap="27" colGap="60" defaultItem="ui://mbo439wbih753k" autoClearItems="true">
+      <gearSize controller="c1" pages="0" values="854,172,1,1" default="854,272,1,1"/>
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+    </list>
+    <group id="n12_ih75" name="grpTags" xy="0,490" size="858,230" group="n19_n0js" advanced="true"/>
+    <group id="n19_n0js" name="n19" xy="0,0" size="858,720" advanced="true" layout="vt" lineGap="45" excludeInvisibles="true"/>
+  </displayList>
+</component>

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

@@ -200,6 +200,7 @@
     <image id="ofwuf8" name="huanzhuang_sz_db.png" path="/images/"/>
     <image id="o4m7f9" name="hz_tsdz.png" path="/imagesNew/"/>
     <component id="o4m7fa" name="Button16.xml" path="/components/"/>
+    <component id="ozulfb" name="ComSearch.xml" path="/components/"/>
   </resources>
   <publish name="" path="../GameClient/Assets/ResIn/UI/DressUp" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 89 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/DressUp/UI_ComSearch.cs

@@ -0,0 +1,89 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.DressUp
+{
+    public partial class UI_ComSearch
+    {
+        public GComponent target;
+        public Controller m_c1;
+        public GList m_listRarity;
+        public GGroup m_grpRarity;
+        public GList m_listScore;
+        public GGroup m_grpScore;
+        public GList m_listTag;
+        public GGroup m_grpTags;
+        public const string URL = "ui://mbo439wbozulfb";
+        public const string PACKAGE_NAME = "DressUp";
+        public const string RES_NAME = "ComSearch";
+        private static UI_ComSearch _proxy;
+
+        public static UI_ComSearch Create(GObject gObject = null)
+        {
+            var ui = new UI_ComSearch();
+            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_ComSearch Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ComSearch();
+            }
+            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_listRarity = (GList)comp.GetChild("listRarity");
+            m_grpRarity = (GGroup)comp.GetChild("grpRarity");
+            m_listScore = (GList)comp.GetChild("listScore");
+            m_grpScore = (GGroup)comp.GetChild("grpScore");
+            m_listTag = (GList)comp.GetChild("listTag");
+            m_grpTags = (GGroup)comp.GetChild("grpTags");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_c1 = null;
+            m_listRarity = null;
+            m_grpRarity = null;
+            m_listScore = null;
+            m_grpScore = null;
+            m_listTag = null;
+            m_grpTags = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/DressUp/UI_ComSearch.cs.meta

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

+ 4 - 18
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/DressUp/UI_DressFilterUI.cs

@@ -13,12 +13,7 @@ namespace UI.DressUp
         public GButton m_btnClose;
         public GButton m_btnConfirm;
         public GButton m_btnReset;
-        public GList m_listRarity;
-        public GGroup m_grpRarity;
-        public GList m_listScore;
-        public GGroup m_grpScore;
-        public GList m_listTag;
-        public GGroup m_grpTags;
+        public UI_ComSearch m_comSearch;
         public const string URL = "ui://mbo439wbih7532";
         public const string PACKAGE_NAME = "DressUp";
         public const string RES_NAME = "DressFilterUI";
@@ -72,12 +67,7 @@ namespace UI.DressUp
             m_btnClose = (GButton)comp.GetChild("btnClose");
             m_btnConfirm = (GButton)comp.GetChild("btnConfirm");
             m_btnReset = (GButton)comp.GetChild("btnReset");
-            m_listRarity = (GList)comp.GetChild("listRarity");
-            m_grpRarity = (GGroup)comp.GetChild("grpRarity");
-            m_listScore = (GList)comp.GetChild("listScore");
-            m_grpScore = (GGroup)comp.GetChild("grpScore");
-            m_listTag = (GList)comp.GetChild("listTag");
-            m_grpTags = (GGroup)comp.GetChild("grpTags");
+            m_comSearch = (UI_ComSearch)UI_ComSearch.Create(comp.GetChild("comSearch"));
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -87,12 +77,8 @@ namespace UI.DressUp
             m_btnClose = null;
             m_btnConfirm = null;
             m_btnReset = null;
-            m_listRarity = null;
-            m_grpRarity = null;
-            m_listScore = null;
-            m_grpScore = null;
-            m_listTag = null;
-            m_grpTags = null;
+            m_comSearch.Dispose();
+            m_comSearch = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 23 - 16
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressFilterView.cs

@@ -46,13 +46,13 @@ namespace GFGGame
             _ui.m_btnReset.onClick.Add(OnClickBtnReset);
             _ui.m_btnClose.onClick.Add(this.OnHide);
 
-            _ui.m_listRarity.itemRenderer = RenderListRarityItem;
-            _ui.m_listScore.itemRenderer = RenderListScoreItem;
-            _ui.m_listTag.itemRenderer = RenderListTagItem;
+            _ui.m_comSearch.m_listRarity.itemRenderer = RenderListRarityItem;
+            _ui.m_comSearch.m_listScore.itemRenderer = RenderListScoreItem;
+            _ui.m_comSearch.m_listTag.itemRenderer = RenderListTagItem;
 
-            _ui.m_listRarity.onClickItem.Add(OnClickListRarityItem);
-            _ui.m_listScore.onClickItem.Add(OnClickListScoreItem);
-            _ui.m_listTag.onClickItem.Add(OnClickListTagItem);
+            _ui.m_comSearch.m_listRarity.onClickItem.Add(OnClickListRarityItem);
+            _ui.m_comSearch.m_listScore.onClickItem.Add(OnClickListScoreItem);
+            _ui.m_comSearch.m_listTag.onClickItem.Add(OnClickListTagItem);
         }
 
         protected override void OnShown()
@@ -67,9 +67,10 @@ namespace GFGGame
         }
         private void UpdateView()
         {
-            _ui.m_listRarity.numItems = ConstDressRarity.DressRarityList().Count;
-            _ui.m_listScore.numItems = ConstDressUpScoreType.scoreTypeList().Count;
-            _ui.m_listTag.numItems = TagCfgArray.Instance.dataArray.Length;//  ConstDressTag.DressTagList().Count;
+            _ui.m_comSearch.m_listRarity.numItems = ConstDressRarity.DressRarityList().Count;
+            _ui.m_comSearch.m_listScore.numItems = ConstDressUpScoreType.scoreTypeList().Count;
+            _ui.m_comSearch.m_listTag.numItems = TagCfgArray.Instance.dataArray.Length;//  ConstDressTag.DressTagList().Count;
+            _ui.m_comSearch.m_listTag.ResizeToFit();
         }
 
         private void RenderListRarityItem(int index, GObject obj)
@@ -177,11 +178,17 @@ namespace GFGGame
         }
         private void OnClickBtnConfirm()
         {
-            ViewManager.Show<ModalStatusView>("搜索中...");
             DressUpMenuItemDataManager.dressFilterType = DressFilterType.Filter;
             DressUpMenuItemDataManager.selectRarityList = _selectRarityList;
             DressUpMenuItemDataManager.selectScoreList = _selectScoreList;
             DressUpMenuItemDataManager.selectTagList = _selectTagList;
+            if (_selectRarityList.Count == 0 && _selectScoreList.Count == 0 && _selectTagList.Count == 0)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("未选择要搜索的类型");
+                return;
+            }
+            ViewManager.Show<ModalStatusView>("搜索中...");
+
             EventAgent.DispatchEvent(ConstMessage.DRESS_FILTER, ConstMessage.DRESS_FILTER);
             ResetSearch();
             this.OnHide();
@@ -201,9 +208,9 @@ namespace GFGGame
             DressUpMenuItemDataManager.selectRarityList.Clear();
             DressUpMenuItemDataManager.selectScoreList.Clear();
             DressUpMenuItemDataManager.selectTagList.Clear();
-            _ui.m_listRarity.SelectNone();
-            _ui.m_listScore.SelectNone();
-            _ui.m_listTag.SelectNone();
+            _ui.m_comSearch.m_listRarity.SelectNone();
+            _ui.m_comSearch.m_listScore.SelectNone();
+            _ui.m_comSearch.m_listTag.SelectNone();
         }
         private void ResetSearch()
         {
@@ -213,9 +220,9 @@ namespace GFGGame
         {
             base.OnHide();
             this.Hide();
-            _ui.m_listRarity.SelectNone();
-            _ui.m_listScore.SelectNone();
-            _ui.m_listTag.SelectNone();
+            _ui.m_comSearch.m_listRarity.SelectNone();
+            _ui.m_comSearch.m_listScore.SelectNone();
+            _ui.m_comSearch.m_listTag.SelectNone();
         }
     }
 }

二进制
GameClient/Assets/ResIn/UI/DressUp/DressUp_fui.bytes