zhaoyang 2 lat temu
rodzic
commit
afaea7bacf

+ 3 - 0
FGUIProject/assets/DressUp/DressUpFightUI.xml

@@ -43,6 +43,9 @@
     <component id="n40_afs6" name="partsList2" src="k6he1v" fileName="components/PartsList.xml" xy="1080,40" size="230,1880" group="n38_8lqj">
       <relation target="" sidePair="right-right,top-top,bottomext-bottom"/>
     </component>
+    <component id="n52_ofwu" name="partsListSearch" src="k6he1v" fileName="components/PartsList.xml" xy="1080,40" size="230,1880" group="n38_8lqj">
+      <relation target="" sidePair="right-right,top-top,bottomext-bottom"/>
+    </component>
     <graph id="n20_8xpg" name="btnClose" xy="0,0" size="1080,1920" group="n38_8lqj" alpha="0" type="rect" fillColor="#ffff0000">
       <relation target="" sidePair="width-width,height-height"/>
     </graph>

+ 17 - 2
GameClient/Assets/Game/HotUpdate/Data/DressUpMenuItemDataManager.cs

@@ -25,6 +25,7 @@ namespace GFGGame
         private static Dictionary<int, List<int>> _itemDatasBySubTypeDic = new Dictionary<int, List<int>>();
         public static Dictionary<int, List<int>> ItemDatasBySubTypeDic { get { return _itemDatasBySubTypeDic; } }
         private static Dictionary<int, List<int>> _newItemdata = new Dictionary<int, List<int>>();
+        private static Dictionary<int, List<int>> _itemDatasByRarityDic = new Dictionary<int, List<int>>();
         private static List<int> _newSuitData = new List<int>();
 
         public static void InitData()
@@ -32,6 +33,7 @@ namespace GFGGame
             _itemDatas.Clear();
             _newItemdata.Clear();
             _itemDatasBySubTypeDic.Clear();
+            _itemDatasByRarityDic.Clear();
         }
         public static void Clear()
         {
@@ -59,6 +61,12 @@ namespace GFGGame
                 }
                 _itemDatasBySubTypeDic[subType].Add(value);
 
+                if (!_itemDatasByRarityDic.ContainsKey(itemInfoProto.Rarity))
+                {
+                    _itemDatasByRarityDic.Add(itemInfoProto.Rarity, new List<int>());
+                }
+                _itemDatasByRarityDic[itemInfoProto.Rarity].Add(value);
+
                 if (GameGlobal.DataInited)
                 {
                     AddNewDressItem(value);
@@ -88,6 +96,11 @@ namespace GFGGame
             {
                 _itemDatasBySubTypeDic[subType].Remove(value);
             }
+            int rarity = ItemCfgArray.Instance.GetCfg(value).rarity;
+            if (_itemDatasByRarityDic.ContainsKey(rarity) && _itemDatasByRarityDic[rarity].IndexOf(value) >= 0)
+            {
+                _itemDatasByRarityDic[rarity].Remove(value);
+            }
 
         }
 
@@ -316,12 +329,13 @@ namespace GFGGame
         // {
         //     return ItemDataManager.GetItemAdditionScore(itemId, InstanceZonesDataManager.currentScoreType);
         // }
-        public static List<int> DressSearch()
+        public static List<int> DressSearch(bool includeScene = true)
         {
             List<int> searchList = new List<int>();
             for (int i = 0; i < _itemDatas.Count; i++)
             {
                 ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_itemDatas[i]);
+                if (!includeScene && DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(_itemDatas[i])) continue;
                 if (itemCfg.name.IndexOf(dressSearchTxt) >= 0 && searchList.IndexOf(itemCfg.id) < 0)
                 {
                     searchList.Add(itemCfg.id);
@@ -329,12 +343,13 @@ namespace GFGGame
             }
             return searchList;
         }
-        public static List<int> DressFilter()
+        public static List<int> DressFilter(bool includeScene = true)
         {
             List<int> filterList = new List<int>();
             for (int i = 0; i < _itemDatas.Count; i++)
             {
                 ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_itemDatas[i]);
+                if (!includeScene && DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(_itemDatas[i])) continue;
                 bool isTag = selectTagList.Count == 0;
                 if (selectTagList.Count > 0)
                 {

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

@@ -21,6 +21,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 GGraph m_btnClose;
         public GTextField m_txtHint;
         public GGroup m_grpTips;
@@ -97,6 +98,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_btnClose = (GGraph)comp.GetChild("btnClose");
             m_txtHint = (GTextField)comp.GetChild("txtHint");
             m_grpTips = (GGroup)comp.GetChild("grpTips");
@@ -134,6 +136,8 @@ namespace UI.DressUp
             m_partsList = null;
             m_partsList2.Dispose();
             m_partsList2 = null;
+            m_partsListSearch.Dispose();
+            m_partsListSearch = null;
             m_btnClose = null;
             m_txtHint = null;
             m_grpTips = null;

+ 119 - 20
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -75,8 +75,10 @@ namespace GFGGame
             _ui.m_btnSearch.visible = true;
             // _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_partsList.m_comboBoxRarity.onChanged.Add(OnComboBoxRarityChanged);
+            _ui.m_partsListSearch.m_comboBoxRarity.onChanged.Add(OnSearchComboBoxRarityChanged);
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
             _ui.m_btnHome.onClick.Add(OnClickBtnHome);
             // _ui.m_btnClothingShop.onClick.Add(OnClickBtnClothingShop);
@@ -85,6 +87,7 @@ namespace GFGGame
             _ui.m_comListType2.m_listType.onClickItem.Add(OnClickListType2Item);
             _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_btnHint.onClick.Add(OnClickBtnHint);
             // _ui.m_btnGuide.onClick.Add(OnTouchPad);
@@ -114,8 +117,9 @@ namespace GFGGame
         {
             base.AddEventListener();
             EventAgent.AddEventListener(ConstMessage.CARD_CHOOSE, StartCalculateScore);
-            EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
-            EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
+
+            EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdateSerch);
+            EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdateSerch);
             // EventAgent.AddEventListener(ConstMessage.DRESS_UP_SCORE_CHANGED, UpdateScore);
 
         }
