From 7425881e9881efd1b2f4ec358b201cc97b2f845b Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sun, 22 Mar 2026 16:33:57 -0700 Subject: [PATCH] feat: add UI panel management, scroll frames, and macro parsing stubs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implement high-frequency FrameXML infrastructure functions: - ShowUIPanel/HideUIPanel/ToggleFrame — UI panel show/hide (240+ calls in FrameXML). ShowUIPanel delegates to frame:Show(), HideUIPanel to frame:Hide(). - TEXT(str) — localization identity function (549 calls) - FauxScrollFrame_GetOffset/Update/SetOffset/OnVerticalScroll — scroll list helpers used by quest log, guild roster, friends list, etc. - SecureCmdOptionParse — basic macro conditional parser, returns unconditional fallback text - ChatFrame_AddMessageGroup/RemoveMessageGroup/AddChannel/RemoveChannel — chat frame configuration stubs - UIPanelWindows table, GetUIPanel, CloseWindows stubs --- src/addons/lua_engine.cpp | 47 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/addons/lua_engine.cpp b/src/addons/lua_engine.cpp index bdf42af4..e0c1468d 100644 --- a/src/addons/lua_engine.cpp +++ b/src/addons/lua_engine.cpp @@ -4985,6 +4985,53 @@ void LuaEngine::registerCoreAPI() { "function IsLoggedIn() return true end\n" "function StaticPopup_Show() end\n" "function StaticPopup_Hide() end\n" + // UI Panel management — Show/Hide standard WoW panels + "UIPanelWindows = {}\n" + "function ShowUIPanel(frame, force)\n" + " if frame and frame.Show then frame:Show() end\n" + "end\n" + "function HideUIPanel(frame)\n" + " if frame and frame.Hide then frame:Hide() end\n" + "end\n" + "function ToggleFrame(frame)\n" + " if frame then\n" + " if frame:IsShown() then frame:Hide() else frame:Show() end\n" + " end\n" + "end\n" + "function GetUIPanel(which) return nil end\n" + "function CloseWindows(ignoreCenter) return false end\n" + // TEXT localization stub — returns input string unchanged + "function TEXT(text) return text end\n" + // Faux scroll frame helpers (used by many list UIs) + "function FauxScrollFrame_GetOffset(frame)\n" + " return frame and frame.offset or 0\n" + "end\n" + "function FauxScrollFrame_Update(frame, numItems, numVisible, valueStep, button, smallWidth, bigWidth, highlightFrame, smallHighlightWidth, bigHighlightWidth)\n" + " if not frame then return false end\n" + " frame.offset = frame.offset or 0\n" + " local showScrollBar = numItems > numVisible\n" + " return showScrollBar\n" + "end\n" + "function FauxScrollFrame_SetOffset(frame, offset)\n" + " if frame then frame.offset = offset or 0 end\n" + "end\n" + "function FauxScrollFrame_OnVerticalScroll(frame, value, itemHeight, updateFunction)\n" + " if not frame then return end\n" + " frame.offset = math.floor(value / (itemHeight or 1) + 0.5)\n" + " if updateFunction then updateFunction() end\n" + "end\n" + // SecureCmdOptionParse — parses conditional macros like [target=focus] + "function SecureCmdOptionParse(options)\n" + " if not options then return nil end\n" + " -- Simple: return the unconditional fallback (text after last semicolon or the whole string)\n" + " local result = options:match(';%s*(.-)$') or options:match('^%[.*%]%s*(.-)$') or options\n" + " return result\n" + "end\n" + // ChatFrame message group stubs + "function ChatFrame_AddMessageGroup(frame, group) end\n" + "function ChatFrame_RemoveMessageGroup(frame, group) end\n" + "function ChatFrame_AddChannel(frame, channel) end\n" + "function ChatFrame_RemoveChannel(frame, channel) end\n" // CreateTexture/CreateFontString are now C frame methods in the metatable "do\n" " local function cc(r,g,b)\n"