mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-26 00:40:15 +00:00
feat: add UI panel management, scroll frames, and macro parsing stubs
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
This commit is contained in:
parent
9a570b49db
commit
7425881e98
1 changed files with 47 additions and 0 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue