WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Drag & Drop Mounts/Pets into empty buttons (https://www.wowinterface.com/forums/showthread.php?t=54417)

Katai 09-07-16 06:13 AM

Drag & Drop Mounts/Pets into empty buttons
 
I'm new when it comes to WoW-Addons, and experimented around with it for the last month.

While covering the basics wasn't too hard, I'm struggling with actually achieving what I'ld like to do: Create an UI window, where I can drag in Mounts/Battle Pets into empty slots (like an action bar) and save the configuration.

I'm able to create the window, add (& handle) buttons, etc - but I can't find a way to just make 1-2 empty buttons that accept Mounts/Pets. If someone can lead me to the right tutorial or explain an easy way to do this, I'm rather sure that I can learn the rest on my own again :)

I tried to look into larger Addons (mainly action bar addons) that do similar stuff with skills, but they are usually too large and confusing to really find the relevant part.

More specifically, how to:
- Add "Empty" buttons (widgets?) to begin with
- Allow certain types of "things" (pets & mounts, in this case) to be dropped - but not other stuff like skills
- Get an information about what was dropped (ID?)
- Pre-Load something when it was saved (example: I dragged in a Sea Turtle and saved. Next time, the button should contain the Sea Turtle)
- Allow dragging out of the button, to remove a "thing"
- Allow dragging over other "things" to replace it's content

I'ld be very happy if someone can point me in the right direction here :)

Ugly example done with Paint: http://imgur.com/a/faGIb

Lombra 09-07-16 07:32 AM

You have to handle the drop functionality "manually", but it should be pretty easy. Just use the OnClick and/or OnDragReceive scripts for your button, and check what's on the cursor using GetCursorInfo.

Katai 09-07-16 10:41 AM

Quote:

Originally Posted by Lombra (Post 318771)
You have to handle the drop functionality "manually", but it should be pretty easy. Just use the OnClick and/or OnDragReceive scripts for your button, and check what's on the cursor using GetCursorInfo.

Thank you so much, I think I can work with this. I'll see if I get anywhere soon, but I was able to identify the cursor contents with GetCursorInfo and "OnClick" now!


All times are GMT -6. The time now is 11:04 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI