Beispiel #1
0
    // Token: 0x06002B38 RID: 11064 RVA: 0x004757DC File Offset: 0x004739DC
    public void UpdateData(int parm1)
    {
        if (parm1 == -1)
        {
            return;
        }
        GUIManager  instance  = GUIManager.Instance;
        DataManager instance2 = DataManager.Instance;

        this.ItemSN    = (ushort)(parm1 >> 16);
        this.StoreType = (byte)(65535 & parm1);
        bool flag = true;

        if (this.StoreType >> 4 == 1)
        {
            this.StoreType = (15 & this.StoreType);
            flag           = false;
        }
        StoreTbl recordByKey = instance2.StoreData.GetRecordByKey(this.ItemSN);

        this.ItemID = recordByKey.ItemID;
        Equip recordByKey2 = instance2.EquipTable.GetRecordByKey(this.ItemID);

        this.ItemNameText.text = instance2.mStringTable.GetStringByID((uint)recordByKey2.EquipName);
        int num;

        if (this.StoreType == 1)
        {
            num = (int)(instance2.RoleAttr.Diamond / recordByKey.Price);
        }
        else
        {
            num = (int)(instance2.RoleAlliance.Money / recordByKey.AlliancePoint);
        }
        if (flag)
        {
            if (num + (int)instance2.GetCurItemQuantity(this.ItemID, 0) >= 65535)
            {
                num = (int)(ushort.MaxValue - instance2.GetCurItemQuantity(this.ItemID, 0));
            }
        }
        else if (num > 65535)
        {
            num = 65535;
        }
        this.MsgIcon.sprite = this.SpriteArray.GetSprite((int)(this.StoreType + 9));
        this.MsgIcon.SetNativeSize();
        instance.SetUnitResourcesSliderSize(this.slider.transform, eUnitSliderSize.m_slider, 384.5f, -322.2f, 257f, 19f, 0f, (float)num);
        instance.ChangeHeroItemImg(this.ItemRect, eHeroOrItem.Item, this.ItemID, 0, 0, 0);
        this.slider.m_slider.value = 1.0;
        this.AutouseSlider.value   = this.slider.m_slider.value;
        this.slider.Value          = (long)this.slider.m_slider.value;
        this.Cstr.ClearString();
        StringManager.IntToStr(this.Cstr, this.slider.Value, 1, true);
        this.slider.m_inputText.text = this.Cstr.ToString();
        this.slider.m_inputText.SetAllDirty();
        this.slider.m_inputText.cachedTextGenerator.Invalidate();
        this.UpdatePrice();
    }
Beispiel #2
0
    // Token: 0x06001BBC RID: 7100 RVA: 0x003145BC File Offset: 0x003127BC
    public void ShowHero(UIButtonHint hint, ushort HeroID, ushort TeamIndex, ushort ArrayIndex)
    {
        if (hint == null)
        {
            return;
        }
        RectTransform rectTransform = hint.transform as RectTransform;
        DataManager   instance      = DataManager.Instance;
        GUIManager    instance2     = GUIManager.Instance;

        this.m_RectTransform.gameObject.SetActive(true);
        this.m_RectTransform.SetAsLastSibling();
        if (this.m_ItemBtn.gameObject.activeSelf)
        {
            this.ItemGo.SetActive(false);
            this.ItemPanel.gameObject.SetActive(false);
            this.HeroPanel.gameObject.SetActive(true);
        }
        HeroTeam recordByKey  = instance.TeamTable.GetRecordByKey(TeamIndex);
        Hero     recordByKey2 = instance.HeroTable.GetRecordByKey(recordByKey.Arrays[(int)ArrayIndex].Hero);

        if (recordByKey2.HeroTitle > 0)
        {
            this.m_Name.text = instance.mStringTable.GetStringByID((uint)recordByKey2.HeroTitle);
        }
        if (recordByKey.Arrays[(int)ArrayIndex].Type == 3)
        {
            this.BossIcon.gameObject.SetActive(true);
            instance2.ChangeHeroItemImg(this.m_HeroBtn.transform, eHeroOrItem.Hero, recordByKey2.HeroKey, recordByKey.HeroStar, 0, 0);
        }
        else
        {
            this.BossIcon.gameObject.SetActive(false);
            GUIManager.Instance.ChangeHeroItemImg(this.m_HeroBtn.transform, eHeroOrItem.Hero, recordByKey2.HeroKey, 1, 0, 0);
        }
        if (instance.UserLanguage == GameLanguage.GL_Chs)
        {
            this.CNBossIconObj.SetActive(this.BossIcon.gameObject.activeSelf);
            this.BossIcon.gameObject.SetActive(false);
        }
        instance2.tmpString.Remove(0, instance2.tmpString.Length);
        this.m_HeroLV.text     = instance2.tmpString.AppendFormat(instance.mStringTable.GetStringByID(52u), recordByKey.HeroLevel).ToString();
        this.m_HeroName.text   = instance.mStringTable.GetStringByID((uint)recordByKey2.HeroName);
        this.m_Properties.text = instance.mStringTable.GetStringByID((uint)recordByKey2.Summary);
        Vector2 sizeDelta = this.m_Properties.rectTransform.sizeDelta;

        sizeDelta.y = Mathf.Max(66f, this.m_Properties.preferredHeight);
        this.m_Properties.rectTransform.sizeDelta = sizeDelta;
        sizeDelta   = this.m_BackRect.sizeDelta;
        sizeDelta.y = Mathf.Max(180f, 117.6f + this.m_Properties.preferredHeight + 14.4f);
        this.m_BackRect.sizeDelta = sizeDelta;
        hint.GetTipPosition(this.m_BackRect, UIButtonHint.ePosition.Original, null);
        float num = -this.m_BackRect.anchoredPosition3D.y + this.m_BackRect.sizeDelta.y;

        if (num > GUIManager.Instance.m_MessageBoxLayer.rect.size.y)
        {
            this.m_Properties.fontSize = 18 - Convert.ToInt32((num - GUIManager.Instance.m_MessageBoxLayer.rect.size.y) * 0.038f);
            sizeDelta   = this.m_Properties.rectTransform.sizeDelta;
            sizeDelta.y = Mathf.Max(66f, this.m_Properties.preferredHeight);
            this.m_Properties.rectTransform.sizeDelta = sizeDelta;
            sizeDelta   = this.m_BackRect.sizeDelta;
            sizeDelta.y = Mathf.Max(180f, 117.6f + this.m_Properties.preferredHeight + 14.4f);
            this.m_BackRect.sizeDelta = sizeDelta;
        }
        this.m_ButtonHint      = hint;
        this.Canvasgroup.alpha = 1f;
    }