|
@@ -23,6 +23,8 @@ namespace GFGGame
|
|
|
|
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER_RESET_ALL, ResetAll);
|
|
|
|
+
|
|
if (_ui != null)
|
|
if (_ui != null)
|
|
{
|
|
{
|
|
_ui.Dispose();
|
|
_ui.Dispose();
|
|
@@ -42,7 +44,6 @@ namespace GFGGame
|
|
this.clickBlankToClose = false;
|
|
this.clickBlankToClose = false;
|
|
viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
|
|
viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
|
|
|
|
|
|
- _ui.m_btnSearch.onClick.Add(OnclickBtnSearch);
|
|
|
|
_ui.m_btnConfirm.onClick.Add(OnClickBtnConfirm);
|
|
_ui.m_btnConfirm.onClick.Add(OnClickBtnConfirm);
|
|
_ui.m_btnReset.onClick.Add(OnClickBtnReset);
|
|
_ui.m_btnReset.onClick.Add(OnClickBtnReset);
|
|
_ui.m_btnClose.onClick.Add(this.OnHide);
|
|
_ui.m_btnClose.onClick.Add(this.OnHide);
|
|
@@ -54,6 +55,9 @@ namespace GFGGame
|
|
_ui.m_comSearch.m_listRarity.onClickItem.Add(OnClickListRarityItem);
|
|
_ui.m_comSearch.m_listRarity.onClickItem.Add(OnClickListRarityItem);
|
|
_ui.m_comSearch.m_listScore.onClickItem.Add(OnClickListScoreItem);
|
|
_ui.m_comSearch.m_listScore.onClickItem.Add(OnClickListScoreItem);
|
|
//_ui.m_comSearch.m_listTag.onClickItem.Add(OnClickListTagItem);
|
|
//_ui.m_comSearch.m_listTag.onClickItem.Add(OnClickListTagItem);
|
|
|
|
+ EventAgent.AddEventListener(ConstMessage.DRESS_FILTER_RESET_ALL, ResetAll);
|
|
|
|
+ _ui.m_page.onChanged.Add(OnTabChange);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
@@ -85,6 +89,18 @@ namespace GFGGame
|
|
UpdateView();
|
|
UpdateView();
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ protected override void AddEventListener()
|
|
|
|
+ {
|
|
|
|
+ base.AddEventListener();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected override void RemoveEventListener()
|
|
|
|
+ {
|
|
|
|
+ base.RemoveEventListener();
|
|
|
|
+ //EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER_RESET_ALL, ResetAll);
|
|
|
|
+ }
|
|
|
|
+
|
|
private void UpdateView()
|
|
private void UpdateView()
|
|
{
|
|
{
|
|
_ui.m_comSearch.m_listRarity.numItems = ConstDressRarity.DressRarityList().Count;
|
|
_ui.m_comSearch.m_listRarity.numItems = ConstDressRarity.DressRarityList().Count;
|
|
@@ -108,6 +124,10 @@ namespace GFGGame
|
|
int data = index + 1;
|
|
int data = index + 1;
|
|
item.data = data;
|
|
item.data = data;
|
|
item.selected = _selectScoreList.IndexOf(data) >= 0;
|
|
item.selected = _selectScoreList.IndexOf(data) >= 0;
|
|
|
|
+ UI_Button2 button2 = UI_Button2.Proxy(obj);
|
|
|
|
+ button2.m_type.selectedIndex = 1;
|
|
|
|
+ button2.m_mainScoreIcon.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + ConstDressUpScoreType.scoreTypeList().GetKey(index));
|
|
|
|
+ UI_Button2.ProxyEnd();
|
|
}
|
|
}
|
|
|
|
|
|
private List<GButton> _TagItemObj = new List<GButton>();
|
|
private List<GButton> _TagItemObj = new List<GButton>();
|
|
@@ -210,7 +230,8 @@ namespace GFGGame
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
- private void OnclickBtnSearch()
|
|
|
|
|
|
+
|
|
|
|
+ private void OnClickBtnSearch()
|
|
{
|
|
{
|
|
DressUpMenuItemDataManager.dressFilterType = DressFilterType.Search;
|
|
DressUpMenuItemDataManager.dressFilterType = DressFilterType.Search;
|
|
if (!CheckIllegalCharacter(_ui.m_txtInput.text))
|
|
if (!CheckIllegalCharacter(_ui.m_txtInput.text))
|
|
@@ -222,24 +243,32 @@ namespace GFGGame
|
|
EventAgent.DispatchEvent(ConstMessage.DRESS_SEARCH, ConstMessage.DRESS_SEARCH);
|
|
EventAgent.DispatchEvent(ConstMessage.DRESS_SEARCH, ConstMessage.DRESS_SEARCH);
|
|
ResetFilter();
|
|
ResetFilter();
|
|
this.OnHide();
|
|
this.OnHide();
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
private void OnClickBtnConfirm()
|
|
private void OnClickBtnConfirm()
|
|
{
|
|
{
|
|
- DressUpMenuItemDataManager.dressFilterType = DressFilterType.Filter;
|
|
|
|
- DressUpMenuItemDataManager.selectRarityList = _selectRarityList;
|
|
|
|
- DressUpMenuItemDataManager.selectScoreList = _selectScoreList;
|
|
|
|
- DressUpMenuItemDataManager.selectTagList = _selectTagList;
|
|
|
|
- if (_selectRarityList.Count == 0 && _selectScoreList.Count == 0 && _selectTagList.Count == 0)
|
|
|
|
|
|
+ // 筛选
|
|
|
|
+ if(_ui.m_page.selectedIndex == 0)
|
|
{
|
|
{
|
|
- PromptController.Instance.ShowFloatTextPrompt("未选择要搜索的类型");
|
|
|
|
- return;
|
|
|
|
|
|
+ DressUpMenuItemDataManager.dressFilterType = DressFilterType.Filter;
|
|
|
|
+ DressUpMenuItemDataManager.selectRarityList = _selectRarityList;
|
|
|
|
+ DressUpMenuItemDataManager.selectScoreList = _selectScoreList;
|
|
|
|
+ DressUpMenuItemDataManager.selectTagList = _selectTagList;
|
|
|
|
+ if (_selectRarityList.Count == 0 && _selectScoreList.Count == 0 && _selectTagList.Count == 0)
|
|
|
|
+ {
|
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("未选择要搜索的类型");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ ViewManager.Show<ModalStatusView>("搜索中...");
|
|
|
|
+ EventAgent.DispatchEvent(ConstMessage.DRESS_FILTER, ConstMessage.DRESS_FILTER);
|
|
|
|
+ ResetSearch();
|
|
|
|
+ this.OnHide();
|
|
|
|
+ }
|
|
|
|
+ // 搜索
|
|
|
|
+ else if(_ui.m_page.selectedIndex == 1)
|
|
|
|
+ {
|
|
|
|
+ OnClickBtnSearch();
|
|
}
|
|
}
|
|
- ViewManager.Show<ModalStatusView>("搜索中...");
|
|
|
|
-
|
|
|
|
- EventAgent.DispatchEvent(ConstMessage.DRESS_FILTER, ConstMessage.DRESS_FILTER);
|
|
|
|
- ResetSearch();
|
|
|
|
- this.OnHide();
|
|
|
|
}
|
|
}
|
|
private void OnClickBtnReset()
|
|
private void OnClickBtnReset()
|
|
{
|
|
{
|
|
@@ -249,6 +278,7 @@ namespace GFGGame
|
|
UpdateView();
|
|
UpdateView();
|
|
EventAgent.DispatchEvent(ConstMessage.DRESS_FILTER_RESET);
|
|
EventAgent.DispatchEvent(ConstMessage.DRESS_FILTER_RESET);
|
|
}
|
|
}
|
|
|
|
+
|
|
private void ResetFilter()
|
|
private void ResetFilter()
|
|
{
|
|
{
|
|
_selectRarityList.Clear();
|
|
_selectRarityList.Clear();
|
|
@@ -261,10 +291,18 @@ namespace GFGGame
|
|
_ui.m_comSearch.m_listScore.SelectNone();
|
|
_ui.m_comSearch.m_listScore.SelectNone();
|
|
_ui.m_comSearch.m_listTag.SelectNone();
|
|
_ui.m_comSearch.m_listTag.SelectNone();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void ResetAll()
|
|
|
|
+ {
|
|
|
|
+ _ui.m_page.selectedIndex = 0;
|
|
|
|
+ OnClickBtnReset();
|
|
|
|
+ }
|
|
|
|
+
|
|
private void ResetSearch()
|
|
private void ResetSearch()
|
|
{
|
|
{
|
|
_ui.m_txtInput.text = null;
|
|
_ui.m_txtInput.text = null;
|
|
}
|
|
}
|
|
|
|
+
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
{
|
|
{
|
|
base.OnHide();
|
|
base.OnHide();
|
|
@@ -273,5 +311,11 @@ namespace GFGGame
|
|
_ui.m_comSearch.m_listScore.SelectNone();
|
|
_ui.m_comSearch.m_listScore.SelectNone();
|
|
_ui.m_comSearch.m_listTag.SelectNone();
|
|
_ui.m_comSearch.m_listTag.SelectNone();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void OnTabChange()
|
|
|
|
+ {
|
|
|
|
+ _ui.m_btnTab0.m_color.selectedIndex = 1 - _ui.m_page.selectedIndex;
|
|
|
|
+ _ui.m_btnTab1.m_color.selectedIndex = _ui.m_page.selectedIndex;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|