phanx-wow / ClassColors

WoW AddOn — Change class colors without breaking parts of the default UI.
https://www.curseforge.com/wow/addons/classcolors
Other
6 stars 5 forks source link

New expansion combability (TWW) #19

Open Pandaabear0 opened 3 months ago

Pandaabear0 commented 3 months ago

Hey! Any chance you will update this for The War Within? It's completely broken.

Or maybe let me know how I could possible do it myself.

supersonic42 commented 3 months ago

+1 Need a fix for TWW.

gotex007 commented 3 months ago

Oh no. I need this to properly differentiate between rogues and hunters.

gotex007 commented 3 months ago

I managed to fix the "!ClassColors/ClassColors.lua:378: attempt to call global 'InterfaceOptions_AddCategory' (a nil value) [string "@!ClassColors/ClassColors.lua"]:378: in function <!ClassColors/ClassColors.lua:119>" error myself.

This post references what changes have to be made with the prepatch update.

Basically you need to

  1. open ClassColors.lua
  2. ctrl-F for InterfaceOptions_AddCategory(self);
  3. replace that line with category, layout = Settings.RegisterCanvasLayoutCategory(self, panel.name, self.name); category.ID = self.name Settings.RegisterAddOnCategory(category);
  4. ctrl-F for InterfaceOptionsFrame_OpenToCategory(self)
  5. replace the two lines of that (no idea why there are two) with Settings.OpenToCategory(category.ID)

Edit: Updated with proper variable name.

Pandaabear0 commented 3 months ago

I managed to fix the "!ClassColors/ClassColors.lua:378: attempt to call global 'InterfaceOptions_AddCategory' (a nil value) [string "@!ClassColors/ClassColors.lua"]:378: in function <!ClassColors/ClassColors.lua:119>" error myself.

This post references what changes have to be made with the prepatch update.

Basically you need to

  1. open ClassColors.lua
  2. ctrl-F for InterfaceOptions_AddCategory(panel);
  3. replace that line with category, layout = Settings.RegisterCanvasLayoutCategory(panel, panel.name, panel.name); category.ID = panel.name Settings.RegisterAddOnCategory(category);
  4. ctrl-F for InterfaceOptionsFrame_OpenToCategory(self)
  5. replace the two lines of that (no idea why there are two) with Settings.OpenToCategory(category.ID)

Hey Gotex! Thanks for helping with a potential fix! However, I don't seem to be able to find "InterfaceOptions_AddCategory(panel);", only "InterfaceOptions_AddCategory(self)"

Changing that didn't do anything. I also tried reading thru the forum post a bit and see if I could somehow understand the problem. My coding knowledge is limited. I tried adding "local category, layout" at the top of the lua file, as someone suggested. That didn't do anything either. I tried replacing the "InterfaceOptions_AddCategory(self)" instead of the suggested "InterfaceOptions_AddCategory(panel);", but as expected that didn't rly do anything either. image_2024-07-26_121427167

Pandaabear0 commented 3 months ago

So a friend who codes helped me fix the addon.

First off: At the top, add: local category, layout, I added it on line 10.

Then scroll down to InterfaceOptions_AddCategory(self) and replace it with: category, layout = Settings.RegisterCanvasLayoutCategory(f, f.name, f.name); category.ID = f.name Settings.RegisterAddOnCategory(category); On lines: 379, 380, 381 respectively.

Then change InterfaceOptionsFrame_OpenToCategory(self) with: Settings.OpenToCategory(category.ID) (yes, both lines). (Should be lines 387 and 388 if you followed the previous steps)

This enabled the addon for me, color changing works etc. I hope it works for you!

Pandaabear0 commented 3 months ago

image_2024-07-26_132824767

image_2024-07-26_132840824

Pandaabear0 commented 3 months ago

image_2024-07-26_132923844

supersonic42 commented 3 months ago

image_2024-07-26_132923844

I did you fix, but when i choose color in colorpicker, it does not change it on Player Unitframe (I use ElvUI)

gotex007 commented 3 months ago

Hey Gotex! Thanks for helping with a potential fix! However, I don't seem to be able to find "InterfaceOptions_AddCategory(panel);", only "InterfaceOptions_AddCategory(self)"

Oops! The addon creator named the variable self, not panel like the example from the forum post. I forgot to change that when copying it over from the article to my comment but I'm glad you and your friend figured it out. I edited my comment with that change. Declaring the variables at the top didn't seem to be required so I didn't bother since it's working, but I probably should if I care about coding ethics.

gotex007 commented 3 months ago

image_2024-07-26_132923844

I did you fix, but when i choose color in colorpicker, it does not change it on Player Unitframe (I use ElvUI)

I didn't even check if I could change the settings, but you're right. The change just removes the error it throws and puts the settings back in the menu but doesn't save any changes you actually try to make. That is unfortunate.

Pandaabear0 commented 3 months ago

Ye, my fix doesn't seem to actually save any changes either. It does work as intended, just no changes can be made in-game.

But, I guess as a temporary fix you can color in the ClassColor.lua inside your WTF > Account > -AccountName#X- > SavedVariables.

Pandaabear0 commented 3 months ago

image

supersonic42 commented 3 months ago

I guess colorpicker in this addon is broken.

I wanted to share this script to run ingame to change colors: /run ClassColorsDB.DRUID.r = 1 ClassColorsDB.DRUID.g = 0.42 ClassColorsDB.DRUID.b = 0.18

Then /reload

supersonic42 commented 2 months ago

Seems the addon is broken again. Any chance for a fix?

dyce commented 2 months ago

@supersonic42 Patch 11.0.2 changed GetAddOnMetadata to C_AddOns.GetAddOnMetadata. So all you have to do is search for GetAddOnMetadata in Localization.lua (line 14 and 15) and in ClassColors.lua (line 21) and change it to C_AddOns.GetAddOnMetadata

Pandaabear0 commented 2 months ago

@supersonic42 Patch 11.0.2 changed GetAddOnMetadata to C_AddOns.GetAddOnMetadata. So all you have to do is search for GetAddOnMetadata in Localization.lua (line 14 and 15) and in ClassColors.lua (line 21) and change it to C_AddOns.GetAddOnMetadata

Seems like that still left another error " Interface/AddOns/!ClassColors/Localization.lua:17: attempt to call global 'FillLocalizedClassList' (a nil value)"

Any fix for this?

EDIT: I just removed that line kekw

supersonic42 commented 2 months ago

@supersonic42 Patch 11.0.2 changed GetAddOnMetadata to C_AddOns.GetAddOnMetadata. So all you have to do is search for GetAddOnMetadata in Localization.lua (line 14 and 15) and in ClassColors.lua (line 21) and change it to C_AddOns.GetAddOnMetadata

Seems like that still left another error " Interface/AddOns/!ClassColors/Localization.lua:17: attempt to call global 'FillLocalizedClassList' (a nil value)"

Any fix for this?

EDIT: I just removed that line kekw

Yes, i also got this error and commented out this line. Seems the addon works fine without it.

gotex007 commented 2 months ago

Seems like that still left another error " Interface/AddOns/!ClassColors/Localization.lua:17: attempt to call global 'FillLocalizedClassList' (a nil value)"

Any fix for this?

The patch changed FillLocalizedClassList to LocalizedClassList.

jaychez commented 1 month ago

Anone know a fix for colorpicker in game? Doesnt seem to save.

muhmiauwau commented 3 weeks ago

Hey, since this addon hasn't been updated in a while, I made my own version. Check it out here: https://www.curseforge.com/wow/addons/colortools-class-colors