Neuron

Neuron

98.2k Downloads

Request: Permit MiddleButton in Macros

ifyouwouldplease opened this issue ยท 8 comments

commented

Thanks for your devotion to the addon.
Please allow MiddleButton clicks to fall through to the assigned macro.
Code in ACTIONBUTTON:PreClick sets the button type attribute to "" on a MiddleButton click.
Any time I update Neuron, I comment (currently) line 1535 in ACTIONBUTTON.lua to keep this from happening, then my macros can "see" middle clicks and I've never known of any other problems arising from the change.

commented

I can't find and addon-breaking problems that arise from commenting the code above.
The degree that Neuron cares about MiddleButton, that I can find:

  • If in keybinding, NeuronBinder:OnClick massages "MiddleButton" to be "Button3" before saving the keybind (Neuron-Keybinder.lua line 363)
  • If in Bar config, change the managed bar on middle-click, without displaying/hiding the config window (BAR.lua line 1267)
  • If in normal play, on middle-click, stash the "type" attrib (macro, action, etc) of the button and set type to "" in PreClick, pass along to the click-handling chain, then restore the stashed type to the button in PostClick, resulting in a no-op for the button on middle-click. (ACTIONBUTTON.lua line 1532)

Lastly, I wasn't able to find any decision-making in the Neuron code or the Ace libs that would be affected by the button "type" attribute being empty.
Maybe this code was prep for something that Maul was planning to implement, or left over from something that's been removed? The code was not present in Macaroon vintage 10/2009
Edit: The code is present in Maul's initial commit of Ion to Github on 6/30/2012

commented

Ok I completely re-wrote the drag and drop code for moving spells around the bars. Care to test it for me? Maybe it helps this issue. There's still issues with ShowGrid sadly, and for right now I have the drag icon as a simple questionmark, but the final version will have the spell's icon on the mousecursor when moving abilities around.

I have moved a bunch of code into a new file called ACTIONBUTTON_DragAndDrop.lua, so the line you refrenced before doesn't match up. Can you take a look and find where you want me to look?

commented

Thanks for looking at this. I'm working on this code right now, and I'll get your changes in with the next build. I'll have a testing build out shortly if you don't mind testing for me

commented

Sure, I'll pull and get you an update (will probably be this PM).

commented

Ok I added in a safety check and fixed that error. What does that macro do? There's not 24th slot....

commented

MiddleButton is no longer filtered in the pull from Github today, so the request is met with no further changes.
Edit: Today's version does throw an error with a particular macro, where the current Curse version does not.
Macro:
/use [noswimming] 4 24
Error:

Message: Interface\AddOns\Neuron\Objects/ACTIONBUTTON.lua:923: Invalid spell ID in GameTooltip:SetSpellByID
Time: Mon Apr  1 20:38:10 2019
Count: 19
Stack: Interface\AddOns\Neuron\Objects/ACTIONBUTTON.lua:923: Invalid spell ID in GameTooltip:SetSpellByID
[C]: in function `SetSpellByID'
Interface\AddOns\Neuron\Objects/ACTIONBUTTON.lua:923: in function `SetSpellTooltip'
commented

Hrm. Yes I did change that code, I'll see what's up. I probably just need to do a safety check

commented

It references the 24th slot of the last bag; I put small stacks of pickpocketed food in my last bag, and use the Reno addon to switch which stack is active:

#showtooltip
/reno [button:3] "use-food" noflying
/stopmacro [button:3]
/use [flying] 4 24
/use [noflying] 4 23
/use [flying] 4 22