Esempio n. 1
0
    // Token: 0x06001534 RID: 5428 RVA: 0x00241EDC File Offset: 0x002400DC
    public void GetTipPosition(Transform HintTransform, UIButtonHint.ePosition position = UIButtonHint.ePosition.Original, Vector3?upsetPoint = null)
    {
        RectTransform rectTransform  = HintTransform as RectTransform;
        RectTransform rectTransform2 = this.recttransform;

        if (rectTransform == null)
        {
            return;
        }
        Vector2 size = GUIManager.Instance.m_MessageBoxLayer.rect.size;

        rectTransform2.position = rectTransform.position;
        Vector3 vector = rectTransform2.anchoredPosition3D;

        if (GUIManager.Instance.bOpenOnIPhoneX)
        {
            size.x -= GUIManager.Instance.IPhoneX_DeltaX * 2f;
        }
        if (position == UIButtonHint.ePosition.Original)
        {
            vector.x += rectTransform.rect.x;
            vector.y += rectTransform.rect.y;
        }
        else
        {
            vector.x -= rectTransform2.rect.width;
            vector.y += rectTransform.rect.y - rectTransform.rect.height;
        }
        if (upsetPoint != null)
        {
            vector += upsetPoint.Value;
        }
        vector.z = 0f;
        if (vector.x + rectTransform2.sizeDelta.x > size.x)
        {
            vector.x = size.x - rectTransform2.sizeDelta.x;
        }
        else if (vector.x < 0f)
        {
            vector.x = 0f;
        }
        if (vector.y + rectTransform.rect.height + rectTransform2.sizeDelta.y <= 0f)
        {
            vector.y += rectTransform.rect.height + rectTransform2.sizeDelta.y;
        }
        else if (-1f * vector.y + rectTransform2.sizeDelta.y > size.y)
        {
            vector.y = -1f * (size.y - rectTransform2.sizeDelta.y);
        }
        if (vector.y > -60f)
        {
            vector.y = -60f;
        }
        rectTransform2.anchoredPosition3D = vector;
    }
Esempio 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;
    }
Esempio n. 3
0
    // Token: 0x06001C26 RID: 7206 RVA: 0x0031BE2C File Offset: 0x0031A02C
    public void ShowPetHint(UIButtonHint hint, PetSkillHint.eKind kind, ushort PetID, ushort SkillID, byte Level, Vector2 upsetPos, UIButtonHint.ePosition position = UIButtonHint.ePosition.Original)
    {
        int parm = (int)PetID << 16 | (int)SkillID;

        this.Show(hint, UIHintStyle.eHintPet, (byte)kind, 0f, 0, parm, (int)Level, upsetPos, position);
    }
Esempio n. 4
0
    // Token: 0x06001C24 RID: 7204 RVA: 0x0031BBA4 File Offset: 0x00319DA4
    public void Show(UIButtonHint hint, UIHintStyle eStyle, byte kind, float width, int fontsize, int Parm1, int Parm2, Vector2 upsetPos, UIButtonHint.ePosition position = UIButtonHint.ePosition.Original)
    {
        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, Parm1, Parm2);
        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, position, new Vector3?(upsetPos));
        this.gameObject.SetActive(true);
        this.Style.SetActive(true);
        this.ButtonHint = hint;
    }
Esempio n. 5
0
    // Token: 0x06002C5F RID: 11359 RVA: 0x0048919C File Offset: 0x0048739C
    public void GetTipPosition(RectTransform tipRect, UIButtonHint.ePosition position = UIButtonHint.ePosition.Original, Vector3?upsetPoint = null)
    {
        RectTransform rectTransform = base.transform as RectTransform;

        if (rectTransform == null)
        {
            return;
        }
        Vector2 size = GUIManager.Instance.m_MessageBoxLayer.rect.size;

        tipRect.position = rectTransform.position;
        Vector3 vector = tipRect.anchoredPosition3D;

        if (GUIManager.Instance.bOpenOnIPhoneX)
        {
            size.x -= GUIManager.Instance.IPhoneX_DeltaX * 2f;
        }
        if (this.m_ForcePos)
        {
            if (this.m_HintPosHandler == null)
            {
                vector.x = this.m_HIBtnOffset.x;
                vector.y = this.m_HIBtnOffset.y;
                vector.z = 0f;
                tipRect.anchoredPosition3D = vector;
                tipRect.anchoredPosition   = this.m_HIBtnOffset;
            }
            else
            {
                this.m_HintPosHandler.UpdatePos(rectTransform, tipRect);
            }
            return;
        }
        if (position == UIButtonHint.ePosition.Original)
        {
            vector.x += rectTransform.rect.x;
            vector.y += rectTransform.rect.y;
        }
        else
        {
            vector.x -= tipRect.rect.width;
            vector.y += rectTransform.rect.y - rectTransform.rect.height;
        }
        if (upsetPoint != null)
        {
            vector += upsetPoint.Value;
        }
        vector.z = 0f;
        if (vector.x + tipRect.sizeDelta.x > size.x)
        {
            vector.x = size.x - tipRect.sizeDelta.x;
        }
        if (vector.y + rectTransform.rect.height + tipRect.sizeDelta.y <= 0f)
        {
            vector.y += rectTransform.rect.height + tipRect.sizeDelta.y;
        }
        else if (-1f * vector.y + tipRect.sizeDelta.y > size.y)
        {
            vector.y = -1f * (size.y - tipRect.sizeDelta.y);
        }
        tipRect.anchoredPosition3D = vector;
    }