Go to Page... |
|
Thread Tools | Display Modes |
02-06-23, 03:14 AM | #1 |
How to move my slash commands to the options panel?
So my brain hurts from trying to figure this out. I tried to look at some of the other addons that I have installed, but they all seem to use libraries for this, which I don't use or really understand.
So I currently use a set of slash commands to handle the only configurable portion of my addon, the color in which the text is displayed for the user. Currently this is how I accomplish this: Lua Code:
I figured the first thing I would try to get working is adding a button to the options panel, which when you click on it, it calls my already defined color picker functions. Lua Code:
This successfully adds a new panel to the ingame options window with the desired title displayed and the clickable button. However, when I actually click on the button, it throws an error: Code:
5x ConvertRatings/ConvertRatings.lua:27: bad argument #1 to 'SetColorRGB' (Usage: self:SetColorRGB(rgb)) [string "=[C]"]: in function `SetColorRGB' [string "@ConvertRatings/ConvertRatings.lua"]:27: in function <ConvertRatings/ConvertRatings.lua:26> Locals: (*temporary) = ColorPickerFrame { 0 = <userdata> Center = Texture { } PixelSnapDisabled = true TopLeftCorner = Texture { } OnBackdropLoaded = <function> defined @SharedXML/Backdrop.lua:152 Border = Frame { } BottomEdge = Texture { } GetBackdropColor = <function> defined @SharedXML/Backdrop.lua:390 SetupTextureCoordinates = <function> defined @SharedXML/Backdrop.lua:214 OnBackdropSizeChanged = <function> defined @SharedXML/Backdrop.lua:182 HasBackdropInfo = <function> defined @SharedXML/Backdrop.lua:278 SetBackdropBorderColor = <function> defined @SharedXML/Backdrop.lua:422 RightEdge = Texture { } BottomRightCorner = Texture { } BottomLeftCorner = Texture { } GetEdgeSize = <function> defined @SharedXML/Backdrop.lua:188 template = "Transparent" TopRightCorner = Texture { } TopEdge = Texture { } ApplyBackdrop = <function> defined @SharedXML/Backdrop.lua:294 SetBackdrop = <function> defined @SharedXML/Backdrop.lua:329 ClearBackdrop = <function> defined @SharedXML/Backdrop.lua:282 backdropInfo = <table> { } GetBackdropBorderColor = <function> defined @SharedXML/Backdrop.lua:409 GetBackdrop = <function> defined @SharedXML/Backdrop.lua:347 SetBorderBlendMode = <function> defined @SharedXML/Backdrop.lua:266 SetupPieceVisuals = <function> defined @SharedXML/Backdrop.lua:246 SetBackdropColor = <function> defined @SharedXML/Backdrop.lua:399 LeftEdge = Texture { } Header = Frame { } } (*temporary) = Button { SetTextToFit = <function> defined @SharedXML/SecureUIPanelTemplates.lua:440 Right = Texture { } Left = Texture { } fitTextWidthPadding = 40 FitToText = <function> defined @SharedXML/SecureUIPanelTemplates.lua:445 Text = TopText { } 0 = <userdata> Middle = Texture { } fitTextCanWidthDecrease = true } (*temporary) = "LeftButton" (*temporary) = false Lua Code:
but that just throws a different error when you load in: Code:
2x ConvertRatings/ConvertRatings.lua:79: Usage: Button:HookScript("frameScriptTypeName", function[, bindingType]) [string "=[C]"]: in function `HookScript' [string "@ConvertRatings/ConvertRatings.lua"]:79: in main chunk Locals: (*temporary) = Button { SetTextToFit = <function> defined @SharedXML/SecureUIPanelTemplates.lua:440 Right = Texture { } Left = Texture { } fitTextWidthPadding = 40 FitToText = <function> defined @SharedXML/SecureUIPanelTemplates.lua:445 Text = TopText { } 0 = <userdata> Middle = Texture { } fitTextCanWidthDecrease = true } (*temporary) = "OnClick" What probably glaring issue am I not seeing here? Why does changing it from a slash command to a button press fuck it all up? |
|
WoWInterface » Developer Discussions » Lua/XML Help » How to move my slash commands to the options panel? |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Switch to Hybrid Mode |
Threaded Mode |
|
|