Beispiel #1
0
    // Token: 0x06002105 RID: 8453 RVA: 0x003EC580 File Offset: 0x003EA780
    public override void OnOpen(int arg1, int arg2)
    {
        this.mOpenType = arg1;
        this.DM        = DataManager.Instance;
        this.GUIM      = GUIManager.Instance;
        this.ActM      = ActivityManager.Instance;
        this.GameT     = base.gameObject.transform;
        this.TTFont    = this.GUIM.GetTTFFont();
        this.door      = (this.GUIM.FindMenu(EGUIWindow.Door) as Door);
        this.mMaT      = this.door.LoadMaterial();
        CString cstring = StringManager.Instance.StaticString1024();

        for (int i = 0; i < 5; i++)
        {
            this.m_CStr[i] = StringManager.Instance.SpawnString(50);
        }
        this.Tmp             = this.GameT.GetChild(1);
        this.Tmp1            = this.Tmp.GetChild(0);
        this.text_Info       = this.Tmp1.GetComponent <UIText>();
        this.text_Info.font  = this.TTFont;
        this.Tmp             = this.GameT.GetChild(2);
        this.Tmp1            = this.Tmp.GetChild(0);
        this.text_Title      = this.Tmp1.GetComponent <UIText>();
        this.text_Title.font = this.TTFont;
        this.Tmp             = this.GameT.GetChild(4);
        this.Tmp1            = this.Tmp.GetChild(2);
        this.btn_Item_L      = this.Tmp1.GetComponent <UILEBtn>();
        Array.Clear(this.ItemID, 0, this.ItemID.Length);
        int  num  = 0;
        int  num2 = 0;
        byte b    = 0;

        if (this.mOpenType == 0)
        {
            KOFPrizeData recordByKey = this.DM.KOFPrize.GetRecordByKey(ActivityManager.Instance.KOWData.EventPrizeID);
            if (recordByKey.PrizeItem != null)
            {
                for (int j = 0; j < 3; j++)
                {
                    this.ItemID[j] = recordByKey.PrizeItem[j].ItemID;
                }
                b    = recordByKey.PrizeItem[0].ItemRank;
                num  = (int)recordByKey.PrizeItem[1].ItemNum;
                num2 = (int)recordByKey.PrizeItem[2].ItemNum;
            }
            this.text_Info.text  = this.DM.mStringTable.GetStringByID(11022u);
            this.text_Title.text = this.DM.mStringTable.GetStringByID(11026u);
        }
        else
        {
            for (int k = 0; k < 3; k++)
            {
                this.ItemID[k] = this.ActM.RewardRankingPrize[k].ItemID;
            }
            b    = this.ActM.RewardRankingPrize[0].Rank;
            num  = (int)this.ActM.RewardRankingPrize[1].Num;
            num2 = (int)this.ActM.RewardRankingPrize[2].Num;
            this.text_Info.text  = this.DM.mStringTable.GetStringByID(11083u);
            this.text_Title.text = this.DM.mStringTable.GetStringByID(11058u);
        }
        Equip recordByKey2 = this.DM.EquipTable.GetRecordByKey(this.ItemID[0]);

        this.GUIM.InitLordEquipImg(this.btn_Item_L.transform, this.ItemID[0], b, eLordEquipDisplayKind.OnlyItem, false, true, 0, 0, 0, 0, 0, false);
        this.tmphint                 = this.btn_Item_L.gameObject.AddComponent <UIButtonHint>();
        this.tmphint.m_eHint         = EUIButtonHint.UILeBtn;
        this.tmphint.m_DownUpHandler = this;
        this.tmphint.Parm1           = recordByKey2.EquipKey;
        this.tmphint.Parm2           = b;
        for (int l = 0; l < 2; l++)
        {
            this.Tmp1        = this.Tmp.GetChild(5 + l);
            this.btn_Itme[l] = this.Tmp1.GetComponent <UIHIBtn>();
            this.GUIM.InitianHeroItemImg(this.btn_Itme[l].transform, eHeroOrItem.Item, 0, 0, 0, 0, true, true, true, false);
        }
        for (int m = 0; m < 5; m++)
        {
            this.Tmp1             = this.Tmp.GetChild(7 + m);
            this.text_Str[m]      = this.Tmp1.GetComponent <UIText>();
            this.text_Str[m].font = this.TTFont;
        }
        this.m_CStr[4].ClearString();
        this.m_CStr[4].Append(this.DM.mStringTable.GetStringByID((uint)recordByKey2.EquipName));
        this.text_Str[4].text = this.m_CStr[4].ToString();
        this.text_Str[4].SetAllDirty();
        this.text_Str[4].cachedTextGenerator.Invalidate();
        this.m_CStr[0].ClearString();
        this.m_CStr[0].IntToFormat((long)num, 1, true);
        if (this.GUIM.IsArabic)
        {
            this.m_CStr[0].AppendFormat("{0}x");
        }
        else
        {
            this.m_CStr[0].AppendFormat("x{0}");
        }
        this.text_Str[0].text = this.m_CStr[0].ToString();
        this.text_Str[0].SetAllDirty();
        this.text_Str[0].cachedTextGenerator.Invalidate();
        recordByKey2 = this.DM.EquipTable.GetRecordByKey(this.ItemID[1]);
        byte equipKind = recordByKey2.EquipKind;

        this.m_CStr[1].ClearString();
        this.GUIM.ChangeHeroItemImg(this.btn_Itme[0].transform, eHeroOrItem.Item, this.ItemID[1], 0, 0, 0);
        if (equipKind == 11)
        {
            this.m_CStr[1].StringToFormat(this.GetItemStr(recordByKey2.PropertiesInfo[0].Propertieskey));
            this.m_CStr[1].IntToFormat((long)((int)(recordByKey2.PropertiesInfo[1].Propertieskey * recordByKey2.PropertiesInfo[1].PropertiesValue) * num), 1, true);
            if (this.GUIM.IsArabic)
            {
                this.m_CStr[1].AppendFormat("{1} {0}");
            }
            else
            {
                this.m_CStr[1].AppendFormat("{0} {1}");
            }
        }
        this.text_Str[1].text = this.m_CStr[1].ToString();
        this.text_Str[1].SetAllDirty();
        this.text_Str[1].cachedTextGenerator.Invalidate();
        this.m_CStr[2].ClearString();
        this.m_CStr[2].IntToFormat((long)num2, 1, true);
        if (this.GUIM.IsArabic)
        {
            this.m_CStr[2].AppendFormat("{0}x");
        }
        else
        {
            this.m_CStr[2].AppendFormat("x{0}");
        }
        this.text_Str[2].text = this.m_CStr[2].ToString();
        this.text_Str[2].SetAllDirty();
        this.text_Str[2].cachedTextGenerator.Invalidate();
        recordByKey2 = this.DM.EquipTable.GetRecordByKey(this.ItemID[2]);
        equipKind    = recordByKey2.EquipKind;
        this.m_CStr[3].ClearString();
        this.GUIM.ChangeHeroItemImg(this.btn_Itme[1].transform, eHeroOrItem.Item, this.ItemID[2], 0, 0, 0);
        if (equipKind == 11)
        {
            this.m_CStr[3].StringToFormat(this.GetItemStr(recordByKey2.PropertiesInfo[0].Propertieskey));
            this.m_CStr[3].IntToFormat((long)((int)(recordByKey2.PropertiesInfo[1].Propertieskey * recordByKey2.PropertiesInfo[1].PropertiesValue) * num2), 1, true);
            if (this.GUIM.IsArabic)
            {
                this.m_CStr[3].AppendFormat("{1} {0}");
            }
            else
            {
                this.m_CStr[3].AppendFormat("{0} {1}");
            }
        }
        this.text_Str[3].text = this.m_CStr[3].ToString();
        this.text_Str[3].SetAllDirty();
        this.text_Str[3].cachedTextGenerator.Invalidate();
        this.Tmp    = this.GameT.GetChild(5);
        this.tmpImg = this.Tmp.GetComponent <Image>();
        cstring.ClearString();
        cstring.AppendFormat("UI_main_close_base");
        this.tmpImg.sprite   = this.door.LoadSprite(cstring);
        this.tmpImg.material = this.mMaT;
        if (this.GUIM.bOpenOnIPhoneX)
        {
            this.tmpImg.enabled = false;
        }
        this.Tmp      = this.GameT.GetChild(5).GetChild(0);
        this.btn_EXIT = this.Tmp.GetComponent <UIButton>();
        cstring.ClearString();
        cstring.AppendFormat("UI_main_close");
        this.btn_EXIT.image.sprite   = this.door.LoadSprite(cstring);
        this.btn_EXIT.image.material = this.mMaT;
        this.btn_EXIT.m_Handler      = this;
        this.btn_EXIT.m_BtnID1       = 0;
        this.btn_EXIT.m_EffectType   = e_EffectType.e_Scale;
        this.btn_EXIT.transition     = Selectable.Transition.None;
        this.GUIM.UpdateUI(EGUIWindow.Door, 1, 2);
        if (this.mOpenType == 0)
        {
            GUIManager.Instance.m_LordInfo.HideEquipVal = true;
        }
    }
