zhaoyang 2 vuotta sitten
vanhempi
commit
6dbb8d8467

+ 4 - 1
FGUIProject/assets/DressUp/DressUpUI.xml

@@ -19,7 +19,7 @@
       <relation target="" sidePair="left-left,bottom-bottom"/>
       <Button icon="ui://mbo439wbrc0744"/>
     </component>
-    <component id="n3_q08x" name="btnBack" src="9xlo8" fileName="components/ButtonBack1.xml" pkg="eg2y0ldp" xy="35,80" group="n30_8lqj">
+    <component id="n3_q08x" name="btnBack" src="9xlo8" fileName="components/BtnBack.xml" pkg="eg2y0ldp" xy="35,80" group="n30_8lqj">
       <Button icon="ui://eg2y0ldpuyuxtj4"/>
     </component>
     <component id="n4_q08x" name="btnHome" src="qp4l60" fileName="components/ButtonHome.xml" pkg="eg2y0ldp" xy="35,220" group="n30_8lqj" visible="false"/>
@@ -44,6 +44,9 @@
     <component id="n32_afs6" name="partsList2" src="k6he1v" fileName="components/PartsList.xml" xy="1080,0" group="n30_8lqj">
       <relation target="" sidePair="right-right,top-top,bottomext-bottom"/>
     </component>
+    <component id="n36_ofwu" name="partsListSearch" src="k6he1v" fileName="components/PartsList.xml" xy="1080,0" group="n30_8lqj">
+      <relation target="" sidePair="right-right,top-top,bottomext-bottom"/>
+    </component>
     <component id="n12_q08x" name="btnSave" src="wonody" fileName="components/Button19.xml" pkg="mk0fwx0x" xy="300,1730" group="n30_8lqj">
       <relation target="" sidePair="left-left,bottom-bottom"/>
       <Button title="保存搭配" titleColor="#fdfaed" titleFontSize="54"/>

+ 38 - 0
GameClient/Assets/Game/HotUpdate/Data/DressUpMenuItemDataManager.cs

@@ -316,7 +316,45 @@ namespace GFGGame
         // {
         //     return ItemDataManager.GetItemAdditionScore(itemId, InstanceZonesDataManager.currentScoreType);
         // }
+        public static List<int> DressSearch()
+        {
+            List<int> searchList = new List<int>();
+            for (int i = 0; i < _itemDatas.Count; i++)
+            {
+                ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_itemDatas[i]);
+                if (itemCfg.name.IndexOf(dressSearchTxt) >= 0 && searchList.IndexOf(itemCfg.id) < 0)
+                {
+                    searchList.Add(itemCfg.id);
+                }
+            }
+            return searchList;
+        }
+        public static List<int> DressFilter()
+        {
+            List<int> filterList = new List<int>();
+            for (int i = 0; i < _itemDatas.Count; i++)
+            {
+                ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_itemDatas[i]);
+                bool isTag = selectTagList.Count == 0;
+                if (selectTagList.Count > 0)
+                {
+                    for (int j = 0; j < itemCfg.tagsArr.Length; j++)
+                    {
+                        if (selectTagList.IndexOf(itemCfg.tagsArr[j][0]) >= 0)
+                        {
+                            isTag = true;
+                            break;
+                        }
+                    }
+                }
+                if (!isTag) continue;
+                if (selectRarityList.Count > 0 && selectRarityList.IndexOf(itemCfg.rarity) < 0) continue;
+                if (selectScoreList.Count > 0 && selectScoreList.IndexOf(itemCfg.mainScore) < 0) continue;
 
+                filterList.Add(itemCfg.id);
+            }
+            return filterList;
+        }
         public static List<int> DressSearch(List<int> list)
         {
             List<int> searchList = new List<int>();

+ 4 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/DressUp/UI_DressUpUI.cs

@@ -19,6 +19,7 @@ namespace UI.DressUp
         public UI_comListType m_comListType2;
         public UI_PartsList m_partsList;
         public UI_PartsList m_partsList2;
+        public UI_PartsList m_partsListSearch;
         public GButton m_btnSave;
         public GButton m_btnNext;
         public GButton m_btnAction;
@@ -88,6 +89,7 @@ namespace UI.DressUp
             m_comListType2 = (UI_comListType)UI_comListType.Create(comp.GetChild("comListType2"));
             m_partsList = (UI_PartsList)UI_PartsList.Create(comp.GetChild("partsList"));
             m_partsList2 = (UI_PartsList)UI_PartsList.Create(comp.GetChild("partsList2"));
+            m_partsListSearch = (UI_PartsList)UI_PartsList.Create(comp.GetChild("partsListSearch"));
             m_btnSave = (GButton)comp.GetChild("btnSave");
             m_btnNext = (GButton)comp.GetChild("btnNext");
             m_btnAction = (GButton)comp.GetChild("btnAction");
@@ -117,6 +119,8 @@ namespace UI.DressUp
             m_partsList = null;
             m_partsList2.Dispose();
             m_partsList2 = null;
+            m_partsListSearch.Dispose();
+            m_partsListSearch = null;
             m_btnSave = null;
             m_btnNext = null;
             m_btnAction = null;

+ 5 - 3
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressFilterView.cs

@@ -96,7 +96,7 @@ namespace GFGGame
             item.text = tagCfg.name;
             item.icon = "ui://DressUp/sxsx_fgdi_" + tagCfg.type;
             // item.data = 
-            string data = string.Format("{0}_{1}", tagCfg.type, tagCfg.name);
+            string data = tagCfg.name;// string.Format("{0}_{1}", tagCfg.type, tagCfg.name);
             item.data = data;
             item.selected = _selectTagList.IndexOf(data) >= 0;
         }
