コード例 #1
0
    public override void PopulateInfoWindow(ItemToolTip infoWindow, IInventoryItem tipItem)
    {
        infoWindow.AddItemTitle(this, tipItem, 0f);
        infoWindow.AddConditionInfo(tipItem);
        infoWindow.AddSectionTitle("Protection", 0f);
        for (int i = 0; i < 6; i++)
        {
            if (this.armorValues[i] != 0f)
            {
                float      contentHeight = infoWindow.GetContentHeight();
                GameObject obj2          = infoWindow.AddBasicLabel(TakeDamage.DamageIndexToString((DamageTypeIndex)i), 0f);
                GameObject obj3          = infoWindow.AddBasicLabel("+" + ((int)this.armorValues[i]).ToString("N0"), 0f);
                obj3.transform.SetLocalPositionX(145f);
                obj3.GetComponentInChildren <UILabel>().color = Color.green;
                obj2.transform.SetLocalPositionY(-(contentHeight + 10f));
                obj3.transform.SetLocalPositionY(-(contentHeight + 10f));
            }
        }
        infoWindow.AddSectionTitle("Equipment Slot", 20f);
        string text = "Head, Chest, Legs, Feet";

        if ((base._itemFlags & Inventory.SlotFlags.Head) == Inventory.SlotFlags.Head)
        {
            text = "Head";
        }
        else if ((base._itemFlags & Inventory.SlotFlags.Chest) == Inventory.SlotFlags.Chest)
        {
            text = "Chest";
        }
        infoWindow.AddBasicLabel(text, 10f);
        infoWindow.AddItemDescription(this, 15f);
        infoWindow.FinishPopulating();
    }
コード例 #2
0
    public void ForceUpdate()
    {
        DamageTypeList      armorValues;
        HumanBodyTakeDamage damage;

        if (RPOS.GetObservedPlayerComponent <HumanBodyTakeDamage>(out damage))
        {
            armorValues = damage.GetArmorValues();
        }
        else
        {
            armorValues = new DamageTypeList();
        }
        this.leftText.text  = string.Empty;
        this.rightText.text = string.Empty;
        for (int i = 0; i < 6; i++)
        {
            if (armorValues[i] != 0f)
            {
                this.leftText.text = this.leftText.text + TakeDamage.DamageIndexToString((DamageTypeIndex)i) + "\n";
                string   text      = this.rightText.text;
                object[] objArray1 = new object[] { text, "+", (int)armorValues[i], "\n" };
                this.rightText.text = string.Concat(objArray1);
            }
        }
    }
コード例 #3
0
ファイル: RPOSArmorWindow.cs プロジェクト: sknchan/LegacyRust
    public void ForceUpdate()
    {
        DamageTypeList      damageTypeList;
        HumanBodyTakeDamage humanBodyTakeDamage;

        damageTypeList      = (!RPOS.GetObservedPlayerComponent <HumanBodyTakeDamage>(out humanBodyTakeDamage) ? new DamageTypeList() : humanBodyTakeDamage.GetArmorValues());
        this.leftText.text  = string.Empty;
        this.rightText.text = string.Empty;
        for (int i = 0; i < 6; i++)
        {
            if (damageTypeList[i] != 0f)
            {
                UILabel uILabel = this.leftText;
                uILabel.text = string.Concat(uILabel.text, TakeDamage.DamageIndexToString((DamageTypeIndex)i), "\n");
                UILabel uILabel1 = this.rightText;
                string  str      = uILabel1.text;
                uILabel1.text = string.Concat(new object[] { str, "+", (int)damageTypeList[i], "\n" });
            }
        }
    }
コード例 #4
0
 public static string DamageIndexToString(int index)
 {
     return(TakeDamage.DamageIndexToString((DamageTypeIndex)index));
 }