Thread Tools Display Modes
05-28-08, 12:23 PM   #1
RazerMantis
A Kobold Labourer
Join Date: May 2008
Posts: 1
Problem witch ColorPickerFrame

I have a littlie problem with my addon. What I want to do is when i use the "classcolor" slashcomand it will open the CPF so you can select the color and if you use the comand again it set the color to the own classcolor. So now to my problem from classcolor "on" to classcolor "off" it works great but if you want to change it again to "on" the RAID_CLASS_COLORS[select(2, UnitClass("player"))] seems not to work you have to reload the ui first. When you start with Classcolor "off" and change it to "on" it works great but once you opend the CPF again it don't work again. So it have something to do with the CPF but I don't know how to change it.
I hope you understand it (sry bad english i know^^). Please help me

so here are the important lines of the code:

Code:
function onUpdate()
        hcoord.mmcoords:SetTextColor(hCoords2DB.Color.r, hCoords2DB.Color.g, hCoords2DB.Color.b)
        hcoord:SetBackdropBorderColor(hCoords2DB.Color.r, hCoords2DB.Color.g, hCoords2DB.Color.b)
end
hcoord:SetScript("OnUpdate", onUpdate)

function hcoord2_Commands(cmd)
	local c,x = string.split(" ",cmd)
if c == "classcolor" then
	if hCoords2DB.ClassColors == true then
		hCoords2DB.ClassColors = false
		ColorPickerFrame:Show()
		ColorPickerFrame.func = function ()
		hCoords2DB.Color.r, hCoords2DB.Color.g,
                hCoords2DB.Color.b = ColorPickerFrame:GetColorRGB()
                end
                DEFAULT_CHAT_FRAME:AddMessage("Classcolor: |cFFFF0000off|r")
	else
      		hCoords2DB.ClassColors = true
                hCoords2DB.Color=RAID_CLASS_COLORS[select(2, UnitClass("player"))]
                DEFAULT_CHAT_FRAME:AddMessage("Classcolor: |cFF00FF21on|r")
        end
end
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Problem witch ColorPickerFrame


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off