Exemplo n.º 1
0
 // Token: 0x060017A8 RID: 6056 RVA: 0x002861B0 File Offset: 0x002843B0
 public void OnButtonClick(UIButton sender)
 {
     if (sender.m_BtnID1 == 1)
     {
         if (sender.m_BtnID2 == 1)
         {
             this.GM.CloseMenu(EGUIWindow.UI_PetStoneTrans);
         }
         else if (sender.m_BtnID2 == 2)
         {
             if (this.StoneCount == 0)
             {
                 this.GM.AddHUDMessage(this.DM.mStringTable.GetStringByID(14568u), 255, true);
                 return;
             }
             if (this.UseCount == 0)
             {
                 this.GM.AddHUDMessage(this.DM.mStringTable.GetStringByID(5703u), 255, true);
                 return;
             }
             if (this.GM.bCheckStoneTrans)
             {
                 if (this.MessageStr == null)
                 {
                     this.MessageStr = StringManager.Instance.SpawnString(300);
                 }
                 this.MessageStr.Length = 0;
                 CString cstring = StringManager.Instance.StaticString1024();
                 UIItemInfo.SetNameProperties(null, null, cstring, null, ref this.tmpEquip, null);
                 this.MessageStr.StringToFormat(cstring);
                 this.MessageStr.IntToFormat((long)this.UseCount, 1, false);
                 this.MessageStr.AppendFormat(this.DM.mStringTable.GetStringByID(14587u));
                 this.GM.OpenCheckStoneTrans(this.MessageStr);
             }
             else
             {
                 this.SendTrans();
             }
         }
     }
     else if (sender.m_BtnID1 == 2)
     {
         this.GM.m_UICalculator.m_CalculatorHandler = this;
         this.GM.m_UICalculator.OpenCalculator(this.m_Slider.MaxValue, this.m_Slider.Value, 260f, 100f, this.m_Slider, 0L);
     }
 }
