|
@@ -73,14 +73,17 @@ namespace GFGGame
|
|
|
|
|
|
_ui.m_btnSearch.visible = true;
|
|
_ui.m_btnSearch.visible = true;
|
|
_ui.m_partsList.m_comboBoxRarity.items = new string[] { "高分优先", "低分优先" };
|
|
_ui.m_partsList.m_comboBoxRarity.items = new string[] { "高分优先", "低分优先" };
|
|
|
|
+ _ui.m_partsListSearch.m_comboBoxRarity.items = new string[] { "高分优先", "低分优先" };
|
|
InitLists();
|
|
InitLists();
|
|
_ui.m_partsList.m_comboBoxRarity.onChanged.Add(OnComboBoxRarityChanged);
|
|
_ui.m_partsList.m_comboBoxRarity.onChanged.Add(OnComboBoxRarityChanged);
|
|
|
|
+ _ui.m_partsListSearch.m_comboBoxRarity.onChanged.Add(OnSearchComboBoxRarityChanged);
|
|
_ui.m_btnBack.onClick.Add(OnClickBtnBack);
|
|
_ui.m_btnBack.onClick.Add(OnClickBtnBack);
|
|
|
|
|
|
_ui.m_comListType1.m_listType.onClickItem.Add(OnClickListType1Item);
|
|
_ui.m_comListType1.m_listType.onClickItem.Add(OnClickListType1Item);
|
|
_ui.m_comListType2.m_listType.onClickItem.Add(OnClickListType2Item);
|
|
_ui.m_comListType2.m_listType.onClickItem.Add(OnClickListType2Item);
|
|
_ui.m_partsList.m_list.onClickItem.Add(OnClickPartsListItem);
|
|
_ui.m_partsList.m_list.onClickItem.Add(OnClickPartsListItem);
|
|
_ui.m_partsList2.m_list.onClickItem.Add(OnClickSuitPartsListItem);
|
|
_ui.m_partsList2.m_list.onClickItem.Add(OnClickSuitPartsListItem);
|
|
|
|
+ _ui.m_partsListSearch.m_list.onClickItem.Add(OnClickSearchPartsListItem);
|
|
|
|
|
|
_ui.m_touchPad.onClick.Add(OnTouchPad);
|
|
_ui.m_touchPad.onClick.Add(OnTouchPad);
|
|
_ui.m_btnDelete.onClick.Add(OnClickBtnDelete);
|
|
_ui.m_btnDelete.onClick.Add(OnClickBtnDelete);
|
|
@@ -98,8 +101,8 @@ namespace GFGGame
|
|
protected override void AddEventListener()
|
|
protected override void AddEventListener()
|
|
{
|
|
{
|
|
base.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);
|
|
EventAgent.AddEventListener(ConstMessage.CARD_SELECTED, UpdateValueInfo);
|
|
}
|
|
}
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
@@ -165,9 +168,9 @@ namespace GFGGame
|
|
protected override void RemoveEventListener()
|
|
protected override void RemoveEventListener()
|
|
{
|
|
{
|
|
base.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()
|
|
private void OnClickBtnBack()
|
|
@@ -275,6 +278,31 @@ namespace GFGGame
|
|
this.hideListType2();
|
|
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)
|
|
private void OnClickPartsListItem(EventContext context)
|
|
{
|
|
{
|
|
if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
|
|
if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
|
|
@@ -362,6 +390,11 @@ namespace GFGGame
|
|
this.showListType1();
|
|
this.showListType1();
|
|
this.hideListType2();
|
|
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_comListType2.m_listType.itemRenderer = ListType2Item;
|
|
_ui.m_partsList.m_list.itemRenderer = ListPartsItem;
|
|
_ui.m_partsList.m_list.itemRenderer = ListPartsItem;
|
|
_ui.m_partsList2.m_list.itemRenderer = ListParts2Item;
|
|
_ui.m_partsList2.m_list.itemRenderer = ListParts2Item;
|
|
|
|
+ _ui.m_partsListSearch.m_list.itemRenderer = ListPartsItem;
|
|
listType1X = _ui.m_comListType1.target.x;
|
|
listType1X = _ui.m_comListType1.target.x;
|
|
partsListX = _ui.m_partsList.target.x - _ui.m_partsList.target.width;
|
|
partsListX = _ui.m_partsList.target.x - _ui.m_partsList.target.width;
|
|
//一级菜单
|
|
//一级菜单
|
|
@@ -529,6 +563,11 @@ namespace GFGGame
|
|
_scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
|
|
_scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
|
|
this.UpdatePartsListSort();
|
|
this.UpdatePartsListSort();
|
|
}
|
|
}
|
|
|
|
+ private void OnSearchComboBoxRarityChanged()
|
|
|
|
+ {
|
|
|
|
+ _scoreIndex = _ui.m_partsListSearch.m_comboBoxRarity.selectedIndex;
|
|
|
|
+ this.UpdateSearchList();
|
|
|
|
+ }
|
|
private void UpdatePartsListSort()
|
|
private void UpdatePartsListSort()
|
|
{
|
|
{
|
|
|
|
|
|
@@ -644,6 +683,64 @@ namespace GFGGame
|
|
_ui.m_partsList2.target.x = t.value.x;
|
|
_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)
|
|
private void ListType1Item(int index, GObject item)
|
|
{
|
|
{
|
|
UI.DressUp.UI_TypeItem typeItem = UI.DressUp.UI_TypeItem.Proxy(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()
|
|
private void UpdateListPartsSelected()
|
|
{
|
|
{
|
|
int count = _ui.m_partsList.m_list.numChildren;
|
|
int count = _ui.m_partsList.m_list.numChildren;
|