public void SelectType(EItemTabType itemType) { if (this.m_ItemType == itemType) { return; } this.Clear(); this.SetTable((ContentSource.Param[]) this.m_Params.Where <ItemListWindow.ItemSource.ItemParam>((Func <ItemListWindow.ItemSource.ItemParam, bool>)(param => param.data.Param.tabtype == itemType)).ToArray <ItemListWindow.ItemSource.ItemParam>()); this.contentController.Resize(0); bool flag = false; Vector2 anchoredPosition = this.contentController.anchoredPosition; Vector2 lastPageAnchorePos = this.contentController.GetLastPageAnchorePos(); if (anchoredPosition.x < lastPageAnchorePos.x) { flag = true; anchoredPosition.x = lastPageAnchorePos.x; } if (anchoredPosition.y < lastPageAnchorePos.y) { flag = true; anchoredPosition.y = lastPageAnchorePos.y; } if (flag) { this.contentController.anchoredPosition = anchoredPosition; } this.contentController.scroller.StopMovement(); this.m_ItemType = itemType; }
private void ChangeTab(EItemTabType tabtype) { if (this.mCurrentTabType == tabtype) { return; } this.RefreshNewPage(tabtype); }
private void RefreshNewPage(EItemTabType tabtype, int page) { this.mCurrentTabType = tabtype; this.mCurrentPage = page; this.mAllItems = this.GetAvailableItems(this.mCurrentTabType); this.mTotalPage = Mathf.CeilToInt((float)this.mAllItems.Count / (float)this.mCellCount); this.RequestItems(); }
private void RefreshNewPage(EItemTabType tabtype) { this.mCurrentTabType = tabtype; int num; this.mCurrentPage = !this.mRecentPages.TryGetValue(tabtype, out num) ? 0 : num; this.mAllItems = this.GetAvailableItems(this.mCurrentTabType); this.mTotalPage = Mathf.CeilToInt((float)this.mAllItems.Count / (float)this.mCellCount); this.RequestItems(); }
private List <ItemParam> GetAvailableItems(EItemTabType tabtype) { IEnumerable <ItemParam> source = MonoSingleton <GameManager> .Instance.MasterParam.Items.Where <ItemParam>((Func <ItemParam, bool>)(item => { if (item.tabtype == tabtype) { return(((IEnumerable <int>) this.mRareFilters).Any <int>((Func <int, bool>)(rare => rare == item.rare))); } return(false); })); return((this.mSortType != GalleryItemListWindow.SortType.Rarity ? (!this.mIsNameAscending ? (IEnumerable <ItemParam>)source.OrderByDescending <ItemParam, string>((Func <ItemParam, string>)(item => item.name)).ToList <ItemParam>() : (IEnumerable <ItemParam>)source.OrderBy <ItemParam, string>((Func <ItemParam, string>)(item => item.name)).ToList <ItemParam>()) : (!this.mIsRarityAscending ? (IEnumerable <ItemParam>)source.OrderByDescending <ItemParam, int>((Func <ItemParam, int>)(item => item.rare)) : (IEnumerable <ItemParam>)source.OrderBy <ItemParam, int>((Func <ItemParam, int>)(item => item.rare)))).ToList <ItemParam>()); }
private void Start() { this.mCellCount = this.GetCellCount(); this.mCurrentTabType = EItemTabType.Used; this.mSettings = this.LoadSetting(); this.mSortType = this.mSettings.sortType; this.mIsRarityAscending = this.mSettings.isRarityAscending; this.mIsNameAscending = this.mSettings.isNameAscending; this.mRareFilters = this.mSettings.rareFilters; this.ChangeFilterButtonSprite(); this.ChangeSortButtonText(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null)) { this.ItemTemplate.SetActive(false); } this.RefreshNewPage(this.mCurrentTabType, 0); }
public bool Deserialize(JSON_ItemParam json) { if (json == null) { return(false); } this.iname = json.iname; this.name = json.name; this.type = (EItemType)json.type; this.tabtype = (EItemTabType)json.tabtype; this.rare = json.rare; this.cap = json.cap; this.invcap = json.invcap; this.equipLv = Math.Max(json.eqlv, 1); this.coin = json.coin; this.tour_coin = json.tc; this.arena_coin = json.ac; this.multi_coin = json.mc; this.piece_point = json.pp; this.buy = json.buy; this.sell = json.sell; this.enhace_cost = json.encost; this.enhace_point = json.enpt; this.value = json.val; this.icon = json.icon; this.skill = json.skill; this.recipe = json.recipe; this.quests = (string[])null; this.is_valuables = json.is_valuables > 0; this.cmn_type = json.cmn_type; if (json.quests != null) { this.quests = new string[json.quests.Length]; for (int index = 0; index < json.quests.Length; ++index) { this.quests[index] = json.quests[index]; } } return(true); }
public override void Release() { base.Release(); this.m_ItemType = EItemTabType.None; }