private void Initialize() { this.transOverview = base.transform.Find("BeforeCoalesce"); this.transConfirm = base.transform.Find("ConfirmCoalesce"); this.closeBG = this.transConfirm.Find("CloseBG"); this.coalesceBG = this.transOverview.Find("BG"); this.confirmBG = this.transOverview.Find("TitleBG"); this.btnCoalesceAll = this.transOverview.Find("CoalesceAllBtn/Sprite"); this.btnConfirm = this.transOverview.Find("ConfirmBtn/Sprite"); this.countCompound = this.transOverview.Find("Coalesce/Count").GetComponent <UILabel>(); this.countCost = this.transOverview.Find("Cost/Count").GetComponent <UILabel>(); this.scrollview = this.transConfirm.Find("CheckView").GetComponent <UIScrollView>(); this.gridInfo = this.transConfirm.Find("CheckView/Grid").GetComponent <UIGrid>(); this.runescoalesceinfo = Resources.Load <RunesCoalesceInfo>("Prefab/UI/Sacrificial/RunesAchievementHint"); UIEventListener.Get(this.btnCoalesceAll.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickCoalesce); UIEventListener.Get(this.btnConfirm.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickConfirm); UIEventListener.Get(this.closeBG.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickCloseBG); }
private int SortByCustom(RunesCoalesceInfo a, RunesCoalesceInfo b) { if (!(null != a) || !(null != b)) { return(0); } if (a.Quality > b.Quality) { return(-1); } if (a.Quality < b.Quality) { return(1); } if (a.Count > b.Count) { return(-1); } if (a.Count < b.Count) { return(1); } return(a.ModelID.CompareTo(b.ModelID)); }
private void SetDisplay() { List <EquipmentInfoData> finalList = new List <EquipmentInfoData>(); finalList.AddRange(this.finalmiddleList); finalList.AddRange(this.finalhighList); if (finalList.Count > 0) { this.btnCoalesceAll.GetComponent <UISprite>().alpha = 1f; this.btnCoalesceAll.GetComponent <UIButton>().defaultColor = new Color(255f, 255f, 255f, 1f); this.btnCoalesceAll.GetComponent <UIButton>().hover = new Color(255f, 255f, 255f, 1f); this.btnCoalesceAll.GetComponent <UIButton>().pressed = new Color(255f, 255f, 255f, 1f); if (finalList.Count < this.gridInfo.transform.childCount) { int num = this.gridInfo.transform.childCount - 1; while (finalList.Count != this.gridInfo.transform.childCount) { UnityEngine.Object.DestroyImmediate(this.gridInfo.transform.GetChild(num).gameObject); num--; } } GridHelper.FillGrid <RunesCoalesceInfo>(this.gridInfo, this.runescoalesceinfo, finalList.Count, delegate(int idx, RunesCoalesceInfo comp) { comp.Init(finalList[idx].ModelId, finalList[idx].Count); comp.name = finalList[idx].ModelId.ToString(); }); List <RunesCoalesceInfo> list = new List <RunesCoalesceInfo>(); for (int num2 = 0; num2 != this.gridInfo.transform.childCount; num2++) { list.Add(this.gridInfo.transform.GetChild(num2).GetComponent <RunesCoalesceInfo>()); } list.Sort(new Comparison <RunesCoalesceInfo>(this.SortByCustom)); if (this.gridInfo.transform.childCount == list.Count) { for (int num3 = 0; num3 != list.Count; num3++) { RunesCoalesceInfo runesCoalesceInfo = list[num3]; for (int num4 = 0; num4 != this.gridInfo.transform.childCount; num4++) { if (this.gridInfo.transform.GetChild(num4).name.CompareTo(runesCoalesceInfo.name) == 0) { this.gridInfo.transform.GetChild(num4).name = string.Format("{0:D3}", num3); break; } } } } this.gridInfo.Reposition(); int num5 = 0; for (int i = 0; i < this.finalhighList.Count; i++) { num5 += this.finalhighList[i].Count; } this.countCompound.text = "x" + num5.ToString(); this.countCost.text = this.costMoney.ToString(); this.countCost.color = (((long)this.costMoney <= ModelManager.Instance.Get_userData_X().Money) ? this.lackC : Color.red); } else { this.SetBtnState(); } }