Quantcast Secure action buttons OnReceiveDrag and mounts - WoWInterface
 
 
Thread Tools Display Modes
08-08-14, 01:02 PM   #1
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Secure action buttons OnReceiveDrag and mounts

I'm experiencing some strange behavior with my custom action buttons (derived from SecureActionButtonTemplate and ActionButtonTemplate) when dragging a mount from the Pet Journal list onto my action button. The resulting arguments in OnReceiveDrag are somewhat ... strange.

Dragging the first mount ("Albino Drake") onto my action button passes the arguments 0, Mount, 268 (kind, value, subtype) to OnReceiveDrag. The first two are as expected. But what the hell is 268? Shouldn't this be 1?
No surprise: /script C_MountJournal.Pickup(268) does not pick up list item 1 (Albino Drake) but item 268 (Mottled Red Raptor ... or whatever it is in your list).

Same problem with any mount that is dragged from a default action button onto my custom button.

Is someone able to confirm or disapprove this problem?

Or do I have to do something with 268 to get the actual list item? Filtering or something?

Last edited by Duugu : 08-08-14 at 01:08 PM.
 
08-08-14, 01:14 PM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
Maybe it is the answer to that universe question?
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
 
08-08-14, 02:41 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,659
subtype isn't going to be the index in the mount journal. That's the actual subtype of the mount. If it's a water mount, flying mount, ground mount, etc, etc.

See here: http://www.wowinterface.com/forums/s...504#post294988


/edit: though I notice 268 isn't included in Gello's list of type id's he's discovered. You might want to double-check yourself, and then post in that thread if that is the case.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh


Last edited by Seerah : 08-08-14 at 02:43 PM.
 
08-08-14, 03:53 PM   #4
Gello
A Firelord
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 488
kind,value in _onreceivedrag is the same as the first two returns in GetCursorInfo().

I get "mount",268 on the Albino Drake also. With spot checking similar mounts, they probably all have unique numbers. Not sure what they mean. They can't be indexes in the journal since many of them are greater than C_MountJournal.GetNumMounts().

When you drag a mount to an action, GetActionInfo() for the slot that contains an Albino Drake is "summonmount",268.

Not sure how to translate that number into knowing what mount it is so you can set a button's texture and attributes. (The obvious attributes I've tried didn't work: "mount"/"mount" "summonmount"/"mount" "summonmount"/"value" etc)

Last edited by Gello : 08-08-14 at 04:02 PM.
 
08-08-14, 09:03 PM   #5
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Ok. Right now my findings are:

As Gello wrote C_MountJournal.GetMountInfo, C_MountJournal.Pickup, and all the other new thingis do expect a 'mount index' number (out of a fixed list of mounts which seems to be character-independent).

As Seerah stated this 'mount index' is not equal to the mounts position within the pet journals mounts list .This list has its own (sequential) index. The corresponding fixed 'mount index' number for an entry can be retrieved from
Code:
MountJournal.cachedMounts[<index of mount position in the pet journal list>]
And there's a cryptically third index with unique numbers which are commited to action buttons.
Via onreceivedrag ... or the return value of GetActionInfo() for a standard buttons ... and such stuff.

For the Albino Drake in my Pet Journal list this ends in:
- A fixed mount index number: 2 (for use with C_MountJournal...)
- A Pet Journal mount list index number: 1 (MountJournal.cachedMounts[1] returns 2)
- A cryptically third index number: 268

I'm stucked.
Pre WoD I used type/spell and the spellID to summon a mount via my secure action buttons.
Now the only thing that is commited to my button is the "cryptically" index number. :/
 
08-08-14, 09:46 PM   #6
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,059
If your action buttons are tied to action slots then you can just call PlaceAction(slot) while the mount is on the cursor.

Otherwise I don't know how you'd tie the number to a mount journal index without looping through, putting each one on the cursor, and caching the result.

Last edited by semlar : 08-08-14 at 09:49 PM.
 
 

WoWInterface » Site Forums » Archived Beta Forums » WoD Beta archived threads » Secure action buttons OnReceiveDrag and mounts

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