Exemplo n.º 2
0
    // Token: 0x06001BBB RID: 7099 RVA: 0x00313DB0 File Offset: 0x00311FB0
    public void Show(UIButtonHint hint, ushort ItemID, int Num = -1, UIButtonHint.ePosition position = UIButtonHint.ePosition.Original, Vector3?upsetPoint = null)
    {
        if (hint == null)
        {
            return;
        }
        if (GUIManager.Instance.m_LordInfo.m_ButtonHint != null)
        {
            GUIManager.Instance.m_LordInfo.Hide(GUIManager.Instance.m_LordInfo.m_ButtonHint);
        }
        DataManager   instance    = DataManager.Instance;
        RectTransform x           = hint.transform as RectTransform;
        Equip         recordByKey = instance.EquipTable.GetRecordByKey(ItemID);

        if (x == null || recordByKey.EquipKey != ItemID)
        {
            return;
        }
        if (recordByKey.EquipKind - 1 == 4 && GUIManager.Instance.FindMenu(EGUIWindow.Door) != null)
        {
            this.HeroID = recordByKey.SyntheticParts[0].SyntheticItem;
            this.ItemBtnRayCast.blocksRaycasts = true;
            this.InfoIcon.gameObject.SetActive(true);
        }
        else
        {
            this.ItemBtnRayCast.blocksRaycasts = false;
            this.InfoIcon.gameObject.SetActive(false);
        }
        if (this.m_HeroBtn.gameObject.activeSelf)
        {
            this.ItemGo.SetActive(true);
            this.ItemPanel.gameObject.SetActive(true);
            this.HeroPanel.gameObject.SetActive(false);
        }
        ushort num;

        if (Num == -1)
        {
            num = instance.GetCurItemQuantity(ItemID, 0);
        }
        else
        {
            num = (ushort)Num;
        }
        this.m_RectTransform.gameObject.SetActive(true);
        this.m_RectTransform.SetAsLastSibling();
        GUIManager.Instance.ChangeHeroItemImg(this.m_ItemBtn.transform, eHeroOrItem.Item, ItemID, 0, 0, 0);
        UIItemInfo.SetNameProperties(this.m_Name, this.m_Properties, this.NameStr, this.PropertiesStr, ref recordByKey, this.AddionalStr);
        if (this.AddionalStr.Length > 0)
        {
            this.PropertiesStr.Append(this.AddionalStr);
            this.m_Properties.text = this.PropertiesStr.ToString();
            this.m_Properties.SetAllDirty();
            this.m_Properties.cachedTextGenerator.Invalidate();
        }
        Vector2 sizeDelta = this.rectProperties.sizeDelta;
        float   num2      = this.m_Properties.preferredHeight - this.OriTextHeight;

        sizeDelta.y = this.m_Properties.preferredHeight;
        this.rectProperties.sizeDelta = sizeDelta;
        sizeDelta   = this.m_BackRect.sizeDelta;
        sizeDelta.y = Mathf.Max(this.OriHeight, this.OriHeight + num2);
        this.m_BackRect.sizeDelta = sizeDelta;
        this.HeroNameStr.ClearString();
        EItemType eitemType = (EItemType)(recordByKey.EquipKind - 1);

        switch (eitemType)
        {
        case EItemType.EIT_SingleNumSynEquip:
        case EItemType.EIT_MultiNumSynEquip:
            this.HeroNameStr.IntToFormat((long)recordByKey.NeedLv, 1, false);
            this.HeroNameStr.AppendFormat(instance.mStringTable.GetStringByID(148u));
            this.m_ItemLvText.text = this.HeroNameStr.ToString();
            this.m_ItemLvText.SetAllDirty();
            this.m_ItemLvText.cachedTextGenerator.Invalidate();
            this.m_ItemLvText.color  = new Color(0.46f, 1f, 1f);
            this.m_ItemKindText.text = instance.mStringTable.GetStringByID(886u);
            break;

        case EItemType.EIT_SynBook:
            this.m_ItemKindText.text = instance.mStringTable.GetStringByID(255u);
            break;

        case EItemType.EIT_SynBaseEquip:
            this.m_ItemKindText.text = instance.mStringTable.GetStringByID(254u);
            break;

        case EItemType.EIT_HeroStone:
            this.m_ItemKindText.text = instance.mStringTable.GetStringByID(256u);
            break;

        case EItemType.EIT_Consumables:
            this.m_ItemKindText.text = instance.mStringTable.GetStringByID(253u);
            break;

        default:
            if (eitemType != EItemType.EIT_EnhanceStone)
            {
                this.m_ItemKindText.text = string.Empty;
            }
            else
            {
                this.m_ItemKindText.text = instance.mStringTable.GetStringByID(16050u);
            }
            break;

        case EItemType.EIT_CaseByCase:
        {
            ECaseByCaseType ecaseByCaseType = (ECaseByCaseType)recordByKey.PropertiesInfo[0].Propertieskey;
            if (ecaseByCaseType == ECaseByCaseType.ECBCT_PetCore)
            {
                this.m_ItemKindText.text = instance.mStringTable.GetStringByID(14654u);
            }
            else if (ecaseByCaseType == ECaseByCaseType.ECBCT_PetMaterial)
            {
                this.m_ItemKindText.text = instance.mStringTable.GetStringByID(879u);
            }
            else
            {
                this.m_ItemKindText.text = string.Empty;
            }
            break;
        }
        }
        if ((recordByKey.EquipKind != 18 || recordByKey.PropertiesInfo[2].Propertieskey < 1 || recordByKey.PropertiesInfo[2].Propertieskey > 2) && (recordByKey.EquipKind != 11 || recordByKey.PropertiesInfo[0].Propertieskey < 6 || recordByKey.PropertiesInfo[0].Propertieskey > 7))
        {
            if (recordByKey.EquipKind == 19 && recordByKey.PropertiesInfo[3].Propertieskey == 1)
            {
                this.m_OwnedText.text = string.Empty;
            }
            else
            {
                this.OwnedStr.ClearString();
                this.OwnedStr.Append("(");
                this.OwnedStr.IntToFormat((long)num, 1, true);
                this.OwnedStr.AppendFormat(DataManager.Instance.mStringTable.GetStringByID(79u));
                this.OwnedStr.Append(")");
                this.m_OwnedText.color = Color.white;
                this.m_OwnedText.text  = this.OwnedStr.ToString();
                this.m_OwnedText.SetAllDirty();
                this.m_OwnedText.cachedTextGenerator.Invalidate();
            }
        }
        else
        {
            this.m_OwnedText.text = string.Empty;
        }
        if (recordByKey.RecoverPrice > 0u)
        {
            this.PriceStr.ClearString();
            this.PriceStr.IntToFormat((long)((ulong)recordByKey.RecoverPrice), 1, true);
            this.PriceStr.AppendFormat("{0}");
            this.m_Price.text = this.PriceStr.ToString();
            this.m_Price.SetAllDirty();
            this.m_Price.cachedTextGenerator.Invalidate();
            this.m_Coin.enabled = true;
        }
        else
        {
            this.m_Coin.enabled = false;
            this.m_Price.text   = string.Empty;
        }
        hint.GetTipPosition(this.m_BackRect, position, upsetPoint);
        this.m_ItemRect.anchoredPosition = this.m_BackRect.anchoredPosition + this.ItemPosUpset;
        float num3 = -this.m_BackRect.anchoredPosition3D.y + this.m_BackRect.sizeDelta.y;

        if (num3 > GUIManager.Instance.m_MessageBoxLayer.rect.size.y)
        {
            this.m_Properties.fontSize = 18 - Convert.ToInt32((num3 - GUIManager.Instance.m_MessageBoxLayer.rect.size.y) * 0.038f);
            Vector2 sizeDelta2 = this.m_Properties.rectTransform.sizeDelta;
            sizeDelta2.y = Mathf.Max(66f, this.m_Properties.preferredHeight);
            this.m_Properties.rectTransform.sizeDelta = sizeDelta2;
            sizeDelta2   = this.m_BackRect.sizeDelta;
            sizeDelta2.y = Mathf.Max(186f, 123.6f + this.m_Properties.preferredHeight + 14.4f);
            this.m_BackRect.sizeDelta = sizeDelta2;
        }
        this.m_ButtonHint      = hint;
        this.Canvasgroup.alpha = 1f;
    }
