|
@@ -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;
|