-- 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