/// <summary> /// ソート&フィルタ情報の設定 /// </summary> /// <param name="sortInfo"></param> public void SetUpSortData(LocalSaveSortInfo sortInfo) { m_IsTutorialSortData = false; if (sortInfo != null && sortInfo.m_SortType == (int)MAINMENU_SORT_SEQ.SEQ_INIT) { sortInfo = SortDialog.SetDefaultSortInfo(sortInfo, SortDialog.DIALOG_TYPE.UNIT); } m_unitBaseList.SetUpSortData(sortInfo); m_SortInfo = sortInfo; if (sortInfo != null) { m_SortType = (MAINMENU_SORT_SEQ)sortInfo.m_SortType; if (sortInfo.m_FavoriteSorts != null) { m_FavoriteSortTypes = new MAINMENU_SORT_SEQ[sortInfo.m_FavoriteSorts.Length]; for (int i = 0; i < sortInfo.m_FavoriteSorts.Length; i++) { m_FavoriteSortTypes[i] = (MAINMENU_SORT_SEQ)sortInfo.m_FavoriteSorts[i].m_SortType; } } m_unitBaseList.AddSortInfo(SORT_PARAM.ID, (sortInfo.m_SortIsAscOrder) ? SORT_ORDER.ASCENDING : SORT_ORDER.DESCENDING); m_unitBaseList.AddSortInfo(SORT_PARAM.LEVEL, (sortInfo.m_SortIsAscOrder) ? SORT_ORDER.ASCENDING : SORT_ORDER.DESCENDING); } m_unitBaseList.AddSortInfo(SORT_PARAM.UNIQUE_ID, SORT_ORDER.ASCENDING); }
public static LocalSaveSortInfo SetDefaultSortInfo(LocalSaveSortInfo sortInfo, DIALOG_TYPE dialogType) { LocalSaveSortInfo _sortInfo = sortInfo; if (_sortInfo == null) { _sortInfo = new LocalSaveSortInfo(); _sortInfo.InitParam(); } if (_sortInfo.m_SortType != (int)MAINMENU_SORT_SEQ.SEQ_INIT) { return(_sortInfo); } switch (dialogType) { case DIALOG_TYPE.UNIT: _sortInfo.m_SortType = (int)DEFAULT_UNIT_SORT_TYPE; _sortInfo.m_SortIsAscOrder = DEFAULT_UNIT_ASC_ORDER; break; case DIALOG_TYPE.FRIEND: _sortInfo.m_SortType = (int)DEFAULT_FRIEND_SORT_TYPE; _sortInfo.m_SortIsAscOrder = DEFAULT_FRIEND_ASC_ORDER; break; default: break; } return(_sortInfo); }
/// <summary> /// ソート内容をリストに適用 /// </summary> /// <param name="sortInfo"></param> public void ExecSortBuild(LocalSaveSortInfo sortInfo) { SelectStatusDisplayType(m_SortType, m_FavoriteSortTypes); SetStatusType(m_SortType, m_FavoriteSortTypes); SetFilterText(sortInfo); m_unitGridView.CreateList(); }
public void UpdateData(LocalSaveSortInfo sortInfo) { for (int i = 0; i < FilterSwitches.Count; i++) { FilterSwitches[i].IsSelect = CheckSelectFilter(FilterSwitches[i].RarityType, sortInfo); } }
/// <summary> /// ソートダイアログを閉じたとき /// </summary> void OnClickSortCloseButton(LocalSaveSortInfo sortInfo) { //-------------------------------- // データ保存 //-------------------------------- LocalSaveManager.Instance.SaveFuncSortFilterFriendWaitHim(sortInfo); m_FriendList.ExecSort(sortInfo); }
/// <summary> /// ソートダイアログを閉じたとき /// </summary> void OnClickSortCloseButton(LocalSaveSortInfo sortInfo) { //-------------------------------- // データ保存 //-------------------------------- LocalSaveManager.Instance.SaveFuncSortFilterEvolveUnit(sortInfo); m_UnitGrid.ExecSortBuild(sortInfo); }
public void UpdateData(LocalSaveSortInfo sortInfo) { for (int i = 0; i < FilterSwitches.Count; i++) { FilterSwitches[i].IsSelect = CheckSelectFilter(FilterSwitches[i].KindType, sortInfo); } IsIncludeSubKind = (sortInfo != null) ? sortInfo.m_FilterIsIncludeKindsSub : false; }
/// <summary> /// フィルターの選択状態を更新 /// </summary> /// <param name="sortInfo"></param> public void UpdateFilter(LocalSaveSortInfo sortInfo) { RareButton.SetSelect(CheckSelectFilter(MAINMENU_FILTER_TYPE.FILTER_RARE, sortInfo)); KindButton.SetSelect(CheckSelectFilter(MAINMENU_FILTER_TYPE.FILTER_KIND, sortInfo)); for (int i = 0; i < Elements.Count; i++) { Elements[i].IsSelect = CheckSelectElementFilter(Elements[i].ElementType, sortInfo); } }
/// <summary> /// ソート設定の初期化 /// </summary> public void ResetSortParam() { m_SortData = null; m_SortData = SetDefaultSortInfo(m_SortData, m_DialogType); m_MainPanel.UpdateSort(m_SortData); m_MainPanel.UpdateFilter(m_SortData); m_RareFilterPanel.UpdateData(m_SortData); m_KindFilterPanel.UpdateData(m_SortData); m_FavoriteSortPanel.UpdateData(m_SortData); }
/// <summary> /// ソートの選択状態を更新 /// </summary> /// <param name="sortInfo"></param> public void UpdateSort(LocalSaveSortInfo sortInfo) { if (sortInfo != null && SortButtons != null) { for (int i = 0; i < SortButtons.Count; i++) { SortButtons[i].IsSelect = (sortInfo.m_SortType == (int)SortButtons[i].SortType); } IsAscOrder = sortInfo.m_SortIsAscOrder; } }
/// <summary> /// フィルタの選択状態をチェック /// </summary> /// <param name="kindType"></param> /// <returns></returns> bool CheckSelectFilter(MasterDataDefineLabel.KindType kindType, LocalSaveSortInfo sortInfo) { if (sortInfo == null) { return(false); } if (sortInfo.m_FilterKinds == null || sortInfo.m_FilterKinds.Length == 0) { return(false); } return(Array.IndexOf(sortInfo.m_FilterKinds, (int)kindType) >= 0); }
/// <summary> /// ソート&フィルタの実行 /// </summary> /// <param name="sortInfo"></param> public void ExecSort(LocalSaveSortInfo sortInfo) { SetUpSortData(sortInfo); friendDataList = friendBaseList.Exec(SORT_OBJECT_TYPE.FRIEND_LIST); IsViewEmpty = (friendDataList.Count == 0) ? true : false; if (scrollContent != null) { scrollContent.Initialize(this); } SetStatusType(sortInfo); SetFilterText(sortInfo); }
/// <summary> /// フィルタの選択状態をチェック /// </summary> /// <param name="rarityType"></param> /// <returns></returns> bool CheckSelectFilter(MasterDataDefineLabel.RarityType rarityType, LocalSaveSortInfo sortInfo) { if (sortInfo == null) { return(false); } if (sortInfo.m_FilterRares == null || sortInfo.m_FilterRares.Length == 0) { return(false); } return(Array.IndexOf(sortInfo.m_FilterRares, (int)rarityType) >= 0); }
/// <summary> /// フィルタの選択状態をチェック /// </summary> /// <param name="elementType"></param> /// <returns></returns> bool CheckSelectElement(MasterDataDefineLabel.ElementType elementType, LocalSaveSortInfo sortInfo) { if (sortInfo == null) { return(false); } if (sortInfo.m_FilterElements == null || sortInfo.m_FilterElements.Length == 0) { return(false); } return(Array.IndexOf(sortInfo.m_FilterElements, (int)elementType) >= 0); }
public void SetUpSortData(LocalSaveSortInfo sortInfo) { if (sortInfo != null && sortInfo.m_SortType == (int)MAINMENU_SORT_SEQ.SEQ_INIT) { sortInfo = SortDialog.SetDefaultSortInfo(sortInfo, SortDialog.DIALOG_TYPE.FRIEND); } friendBaseList.SetUpSortData(sortInfo); m_SortInfo = sortInfo; if (sortInfo != null) { friendBaseList.AddSortInfo(SORT_PARAM.FRIEND_STATE, (sortInfo.m_SortIsAscOrder) ? SORT_ORDER.ASCENDING : SORT_ORDER.DESCENDING); friendBaseList.AddSortInfo(SORT_PARAM.LOGIN_TIME, (sortInfo.m_SortIsAscOrder) ? SORT_ORDER.ASCENDING : SORT_ORDER.DESCENDING); friendBaseList.AddSortInfo(SORT_PARAM.ID, (sortInfo.m_SortIsAscOrder) ? SORT_ORDER.ASCENDING : SORT_ORDER.DESCENDING); } }
/// <summary> /// ソートダイアログを閉じたとき /// </summary> void OnClickSortCloseButton(LocalSaveSortInfo sortInfo) { //-------------------------------- // データ保存 //-------------------------------- LocalSaveManager.Instance.SaveFuncSortFilterQuestFriend(sortInfo); //TODO ソートテスト //m_FriendList.FriendBaseList.AddSortInfo(SORT_PARAM.RANK, SORT_ORDER.DESCENDING); //m_FriendList.FriendBaseList.AddSortInfo(SORT_PARAM.ELEMENT, SORT_ORDER.ASCENDING); //m_FriendList.FriendBaseList.AddSortInfo(SORT_PARAM.LOGIN_TIME, SORT_ORDER.DESCENDING); //TODO フィルタテスト //m_FriendList.FriendBaseList.AddFilter<int>(SORT_PARAM.ELEMENT, new int[] { (int)MasterDataDefineLabel.ElementType.FIRE }); m_FriendList.ExecSort(sortInfo); }
/// <summary> /// ソートの種別表示の設定 /// </summary> /// <param name="sortInfo"></param> void SetStatusType(LocalSaveSortInfo sortInfo) { StatusTypeText = ""; if (sortInfo != null) { MAINMENU_SORT_SEQ sortType = (MAINMENU_SORT_SEQ)sortInfo.m_SortType; if (sortType == MAINMENU_SORT_SEQ.SEQ_INIT) { StatusTypeText = GameTextUtil.GetText("filter_text18"); } else { StatusTypeText = GameTextUtil.GetSortDialogSortText(sortType); } StatusTypeText = string.Format(GameTextUtil.GetText("sort_colorset"), StatusTypeText); // カラーコード設定 } }
/// <summary> /// ソートの項目を選択したとき /// </summary> /// <param name="sortButton"></param> void OnClickMainPanelSortButton(SortDialogTextButtonListContext sortButton) { if (sortButton.SortType == MAINMENU_SORT_SEQ.SEQ_SORT_TYPE_FAVORITE_SORT) { ConfirmSortType(); // ソート設定を確定させる AndroidBackKeyManager.Instance.StackPush(m_FavoriteSortPanel.gameObject, OnBackKeyFavoriteSortPanel); IsActiveOneButton = false; IsActiveTwoButton = true; m_MainPanel.gameObject.SetActive(false); m_FavoriteSortPanel.gameObject.SetActive(true); m_FavoriteSortPanel.UpdateData(m_SortData); } else { LocalSaveSortInfo sort = new LocalSaveSortInfo(); sort.m_SortType = (int)sortButton.SortType; sort.m_SortIsAscOrder = m_MainPanel.IsAscOrder; m_MainPanel.UpdateSort(sort); } }
/// <summary> /// 絞り込みの表示設定 /// </summary> /// <param name="sortInfo"></param> void SetFilterText(LocalSaveSortInfo sortInfo) { FilterText = ""; string resourcePath = "config"; if (sortInfo != null) { if (SortUtil.CheckFilterWorking(sortInfo.m_FilterRares) == true || SortUtil.CheckFilterWorking(sortInfo.m_FilterElements) == true || SortUtil.CheckFilterWorking(sortInfo.m_FilterKinds) == true) { FilterText = GameTextUtil.GetText("filter_text59"); resourcePath = resourcePath + "_active"; } } if (m_SortButton != null) { m_SortButton.m_ButtonImage.sprite = ResourceManager.Instance.Load(resourcePath); } }
/// <summary> /// フィルタの選択状態をチェック /// </summary> /// <param name="filterType"></param> /// <returns></returns> bool CheckSelectFilter(MAINMENU_FILTER_TYPE filterType, LocalSaveSortInfo sortInfo) { if (sortInfo == null) { return(false); } if (filterType == MAINMENU_FILTER_TYPE.FILTER_RARE) { return(SortUtil.CheckFilterWorking(sortInfo.m_FilterRares)); } else if (filterType == MAINMENU_FILTER_TYPE.FILTER_ELEMENT) { return(SortUtil.CheckFilterWorking(sortInfo.m_FilterElements)); } else if (filterType == MAINMENU_FILTER_TYPE.FILTER_KIND) { return(SortUtil.CheckFilterWorking(sortInfo.m_FilterKinds)); } return(false); }
/// <summary> /// ソート設定を確定させる /// </summary> void ConfirmSortType() { if (m_DialogType == DIALOG_TYPE.UNIT || m_DialogType == DIALOG_TYPE.FRIEND) { if (m_SortData != null) { SortDialogTextButtonListContext item = m_MainPanel.SortButtons.Find((v) => v.IsSelect == true); if (item != null) { m_SortData.m_SortType = (int)item.SortType; } else { m_SortData = SetDefaultSortInfo(m_SortData, m_DialogType); } m_SortData.m_SortIsAscOrder = m_MainPanel.IsAscOrder; // 属性フィルタの設定 m_SortData.m_FilterElements = new int[m_MainPanel.Elements.Count]; m_SortData.m_FilterElements = Array.ConvertAll(m_SortData.m_FilterElements, (v) => - 1); int count = 0; for (int i = 0; i < m_MainPanel.Elements.Count; i++) { if (m_MainPanel.Elements[i].IsSelect == true) { m_SortData.m_FilterElements[count] = (int)m_MainPanel.Elements[i].ElementType; ++count; } } if (count == 0) { m_SortData.m_FilterElements = null; } } } else if (m_DialogType == DIALOG_TYPE.MISSION) { } }
public void UpdateData(LocalSaveSortInfo sortInfo) { if (sortInfo != null) { for (int i = 0; i < SortCells.Count; i++) { MAINMENU_SORT_SEQ sortType = MAINMENU_SORT_SEQ.SEQ_INIT; bool isAscOrder = true; if (sortInfo != null && sortInfo.m_FavoriteSorts != null) { if (sortInfo.m_FavoriteSorts.Length > i) { sortType = (MAINMENU_SORT_SEQ)sortInfo.m_FavoriteSorts[i].m_SortType; isAscOrder = sortInfo.m_FavoriteSorts[i].m_IsAscOrder; } } SetSortType(sortType, i); SortCells[i].IsAscOrder = isAscOrder; } IsOnUsePriority = sortInfo.m_FavoriteSortIsUsePriority; } }
/// <summary> /// ソート実行(データのみ) /// </summary> /// <param name="sortInfo"></param> public void ExecSortOnly(LocalSaveSortInfo sortInfo) { SetUpSortData(sortInfo); Units = m_unitBaseList.Exec(SORT_OBJECT_TYPE.UNIT_LIST); }
public void SetSortData(LocalSaveSortInfo sortData) { m_SortData = SetDefaultSortInfo(sortData, m_DialogType); }
/// <summary> /// ソート&フィルタ情報の設定 /// </summary> /// <param name="sortInfo"></param> public void SetUpSortData(LocalSaveSortInfo sortInfo) { ClearSortInfo(); ClearFilter(); //-------------------------------- // ソートの設定 //-------------------------------- if (sortInfo != null) { if (sortInfo.m_SortType == (int)MAINMENU_SORT_SEQ.SEQ_SORT_TYPE_FAVORITE_SORT) { // お好みソート if (sortInfo != null && sortInfo.m_FavoriteSorts != null) { // 使用中優先 if (sortInfo.m_FavoriteSortIsUsePriority) { AddSortInfo(SORT_PARAM.PARTY, SORT_ORDER.ASCENDING); } // ソート for (int i = 0; i < sortInfo.m_FavoriteSorts.Length; i++) { SORT_PARAM sortparam = SortUtil.GetSortParam((MAINMENU_SORT_SEQ)sortInfo.m_FavoriteSorts[i].m_SortType); if (sortparam == SORT_PARAM.NONE) { continue; } AddSortInfo(sortparam, (sortInfo.m_FavoriteSorts[i].m_IsAscOrder) ? SORT_ORDER.ASCENDING : SORT_ORDER.DESCENDING); } } } else if (sortInfo.m_SortType != (int)MAINMENU_SORT_SEQ.SEQ_SORT_TYPE_DEFAULT) { // 通常ソート SORT_PARAM sortparam = SortUtil.GetSortParam((MAINMENU_SORT_SEQ)sortInfo.m_SortType); if (sortparam != SORT_PARAM.NONE) { AddSortInfo(sortparam, (sortInfo.m_SortIsAscOrder) ? SORT_ORDER.ASCENDING : SORT_ORDER.DESCENDING); } } } //-------------------------------- // フィルタの設定 //-------------------------------- if (sortInfo != null) { // レア度 if (SortUtil.CheckFilterWorking(sortInfo.m_FilterRares)) { AddFilter <int>(SORT_PARAM.RARITY, sortInfo.m_FilterRares); } // 属性 if (SortUtil.CheckFilterWorking(sortInfo.m_FilterElements)) { AddFilter <int>(SORT_PARAM.ELEMENT, SortUtil.GetFilterNumElements(sortInfo.m_FilterElements)); } // 種族 if (SortUtil.CheckFilterWorking(sortInfo.m_FilterKinds)) { if (sortInfo.m_FilterIsIncludeKindsSub) { AddFilter <int>(new SORT_PARAM[] { SORT_PARAM.KIND, SORT_PARAM.SUB_KIND }, SortUtil.GetFilterNumKindss(sortInfo.m_FilterKinds)); } else { AddFilter <int>(SORT_PARAM.KIND, SortUtil.GetFilterNumKindss(sortInfo.m_FilterKinds)); } } } }
void OnClickSortThread(LocalSaveSortInfo sortInfo) { m_UnitGrid.ExecSortOnly(sortInfo); }
void OnClickCloseButton(LocalSaveSortInfo sortInfo) { LocalSaveManager.Instance.SaveFuncSortFilterPartyForm(sortInfo); }