zhaoyang 2 år sedan
förälder
incheckning
fb6904ac9a

+ 5 - 2
FGUIProject/assets/DressUp/ArenaDressUpFightUI.xml

@@ -7,11 +7,11 @@
     <graph id="n0_qsvd" name="touchPad" xy="0,0" size="1080,1920" alpha="0" type="rect">
       <relation target="" sidePair="width-width,height-height"/>
     </graph>
-    <component id="n1_qsvd" name="btnBack" src="9xlo8" fileName="components/ButtonBack1.xml" pkg="eg2y0ldp" xy="35,60" group="n38_8lqj">
+    <component id="n1_qsvd" name="btnBack" src="9xlo8" fileName="components/BtnBack.xml" pkg="eg2y0ldp" xy="35,60" group="n38_8lqj">
       <Button icon="ui://eg2y0ldpuyuxtj4"/>
     </component>
     <image id="n50_f2bf" name="n50" src="f2bfey" fileName="images/dz_cdxzcdxz.png" xy="837,60" group="n51_f2bf"/>
-    <text id="n49_f2bf" name="txtDressLimit" xy="855,63" size="216,35" group="n51_f2bf" fontSize="25" color="#7a5e38" text="饰品穿戴限制:0/5"/>
+    <text id="n49_f2bf" name="txtDressLimit" xy="855,63" size="213,35" group="n51_f2bf" fontSize="25" color="#7a5e38" text="饰品穿戴限制:0/5"/>
     <group id="n51_f2bf" name="n51" xy="837,60" size="243,44" group="n38_8lqj"/>
     <graph id="n61_u2u3" name="grhCloseComFightScore" xy="0,0" size="1080,1920" group="n38_8lqj" alpha="0" type="rect">
       <relation target="" sidePair="width-width,height-height"/>
@@ -29,6 +29,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="n62_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>
     <component id="n6_qsvd" name="btnDelete" src="f4xv3o" fileName="components/Button6.xml" xy="46,1458" group="n44_wono">
       <Button icon="ui://mbo439wbq08xn"/>
     </component>

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

@@ -17,6 +17,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_btnDelete;
         public GButton m_btnSearch;
         public GButton m_btnNext;
@@ -78,6 +79,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_btnDelete = (GButton)comp.GetChild("btnDelete");
             m_btnSearch = (GButton)comp.GetChild("btnSearch");
             m_btnNext = (GButton)comp.GetChild("btnNext");
@@ -99,6 +101,8 @@ namespace UI.DressUp
             m_partsList = null;
             m_partsList2.Dispose();
             m_partsList2 = null;
+            m_partsListSearch.Dispose();
+            m_partsListSearch = null;
             m_btnDelete = null;
             m_btnSearch = null;
             m_btnNext = null;

+ 126 - 5
GameClient/Assets/Game/HotUpdate/Views/DressUp/ArenaDressUpFightView.cs

@@ -73,14 +73,17 @@ namespace GFGGame
 
             _ui.m_btnSearch.visible = true;
             _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_comListType1.m_listType.onClickItem.Add(OnClickListType1Item);
             _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(OnClickSearchPartsListItem);
 
             _ui.m_touchPad.onClick.Add(OnTouchPad);
             _ui.m_btnDelete.onClick.Add(OnClickBtnDelete);
@@ -98,8 +101,8 @@ namespace GFGGame
         protected override void AddEventListener()
         {
             base.AddEventListener();
-            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.CARD_SELECTED, UpdateValueInfo);
         }
         protected override void OnShown()
@@ -165,9 +168,9 @@ namespace GFGGame
         protected override void RemoveEventListener()
         {
             base.RemoveEventListener();
-            EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
-            EventAgent.RemoveEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
-            EventAgent.AddEventListener(ConstMessage.CARD_SELECTED, UpdateValueInfo);
+            EventAgent.RemoveEventListener(ConstMessage.DRESS_SEARCH, UpdateSerch);
+            EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdateSerch);
+            EventAgent.RemoveEventListener(ConstMessage.CARD_SELECTED, UpdateValueInfo);
 
         }
         private void OnClickBtnBack()
@@ -275,6 +278,31 @@ namespace GFGGame
             this.hideListType2();
         }
 
+        private void OnClickSearchPartsListItem(EventContext context)
+        {
+            if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
+            {
+                return;
+            }
+            GObject listItem = context.data as GObject;
+            int id = (int)listItem.data;
+
+            bool isOrnament = DressUpMenuItemCfg1Array.Instance.CheckIsOrnamentsType(id);
+            bool isDress = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
+            bool isHasSame = MyDressUpHelper.dressUpObj.CheckSameTypeIsOn(id);
+            bool isMaxCount = MyDressUpHelper.GetCurrentOrnamentCount() >= GlobalCfgArray.globalCfg.dressLimitCount;
+            if (isOrnament && !isDress && !isHasSame && isMaxCount)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("饰品穿戴数量已达上限");
+                return;
+            }
+            MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
+
+            _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
+            UpdateSearchListPartsSelected();
+            UpdateValueInfo();
+
+        }
         private void OnClickPartsListItem(EventContext context)
         {
             if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
@@ -362,6 +390,11 @@ namespace GFGGame
                 this.showListType1();
                 this.hideListType2();
             }
+            else if (this.currentListType == DressUpListType.List5)
+            {
+                this.showListType1();
+                this.hideSearchListType();
+            }
         }
 
 
@@ -427,6 +460,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;
             //一级菜单
@@ -529,6 +563,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()
         {
 
@@ -644,6 +683,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.DressUp.UI_TypeItem typeItem = UI.DressUp.UI_TypeItem.Proxy(item);
@@ -768,6 +865,30 @@ namespace GFGGame
 
 
         }
+        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 UpdateListPartsSelected()
         {
             int count = _ui.m_partsList.m_list.numChildren;

+ 25 - 2
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -87,7 +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_partsListSearch.m_list.onClickItem.Add(OnClickSearchPartsListItem);
             _ui.m_touchPad.onClick.Add(OnTouchPad);
             _ui.m_btnHint.onClick.Add(OnClickBtnHint);
             // _ui.m_btnGuide.onClick.Add(OnTouchPad);
@@ -317,7 +317,31 @@ namespace GFGGame
             }
             this.hideListType2();
         }
+        private void OnClickSearchPartsListItem(EventContext context)
+        {
+            if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
+            {
+                return;
+            }
+            GObject listItem = context.data as GObject;
+            int id = (int)listItem.data;
+
+            bool isOrnament = DressUpMenuItemCfg1Array.Instance.CheckIsOrnamentsType(id);
+            bool isDress = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
+            bool isHasSame = MyDressUpHelper.dressUpObj.CheckSameTypeIsOn(id);
+            bool isMaxCount = MyDressUpHelper.GetCurrentOrnamentCount() >= GlobalCfgArray.globalCfg.dressLimitCount;
+            if (isOrnament && !isDress && !isHasSame && isMaxCount)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("饰品穿戴数量已达上限");
+                return;
+            }
+            MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
 
+            _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
+            UpdateSearchListPartsSelected();
+
+            UpdateScore();
+        }
         private void OnClickPartsListItem(EventContext context)
         {
             if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
@@ -347,7 +371,6 @@ namespace GFGGame
                 MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
             }
             _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
-            UpdateSearchListPartsSelected();
             UpdateListPartsSelected();
             UpdateListSuitPartsSelected();
             UpdateScore();

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