brittyazel / Neuron

A full-featured World of Warcraft action bar and interface replacement addon
https://www.curseforge.com/wow/addons/neuron
MIT License
31 stars 21 forks source link

Dual spec cleanup #455

Closed ylixir closed 2 years ago

brittyazel commented 2 years ago

Is there a reason you moved the UpdateIcon() code out of Button and into ActionButton? Was it really the case that ActionButton was the only object using the code in Button? I guess that's an oversight on my part.

ylixir commented 2 years ago

Is there a reason you moved the UpdateIcon() code out of Button and into ActionButton? Was it really the case that ActionButton was the only object using the code in Button? I guess that's an oversight on my part.

Yeah, there was hidden/implicit dependencies on actionbutton. some fields were getting set from the function that parsed the macro on the actionbutton, which the updateicon function in button referenced. so then when i started getting rid of the state dependencies in those functions, it became unworkable to keep it in the button class--i needed to call the function to parse the macro (ExtractMacroData) and extract the spell or item name from the GetAppearance function, but that code existed in actionbutton, not button.

i had a few false starts trying to keep that code in button, but the data in all the buttons types was so different, and all the other buttons seemed to have their own implementation anyhow, so i just moved it