WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Color Picker issues 10.2.5 (https://www.wowinterface.com/forums/showthread.php?t=59755)

Sharpedge 01-06-24 01:28 PM

Color Picker issues 10.2.5
 
I'm trying to see if anyone else has had an issue with color picker when using it to change font colors etc. It works perfectly fine in 10.2, but when I went to the PTR its a no go. There are no errors, and when you click on the Font color button in my addon it does nothing. It doesn't even pull up the color picker.

Does anyone know if this is an issue that Blizz knows about? Or do I need to figure out how to get around it? Below is part of my code for the color picker:

Code:

fontColor = {
            type = "color",
            name = "Button Font Color",
            desc = "Set the color of the button text.",
            hasAlpha = true,
            get = function()
                local color = IncDB.fontColor or {r = 1, g = 1, b = 1, a = 1} -- Default to white
                return color.r, color.g, color.b, color.a
            end,
            set = function(_, r, g, b, a)
                IncDB.fontColor.r = r
                IncDB.fontColor.g = g
                IncDB.fontColor.b = b
                IncDB.fontColor.a = a
                for _, text in ipairs(buttonTexts) do
                    text:SetTextColor(r, g, b, a)
                end
            end,
            order = 5,
        },
        buttonColor = {
            type = "color",
            name = "Button Color",
            desc = "Set the color of the buttons.",
            hasAlpha = true,
            get = function()
                local color = IncDB.buttonColor or {r = 1, g = 0, b = 0, a = 1} -- Default to red
                return color.r, color.g, color.b, color.a
            end,
            set = function(_, r, g, b, a)
                IncDB.buttonColor.r = r 
                IncDB.buttonColor.g = g
                IncDB.buttonColor.b = b
                IncDB.buttonColor.a = a
                applyButtonColor()
            end,
            order = 6,

The full code can be seen at: https://github.com/The-Sickness/Incoming-BG

Any help on this will be greatly appreciated.

Xrystal 01-06-24 02:13 PM

A quick look at the changes between 10.2 and 10.2.5 and it looks like the file has had a few changes which might affect the functionality. But I am surprised that there are no errors if it is just an access change.

An example:
Removed: OpenColorPicker(info)
Added: ColorPickerFrame:SetupColorPickerAndShow(info)

Aha, looking at the xml file - It has gone from a ColorSelect type to a Frame type.
<ColorSelect name="ColorPickerFrame" toplevel="true" parent="UIParent" movable="true" enableMouse="true" enableKeyboard="true" hidden="true" frameStrata="DIALOG">

<Frame name="ColorPickerFrame" mixin="ColorPickerFrameMixin" toplevel="true" parent="UIParent" movable="true" clampedToScreen="true" hidden="true" frameStrata="DIALOG">

https://github.com/Gethe/wow-ui-sour...ickerFrame.xml


Ace doesn't appear to have been updated since 10.1.5 but there is a ColorPickerPlus addon by them that has been updated sooner.

https://github.com/WoWUIDev

Sharpedge 01-06-24 02:28 PM

Thanks for the info man. I will look into it.

SteVex 01-10-24 01:34 AM

Have you checked the changes in the Color Picker functionality between versions 10.2 and 10.2.5? Also, have you considered exploring addons like ColorPickerPlus by WoWUIDev, which might have updates addressing the issue?

Sharpedge, have you made any progress in resolving the Color Picker issue in your addon?

Sharpedge 01-10-24 06:26 AM

Quote:

Originally Posted by SteVex (Post 343127)
Have you checked the changes in the Color Picker functionality between versions 10.2 and 10.2.5? Also, have you considered exploring addons like ColorPickerPlus by WoWUIDev, which might have updates addressing the issue?

Sharpedge, have you made any progress in resolving the Color Picker issue in your addon?

ColorPickerPlus does not work in 10.2.5 as well. I'm still tinkering with it all. I may just do away with the color picker all together and go another route with just picking solid colors.

Fizzlemizz 01-10-24 09:00 AM

If Ace has an alpha/beta for 10.2.5, use that otherwise, wait for the 10.2.5 version. Blizz changed how the ColorPicker is constructed and some of the methods. Your current (and likely soon to be old) version of Ace ColorPicker won't work with it. It will likely be the same for ColorPickerPlus if it is using default CP methods to "replace" it.

Sharpedge 01-10-24 06:55 PM

Quote:

Originally Posted by Fizzlemizz (Post 343131)
If Ace has an alpha/beta for 10.2.5, use that otherwise, wait for the 10.2.5 version. Blizz changed how the ColorPicker is constructed and some of the methods. Your current (and likely soon to be old) version of Ace ColorPicker won't work with it. It will likely be the same for ColorPickerPlus if it is using default CP methods to "replace" it.

No Beta version just yet. I'm just going to hold off and wait and see what they do.

ClyAbext 01-11-24 11:12 AM

It seems like the changes in the Color Picker functionality between versions might be the culprit. Have you considered updating your code to reflect the changes highlighted in the example, and have you encountered any other compatibility issues between versions that you're addressing in your addon development?

Sharpedge 01-11-24 11:47 AM

Quote:

Originally Posted by ClyAbext (Post 343140)
It seems like the changes in the Color Picker functionality between versions might be the culprit. Have you considered updating your code to reflect the changes highlighted in the example, and have you encountered any other compatibility issues between versions that you're addressing in your addon development?

I have messed with it. But it throws a lot of errors pertaining to Ace 3. So, after that I'm just going to wait and see what Ace does before I have revamp my addons.

Sharpedge 01-15-24 06:06 PM

Testing the new updates now....

I'm tripping. I didn't read the changelog for Ace 3 lol. It's still broken. But they are aware of it.

dragonflyy 01-23-24 10:05 PM

Not sure if this will help you are not, the new color picker is acutally well made (in my opinion). I am leaving a small code snippet from my addon so anyone else can use it to use the new color picker. It's all contained in one function call now, and there is no callback.

Lua Code:
  1. ColorPickerFrame:SetupColorPickerAndShow({
  2.     r = colors.red,
  3.     g = colors.green,
  4.     b = colors.blue,
  5.     opacity = colors.alpha,
  6.     hasOpacity = true,
  7.     swatchFunc = function()
  8.         colors.red, colors.green, colors.blue = ColorPickerFrame:GetColorRGB()
  9.         colors.alpha = ColorPickerFrame:GetColorAlpha()
  10.         L.AttachedFrame.ScrollFrame.listView:Refresh()
  11.     end,
  12.     cancelFunc = function()
  13.         colors.red, colors.green, colors.blue, colors.alpha =
  14.         ColorPickerFrame.previousValues.r, ColorPickerFrame.previousValues.g,
  15.             ColorPickerFrame.previousValues.b, ColorPickerFrame.previousValues.a
  16.         L.AttachedFrame.ScrollFrame.listView:Refresh()
  17.     end
  18. })

An alternative way (this is more how Blizzard did this)
Lua Code:
  1. local info = {}
  2. info.r, info.g, info.b = colors.red, colors.green, colors.blue
  3. info.opacity = colors.alpha
  4. info.hasOpacity = true
  5. info.swatchFunc = function()
  6.     colors.red, colors.green, colors.blue = ColorPickerFrame:GetColorRGB()
  7.     colors.alpha = ColorPickerFrame:GetColorAlpha()
  8.     L.AttachedFrame.ScrollFrame.listView:Refresh()
  9. end
  10. info.cancelFunc = function()
  11.     colors.red, colors.green, colors.blue, colors.alpha =
  12.         ColorPickerFrame.previousValues.r, ColorPickerFrame.previousValues.g,
  13.         ColorPickerFrame.previousValues.b, ColorPickerFrame.previousValues.a
  14.     L.AttachedFrame.ScrollFrame.listView:Refresh()
  15. end
  16. ColorPickerFrame:SetupColorPickerAndShow(info)

Also one thing to note, the new window is moveable and it remembers where it was. It also has hex code for colors :)


All times are GMT -6. The time now is 10:29 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI