コード例 #1
0
ファイル: UIPetSkill.cs プロジェクト: gsoec/lm-source
 // 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();
     }
 }
コード例 #2
0
 // Token: 0x060016C3 RID: 5827 RVA: 0x002734A8 File Offset: 0x002716A8
 protected void SetSkill(bool Casting = true)
 {
     if (!Casting)
     {
         PetBuff.Refreshed = true;
     }
     if (!PetBuff.SkillInit)
     {
         PetBuff.UpdateSkill(0);
     }
     PetBuff.bCasting = Casting;
     for (int i = 0; i < PetBuff.PetSkillList.Length; i++)
     {
         if (PetBuff.PetSkillList[i] != null)
         {
             PetBuff.PetSkillList[i].Sort(PetBuff.PSC);
         }
     }
 }
コード例 #3
0
ファイル: UIPetSkill.cs プロジェクト: gsoec/lm-source
 // 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);
     }
 }
コード例 #4
0
    // Token: 0x060016CA RID: 5834 RVA: 0x002735F8 File Offset: 0x002717F8
    public static bool UpdateSkill(int arg = 0)
    {
        Door door = GUIManager.Instance.FindMenu(EGUIWindow.Door) as Door;

        if (door)
        {
            door.m_PetSkillBtnFlashGO.GetComponent <uTweener>().enabled = !PetBuff.Refreshed;
            door.m_PetSkillBtnFlashGO.GetComponent <Image>().color      = Color.white;
        }
        if (arg > 0 || !PetBuff.SkillInit)
        {
            PetBuff.SkillInit = true;
            for (int i = 0; i < PetBuff.ActiveSkill.Length; i++)
            {
                PetBuff.ActiveSkill[i] = 0;
            }
            for (int j = 0; j < PetBuff.PetSkillList.Length; j++)
            {
                if (PetBuff.PetSkillList[j] == null)
                {
                    PetBuff.PetSkillList[j] = new List <PetBuff.PetSkillData>();
                }
                else
                {
                    PetBuff.PetSkillList[j].Clear();
                }
            }
            for (int k = 0; k < (int)PetManager.Instance.PetDataCount; k++)
            {
                PetData petData = PetManager.Instance.GetPetData((int)((byte)k));
                if (petData != null)
                {
                    PetTbl recordByKey = PetManager.Instance.PetTable.GetRecordByKey(petData.ID);
                    byte   b           = 0;
                    while (recordByKey.PetSkill != null && (int)b < recordByKey.PetSkill.Length)
                    {
                        if (recordByKey.PetSkill[(int)b] > 0 && petData.SkillLv != null && (int)b < petData.SkillLv.Length && petData.Enhance >= b)
                        {
                            PetSkillTbl recordByKey2 = PetManager.Instance.PetSkillTable.GetRecordByKey(recordByKey.PetSkill[(int)b]);
                            if (recordByKey2.Subject > 0 && recordByKey2.Type == 1 && recordByKey2.Class >= 1 && (int)recordByKey2.Class <= PetBuff.PetSkillList.Length && (int)recordByKey2.Subject <= PetBuff.ActiveSkill.Length)
                            {
                                PetBuff.PetSkillList[(int)(recordByKey2.Class - 1)].Add(new PetBuff.PetSkillData((uint)recordByKey.PetSkill[(int)b], b, recordByKey2.Subject, petData.ID));
                            }
                        }
                        b += 1;
                    }
                }
            }
            if (arg > 0)
            {
                PetBuff.Update(6, 0, true);
            }
        }
        for (int l = 0; l < PetBuff.ActiveSkill.Length; l++)
        {
            if (PetBuff.ActiveSkill[l] > 0)
            {
                return(true);
            }
        }
        return(false);
    }
コード例 #5
0
 // Token: 0x060016C8 RID: 5832 RVA: 0x002735B0 File Offset: 0x002717B0
 public static bool CheckActive(int PointID, byte Type = 1)
 {
     return(PetBuff.ShowActive(Type) && GUIManager.Instance.OpenMenu(EGUIWindow.UI_PetSkill, PointID, (int)(Type + 1), false, true, false) != null);
 }
コード例 #6
0
 // Token: 0x060016CD RID: 5837 RVA: 0x00273960 File Offset: 0x00271B60
 public static bool ShowButt(int arg)
 {
     return((PetBuff.UpdateSkill(arg) && PetBuff.ShowActive(0)) || PetManager.Instance.BuffImmune.BeginTime > 0L || PetManager.Instance.NegBuff.Count > 0 || DataManager.Instance.RoleAttr.PetSkillFatigue > 0);
 }
コード例 #7
0
 // Token: 0x060016CC RID: 5836 RVA: 0x00273948 File Offset: 0x00271B48
 public static void Update()
 {
     PetBuff.UpdateSkill(1);
     GUIManager.Instance.UpdateUI(EGUIWindow.Door, 26, 0);
 }