Exemple #1
0
    // Token: 0x0600171C RID: 5916 RVA: 0x0027C960 File Offset: 0x0027AB60
    public void SetEffectExpText(byte lv)
    {
        PetManager instance = PetManager.Instance;
        PetData    petData  = instance.FindPetData(this.m_PetID);

        if (petData == null)
        {
            return;
        }
        PetTbl    recordByKey  = instance.PetTable.GetRecordByKey(petData.ID);
        PetExpTbl recordByKey2 = instance.PetExpTable.GetRecordByKey((ushort)lv);
        uint      num;

        if (this.m_UIType == UIPetLevelUp.EUIType.PetLvUp)
        {
            num = instance.GetNeedExp(lv, recordByKey.Rare);
        }
        else
        {
            num = instance.GetPetSkillMaxExp(this.m_PetID, this.m_Skillidx);
        }
        if (this.m_EffectTextLV != null && this.m_EffectTextExp != null)
        {
            this.m_Str[4].ClearString();
            if (lv == instance.m_PetBeginLv)
            {
                this.m_Str[4].IntToFormat((long)((ulong)(num - instance.m_BeginExp)), 1, false);
            }
            else if (lv == instance.m_PetEndLv)
            {
                this.m_Str[4].IntToFormat((long)((ulong)instance.m_EndExp), 1, false);
            }
            else
            {
                this.m_Str[4].IntToFormat((long)((ulong)num), 1, false);
            }
            this.m_Str[4].AppendFormat(DataManager.Instance.mStringTable.GetStringByID(55u));
            this.m_EffectTextExp.text = this.m_Str[4].ToString();
            this.m_EffectTextExp.SetAllDirty();
            this.m_EffectTextExp.cachedTextGenerator.Invalidate();
        }
    }
Exemple #2
0
    // Token: 0x06002854 RID: 10324 RVA: 0x004465E8 File Offset: 0x004447E8
    public int Compare(ItemCraftDataType x, ItemCraftDataType y)
    {
        PetManager  instance     = PetManager.Instance;
        DataManager instance2    = DataManager.Instance;
        Equip       recordByKey  = instance2.EquipTable.GetRecordByKey(x.ItemID);
        Equip       recordByKey2 = instance2.EquipTable.GetRecordByKey(y.ItemID);
        bool        flag         = false;

        if (recordByKey.EquipKind == 30)
        {
            if (recordByKey2.EquipKind != 30)
            {
                return(-1);
            }
            flag = true;
        }
        else if (recordByKey.EquipKind != 30)
        {
            if (recordByKey2.EquipKind == 30)
            {
                return(1);
            }
            if (recordByKey.EquipKind == 29)
            {
                if (recordByKey2.EquipKind != 29)
                {
                    return(-1);
                }
                PetData petData  = instance.FindPetData(instance2.EquipTable.GetRecordByKey(x.ItemID).SyntheticParts[0].SyntheticItem);
                PetData petData2 = instance.FindPetData(instance2.EquipTable.GetRecordByKey(y.ItemID).SyntheticParts[0].SyntheticItem);
                if (petData != null)
                {
                    if (petData2 != null)
                    {
                        if (petData.Enhance == 2)
                        {
                            if (petData2.Enhance != 2)
                            {
                                return(1);
                            }
                            flag = true;
                        }
                        else
                        {
                            if (petData2.Enhance == 2)
                            {
                                return(-1);
                            }
                            flag = true;
                        }
                    }
                    else
                    {
                        if (petData.Enhance == 2)
                        {
                            return(1);
                        }
                        flag = true;
                    }
                }
                else if (petData2 != null)
                {
                    if (petData2.Enhance == 2)
                    {
                        return(-1);
                    }
                    flag = true;
                }
                else
                {
                    flag = true;
                }
            }
            else
            {
                if (recordByKey2.EquipKind == 29)
                {
                    return(1);
                }
                flag = true;
            }
        }
        if (!flag)
        {
            return(0);
        }
        if (x.mNo < y.mNo)
        {
            return(-1);
        }
        return(1);
    }