@@ -168,19 +168,21 @@ namespace GFGGame
             {
                 return;
             }
+            ViewManager.Show<ModalStatusView>("搜索中...");
             DressUpMenuItemDataManager.dressSearchTxt = _ui.m_txtInput.text;
-            EventAgent.DispatchEvent(ConstMessage.DRESS_SEARCH);
+            EventAgent.DispatchEvent(ConstMessage.DRESS_SEARCH, ConstMessage.DRESS_SEARCH);
             ResetFilter();
             this.OnHide();
 
         }
         private void OnClickBtnConfirm()
         {
+            ViewManager.Show<ModalStatusView>("搜索中...");
             DressUpMenuItemDataManager.dressFilterType = DressFilterType.Filter;
             DressUpMenuItemDataManager.selectRarityList = _selectRarityList;
             DressUpMenuItemDataManager.selectScoreList = _selectScoreList;
             DressUpMenuItemDataManager.selectTagList = _selectTagList;
-            EventAgent.DispatchEvent(ConstMessage.DRESS_FILTER);
+            EventAgent.DispatchEvent(ConstMessage.DRESS_FILTER, ConstMessage.DRESS_FILTER);
             ResetSearch();
             this.OnHide();
         }

+ 5 - 4
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpListType.cs

@@ -2,9 +2,10 @@ namespace GFGGame
 {
     public enum DressUpListType
     {
-        List1,
-        List2,
-        List3,
-        List4
+        List1,//主菜单
+        List2,//二级菜单
+        List3,//部件列表
+        List4,//套装部件
+        List5//筛选列表
     }
 }

+ 111 - 35
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpView.cs

@@ -77,6 +77,7 @@ namespace GFGGame
 
             // _ui.m_comboBox.items = new string[] { "我的套装一", "我的套装二", "我的套装三", "我的套装四", "我的套装五", "我的套装六" };
             _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
+            _ui.m_partsListSearch.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
 
             InitLists();
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
@@ -89,10 +90,12 @@ namespace GFGGame
             // _ui.m_partsList.m_list.SetVirtual();
             _ui.m_partsList.m_list.onClickItem.Add(OnClickPartsListItem);
             _ui.m_partsList2.m_list.onClickItem.Add(OnClickSuitPartsListItem);
+            _ui.m_partsListSearch.m_list.onClickItem.Add(OnClickPartsListItem);
             _ui.m_touchPad.onClick.Add(OnTouchPad);
             _ui.m_btnDelete.onClick.Add(OnClickBtnDelete);
             _ui.m_btnSave.onClick.Add(OnClickBtnSave);
             _ui.m_partsList.m_comboBoxRarity.onChanged.Add(OnComboBoxRarityChanged);
