Question about item actions for equipments

Jakuri

New member
Hi,

Currently I'm working on equipments, My characters have two accessory slots. I want
1. Let the action panel's position follow the clicked item slot;
2. Make actions such as "Equip to accessory slot 1" and "Equip to accessory slot 2";
3. When there's only one action, don't let the action panel show, just trigger the action; When there's 2 or more actions, let the action panel show.

Do you have any suggestions? Thank you!
 
I would probably make a custom component for that if I were you. You can reuse some of the functionality from the ItemActionPanel and ItemViewSlotContainerItemActionBinding component, either by copy pasting the parts you want or by inheriting the classes.

This way you can really have complete control on whether you open the action panel or not.

To equip an item within a specific slot (accessory 1 or 2) you will need a custom Item Action which lets you sepcify the slot to add the item to. You'll need to cast the ItemCollection to an ItemSlotCollection to get access to the function that lets you add items to slots by name or index. Check the documentation, there should be some examples of that:

I am currently on vacation until the 3rd, so support is a bit slower than usual. But don't hesitate to ask for pointers if you are unsure on how to proceed.
 
Top