-- benilla's own: the six `OptionsFrame_*` enable/disable helpers the realm's FrameXML dropped. -- -- `benilla.toc` loads two of the reference's own settings windows that the realm's toc does NOT -- list — `Interface\FrameXML\SoundOptionsFrame.xml` and `Interface\FrameXML\UIOptionsFrame.xml` — -- so that addons find their frames by name and their option globals get set. Both come off the -- chain as **stock 1.12** files, and stock 1.12 defines these six beside them in its own -- `OptionsFrame.lua`. The realm replaced that file (OctoWoW's `patch-4.mpq` ships Turtle's -- rewrite, with search and categories), and the rewrite does not carry them: nothing in the -- realm's 151 interface rows defines or calls one, checked file by file. -- -- So the two windows we load call six functions that no file in this client provides. Nothing -- raises at load, because every call sits behind a click or a CVar arm — which is exactly what -- makes it worth fixing rather than listing: a sound checkbox that cannot grey out when its master -- toggle goes off, a slider whose thumb stays put, a dropdown that reads enabled while it is not. -- The player sees a control that looks live and is not, and the first thing that *does* raise is -- the click that reaches one. -- -- These are the reference's own bodies, read out of `patch.MPQ`'s pre-Turtle `OptionsFrame.lua` -- rather than written from memory, down to the commented-out `SetChecked` in the first and the -- four-argument `OptionsFrame_EnableCheckBox(checkBox, setChecked, checked, isWhite)` shape that -- `UIOptionsFrame.xml` calls with two. Defined with `or` so that a realm which puts them back -- keeps its own. -- -- Loaded before the two windows in `benilla.toc`. Their callers are all runtime, so the order is -- not load-bearing — it is just where the definition belongs. OptionsFrame_DisableCheckBox = OptionsFrame_DisableCheckBox or function(checkBox) checkBox:Disable(); getglobal(checkBox:GetName().."Text"):SetTextColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b); end OptionsFrame_EnableCheckBox = OptionsFrame_EnableCheckBox or function(checkBox, setChecked, checked, isWhite) if ( setChecked ) then checkBox:SetChecked(checked); end checkBox:Enable(); if ( isWhite ) then getglobal(checkBox:GetName().."Text"):SetTextColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b); else getglobal(checkBox:GetName().."Text"):SetTextColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b); end end OptionsFrame_DisableSlider = OptionsFrame_DisableSlider or function(slider) local name = slider:GetName(); getglobal(name.."Thumb"):Hide(); getglobal(name.."Text"):SetVertexColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b); getglobal(name.."Low"):SetVertexColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b); getglobal(name.."High"):SetVertexColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b); end OptionsFrame_EnableSlider = OptionsFrame_EnableSlider or function(slider) local name = slider:GetName(); getglobal(name.."Thumb"):Show(); getglobal(name.."Text"):SetVertexColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b); getglobal(name.."Low"):SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b); getglobal(name.."High"):SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b); end OptionsFrame_DisableDropDown = OptionsFrame_DisableDropDown or function(dropDown) getglobal(dropDown:GetName().."Label"):SetVertexColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b); getglobal(dropDown:GetName().."Text"):SetVertexColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b); getglobal(dropDown:GetName().."Button"):Disable(); end OptionsFrame_EnableDropDown = OptionsFrame_EnableDropDown or function(dropDown) getglobal(dropDown:GetName().."Label"):SetVertexColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b); getglobal(dropDown:GetName().."Text"):SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b); getglobal(dropDown:GetName().."Button"):Enable(); end