fc364f4693
A patch-F.MPQ source for benilla: the player's stock FrameXML.toc with one row appended, the chooser shown at the first world entry while the moonwellUIStyle CVar is unset, and an Interface Style rung in the game menu that reopens it. Forever UI is a stub that announces itself. Verified with benilla's addon harness (clean load, choose/finish/reopen flow), capture renders of the chooser and the game menu, and a live client: the forever style reloads the UI, persists across a restart and switches back to classic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.0 KiB
Lua
35 lines
1.0 KiB
Lua
-- The interface style, one CVar for the whole client: "classic" or "forever", "" until the
|
|
-- player chooses. Every Forever UI file reads MoonWellUI_IsForever() at load and does nothing
|
|
-- on the classic style, so a change of style takes a ReloadUI.
|
|
|
|
MOONWELLUI_STYLE_CVAR = "moonwellUIStyle"
|
|
RegisterCVar(MOONWELLUI_STYLE_CVAR, "")
|
|
|
|
local function MoonWellUI_ReadStyle()
|
|
local value = GetCVar(MOONWELLUI_STYLE_CVAR)
|
|
if value == "classic" or value == "forever" then
|
|
return value
|
|
end
|
|
return nil
|
|
end
|
|
|
|
-- The style this UI build loaded with; unchosen loads as classic.
|
|
MOONWELLUI_LOADED_STYLE = MoonWellUI_ReadStyle() or "classic"
|
|
|
|
-- The chosen style, or nil while the player has not chosen.
|
|
function MoonWellUI_GetStyle()
|
|
return MoonWellUI_ReadStyle()
|
|
end
|
|
|
|
function MoonWellUI_IsForever()
|
|
return MOONWELLUI_LOADED_STYLE == "forever"
|
|
end
|
|
|
|
-- Save `style` and reload the UI when it is not the one loaded.
|
|
function MoonWellUI_SetStyle(style)
|
|
SetCVar(MOONWELLUI_STYLE_CVAR, style)
|
|
if style ~= MOONWELLUI_LOADED_STYLE then
|
|
ReloadUI()
|
|
end
|
|
end
|