Thread Tools Display Modes
09-07-16, 06:13 AM   #1
Katai
A Defias Bandit
Join Date: Sep 2016
Posts: 2
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

Last edited by Katai : 09-07-16 at 06:17 AM.
  Reply With Quote
09-07-16, 07:32 AM   #2
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
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.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
09-07-16, 10:41 AM   #3
Katai
A Defias Bandit
Join Date: Sep 2016
Posts: 2
Originally Posted by Lombra View Post
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!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Drag & Drop Mounts/Pets into empty buttons

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off