Neuron

Neuron

98.2k Downloads

Bug with putting icons on bars

Addonman opened this issue ยท 9 comments

commented

With latest version something weird happens with buttons.I was trying to put new icons from spellbook into bars since i had old icons without names and just wanted to see buttons with names on them .Weird part is that it works for only 1 icon i try to replace but when i try to go for 2nd i just get old 1st icon without name instead of 2nd spell with icon+name.If i reload ui i can put 1 icon on bars and bug starst all over.Also left or right mouse click anywhere on scrren seems to "activate" what seems like edit mode of bars -showing bars with all grid but without ability to edit anything.
i dont get any error just need to reload ui for each spell that i want to replace

commented

yeah that's a bug for sure, I'll fix it asap.

commented

Wow so this is actually a surprisingly complex issue.
The issue was this (just documenting my thoughts at this point, feel free to skip), originally Neuron would handle all the macro dragging/dropping internally, caching the macro name/icon/text once it's picked up, and clearing the previous button and applying the cached settings to the new button. This also came with a nice effect where the mouse cursor would take the icon of the macro being dragged.

The issue stemmed from Legion incorporating a change that made it so querying a spells icon returns back a texture ID #, but the SetCursor() function requires the physical location of a texture file. And unfortunately we have no way of getting the texture file's name just from the texture ID alone. This as it is right now I can't get the cursor to take the "appearance" of the icon being dragged.

Around when Legion came out, the previous maintainer wrote some code that as a 'hack' instead of directly dragging the macro from one button to another and setting the cursor texture ourselves, he would create a on-the-fly WoW Macro (the built in to the game kind) called "NeuronTemp", he would then load that onto the cursor to drag, and the drop that in an ability button, and then delete NeuronTemp. Now, the perks of this is that it allows you to drag a button from Neuron to any bar really. It just gets treated as a WoW Macro at that point. It also allows you to have the nice look of the cursor getting changed to the appropriate icon. However, the downside to how he implemented it is that he didn't do it right, and he kept all the original code in as well, so he would drop the WoW Macro AND cache all the previous settings, hence the weird unpredictable behavior.

Now, I'm not sure which way to solve this problem. I can surely follow the previous hack (but do it right this time) and create a temp WoW Macro for the purposes of copying the ability, and then deleting it. However this comes with some major issues, 1 being that it's slow, 2 being that it's not elegant, 3 being that it puts a restriction on how long Neuron Macros can be, and 4 being that if someone has used up all their WoW macro slots, they can no longer drag any buttons around. However, with the original Neuron implementation it works perfectly, but you don't get the cursor changing to the ability icon, and right now dragging abilities off the bar is buggy and the game isn't letting go of the cached settings once you click the button off (but this is probably fixable).

commented

Fixed in new release

commented

Tested fix.Its working only half way.Seems i didnt get bars on end,but switching spells works only for 1st time .Tested it little further-so if you switching spell book to button where you want spell to go it works for only 1st time it seems,but if you drag spell to empty space on bar and you pull it out there 1 or 2 times then you get spell (with name) and you can move spell to button where you really wanted it.And to me it seems that draging keeps in cache that first button you wanted to replace.

commented

Ugh alright, back to the drawing board lol.

commented

I can't seem to replicate this. No matter how many times I try dragging stuff around and from the spellbook it seems to always work. Can you give me an order of steps 1) 2) 3) etc., that you can use that always experiences this issue?

commented

I have old buttons without names on them,i pick spell from spellbook to replace,put that spell on bar.1st time it works.I go for 2nd spell and pick up 2nd spell and go to replace it and instead of getting that 2nd spell i get 1st spell i was trying to replace like it was stuck in memory of my mouse pointer and evrywhere i try to put it down i get that 1st spell.
In case of reload i can replace spell 1st time but 2nd time same thing happens.
I tried testing something on my rouge-lets say i have already Faint on bars and i tried to replace it with Distract ,it works.Then i go for Faint again,again,again and you would assume i get Faint every time on bar,but thats not case-i get Faint,Distract,Faint,... you get my point.
It seems to me like you said that NeuronTemp or whatever you calling it isnt clearing its memory properly or at all so you get this unusall behavior.
Just to be sure and for fun I tried after all this steps draging some other spell ( like 3-4) in that position and what did i get-Faint,Distract,Faint,Distract no matter what spell i tried to drag.

commented

ooooh I see. Dragging and replacing multiple spells straight from the spellbook. Got it! Will fix this when I get home depending on my intoxication level

commented

It also doesn't seem to be able to shed the button after the 'drop'.
if I drag 'anyspell' to an empty grid space, I continue to drag 'anyspell' after I have dropped it in the grid. If I drag 'anyspell' to a used grid space, I pick up 'oldspell' and drag that around. I used to be able to shed it with an 'Esc' but that no longer works for me. Until I reloadui, the cursor will always show the grabhand as i pass over a bar/button and continue to try to swap the button.