// Token: 0x060019FA RID: 6650 RVA: 0x002C1810 File Offset: 0x002BFA10 public override void UpdateUI(int arg1, int arg2) { if (this.Delay > 0) { return; } CastleSkin._SortType curSortType = GUIManager.Instance.BuildingData.castleSkin.curSortType; if (curSortType != this.ListSortType) { this.LastSelect = null; byte b; this.AllCastleID = GUIManager.Instance.BuildingData.castleSkin.GetAllCastleID(this.ListSortType, out b); int num = this.ItemsHeight.Count - (int)b; if (num < 0) { short num2 = 0; while ((int)num2 > num) { this.ItemsHeight.Insert(this.ItemsHeight.Count - 1, 120f); num2 -= 1; } } else if (num > 0) { byte b2 = 0; while ((int)b2 < num) { this.ItemsHeight.RemoveAt(this.ItemsHeight.Count - 1); b2 += 1; } } this.CastleLv = GUIManager.Instance.BuildingData.GetBuildData(8, 0).Level; Vector2 anchoredPosition = this.ScrollRect.anchoredPosition; int beginIdx = this.CastleView.GetBeginIdx(); this.CastleView.AddNewDataHeight(this.ItemsHeight, true, true); this.CastleView.GoTo(beginIdx, anchoredPosition.x); } else { for (int i = 0; i < this.ViewItem.Length; i++) { this.ViewItem[i].UpdateSelf(); if ((ushort)this.ViewItem[i].CastleID == this.SelectedCastleID) { this.ViewItem[i].SetSelect(true); this.LastSelect = this.ViewItem[i]; } } } this.Hint.Update(); }
// Token: 0x06001148 RID: 4424 RVA: 0x001E7D94 File Offset: 0x001E5F94 public ushort[] GetAllCastleID(CastleSkin._SortType type, out byte count) { if (type == this.SortType) { count = this.SortCount; return(this.SortCastleID); } this.SortType = type; this.SortCount = 0; for (int i = 0; i < this.CastleSkinTable.TableCount; i++) { if (this.SortType == CastleSkin._SortType.Own) { if (this.CheckUnlock((byte)(i + 1))) { ushort[] sortCastleID = this.SortCastleID; byte sortCount; this.SortCount = (sortCount = this.SortCount) + 1; sortCastleID[(int)sortCount] = (ushort)(i + 1); } } else { ushort[] sortCastleID2 = this.SortCastleID; byte sortCount; this.SortCount = (sortCount = this.SortCount) + 1; sortCastleID2[(int)sortCount] = (ushort)(i + 1); } } this.SortComparer.type = this.SortType; Array.Sort <ushort>(this.SortCastleID, 0, (int)this.SortCount, this.SortComparer); if (this.SortCastleID.Length - 1 > (int)this.SortCount) { this.SortCastleID[(int)this.SortCount] = 0; } count = this.SortCount; return(this.SortCastleID); }