Beispiel #2
0
    // Token: 0x06002107 RID: 8455 RVA: 0x003ECF6C File Offset: 0x003EB16C
    public void RefreshItem()
    {
        Array.Clear(this.ItemID, 0, this.ItemID.Length);
        int  num  = 0;
        int  num2 = 0;
        byte b    = 0;

        if (this.mOpenType == 0)
        {
            KOFPrizeData recordByKey = this.DM.KOFPrize.GetRecordByKey(ActivityManager.Instance.KOWData.EventPrizeID);
            if (recordByKey.PrizeItem != null)
            {
                for (int i = 0; i < 3; i++)
                {
                    this.ItemID[i] = recordByKey.PrizeItem[i].ItemID;
                }
                b    = recordByKey.PrizeItem[0].ItemRank;
                num  = (int)recordByKey.PrizeItem[1].ItemNum;
                num2 = (int)recordByKey.PrizeItem[2].ItemNum;
            }
        }
        else
        {
            for (int j = 0; j < 3; j++)
            {
                this.ItemID[j] = this.ActM.RewardRankingPrize[j].ItemID;
            }
            b    = this.ActM.RewardRankingPrize[0].Rank;
            num  = (int)this.ActM.RewardRankingPrize[1].Num;
            num2 = (int)this.ActM.RewardRankingPrize[2].Num;
        }
        Equip recordByKey2 = this.DM.EquipTable.GetRecordByKey(this.ItemID[0]);

        this.GUIM.ChangeLordEquipImg(this.btn_Item_L.transform, this.ItemID[0], b, eLordEquipDisplayKind.OnlyItem, 0, 0, 0, 0, 0, false);
        this.tmphint.Parm1 = recordByKey2.EquipKey;
        this.tmphint.Parm2 = b;
        this.m_CStr[4].ClearString();
        this.m_CStr[4].Append(this.DM.mStringTable.GetStringByID((uint)recordByKey2.EquipName));
        this.text_Str[4].text = this.m_CStr[4].ToString();
        this.text_Str[4].SetAllDirty();
        this.text_Str[4].cachedTextGenerator.Invalidate();
        this.m_CStr[0].ClearString();
        this.m_CStr[0].IntToFormat((long)num, 1, true);
        if (this.GUIM.IsArabic)
        {
            this.m_CStr[0].AppendFormat("{0}x");
        }
        else
        {
            this.m_CStr[0].AppendFormat("x{0}");
        }
        this.text_Str[0].text = this.m_CStr[0].ToString();
        this.text_Str[0].SetAllDirty();
        this.text_Str[0].cachedTextGenerator.Invalidate();
        recordByKey2 = this.DM.EquipTable.GetRecordByKey(this.ItemID[1]);
        byte equipKind = recordByKey2.EquipKind;

        this.m_CStr[1].ClearString();
        this.GUIM.ChangeHeroItemImg(this.btn_Itme[0].transform, eHeroOrItem.Item, this.ItemID[1], 0, 0, 0);
        if (equipKind == 11)
        {
            this.m_CStr[1].StringToFormat(this.GetItemStr(recordByKey2.PropertiesInfo[0].Propertieskey));
            this.m_CStr[1].IntToFormat((long)((int)(recordByKey2.PropertiesInfo[1].Propertieskey * recordByKey2.PropertiesInfo[1].PropertiesValue) * num), 1, true);
            if (this.GUIM.IsArabic)
            {
                this.m_CStr[1].AppendFormat("{1} {0}");
            }
            else
            {
                this.m_CStr[1].AppendFormat("{0} {1}");
            }
        }
        this.text_Str[1].text = this.m_CStr[1].ToString();
        this.text_Str[1].SetAllDirty();
        this.text_Str[1].cachedTextGenerator.Invalidate();
        this.m_CStr[2].ClearString();
        this.m_CStr[2].IntToFormat((long)num2, 1, true);
        if (this.GUIM.IsArabic)
        {
            this.m_CStr[2].AppendFormat("{0}x");
        }
        else
        {
            this.m_CStr[2].AppendFormat("x{0}");
        }
        this.text_Str[2].text = this.m_CStr[2].ToString();
        this.text_Str[2].SetAllDirty();
        this.text_Str[2].cachedTextGenerator.Invalidate();
        recordByKey2 = this.DM.EquipTable.GetRecordByKey(this.ItemID[2]);
        equipKind    = recordByKey2.EquipKind;
        this.m_CStr[3].ClearString();
        this.GUIM.ChangeHeroItemImg(this.btn_Itme[1].transform, eHeroOrItem.Item, this.ItemID[2], 0, 0, 0);
        if (equipKind == 11)
        {
            this.m_CStr[3].StringToFormat(this.GetItemStr(recordByKey2.PropertiesInfo[0].Propertieskey));
            this.m_CStr[3].IntToFormat((long)((int)(recordByKey2.PropertiesInfo[1].Propertieskey * recordByKey2.PropertiesInfo[1].PropertiesValue) * num2), 1, true);
            if (this.GUIM.IsArabic)
            {
                this.m_CStr[3].AppendFormat("{1} {0}");
            }
            else
            {
                this.m_CStr[3].AppendFormat("{0} {1}");
            }
        }
        this.text_Str[3].text = this.m_CStr[3].ToString();
        this.text_Str[3].SetAllDirty();
        this.text_Str[3].cachedTextGenerator.Invalidate();
    }