ID:273129
 
I'm trying to figure out ways to MouseDrop() an object into one of my empty object slots. Basically I was to replace one of the four "Empty" slots with the skill I Click() and assign to. Then, be able to replace that skill with another skil if I assign one there, setting the old skill in my Free Skills section. I have no clue on how to do it. I've switched from grids back to the statpanel way and I KNOW it's possible. I've seen it once. Heres an image of this issue.

Perhaps you should think about switching back to grids, seeing as they're generally, well, better.

Anyway, this involves rather simple usage of MouseDrop(). It's not difficult, you just need to not be fazed by the amount of arguments it has, read what each one is in the Reference carefully and use the ones you need. Then do whatever you want according to the arguments' values - in this case you'd want to change vars (preferably one var which contains a list) of the player that represent his slots.
In case you are not aware, note that as only atom objects can have regular mouse control used on them, you'd have to display the "Empty" text using an actual atom instead of a text string, so it's actually interactable. You could use an obj with no icon named "Empty". You won't need to use multiple such dummy objs for each unused row in the statpanel - you can just reuse the same one for each. In fact, you can only create on such obj globally, stored in a global variable, and share that single obj with all of your players, e.g.:
obj/empty
icon = null
name = "Empty"

var/obj/empty/Empty = new() //create an /obj/empty object and store it in a global var named "Empty"
//then you can use that obj from anywhere


Anyway, here's a psuedo-code example of the MouseDrop() override:
mob/player
var/list/skill_slots = list("num1","num3",...)
obj/item/MouseDrop(over_object,src_location,over_location,src_control,over_control,params))
if the control we've been dragged from is our statpanel control and the location was the "Techniques" statpanel (or whatever)
and the same is true for the control we've been dropped on
then get the slot for both the the dragged obj (src)
and the obj it was dropped on
then, swap the 2 objs' slots around
(all this part is done through working with the list)