|
@@ -17,7 +17,9 @@ namespace GFGGame
|
|
private GameObject _scenePrefab;
|
|
private GameObject _scenePrefab;
|
|
private GameObject _sceneObject;
|
|
private GameObject _sceneObject;
|
|
private List<int> _currentList3;
|
|
private List<int> _currentList3;
|
|
|
|
+ private List<int> _currentList4;
|
|
private int _currentMenuType;
|
|
private int _currentMenuType;
|
|
|
|
+ private int _currentSuitId;
|
|
private StoryLevelCfg _levelCfg;
|
|
private StoryLevelCfg _levelCfg;
|
|
private StoryFightCfg _fightCfg;
|
|
private StoryFightCfg _fightCfg;
|
|
|
|
|
|
@@ -76,6 +78,7 @@ namespace GFGGame
|
|
_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_touchPad.onClick.Add(OnTouchPad);
|
|
_ui.m_touchPad.onClick.Add(OnTouchPad);
|
|
_ui.m_btnHint.onClick.Add(OnClickBtnHint);
|
|
_ui.m_btnHint.onClick.Add(OnClickBtnHint);
|
|
_ui.m_btnClose.onClick.Add(OnClickBtnClose);
|
|
_ui.m_btnClose.onClick.Add(OnClickBtnClose);
|
|
@@ -97,6 +100,7 @@ namespace GFGGame
|
|
EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
|
|
EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
|
|
// EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdatePartsListSort);
|
|
// EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdatePartsListSort);
|
|
EventAgent.AddEventListener(ConstMessage.CARD_CHOOSE, StartCalculateScore);
|
|
EventAgent.AddEventListener(ConstMessage.CARD_CHOOSE, StartCalculateScore);
|
|
|
|
+ _ui.m_partsList2.m_comboBoxRarity.visible = false;
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
@@ -242,6 +246,8 @@ namespace GFGGame
|
|
int id = (int)listItem.data;
|
|
int id = (int)listItem.data;
|
|
if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
|
|
if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
|
|
{
|
|
{
|
|
|
|
+ this.showListParts2(id);
|
|
|
|
+ this.hideListParts();
|
|
EquipDataCache.cacher.PutOnSuitCfg(id, false, true);
|
|
EquipDataCache.cacher.PutOnSuitCfg(id, false, true);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
@@ -251,12 +257,26 @@ namespace GFGGame
|
|
|
|
|
|
}
|
|
}
|
|
UpdateListPartsSelected();
|
|
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()
|
|
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)
|
|
if (_currentList2 != null)
|
|
{
|
|
{
|
|
@@ -336,6 +356,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;
|
|
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;
|
|
//一级菜单
|
|
//一级菜单
|
|
@@ -416,6 +437,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
_ui.m_partsList.target.x = t.value.x;
|
|
_ui.m_partsList.target.x = t.value.x;
|
|
});
|
|
});
|
|
|
|
+ UpdateListPartsSelected();
|
|
}
|
|
}
|
|
private void OnComboBoxRarityChanged()
|
|
private void OnComboBoxRarityChanged()
|
|
{
|
|
{
|
|
@@ -494,7 +516,25 @@ namespace GFGGame
|
|
_ui.m_partsList.m_list.numItems = _currentList3.Count;
|
|
_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()
|
|
private void hideListParts()
|
|
{
|
|
{
|
|
@@ -505,7 +545,40 @@ namespace GFGGame
|
|
_ui.m_partsList.target.x = t.value.x;
|
|
_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)
|
|
private void ListType1Item(int index, GObject item)
|
|
{
|
|
{
|
|
UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
|
|
UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
|
|
@@ -559,7 +632,37 @@ namespace GFGGame
|
|
listItem.target.data = id;
|
|
listItem.target.data = id;
|
|
listItem.m_imgNeed.visible = _fightCfg.needItemId == id || _fightCfg.needSuitId == 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()
|
|
private void UpdateListPartsSelected()
|
|
{
|
|
{
|
|
int count = _ui.m_partsList.m_list.numChildren;
|
|
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()
|
|
private void ShowTaskHint()
|
|
{
|
|
{
|
|
_ui.m_groupTaskHint.visible = true;
|
|
_ui.m_groupTaskHint.visible = true;
|