Exemplo n.º 3
0
 // Token: 0x06001ED6 RID: 7894 RVA: 0x003AF68C File Offset: 0x003AD88C
 public void UpDateRowItem(GameObject item, int dataIdx, int panelObjectIdx, int panelId)
 {
     if (panelObjectIdx < 9)
     {
         if (!this.bFindScrollComp[panelObjectIdx])
         {
             this.bFindScrollComp[panelObjectIdx]            = true;
             this.ScrollComp[panelObjectIdx].LineImage       = item.transform.GetChild(0).GetComponent <Image>();
             this.ScrollComp[panelObjectIdx].HIBtn           = item.transform.GetChild(1).GetComponent <UIHIBtn>();
             this.ScrollComp[panelObjectIdx].HIBtn.m_Handler = this;
             this.ScrollComp[panelObjectIdx].LEBtn           = item.transform.GetChild(2).GetComponent <UILEBtn>();
             this.ScrollComp[panelObjectIdx].LEBtn.m_Handler = this;
             this.ScrollComp[panelObjectIdx].ItemName        = item.transform.GetChild(4).GetComponent <UIText>();
             this.ScrollComp[panelObjectIdx].ItemCountText   = item.transform.GetChild(5).GetComponent <UIText>();
             this.ScrollComp[panelObjectIdx].RankImg         = item.transform.GetChild(3).GetComponent <Image>();
             this.ScrollComp[panelObjectIdx].RankText        = item.transform.GetChild(3).GetChild(0).GetComponent <UIText>();
             this.ScrollComp[panelObjectIdx].Btn3            = item.transform.GetChild(6).GetComponent <UIButton>();
             this.ScrollComp[panelObjectIdx].Hint3           = item.transform.GetChild(6).GetComponent <UIButtonHint>();
             this.ScrollComp[panelObjectIdx].Hint3.m_Handler = this;
             this.ScrollComp[panelObjectIdx].Hint3.DelayTime = 0.2f;
             this.PriceStr[panelObjectIdx] = StringManager.Instance.SpawnString(30);
             this.NameStr[panelObjectIdx]  = StringManager.Instance.SpawnString(150);
             this.RankStr[panelObjectIdx]  = StringManager.Instance.SpawnString(30);
         }
         if (dataIdx < 0)
         {
             return;
         }
         ushort num  = 1;
         ushort num2 = 1;
         byte   b    = 1;
         bool   flag = false;
         this.NameStr[panelObjectIdx].Length            = 0;
         this.ScrollComp[panelObjectIdx].HIBtn.m_BtnID2 = panelObjectIdx;
         if (this.OpenKind == 1 || this.OpenKind == 4)
         {
             this.ScrollComp[panelObjectIdx].LineImage.color = new Color32(94, 183, 138, byte.MaxValue);
             if (this.tmpEquip.EquipKind == 18)
             {
                 if (this.IsGiftBox(this.BoxID))
                 {
                     if (dataIdx >= this.tmpGB.ItemData.Length)
                     {
                         return;
                     }
                     num  = this.tmpGB.ItemData[dataIdx].ItemID;
                     num2 = this.tmpGB.ItemData[dataIdx].ItemCount;
                 }
                 else
                 {
                     if (dataIdx >= this.tmpLB.ItemData.Length)
                     {
                         return;
                     }
                     num  = this.tmpLB.ItemData[dataIdx].ItemID;
                     num2 = this.tmpLB.ItemData[dataIdx].ItemCount;
                 }
                 Equip recordByKey = this.DM.EquipTable.GetRecordByKey(num);
                 flag = this.GM.IsLeadItem(recordByKey.EquipKind);
                 this.NameStr[panelObjectIdx].Append(this.DM.mStringTable.GetStringByID((uint)recordByKey.EquipName));
                 if (flag)
                 {
                     if (this.EndRank == 0)
                     {
                         this.NameStr[panelObjectIdx].StringToFormat(MallManager.Instance.GetItemRankName(this.BeginRank));
                         this.NameStr[panelObjectIdx].AppendFormat("({0})");
                     }
                     else
                     {
                         this.NameStr[panelObjectIdx].StringToFormat(MallManager.Instance.GetItemRankName(this.BeginRank));
                         this.NameStr[panelObjectIdx].StringToFormat(MallManager.Instance.GetItemRankName(this.EndRank));
                         this.NameStr[panelObjectIdx].AppendFormat(this.DM.mStringTable.GetStringByID(7738u));
                     }
                 }
                 if (recordByKey.EquipKind == 30)
                 {
                     PetTbl recordByKey2 = PetManager.Instance.PetTable.GetRecordByKey(recordByKey.SyntheticParts[0].SyntheticItem);
                     this.RankStr[panelObjectIdx].Length = 0;
                     StringManager.IntToStr(this.RankStr[panelObjectIdx], (long)recordByKey2.Rare, 1, false);
                     this.ScrollComp[panelObjectIdx].RankText.text = this.RankStr[panelObjectIdx].ToString();
                     this.ScrollComp[panelObjectIdx].RankText.SetAllDirty();
                     this.ScrollComp[panelObjectIdx].RankText.cachedTextGenerator.Invalidate();
                     this.ScrollComp[panelObjectIdx].RankImg.gameObject.SetActive(true);
                 }
                 else
                 {
                     this.ScrollComp[panelObjectIdx].RankImg.gameObject.SetActive(false);
                 }
             }
             else
             {
                 if (this.tmpEquip.EquipKind != 19)
                 {
                     return;
                 }
                 if (dataIdx >= this.tmpCB.ItemData.Length)
                 {
                     return;
                 }
                 num  = this.tmpCB.ItemData[dataIdx].ItemID;
                 num2 = this.tmpCB.ItemData[dataIdx].ItemCount;
                 b    = this.tmpCB.ItemData[dataIdx].Rank;
                 Equip recordByKey = this.DM.EquipTable.GetRecordByKey(num);
                 flag = this.GM.IsLeadItem(recordByKey.EquipKind);
                 if (this.tmpCB.ItemData[dataIdx].Rank != 0)
                 {
                     this.NameStr[panelObjectIdx].StringToFormat(MallManager.Instance.GetItemRankName(this.tmpCB.ItemData[dataIdx].Rank));
                     this.NameStr[panelObjectIdx].AppendFormat(this.DM.mStringTable.GetStringByID(7739u));
                 }
                 else if (recordByKey.EquipKind == 18 && this.tmpEquip.PropertiesInfo[0].Propertieskey != 6)
                 {
                     byte itemRank = 1;
                     if (this.tmpEquip.PropertiesInfo[0].Propertieskey == 1)
                     {
                         itemRank = 3;
                     }
                     else if (this.tmpEquip.PropertiesInfo[0].Propertieskey == 2)
                     {
                         itemRank = 4;
                     }
                     else if (this.tmpEquip.PropertiesInfo[0].Propertieskey == 3)
                     {
                         itemRank = 5;
                     }
                     this.NameStr[panelObjectIdx].StringToFormat(MallManager.Instance.GetItemRankName(itemRank));
                     this.NameStr[panelObjectIdx].AppendFormat(this.DM.mStringTable.GetStringByID(7739u));
                 }
                 this.NameStr[panelObjectIdx].Append(this.DM.mStringTable.GetStringByID((uint)recordByKey.EquipName));
             }
         }
         else if (this.OpenKind == 2)
         {
             this.ScrollComp[panelObjectIdx].LineImage.color = new Color32(94, 165, 183, byte.MaxValue);
             if (dataIdx >= this.GM.CommonItemData.Count)
             {
                 return;
             }
             num  = this.GM.CommonItemData[dataIdx].ItemID;
             num2 = this.GM.CommonItemData[dataIdx].Num;
             b    = this.GM.CommonItemData[dataIdx].ItemRank;
             Equip recordByKey = this.DM.EquipTable.GetRecordByKey(num);
             flag = this.GM.IsLeadItem(recordByKey.EquipKind);
             if (this.GM.CommonItemData[dataIdx].ItemRank != 0)
             {
                 this.NameStr[panelObjectIdx].StringToFormat(MallManager.Instance.GetItemRankName(b));
                 this.NameStr[panelObjectIdx].AppendFormat(this.DM.mStringTable.GetStringByID(7739u));
             }
             CString cstring = StringManager.Instance.StaticString1024();
             UIItemInfo.SetNameProperties(null, null, cstring, null, ref recordByKey, null);
             this.NameStr[panelObjectIdx].Append(cstring);
         }
         else if (this.OpenKind == 3)
         {
             this.ScrollComp[panelObjectIdx].LineImage.color = new Color32(94, 165, 183, byte.MaxValue);
             MerchantmanManager instance = MerchantmanManager.Instance;
             if (dataIdx >= (int)instance.MerchantmanExtraData.DataLen)
             {
                 return;
             }
             num  = instance.MerchantmanExtraData.ItemContain[dataIdx].ItemID;
             num2 = instance.MerchantmanExtraData.ItemContain[dataIdx].Num;
             b    = instance.MerchantmanExtraData.ItemContain[dataIdx].ItemRank;
             Equip recordByKey = this.DM.EquipTable.GetRecordByKey(num);
             flag = this.GM.IsLeadItem(recordByKey.EquipKind);
             if (b != 0)
             {
                 this.NameStr[panelObjectIdx].StringToFormat(MallManager.Instance.GetItemRankName(b));
                 this.NameStr[panelObjectIdx].AppendFormat(this.DM.mStringTable.GetStringByID(7739u));
             }
             CString cstring2 = StringManager.Instance.StaticString1024();
             UIItemInfo.SetNameProperties(null, null, cstring2, null, ref recordByKey, null);
             this.NameStr[panelObjectIdx].Append(cstring2);
         }
         if (flag)
         {
             GUIManager.Instance.ChangeLordEquipImg(this.ScrollComp[panelObjectIdx].LEBtn.transform, num, b, eLordEquipDisplayKind.OnlyItem, 0, 0, 0, 0, 0, false);
         }
         else
         {
             GUIManager.Instance.ChangeHeroItemImg(this.ScrollComp[panelObjectIdx].HIBtn.transform, eHeroOrItem.Item, num, 0, 0, 0);
         }
         this.ScrollComp[panelObjectIdx].LEBtn.gameObject.SetActive(flag);
         this.ScrollComp[panelObjectIdx].HIBtn.gameObject.SetActive(!flag);
         this.ScrollComp[panelObjectIdx].Hint3.Parm1 = num;
         this.ScrollComp[panelObjectIdx].Hint3.Parm2 = b;
         if (flag || (!MallManager.Instance.CheckCanOpenDetail(num) && !PetManager.Instance.IsFakePetItem(num)))
         {
             this.ScrollComp[panelObjectIdx].Hint3.enabled = true;
         }
         else
         {
             this.ScrollComp[panelObjectIdx].Hint3.enabled = false;
         }
         this.ScrollComp[panelObjectIdx].Btn3.gameObject.SetActive(this.ScrollComp[panelObjectIdx].Hint3.enabled);
         this.ScrollComp[panelObjectIdx].ItemName.text = this.NameStr[panelObjectIdx].ToString();
         this.ScrollComp[panelObjectIdx].ItemName.SetAllDirty();
         this.ScrollComp[panelObjectIdx].ItemName.cachedTextGenerator.Invalidate();
         this.PriceStr[panelObjectIdx].Length = 0;
         StringManager.IntToStr(this.PriceStr[panelObjectIdx], (long)num2, 1, true);
         this.ScrollComp[panelObjectIdx].ItemCountText.text = this.PriceStr[panelObjectIdx].ToString();
         this.ScrollComp[panelObjectIdx].ItemCountText.SetAllDirty();
         this.ScrollComp[panelObjectIdx].ItemCountText.cachedTextGenerator.Invalidate();
     }
 }