Пример #1
0
    void ShowConsommableInteraction(int itemSelectedIndex)
    {
        AConsommable <TModuleType> consommable = this.inventory.Consommables[itemSelectedIndex];
        string text = MultiResolutions.Font(13) + "<color=red>" + consommable.Name + "\n" + consommable.Description + "\n</color></size>\n";
        Rect   rect = StuffGUI <TModuleType> .GetRectOfMyGUIContent(text, 0.41f, 0.85f);

        float posX = rect.x + rect.width;
        float posY = rect.y;

        StuffGUI <TModuleType> .DisplayItemContent(MultiResolutions.Rectangle(rect), text);

        for (byte i = 0; i < 3; i++)
        {
            GUI.Box(MultiResolutions.Rectangle(posX, posY - 0.050f, 0.06f, 0.025f * 4), "");
        }

        if (GUI.Button(MultiResolutions.Rectangle(posX, posY - 0.050F, 0.06f, 0.025f), MultiResolutions.Font(14) + "<color=#00FF00><b>Sell</b></color></size>"))
        {
            this.itemMgr.Sell(this.itemSelectedIndex, this.itemSelectedFiltre);
        }
        if (GUI.Button(MultiResolutions.Rectangle(posX, posY + 0.025f - 0.050F, 0.06f, 0.025f), MultiResolutions.Font(14) + "<color=#00FF00><b>Throw</b></color></size>"))
        {
            this.itemMgr.ThrowOut(this.itemSelectedIndex, this.itemSelectedFiltre);
        }
        if (GUI.Button(MultiResolutions.Rectangle(posX, posY + 0.025f * 2 - 0.050F, 0.06f, 0.025f), MultiResolutions.Font(14) + "<color=#00FF00><b>Destruct</b></color></size>"))
        {
            this.itemMgr.Destruct(this.itemSelectedIndex, this.itemSelectedFiltre);
        }
        if (GUI.Button(MultiResolutions.Rectangle(posX, posY + 0.025f * 3 - 0.050F, 0.06f, 0.025f), MultiResolutions.Font(14) + "<color=#00FF00><b>Use</b></color></size>"))
        {
            this.itemMgr.UseConsommable(this.itemSelectedIndex);
        }

        //StuffGUI.DisplayItemInteractionBorder(posX, posY, stuff);
    }
Пример #2
0
    public string GetStuffContent(AStuff <TModuleType> stuff)
    {
        AStuff <TModuleType> equippedStuff = this.equipment.EquipmentSlots[((int)stuff.equipmentEmplacement)].Item;
        string text = "";

        text = StuffGUI <TModuleType> .GetStuffTitle(stuff, this.inventory, this.itemSelectedIndex);

        //if (stuff.equipmentEmplacement == e_equipmentEmplacement.Both_Hand &&
        //	(null != equipment.equipmentSlots[((int)e_equipmentEmplacement.Left_Hand)].item || null != equipment.equipmentSlots[((int)e_equipmentEmplacement.Right_Hand)].item))
        //{
        //	//if (null != equipment.equipmentSlots[((int)e_equipmentEmplacement.Left_Hand)].item && null != equipment.equipmentSlots[((int)e_equipmentEmplacement.Right_Hand)].item)
        //	//	text += objectAttributeToString.ComparedDefinedToString(stuff,
        //	//	objectAttributeToString.AdditionListOfObjectAttributeCompared(
        //	//	stuff.GetTheWhiteAttributesCompared(equipment.equipmentSlots[((int)e_equipmentEmplacement.Right_Hand)].item, player),
        //	//	stuff.GetTheWhiteAttributesCompared(equipment.equipmentSlots[((int)e_equipmentEmplacement.Left_Hand)].item, player))) + "</size>";
        //	//if (null != equipment.equipmentSlots[((int)e_equipmentEmplacement.Left_Hand)].item)
        //	//	text += objectAttributeToString.GetTheWhiteAttributesCompared(stuff, equipment.equipmentSlots[((int)e_equipmentEmplacement.Left_Hand)].item, player);
        //	//else if (null != equipment.equipmentSlots[((int)e_equipmentEmplacement.Right_Hand)].item)
        //	//	text += objectAttributeToString.GetTheWhiteAttributesCompared(stuff, equipment.equipmentSlots[((int)e_equipmentEmplacement.Right_Hand)].item, player);
        //}
        if (equippedStuff != null && stuff.equipmentCategory == equippedStuff.equipmentCategory)
        {
            text += this.objectAttributeToString.GetTheWhiteAttributesCompared(stuff, equippedStuff, player);
        }
        else
        {
            text += this.objectAttributeToString.SimpleDefinedToString(stuff, stuff.GetTheWhiteAttributes()) + "</size>";
        }

        //if (stuff.equipmentEmplacement == e_equipmentEmplacement.Both_Hand &&
        //	(null != equipment.equipmentSlots[((int)e_equipmentEmplacement.Left_Hand)].item || null != equipment.equipmentSlots[((int)e_equipmentEmplacement.Right_Hand)].item))
        //{
        //	//if (null != equipment.equipmentSlots[((int)e_equipmentEmplacement.Left_Hand)].item && null != equipment.equipmentSlots[((int)e_equipmentEmplacement.Right_Hand)].item)
        //	//	text += objectAttributeToString.ComparedRandomToString(stuff,
        //	//	objectAttributeToString.AdditionListOfObjectAttributeCompared(
        //	//	stuff.GetTheBlueAttributesCompared(equipment.equipmentSlots[((int)e_equipmentEmplacement.Right_Hand)].item.GetheBlueAttributes()),
        //	//	stuff.GetTheBlueAttributesCompared(equipment.equipmentSlots[((int)e_equipmentEmplacement.Left_Hand)].item.GetheBlueAttributes()))) + "</size>";
        //	//if (null != equipment.equipmentSlots[((int)e_equipmentEmplacement.Left_Hand)].item)
        //	//	text += objectAttributeToString.ComparedRandomToString(stuff, stuff.GetTheWhiteAttributesCompared(equipment.equipmentSlots[((int)e_equipmentEmplacement.Left_Hand)].item, player));
        //	//else if (null != equipment.equipmentSlots[((int)e_equipmentEmplacement.Right_Hand)].item)
        //	//	text += objectAttributeToString.ComparedRandomToString(stuff, stuff.GetTheWhiteAttributesCompared(equipment.equipmentSlots[((int)e_equipmentEmplacement.Right_Hand)].item, player));
        //}
        if (equippedStuff != null && stuff.equipmentEmplacement == equippedStuff.equipmentEmplacement && stuff != equippedStuff && equippedStuff.equipped != e_equipmentEquipped.NOT_EQUIPPED)
        {
            text += this.objectAttributeToString.GetTheBlueAttributesCompared(stuff, equippedStuff);
        }
        else
        {
            text += StuffGUI <TModuleType> .GetTheBlueAttributes(stuff);
        }

        return(text);
    }