Exemple #3
0
    // Token: 0x06001C0D RID: 7181 RVA: 0x0031A124 File Offset: 0x00318324
    public override void SetContent(int kind, int fontsize, float width, int Parm1, int Parm2 = 0)
    {
        PetManager  instance     = PetManager.Instance;
        GUIManager  instance2    = GUIManager.Instance;
        StringTable mStringTable = DataManager.Instance.mStringTable;

        this.Kind    = (PetSkillHint.eKind)kind;
        this.SkillID = (ushort)(Parm1 & 255);
        this.PetID   = (ushort)(Parm1 >> 16);
        this.Level   = (byte)Parm2;
        byte        b           = 0;
        float       num         = 0f;
        PetData     petData     = instance.FindPetData(this.PetID);
        PetSkillTbl recordByKey = instance.PetSkillTable.GetRecordByKey(this.SkillID);

        if (this.Level == 0)
        {
            this.Level = 1;
        }
        if (recordByKey.UpLevel < this.Level)
        {
            this.Level = recordByKey.UpLevel;
        }
        if (this.Kind == PetSkillHint.eKind.State)
        {
            this.SetStateContent(mStringTable.GetStringByID((uint)recordByKey.Name), this.SkillID, this.Level);
            this.HintFrameSprite = this.BackSprite[3];
            this.StateObj.SetActive(true);
            this.OthersObj.SetActive(false);
            return;
        }
        this.StateObj.SetActive(false);
        this.OthersObj.SetActive(true);
        CString cstring = StringManager.Instance.StaticString1024();

        cstring.Append('s');
        cstring.IntToFormat((long)recordByKey.Icon, 5, false);
        cstring.AppendFormat("{0}");
        this.SkillImg.sprite   = instance2.LoadSkillSprite(cstring);
        this.SkillImg.material = instance2.GetSkillMaterial();
        this.NameText.text     = mStringTable.GetStringByID((uint)recordByKey.Name);
        if (recordByKey.Diamond > 0)
        {
            this.CrystalObj.SetActive(true);
            b += 1;
        }
        else
        {
            this.CrystalObj.SetActive(false);
        }
        byte type = recordByKey.Type;

        if (type != 1)
        {
            if (type != 2)
            {
                this.KindText.text = string.Empty;
            }
            else
            {
                this.KindText.text = mStringTable.GetStringByID(10091u);
            }
        }
        else if (recordByKey.Subject == 1)
        {
            this.KindText.text = mStringTable.GetStringByID(10083u);
        }
        else if (recordByKey.Subject == 2)
        {
            this.KindText.text = mStringTable.GetStringByID(10084u);
        }
        else if (recordByKey.Subject == 3)
        {
            this.KindText.text = mStringTable.GetStringByID(10085u);
        }
        else
        {
            this.KindText.text = string.Empty;
        }
        switch (this.Kind)
        {
        case PetSkillHint.eKind.Normal:
        {
            byte needEnhance = this.GetNeedEnhance(petData);
            this.LineObj.SetActive(true);
            this.Contents[0].SetActive(true);
            this.Contents[0].SetData(ref recordByKey, this.Level, PetSkillHint._Content._ShowType.ShowNone, needEnhance, 0, PetSkillHint._Content.eFlag.None);
            if (petData != null && petData.Enhance < needEnhance)
            {
                this.Note.activeSelf = false;
                this.Contents[1].SetActive(true);
                num = 25f;
                this.Contents[1].SetData(ref recordByKey, recordByKey.UpLevel, PetSkillHint._Content._ShowType.ShowMax, needEnhance, this.GetNeedLv(recordByKey.UpLevel, recordByKey.OpenLevel, petData), PetSkillHint._Content.eFlag.None);
            }
            else
            {
                if (recordByKey.Type == 2)
                {
                    this.Note.activeSelf = true;
                }
                else
                {
                    this.Note.activeSelf = false;
                }
                if (this.Level < recordByKey.UpLevel)
                {
                    this.Contents[1].SetActive(true);
                    this.Contents[1].SetData(ref recordByKey, this.Level += 1, PetSkillHint._Content._ShowType.ShowNext, needEnhance, this.GetNeedLv(this.Level, recordByKey.OpenLevel, petData), PetSkillHint._Content.eFlag.None);
                }
                else
                {
                    this.Contents[1].SetActive(false);
                    this.LineObj.SetActive(false);
                }
            }
            break;
        }

        case PetSkillHint.eKind.MaxLv:
            this.Note.activeSelf = false;
            this.LineObj.SetActive(true);
            this.Contents[0].SetActive(true);
            this.Contents[0].SetData(ref recordByKey, this.Level, PetSkillHint._Content._ShowType.ShowNone, 0, 0, PetSkillHint._Content.eFlag.None);
            this.Contents[1].SetActive(true);
            this.Contents[1].SetData(ref recordByKey, recordByKey.UpLevel, PetSkillHint._Content._ShowType.ShowMax, this.GetNeedEnhance(petData), this.GetNeedLv(recordByKey.UpLevel, recordByKey.OpenLevel, petData), PetSkillHint._Content.eFlag.None);
            break;

        case PetSkillHint.eKind.Lv1AndMax:
            this.Note.activeSelf = false;
            this.LineObj.SetActive(true);
            this.Contents[0].SetActive(true);
            this.Contents[0].SetData(ref recordByKey, 1, PetSkillHint._Content._ShowType.ShowNone, 0, 0, PetSkillHint._Content.eFlag.ShowLvOne);
            this.Contents[1].SetActive(true);
            this.Contents[1].SetData(ref recordByKey, recordByKey.UpLevel, PetSkillHint._Content._ShowType.ShowMax, this.GetNeedEnhance(petData), this.GetNeedLv(recordByKey.UpLevel, recordByKey.OpenLevel, petData), PetSkillHint._Content.eFlag.SkipLvCheck);
            break;

        case PetSkillHint.eKind.CurentLv:
            this.LineObj.SetActive(false);
            this.Contents[0].SetActive(true);
            this.Contents[0].SetData(ref recordByKey, this.Level, PetSkillHint._Content._ShowType.ShowNone, 0, 0, PetSkillHint._Content.eFlag.None);
            this.Contents[1].SetActive(false);
            break;

        case PetSkillHint.eKind.Mail:
            this.Note.activeSelf = false;
            this.LineObj.SetActive(false);
            this.Contents[0].SetActive(true);
            this.Contents[0].SetData(ref recordByKey, this.Level, PetSkillHint._Content._ShowType.ShowNone, 0, 0, PetSkillHint._Content.eFlag.Mail);
            this.Contents[1].SetActive(false);
            break;

        default:
            this.Note.activeSelf = false;
            this.LineObj.SetActive(false);
            this.Contents[0].SetActive(false);
            this.Contents[1].SetActive(false);
            break;
        }
        if (this.Contents[0].CoolTime())
        {
            b += 1;
        }
        this.HintFrameSprite = this.BackSprite[(int)b];
        this.DefHeight       = this.DefHeights[(int)b];
        this.Contents[0].rectTransfrom.anchoredPosition = new Vector2(this.Contents[0].rectTransfrom.anchoredPosition.x, -this.DefHeight);
        if (this.LineObj.activeSelf)
        {
            this.LineRect.anchoredPosition = new Vector2(this.LineRect.anchoredPosition.x, this.Contents[0].rectTransfrom.anchoredPosition.y - this.Contents[0].Height - 25f + num);
        }
        if (this.Contents[1].activeSelf)
        {
            this.Contents[1].rectTransfrom.anchoredPosition = new Vector2(this.Contents[1].rectTransfrom.anchoredPosition.x, this.LineRect.anchoredPosition.y - this.LineRect.sizeDelta.y - 13f);
        }
        if (this.Note.activeSelf)
        {
            if (this.Contents[1].activeSelf)
            {
                this.Note.rectTransform.anchoredPosition = new Vector2(this.Note.rectTransform.anchoredPosition.x, this.Contents[1].rectTransfrom.anchoredPosition.y - this.Contents[1].Height);
            }
            else
            {
                this.Note.rectTransform.anchoredPosition = new Vector2(this.Note.rectTransform.anchoredPosition.x, this.Contents[0].rectTransfrom.anchoredPosition.y - this.Contents[0].Height);
            }
        }
        if (this.CanvasRect.sizeDelta.y < this.GetSize().y)
        {
            int num2 = 0;
            while (this.CanvasRect.sizeDelta.y < this.GetSize().y)
            {
                for (int i = 0; i < this.Contents.Length; i++)
                {
                    if (this.Contents[i].activeSelf)
                    {
                        num2 = this.Contents[i].FontShrink();
                    }
                }
                if (this.LineObj.activeSelf)
                {
                    this.LineRect.anchoredPosition = new Vector2(this.LineRect.anchoredPosition.x, this.Contents[0].rectTransfrom.anchoredPosition.y - this.Contents[0].Height - 25f);
                }
                if (this.Contents[1].activeSelf)
                {
                    this.Contents[1].rectTransfrom.anchoredPosition = new Vector2(this.Contents[1].rectTransfrom.anchoredPosition.x, this.LineRect.anchoredPosition.y - this.LineRect.sizeDelta.y - 13f);
                }
                if (num2 == 8)
                {
                    break;
                }
            }
        }
        if (this.Contents[1].activeSelf && (num > 0f || this.Kind == PetSkillHint.eKind.MaxLv || this.Kind == PetSkillHint.eKind.Lv1AndMax))
        {
            this.MaxBackRect.gameObject.SetActive(true);
            this.MaxBackRect.anchoredPosition = new Vector2(this.MaxBackRect.anchoredPosition.x, this.LineRect.anchoredPosition.y - 5f);
            this.MaxBackRect.sizeDelta        = new Vector2(this.MaxBackRect.sizeDelta.x, this.Contents[1].Height + 24f);
        }
        else
        {
            this.MaxBackRect.gameObject.SetActive(false);
        }
    }