Explorar el Código

战斗换装展示套装部件

zhaoyang hace 3 años
padre
commit
6dc7c4a273

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

@@ -34,6 +34,9 @@
     <component id="n10_qsvd" name="partsList" src="k6he1v" fileName="components/PartsList.xml" xy="1081,80" size="222,1828" group="n38_8lqj">
       <relation target="" sidePair="right-right,top-top,bottomext-bottom"/>
     </component>
+    <component id="n40_afs6" name="partsList2" src="k6he1v" fileName="components/PartsList.xml" xy="1080,80" size="222,1828" group="n38_8lqj">
+      <relation target="" sidePair="right-right,top-top,bottomext-bottom"/>
+    </component>
     <component id="n15_vxw5" name="btnHint" src="f4xv3o" fileName="components/Button6.xml" xy="27,895" size="116,106" group="n38_8lqj">
       <relation target="" sidePair="left-left,bottom-bottom"/>
       <Button title="任务提示" titleColor="#ffffff" titleFontSize="42" icon="ui://mbo439wb8xpg2q"/>

+ 1 - 1
GameClient/Assets/Game/CSShare

@@ -1 +1 @@
-Subproject commit 3526f01fb4a402a5b9dfb0b54d30871adf2a6993
+Subproject commit 1712c8aa34dd2eb9c736d4f36f358290679a3393

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

@@ -18,6 +18,7 @@ namespace UI.DressUp
         public UI_comListType m_comListType1;
         public UI_comListType m_comListType2;
         public UI_PartsList m_partsList;
+        public UI_PartsList m_partsList2;
         public GButton m_btnHint;
         public GGraph m_btnClose;
         public GTextField m_txtHint;
@@ -90,6 +91,7 @@ namespace UI.DressUp
             m_comListType1 = (UI_comListType)UI_comListType.Create(comp.GetChild("comListType1"));
             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_btnHint = (GButton)comp.GetChild("btnHint");
             m_btnClose = (GGraph)comp.GetChild("btnClose");
             m_txtHint = (GTextField)comp.GetChild("txtHint");
@@ -122,6 +124,8 @@ namespace UI.DressUp
             m_comListType2 = null;
             m_partsList.Dispose();
             m_partsList = null;
+            m_partsList2.Dispose();
+            m_partsList2 = null;
             m_btnHint = null;
             m_btnClose = null;
             m_txtHint = null;

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

@@ -17,7 +17,9 @@ namespace GFGGame
         private GameObject _scenePrefab;
         private GameObject _sceneObject;
         private List<int> _currentList3;
+        private List<int> _currentList4;
         private int _currentMenuType;
+        private int _currentSuitId;
         private StoryLevelCfg _levelCfg;
         private StoryFightCfg _fightCfg;
 
@@ -76,6 +78,7 @@ namespace GFGGame
             _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_touchPad.onClick.Add(OnTouchPad);
             _ui.m_btnHint.onClick.Add(OnClickBtnHint);
             _ui.m_btnClose.onClick.Add(OnClickBtnClose);
@@ -97,6 +100,7 @@ namespace GFGGame
             EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
             // EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdatePartsListSort);
             EventAgent.AddEventListener(ConstMessage.CARD_CHOOSE, StartCalculateScore);
+            _ui.m_partsList2.m_comboBoxRarity.visible = false;
         }
 
         protected override void OnShown()
@@ -242,6 +246,8 @@ namespace GFGGame
             int id = (int)listItem.data;
             if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
             {
+                this.showListParts2(id);
+                this.hideListParts();
                 EquipDataCache.cacher.PutOnSuitCfg(id, false, true);
             }
             else
@@ -251,12 +257,26 @@ namespace GFGGame
 
             }
             UpdateListPartsSelected();
-
+            UpdateListSuitPartsSelected();
         }
+        private void OnClickSuitPartsListItem(EventContext context)
+        {
+            GObject listItem = (GObject)context.data as GObject;
+            int id = (int)listItem.data;
 
+            EquipDataCache.cacher.TryCancelSuit(id);
+            EquipDataCache.cacher.AddOrRemove(id, true);
+
+            UpdateListSuitPartsSelected();
+        }
         private void OnTouchPad()
         {
-            if (this.currentListType == DressUpListType.List3)
+            if (this.currentListType == DressUpListType.List4)
+            {
+                this.hideListParts2();
+                this.showListParts(ConstDressUpItemType.TAO_ZHUANG);
+            }
+            else if (this.currentListType == DressUpListType.List3)
             {
                 if (_currentList2 != null)
                 {
@@ -336,6 +356,7 @@ namespace GFGGame
         {
             _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;
             //一级菜单
@@ -416,6 +437,7 @@ namespace GFGGame
                 {
                     _ui.m_partsList.target.x = t.value.x;
                 });
+            UpdateListPartsSelected();
         }
         private void OnComboBoxRarityChanged()
         {
@@ -494,7 +516,25 @@ namespace GFGGame
             _ui.m_partsList.m_list.numItems = _currentList3.Count;
 
         }
+        private void UpdateSuitPartsListSort()
+        {
+            if (_currentMenuType == 0) return;
+
+            _currentList4 = new List<int>(SuitCfgManager.Instance.GetSuitItems(_currentSuitId, true));
+
+            if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
+            {
+                _currentList4 = DressUpMenuItemDataManager.DressSearch(_currentList4, false);
+            }
+            else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
+            {
+                _currentList4 = DressUpMenuItemDataManager.DressFilter(_currentList4, false);
+            }
 
+            _ui.m_partsList2.m_list.RemoveChildrenToPool();
+            _ui.m_partsList2.m_list.numItems = _currentList4.Count;
+
+        }
 
         private void hideListParts()
         {
@@ -505,7 +545,40 @@ namespace GFGGame
                     _ui.m_partsList.target.x = t.value.x;
                 });
         }