Пример #3
0
    public void DisplayKey(ref byte offset, ref byte keyIndex)
    {
        Keys <TModuleType> key = this.inventory.Keys[keyIndex];

        if (GUI.Button(MultiResolutions.Rectangle(0, offset * 0.05f, 0.17f, 0.05f), StuffGUI <TModuleType> .GetKeyName(key)))
        {
            this.SelectThisItem(keyIndex, ItemExtension.FiltreKeys);
        }

        ++keyIndex;
        ++offset;
    }
Пример #4
0
    void ItemInteraction(string text, AStuff <TModuleType> stuff)
    {
        Rect rect = StuffGUI <TModuleType> .GetRectOfMyGUIContent(text, 0.41f, 0.85f);

        float posX = rect.x + rect.width;
        float posY = rect.y;

        StuffGUI <TModuleType> .DisplayItemContent(MultiResolutions.Rectangle(rect), text);

        StuffGUI <TModuleType> .DisplayItemInteractionBorder(posX, posY, stuff);

        this.ItemInteractionBehaviour(ref posX, ref posY, stuff);
    }
Пример #5
0
    public void DisplayClothe(ref byte offset, ref byte clotheIndex)
    {
        AClothe <TModuleType> clothe = this.inventory.Clothes[clotheIndex];

        if (GUI.Button(MultiResolutions.Rectangle(0, offset * 0.05f, 0.17f, 0.05f), StuffGUI <TModuleType> .GetEquippedStuffName(clothe)))
        {
            this.SelectAndMaybeEquipItem(clothe, clotheIndex);
        }

        if (inventory.Clothes[clotheIndex].Selected)
        {
            this.SelectThisItem(clotheIndex, ItemExtension.FiltreClothe);
        }

        ++clotheIndex;
        ++offset;
    }
Пример #6
0
    public void DisplayWeapon(ref byte offset, ref byte weaponIndex)
    {
        AWeapon <TModuleType> weapon = this.inventory.Weapons[weaponIndex];

        if (GUI.Button(MultiResolutions.Rectangle(0, offset * 0.05f, 0.17f, 0.05f), StuffGUI <TModuleType> .GetEquippedStuffName(weapon)))
        {
            this.SelectAndMaybeEquipItem(weapon, weaponIndex);
        }

        if (inventory.Weapons[weaponIndex].Selected)
        {
            this.SelectThisItem(weaponIndex, ItemExtension.FiltreWeapon);
        }

        ++weaponIndex;
        ++offset;
    }
