Use this if you are intending to use drag and drop functionality on a visual menu to drag and drop abilities [icons] into equipped slots (abilities/items/etc...) and use said menu to determine what abilities/items/etc... are currently equipped to your character
So basically the idea is there are 16 abilities and 3 slots that you can equip them in, each ability is represented by an icon in the menu, you drag and drop the icons onto the slots to equip them. i have figured out how to get most of it working but i am stuck in the regard of getting the ability icons to return to their original positions once a new one is placed onto the slot.
each ability has 4 instance variables atm (slot1active, slot2active, slot3active and notslotted)
each ability has a text object associated to it and each slot has a text object associated with it
the logic looks like this:
if dropped and overlapping slot1/2/3 then set slot1, slot2, or slot3's text object to the said ability text object
if slot(x) text object = ability(x) text object then set said ability (x)'s icon to slot position and set slot(x)active instance variable to true on that ability
if slot(x)active instance variable is true on given ability then set slot(x)active instance ability to false for all other abilities (this goes through slot1/slot2 and slot3)
if slot(1,2 and 3)active instance variables are false and notslotted is true then set ability icon to original position
simultaneously if any ability is dropped anywhere but slot1,2 or 3 then return to original position
i keep running into the problem that if slot(1,2,3)active instance variables are false then return to position, basically disables the ability to drag and drop them at all, however, if that logic isn't in there they don't return to their original positions. i added the notslotted instance variable in an attempt to disrupt this so it is not active one startup but then becomes active once it is slotted/unslotted, but i am not sure where/how to work in notslotted, or if that is truly the solution.
does anyone have an idea as to how to approach this issue?
my thinking is that there needs to be something that ensures that only 1 ability is slotted at a time on each slot, then something else that triggers the previous ability to return to original position once a new ability is equipped to a given slot. i just am not sure how the logic of this would look.