+            _ui.m_partsListSearch.m_comboBoxRarity.onChanged.Add(OnSearchComboBoxRarityChanged);
             _ui.m_btnAction.onClick.Add(OnClickBtnAction);
             _ui.m_btnSearch.onClick.Add(OnClickBtnSearch);
             _ui.m_btnNext.onClick.Add(OnClickBtnNext);
@@ -107,12 +110,31 @@ namespace GFGGame
             _ui.m_partsList2.m_imgTop.visible = true;
             _ui.m_partsList.m_imgTop.visible = false;
         }
+        private void InitLists()
+        {
+            _ui.m_comListType2.m_listType.itemRenderer = ListType2Item;
+            _ui.m_partsList.m_list.itemRenderer = ListPartsItem;
+            _ui.m_partsList2.m_list.itemRenderer = ListParts2Item;
+            _ui.m_partsListSearch.m_list.itemRenderer = ListPartsItem;
+            listType1X = _ui.m_comListType1.target.x;
+            partsListX = _ui.m_partsList.target.x - _ui.m_partsList.target.width;// - DressUpView.RIGHT_BLANK;
+            //一级菜单
+            _ui.m_comListType1.m_listType.itemRenderer = ListType1Item;
+            _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length;
+            //_ui.m_comListType1.m_listType1.ResizeToFit(_ui.m_comListType1.m_listType1.numItems);
+            float maxHeight = _ui.target.height - _ui.m_comListType1.target.y - DressUpView.BOTTOM_BLANK;
+            if (_ui.m_comListType1.m_listType.height > maxHeight)
+            {
+                _ui.m_comListType1.m_listType.height = maxHeight;
+            }
+        }
         protected override void AddEventListener()
         {
             base.AddEventListener();
             EventAgent.AddEventListener(ConstMessage.CLOSE_PHOTOGRAPHVIEW, UpdateScene);
             EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
-            EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
+            EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdateSerch);
+            EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdateSerch);
         }
         protected override void OnShown()
         {
@@ -423,6 +445,16 @@ namespace GFGGame
                 this.showListType1();
                 this.hideListType2();
             }
+            else if (this.currentListType == DressUpListType.List4)
+            {
+                this.showListType1();
+                this.hideListType2();
+            }
+            else if (this.currentListType == DressUpListType.List5)
+            {
+                this.showListType1();
+                this.hideSearchListType();
+            }
             // _ui.m_comListType1.m_listType.numItems = _ui.m_comListType1.m_listType.numItems;
             // this.ShowSubList();
         }
@@ -446,6 +478,11 @@ namespace GFGGame
             _rarityIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
             this.UpdatePartsListSort();
         }
+        private void OnSearchComboBoxRarityChanged()
+        {
+            _rarityIndex = _ui.m_partsListSearch.m_comboBoxRarity.selectedIndex;
+            this.UpdateSearchList();
+        }
 
         private void OnClickBtnAction()
         {
@@ -456,23 +493,7 @@ namespace GFGGame
             ViewManager.Show<DressFilterView>(true, new object[] { ViewName.DRESS_UP_VIEW });
         }
 
-        private void InitLists()
-        {
-            _ui.m_comListType2.m_listType.itemRenderer = ListType2Item;
-            _ui.m_partsList.m_list.itemRenderer = ListPartsItem;
-            _ui.m_partsList2.m_list.itemRenderer = ListParts2Item;
-            listType1X = _ui.m_comListType1.target.x;
-            partsListX = _ui.m_partsList.target.x - _ui.m_partsList.target.width;// - DressUpView.RIGHT_BLANK;
-            //一级菜单
-            _ui.m_comListType1.m_listType.itemRenderer = ListType1Item;
-            _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length;
-            //_ui.m_comListType1.m_listType1.ResizeToFit(_ui.m_comListType1.m_listType1.numItems);
-            float maxHeight = _ui.target.height - _ui.m_comListType1.target.y - DressUpView.BOTTOM_BLANK;
-            if (_ui.m_comListType1.m_listType.height > maxHeight)
-            {
-                _ui.m_comListType1.m_listType.height = maxHeight;
-            }
-        }
+
 
         private void showListType1()
         {
@@ -600,7 +621,6 @@ namespace GFGGame
         }
 
 