+        private void showListParts2(int suitId)
+        {
+            _currentSuitId = suitId;
+
+            _ui.m_partsList2.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
+
+            this.UpdateSuitPartsListSort();
+            _ui.m_partsList2.m_list.ResizeToFit(_ui.m_partsList2.m_list.numItems);
+            float maxHeight = _ui.m_partsList2.target.height - _ui.m_partsList2.m_list.y;// - DressUpView.BOTTOM_BLANK;
+            if (_ui.m_partsList2.m_list.height > maxHeight)
+            {
+                _ui.m_partsList2.m_list.height = maxHeight;
+            }
+            currentListType = DressUpListType.List4;
+            GTween.To(_ui.target.width, partsListX, 0.5f)
+                .SetTarget(_ui.m_partsList2)
+                .OnUpdate((GTweener t) =>
+                {
+                    _ui.m_partsList2.target.x = t.value.x;
+                });
+
+        }
+
+        private void hideListParts2()
+        {
+            _currentMenuType = ConstDressUpItemType.TAO_ZHUANG;
 
+            GTween.To(partsListX, _ui.target.width, 0.5f)
+                .SetTarget(_ui.m_partsList2)
+                .OnUpdate((GTweener t) =>
+                {
+                    _ui.m_partsList2.target.x = t.value.x;
+                });
+        }
         private void ListType1Item(int index, GObject item)
         {
             UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
@@ -559,7 +632,37 @@ namespace GFGGame
             listItem.target.data = id;
             listItem.m_imgNeed.visible = _fightCfg.needItemId == id || _fightCfg.needSuitId == id;
         }
+        private void ListParts2Item(int index, GObject item)
+        {
+            UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
+            int id = (int)_currentList4[index];
+            string iconRes = "";
+            string partName = "";
+            string ext = "png";
+
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
+            iconRes = itemCfg.res;
+            partName = itemCfg.name;
+            listItem.m_iconSelected.visible = EquipDataCache.cacher.CheckDressUpItemIsOn(id);
+            RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
+            ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType);
 
+            listItem.m_ScoreType.visible = true;
+            int mainScore;
+            int mainValuel;
+            ItemDataManager.GetMainScore(id, out mainScore, out mainValuel);
+            listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + mainScore);
+
+
+            listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
+            listItem.m_txtTitle.text = partName;
+            listItem.target.data = id;
+            listItem.m_txtScore.visible = false;
+            //listItem.m_ScoreType.visible = true;
+            listItem.m_imgNeed.visible = false;
+
+
+        }
         private void UpdateListPartsSelected()
         {
             int count = _ui.m_partsList.m_list.numChildren;
@@ -580,7 +683,21 @@ namespace GFGGame
                 }
             }
         }
+        private void UpdateListSuitPartsSelected()
+        {
+            int count = _ui.m_partsList2.m_list.numChildren;
+            for (int i = 0; i < count; i++)
+            {
+                UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList2.m_list.GetChildAt(i));
+                int id = (int)listItem.target.data;
 
+                bool isPutOn = EquipDataCache.cacher.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
+                bool isSuit = !DressUpMenuItemDataManager.CheckIsSceneType(id) && EquipDataCache.cacher.suitId > 0 && SuitCfgManager.Instance.GetItemSuitId(id) == EquipDataCache.cacher.suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
+                bool isSceneSuit = DressUpMenuItemDataManager.CheckIsSceneType(id) && EquipDataCache.cacher.suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
+                listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
+
+            }
+        }
         private void ShowTaskHint()
         {
             _ui.m_groupTaskHint.visible = true;

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

@@ -487,7 +487,7 @@ namespace GFGGame
         private void ListParts2Item(int index, GObject item)
         {
             UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
-            int id = (int)_currentList3[index];
+            int id = (int)_currentList4[index];
             string iconRes = "";
             string partName = "";
             string ext = "png";
@@ -609,15 +609,15 @@ namespace GFGGame
             _currentList4 = new List<int>(SuitCfgManager.Instance.GetSuitItems(_currentSuitId));
             if (_rarityIndex == SORT_BY_HIGH_RARITY)
             {
-                _currentList3 = DressUpMenuItemDataManager.SortItemListByHighRarity(_currentList4);
+                _currentList4 = DressUpMenuItemDataManager.SortItemListByHighRarity(_currentList4);
             }
             else if (_rarityIndex == SORT_BY_LOW_RARITY)
             {
-                _currentList3 = DressUpMenuItemDataManager.SortItemListByLowRarity(_currentList4);
+                _currentList4 = DressUpMenuItemDataManager.SortItemListByLowRarity(_currentList4);
             }
             else
             {
-                _currentList3.Reverse();
+                _currentList4.Reverse();
             }
 
             if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)

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