// Token: 0x060016BC RID: 5820 RVA: 0x00272F54 File Offset: 0x00271154 protected void SetPanelItem(int idx, bool force = false) { if (this.m_panel != null && this.m_panel[idx].Init && this.m_panel[idx].Item && this.PM.CoolDownData != null && this.PM.BuffInfoData != null && (this.m_panel[idx].Item.activeInHierarchy || force) && this.m_panel[idx].ID >= 0 && this.m_panel[idx].ID < PetBuff.PetSkills.Count) { this.m_Buffer[idx].ClearString(); long num = PetBuff.CheckSkillCD((ushort)PetBuff.PetSkills[this.m_panel[idx].ID].ID); GameConstants.GetTimeStringShort(this.m_Buffer[idx], (uint)num); this.m_panel[idx].Item.transform.GetChild(9).GetChild(2).GetComponent <Image>().color = ((num <= 0L) ? Color.white : Color.gray); this.m_panel[idx].Item.transform.GetChild(9).GetChild(2).GetChild(1).GetComponent <Text>().text = ((num <= 0L) ? string.Empty : this.m_Buffer[idx].ToString()); this.m_panel[idx].Item.transform.GetChild(9).GetChild(2).GetChild(1).GetComponent <Text>().cachedTextGenerator.Invalidate(); this.m_panel[idx].Item.transform.GetChild(9).GetChild(2).GetChild(1).GetComponent <Text>().SetAllDirty(); } }
// Token: 0x060016B5 RID: 5813 RVA: 0x00271EA4 File Offset: 0x002700A4 public override void UpdateUI(int arg1, int arg2) { if (arg1 == 5) { if (this.currentBtnID > 0 && this.currentBtnID <= PetBuff.PetSkills.Count) { PetData petData = PetManager.Instance.FindPetData(PetBuff.PetSkills[this.currentBtnID - 1].Pet); PetSkillTbl recordByKey = PetManager.Instance.PetSkillTable.GetRecordByKey((ushort)PetBuff.PetSkills[this.currentBtnID - 1].ID); if (this.m_panel != null) { for (int i = 0; i < this.m_panel.Length; i++) { if (this.m_panel[i].Init && this.m_panel[i].Item && this.m_panel[i].ID >= 0 && this.m_panel[i].ID < PetBuff.PetSkills.Count) { this.m_panel[i].Item.transform.GetChild(9).GetChild(2).GetChild(2).gameObject.SetActive(PetBuff.PetSkills[this.currentBtnID - 1].ID == PetBuff.PetSkills[this.m_panel[i].ID].ID); } } } this.GM.ChangeHeroItemImg(base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(0).GetChild(0).transform, eHeroOrItem.Item, recordByKey.Diamond, 0, 0, 0); if (petData != null && petData.SkillLv != null) { this.m_Str[1].ClearString(); this.m_Str[1].IntToFormat((long)petData.SkillLv[(int)PetBuff.PetSkills[this.currentBtnID - 1].Slot], 1, false); this.m_Str[1].StringToFormat(this.DM.mStringTable.GetStringByID((uint)recordByKey.Name)); this.m_Str[1].AppendFormat(this.DM.mStringTable.GetStringByID(268u)); base.transform.GetChild(1).GetChild(26).GetChild(0).GetComponent <Text>().text = this.m_Str[1].ToString(); this.PM.FormatSkillContent(UIPetSkill.nowSkillId, petData.SkillLv[(int)PetBuff.PetSkills[this.currentBtnID - 1].Slot], this.m_Str[2], 0); } else { base.transform.GetChild(1).GetChild(26).GetChild(0).GetComponent <Text>().text = this.DM.mStringTable.GetStringByID((uint)recordByKey.Name); } base.transform.GetChild(1).GetChild(26).GetChild(0).GetComponent <Text>().SetAllDirty(); base.transform.GetChild(1).GetChild(26).GetChild(0).GetComponent <Text>().cachedTextGenerator.Invalidate(); base.transform.GetChild(1).GetChild(26).GetChild(1).GetComponent <Text>().text = this.m_Str[2].ToString(); base.transform.GetChild(1).GetChild(26).GetChild(1).GetComponent <Text>().SetAllDirty(); base.transform.GetChild(1).GetChild(26).GetChild(1).GetComponent <Text>().cachedTextGenerator.Invalidate(); ushort curItemQuantity = this.DM.GetCurItemQuantity(recordByKey.Diamond, 0); base.transform.GetChild(1).GetChild(26).GetChild(4).GetComponent <Text>().text = string.Format(this.DM.mStringTable.GetStringByID(12559u), curItemQuantity); base.transform.GetChild(1).GetChild(26).GetChild(4).gameObject.SetActive(recordByKey.Diamond > 0); base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(0).gameObject.SetActive(recordByKey.Diamond == 0); base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).gameObject.SetActive(recordByKey.Diamond > 0); base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(2).gameObject.SetActive(curItemQuantity > 0); base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(4).gameObject.SetActive(curItemQuantity == 0); this.UpdateUI(10, 1); } } else if (arg1 == 6) { UIPetSkill.Scrolling = this.SkillRect.anchoredPosition.x; UIPetSkill.Positioning = this.m_scroll.GetTopIdx(); this.Refresh(0); } else if (arg1 == 10) { long num = PetBuff.CheckSkillCD(UIPetSkill.nowSkillId); if (this.currentBtnID > 0 && this.currentBtnID <= PetBuff.PetSkills.Count && num == 0L) { if (arg2 > 0 || !base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(1).gameObject.activeSelf) { PetSkillTbl recordByKey2 = PetManager.Instance.PetSkillTable.GetRecordByKey(UIPetSkill.nowSkillId); PetSkillCoolTbl recordByKey3 = this.PM.PetSkillCoolTable.GetRecordByKey(recordByKey2.CoolDown); PetData petData2 = PetManager.Instance.FindPetData(UIPetSkill.nowPetId); if (petData2 != null && petData2.SkillLv != null) { byte b = petData2.SkillLv[(int)PetBuff.PetSkills[this.currentBtnID - 1].Slot]; if (b > 0 && (int)b <= recordByKey3.CoolBySkillLv.Length) { this.m_Str[3].ClearString(); this.PM.FormatCoolTime(recordByKey3.CoolBySkillLv[(int)(b - 1)], this.m_Str[3], 0); base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(1).GetChild(0).GetComponent <Text>().text = this.m_Str[3].ToString(); base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(1).GetChild(0).GetComponent <Text>().cachedTextGenerator.Invalidate(); base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(1).GetChild(0).GetComponent <Text>().SetAllDirty(); } } } } else { this.m_Str[3].ClearString(); GameConstants.GetTimeString(this.m_Str[3], (uint)num, false, true, false, false, true); base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(0).GetChild(0).GetComponent <Text>().text = this.m_Str[3].ToString(); base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(0).GetChild(0).GetComponent <Text>().cachedTextGenerator.Invalidate(); base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(0).GetChild(0).GetComponent <Text>().SetAllDirty(); } if (num > 0L || base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(4).gameObject.activeSelf) { base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(1).gameObject.SetActive(false); base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(3).gameObject.SetActive(true); } else { base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(3).gameObject.SetActive(false); base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(1).gameObject.SetActive(true); } if (base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(0).GetChild(0).childCount > 1) { base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(0).GetChild(0).GetChild(0).GetComponent <Image>().color = ((num <= 0L) ? Color.white : Color.gray); base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(0).GetChild(0).GetChild(1).GetComponent <Image>().color = ((num <= 0L) ? Color.white : Color.gray); } base.transform.GetChild(1).GetChild(26).GetChild(5).GetComponent <Image>().color = ((num <= 0L) ? Color.white : Color.gray); base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(1).GetComponent <Text>().color = base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(1).GetChild((num <= 0L) ? 0 : 1).GetComponent <Text>().color; base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(2).GetComponent <Text>().color = base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(2).GetChild((num <= 0L) ? 0 : 1).GetComponent <Text>().color; base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(3).GetComponent <Text>().color = base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(3).GetChild((num <= 0L) ? 0 : 1).GetComponent <Text>().color; base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(4).GetComponent <Text>().color = base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(4).GetChild((num <= 0L) ? 0 : 1).GetComponent <Text>().color; base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(1).gameObject.SetActive(num == 0L); base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(0).gameObject.SetActive(num > 0L); if (this.m_UIHint) { this.m_UIHint.Parm1 = ((num <= 0L) ? 0 : 1); } } else if (arg1 == 11) { if (UIPetSkill.nowSkillId > 0) { PetSkillTbl recordByKey4 = PetManager.Instance.PetSkillTable.GetRecordByKey(UIPetSkill.nowSkillId); if (recordByKey4.Type == 1 && recordByKey4.Class >= 1 && (int)recordByKey4.Class <= PetBuff.PetSkillList.Length && this.PM.CoolDownData != null && this.PM.BuffInfoData != null) { if (this.PM.CDFinder != null && this.PM.CDFinder.ContainsKey(UIPetSkill.nowSkillId)) { this.GM.AddHUDMessage(this.DM.mStringTable.GetStringByID(12575u), 255, true); } else if (this.PM.m_PetMarchEventData.PetID > 0 && (ulong)this.PM.m_PetMarchEventData.MarchEventTime.RequireTime + (ulong)this.PM.m_PetMarchEventData.MarchEventTime.BeginTime >= (ulong)this.DM.ServerTime) { this.GM.AddHUDMessage(this.DM.mStringTable.GetStringByID(12576u), 255, true); } else if (recordByKey4.Diamond > 0 && this.DM.GetCurItemQuantity(recordByKey4.Diamond, 0) == 0) { this.GM.MsgStr.ClearString(); this.GM.MsgStr.StringToFormat(this.DM.mStringTable.GetStringByID(14654u)); this.GM.MsgStr.AppendFormat(this.DM.mStringTable.GetStringByID(1545u)); this.GM.OpenMessageBox(this.GM.MsgStr.ToString(), this.DM.mStringTable.GetStringByID(12571u), this.DM.mStringTable.GetStringByID(3968u), this, (int)recordByKey4.Diamond, (int)UIPetSkill.nowSkillId, true, false, false, false, false); } else if (this.PM.BuffImmune.BeginTime > 0L && arg2 > 0) { this.GM.OpenOKCancelBox(this, this.DM.mStringTable.GetStringByID(4840u), this.DM.mStringTable.GetStringByID(12573u), 0, 0, null, null); } else { this.onUse(UIPetSkill.nowPetId, UIPetSkill.nowSkillId); this.UpdateUI(0, 0); } } } } else if (arg1 != 12 || arg2 == UIPetSkill.nowMapPoint) { GUIManager.Instance.CloseMenu(this.m_eWindow); GUIManager.Instance.UIQueueLockRelease(EGUIQueueLock.UIQL_UI_notAllowPopUps); } }