Пример #7
0
    public void ShowItemMesh(int itemIndex)
    {
        Rect rectToPutMesh = new Rect(0.6f, 0.00f, 0.17f, 0.50f);

        if (this.itemSelectedFiltre == ItemExtension.FiltreWeapon)
        {
            var stuff = this.inventory.Weapons[itemIndex];

            this.meshToDisplay = this.CreateAndRotateItemMesh(this.meshToDisplay, stuff.Mesh, StuffGUI <TModuleType> .GetStuffName(stuff), rectToPutMesh, 5f);
        }
        else if (this.itemSelectedFiltre == ItemExtension.FiltreClothe)
        {
            var stuff = this.inventory.Clothes[itemIndex];

            this.meshToDisplay = this.CreateAndRotateItemMesh(this.meshToDisplay, stuff.Mesh, StuffGUI <TModuleType> .GetStuffName(stuff), rectToPutMesh, 5f);
        }
        else if (itemSelectedFiltre == ItemExtension.FiltreKeys)
        {
            var stuff = this.inventory.Keys[itemIndex];

            this.meshToDisplay = this.CreateAndRotateItemMesh(this.meshToDisplay, stuff.Mesh, StuffGUI <TModuleType> .GetKeyName(stuff), rectToPutMesh, 5f);
        }
        //else if (itemSelectedFiltre == ItemExtension.FiltreConsommable)
        //{
        //	var stuff = inventory.consommables[itemIndex];

        //	meshToDisplay = CreateAndRotateItemMesh(meshToDisplay, stuff.mesh, "Consommable", rectToPutMesh, 5f);
        //}
        //Debug.Log(itemIndex);
    }
Пример #8
0
    void Liste()
    {
        GUI.Box(MultiResolutions.Rectangle(0.59f, 0, 0.20f, 1.0f), "");
        GUI.Label(MultiResolutions.Rectangle(0.67f, 0.3f, 1f, 1f), MultiResolutions.Font(20) + "<b><color=red>List</color></b></size>");
        GUI.Box(MultiResolutions.Rectangle(0.61f, 0.35f, 0.17f, 0.45f), "");

        int filtreLength = 0;

        for (short i = 0; i < inventory.Items.Count; i++)
        {
            if ((((filtre & ItemExtension.FiltreAll) != 0) || (filtre & inventory.Items[i].FiltreSkill) != 0) && inventory.Items[i] is Cast <TModuleType> )
            {
                ++filtreLength;
            }
        }

        itemSelectedIndex = 0;
        scrollPosition    = GUI.BeginScrollView(MultiResolutions.Rectangle(0.61f, 0.35f, 0.17f, 0.45f), scrollPosition,
                                                MultiResolutions.Rectangle(0f, 0f, 0.18f, 0.05f * filtreLength));

        int[] indexes = new int[((int)e_itemCategory.SIZE)];
        for (int offset = 0, i = 0; i < inventory.Items.Count; i++)
        {
            if (((filtre & ItemExtension.FiltreAll) != 0) || (filtre == inventory.Items[i].FiltreSkill))
            {
                string equippedString = "";
                //var stuff = inventory.stuffs[indexes[((int)e_itemCategory.Stuff)]] as AStuff;
                var stuff = inventory.Items[i] as Cast <TModuleType>;


                if (stuff != null)
                {
                    equippedString = StuffGUI <TModuleType> .GetEquippedString(stuff);

                    if (GUI.Button(MultiResolutions.Rectangle(0, offset * 0.05f, 0.17f, 0.05f), MultiResolutions.Font(16) +
                                   equippedString + inventory.Items[i].Name + "</size>"))
                    {
                        AStuff <TModuleType> stuffEquipped = inventory.Items[i] as AStuff <TModuleType>;
                        if (null != stuffEquipped && stuffEquipped is Cast <TModuleType> && stuff.Selected && stuffEquipped.equipmentEmplacement != e_equipmentEmplacement.Both_Hand)
                        {
                            if (rightClick)
                            {
                                stuff.equipmentEmplacement = e_equipmentEmplacement.Left_Hand;
                            }
                            else
                            {
                                stuff.equipmentEmplacement = e_equipmentEmplacement.Right_Hand;
                            }

                            itemMgr.Equip(stuff);
                            stuff.Selected = false;
                        }
                        inventory.Select(i);
                    }
                    offset++;
                }

                if (inventory.Items[i].Selected)
                {
                    itemSelectedIndex = i;
                }
            }
            inventory.Items[i].ModifyItemCategoryIndexes(ref indexes);
        }
        GUI.EndScrollView();
    }