@@ -218,8 +222,9 @@ namespace GFGGame
         {
             base.RemoveEventListener();
             EventAgent.RemoveEventListener(ConstMessage.CARD_CHOOSE, StartCalculateScore);
-            EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
-            EventAgent.RemoveEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
+
+            EventAgent.RemoveEventListener(ConstMessage.DRESS_SEARCH, UpdateSerch);
+            EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdateSerch);
             // EventAgent.RemoveEventListener(ConstMessage.DRESS_UP_SCORE_CHANGED, UpdateScore);
 
         }
@@ -342,6 +347,7 @@ namespace GFGGame
                 MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
             }
             _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
+            UpdateSearchListPartsSelected();
             UpdateListPartsSelected();
             UpdateListSuitPartsSelected();
             UpdateScore();
@@ -400,6 +406,11 @@ namespace GFGGame
                 this.showListType1();
                 this.hideListType2();
             }
+            else if (this.currentListType == DressUpListType.List5)
+            {
+                this.showListType1();
+                this.hideSearchListType();
+            }
         }
 
         private void OnClickBtnHint()
@@ -546,6 +557,7 @@ namespace GFGGame
             _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;
             //一级菜单
@@ -648,6 +660,11 @@ namespace GFGGame
             _scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
             this.UpdatePartsListSort();
         }
+        private void OnSearchComboBoxRarityChanged()
+        {
+            _scoreIndex = _ui.m_partsListSearch.m_comboBoxRarity.selectedIndex;
+            this.UpdateSearchList();
+        }
         private void UpdatePartsListSort()
         {
 
@@ -686,14 +703,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);
+            // }
 
             //必穿品放在列表最前面
             if (_fightCfg.needItemId > 0)
@@ -726,14 +743,14 @@ namespace GFGGame
 
             _currentList4 = new List<int>(SuitCfgArray.Instance.GetSuitItems(_currentSuitId, true));
 
-            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;
@@ -783,6 +800,64 @@ 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(false);
+            }
+            else if (context.data.ToString() == ConstMessage.DRESS_FILTER)
+            {
+                _currentList3 = DressUpMenuItemDataManager.DressFilter(false);
+            }
+            ViewManager.Hide<ModalStatusView>();
+            UpdateSearchList();
+            if (currentListType != DressUpListType.List5)
+            {
+                hideListParts();
+                hideListParts2();
+                hideListType1();
+                hideListType2();
+                showSearchListType();
+            }
+            _currentMenuType = 0;
+        }
+        private void UpdateSearchList()
+        {
+
+            if (_scoreIndex == SORT_BY_HIGH_SCORE)
+            {
+                _currentList3 = DressUpMenuItemDataManager.SortItemListByHighScore(_currentList3, true);
+            }
+            else if (_scoreIndex == SORT_BY_LOW_SCORE)
+            {
+                _currentList3 = DressUpMenuItemDataManager.SortItemListByLowScore(_currentList3, true);
+            }
+            _currentMenuType = 0;
+            _ui.m_partsListSearch.m_list.numItems = _currentList3.Count; ;
+        }
         private void ListType1Item(int index, GObject item)
         {
             UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
@@ -931,6 +1006,30 @@ namespace GFGGame
                 UI_PartsListItem.ProxyEnd();
             }
         }
+        private void UpdateSearchListPartsSelected()
+        {
+            int count = _ui.m_partsListSearch.m_list.numChildren;
+            int suitId = MyDressUpHelper.dressUpObj.suitId;
+
+            for (int i = 0; i < count; i++)
+            {
+                UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsListSearch.m_list.GetChildAt(i));
+                int id = (int)listItem.target.data;
+                if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
+                {
+                    listItem.m_iconSelected.visible = suitId > 0 && id == suitId;
+                }
+                else
+                {
+                    bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
+                    var isSceneType = DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(id);
+                    bool isSuit = !isSceneType && suitId > 0 && SuitCfgArray.Instance.GetSuitIdOfItem(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
+                    bool isSceneSuit = isSceneType && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
+                    listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
+                }
+                UI_PartsListItem.ProxyEnd();
+            }
+        }
         private void UpdateListSuitPartsSelected()
         {
             int count = _ui.m_partsList2.m_list.numChildren;

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpView.cs

@@ -700,6 +700,7 @@ namespace GFGGame
                 hideListType2();
                 showSearchListType();
             }
+            _currentMenuType = 0;
         }
         private void UpdateSearchList()
         {

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