-
         private void showListParts2(int suitId)
         {
             _currentSuitId = suitId;
@@ -638,7 +658,63 @@ namespace GFGGame
                     _ui.m_partsList2.target.x = t.value.x;
                 });
         }
+
+        private void showSearchListType()
+        {
+            // _currentList2 = null;
+            currentListType = DressUpListType.List5;
+            GTween.To(_ui.target.width, partsListX, 0.5f)
+                .SetTarget(_ui.m_partsListSearch.target)
+                .OnUpdate((GTweener t) =>
+                {
+                    _ui.m_partsListSearch.target.x = t.value.x;
+                });
+        }
+        private void hideSearchListType()
+        {
+            GTween.To(partsListX, _ui.target.width, 0.5f)
+                .SetTarget(_ui.m_partsListSearch.target)
+                .OnUpdate((GTweener t) =>
+                {
+                    _ui.m_partsListSearch.target.x = t.value.x;
+                });
+        }
         /****************************************************************************************************************************/
+        private void UpdateSerch(EventContext context)
+        {
+            if (context.data.ToString() == ConstMessage.DRESS_SEARCH)
+            {
+                _currentList3 = DressUpMenuItemDataManager.DressSearch();
+            }
+            else if (context.data.ToString() == ConstMessage.DRESS_FILTER)
+            {
+                _currentList3 = DressUpMenuItemDataManager.DressFilter();
+            }
+            ViewManager.Hide<ModalStatusView>();
+            UpdateSearchList();
+            if (currentListType != DressUpListType.List5)
+            {
+                hideListParts();
+                hideListParts2();
+                hideListType1();
+                hideListType2();
+                showSearchListType();
+            }
+        }
+        private void UpdateSearchList()
+        {
+
+            if (_rarityIndex == SORT_BY_HIGH_RARITY)
+            {
+                _currentList3 = DressUpMenuItemDataManager.SortItemListByHighRarity(_currentList3);
+            }
+            else if (_rarityIndex == SORT_BY_LOW_RARITY)
+            {
+                _currentList3 = DressUpMenuItemDataManager.SortItemListByLowRarity(_currentList3);
+            }
+            _currentMenuType = 0;
+            _ui.m_partsListSearch.m_list.numItems = _currentList3.Count; ;
+        }
         private void ListType1Item(int index, GObject item)
         {
             UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
@@ -904,14 +980,14 @@ namespace GFGGame
                 }
 
             }
-            if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
-            {
-                _currentList3 = DressUpMenuItemDataManager.DressSearch(_currentList3);
-            }
-            else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
-            {
-                _currentList3 = DressUpMenuItemDataManager.DressFilter(_currentList3);
-            }
+            // if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
+            // {
+            //     _currentList3 = DressUpMenuItemDataManager.DressSearch(_currentList3);
+            // }
+            // else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
+            // {
+            //     _currentList3 = DressUpMenuItemDataManager.DressFilter(_currentList3);
+            // }
 
             _ui.m_partsList.m_list.RemoveChildrenToPool();
             _ui.m_partsList.m_list.numItems = _currentList3.Count;
@@ -930,14 +1006,14 @@ namespace GFGGame
                 _currentList4.Add(_currentSuitId);
             }
 
-            if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
-            {
-                _currentList4 = DressUpMenuItemDataManager.DressSearch(_currentList4);
-            }
-            else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
-            {
-                _currentList4 = DressUpMenuItemDataManager.DressFilter(_currentList4);
-            }
+            // if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
+            // {
+            //     _currentList4 = DressUpMenuItemDataManager.DressSearch(_currentList4);
+            // }
+            // else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
+            // {
+            //     _currentList4 = DressUpMenuItemDataManager.DressFilter(_currentList4);
+            // }
 
             _ui.m_partsList2.m_list.RemoveChildrenToPool();
             _ui.m_partsList2.m_list.numItems = _currentList4.Count;

BIN
GameClient/Assets/ResIn/UI/DressUp/DressUp_fui.bytes