Item Description for Equipped Item

fuelfoundrysix

New member
Hi,

I want to display information for the clicked item as well as the equipped item.

For example, if I click on a weapon, the current clicked weapon and equipped weapon should display stats.

How do I go about to achieve this?

Thank you
 
There are multiple ways to do this.
But it requires some custom code.

You'll want two ItemDescriptions. One for the clicked item and one for the equipment item.

When an item is clicked there is an event that gets called. You can use that event to get the clicked item
Code:
myInventoryGrid.OnItemViewSlotSelected += HandleItemSelected;
myInventoryGrid.OnItemViewSlotClicked += HandleItemClicked;

and find the slot it would be assigned to if equipped.
Once you have the slot, you can get the equipped item and draw the ItemDescription for that
Code:
myEquipmentItemSlotCollection = myInventory.GetItemCollection("Equipment") as ItemSlotCollection;
var slotIndex = myEquipmentItemSlotCollection.GetTargetSlotIndex(myWeapon);
var equippedItemInfo = myEquipmentItemSlotCollection.GetItemInfoAtSlot(slotIndex);


myItemDescription.SetValue(equippedItemInfo);

I hope that helps point you the correct direction.
Note that's only the first solution that came in mind, There are many others to achieve similar results
 
Top