Colorpicker?
Can anybody tell me how to use this?
https://wow.gamepedia.com/Using_the_ColorPickerFrame seems to be outdated (global ShowColorPicker() does not exist any more) just as everything I could find on the forums... |
I've not played with it myself but this is Blizzards files for it which has changed at least once for at least the last 3 expansions.
https://www.townlong-yak.com/framexm...ickerFrame.xml ShowColorPicker is on that page you linked .. it's one you code in yourself it seems. |
You are right. I completely missed that definition of ShowColorPicker() further above on the wiki page. Thanks!
|
Finally got back to this, and two questions arose:
Code:
function ShowColorPicker(r, g, b, a, changedCallback) 1st Question: Code:
local myPackedColor = {1, 1, 1, 1}; 2nd Question: Is there a way to pass additional arguments to the changedCallback function? Or do I have to do this with "public" variables? |
1. The vararg needs to go at th end.
Code:
local function ShowColorPicker(changedCallback, r, g, b, a) Code:
local myPackedColor = {1, 1, 1, 1}; Code:
local function changedCallback(self) Code:
local addonName, addonTable = ... |
Thanks for the reply!
Quote:
Quote:
Quote:
|
Quote:
I guess the question becomes, what are you doing in ShowColorPicker to gather the variables you want to pass that you couldn't do directly in changedCallback? If you're calling ShowColorPicker() as the result of a button click (like a target box to change colours as the picker changes), you can set the button as a key of the ColorPickerFrame. Code:
local function myColorCallback() |
All right. I mean, what I basically want to do is to use the color picker in several different places, changing a different color each time. So I have to let ColorPicker() know what variable it should change. Passing arguments to ColorPicker() like ColorPicker("variableName") ist straight forward, but my question was how I could pass "variableName" on to the callback functions.
Now I understand that I have to do this with another (what I called "public" as it can be accessed from anywhere in my addon) variable (be it ColorPicker.tmpVariableName or local tmpVariableName). Thanks! |
All times are GMT -6. The time now is 04:30 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI