Beispiel #1
0
 // Token: 0x06001A23 RID: 6691 RVA: 0x002C460C File Offset: 0x002C280C
 public void OnButtonDown(UIButtonHint sender)
 {
     if (sender.Parm1 == 0)
     {
         GUIManager.Instance.m_Hint.Show(sender, UIHintStyle.eHintSimple, 2, 240f, 20, (int)this.CurUseCastleID, 0, Vector2.zero, UIButtonHint.ePosition.Original);
     }
     else
     {
         sender.GetTipPosition(this.Hint.ThisTransform, UIButtonHint.ePosition.Original, null);
         this.Hint.Show((ushort)this.CurUseCastleID);
     }
     AudioManager.Instance.PlayUISFXIndex(UIClickSoundIndex.Normal);
 }
Beispiel #2
0
    // Token: 0x060019DC RID: 6620 RVA: 0x002BF238 File Offset: 0x002BD438
    public void OnButtonDown(UIButtonHint sender)
    {
        this.HintText.text = DataManager.Instance.mStringTable.GetStringByID((uint)sender.Parm1);
        Vector2 vector = this.RectHint.sizeDelta;

        vector.y = this.HintText.preferredHeight + 16f;
        this.RectHint.sizeDelta = vector;
        sender.GetTipPosition(this.RectHint, UIButtonHint.ePosition.Original, null);
        vector    = this.RectHint.anchoredPosition;
        vector.x += 20f;
        vector.y -= 2f;
        this.RectHint.anchoredPosition = vector;
        this.RectHint.gameObject.SetActive(true);
        AudioManager.Instance.PlayUISFXIndex(UIClickSoundIndex.Normal);
    }
Beispiel #3
0
    // Token: 0x06001C23 RID: 7203 RVA: 0x0031BA64 File Offset: 0x00319C64
    public void Show(UIButtonHint hint, UIHintStyle eStyle, byte kind, float width, int fontsize, CString Content, Vector2 upsetPos)
    {
        if (this.HintStyle[(int)eStyle] == null)
        {
            this.HintStyle[(int)eStyle] = this.CreateHintStyle(eStyle);
        }
        if (this.Style != null)
        {
            this.Style.SetActive(false);
        }
        this.Style = this.HintStyle[(int)eStyle];
        if (this.Style == null)
        {
            return;
        }
        this.ResetVal();
        Vector2 sizeDelta = this.Recttrans.sizeDelta;

        sizeDelta.x = width;
        this.Recttrans.sizeDelta = sizeDelta;
        this.Style.SetContent((int)kind, fontsize, width, Content);
        this.Recttrans.sizeDelta = this.Style.GetSize();
        this.HintFrame.sprite    = this.Style.HintFrameSprite;
        this.HintFrame.material  = this.Style.HintFrameMat;
        if (this.HintFrame.sprite == null)
        {
            this.HintFrame.enabled = false;
        }
        else
        {
            this.HintFrame.enabled = true;
        }
        hint.GetTipPosition(this.Recttrans, UIButtonHint.ePosition.Original, new Vector3?(upsetPos));
        this.gameObject.SetActive(true);
        this.Style.SetActive(true);
        this.ButtonHint = hint;
    }
Beispiel #4
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;
    }
Beispiel #5
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;
    }