-- The game menu's "Interface Style" rung, under Macros, which reopens the chooser. Added at -- VARIABLES_LOADED, after benilla's layer has laid out GameMenuFrame, and kept clear of its -- layout: it takes Macros' rung gap and Logout keeps the gap it had above it. local function MoonWellUIGameMenu_AddRung() if MoonWellUIGameMenuButtonStyle then return end local button = CreateFrame("Button", "MoonWellUIGameMenuButtonStyle", GameMenuFrame, "GameMenuButtonTemplate") button:SetText(MOONWELLUI_TEXT.MENU_BUTTON) local _, _, _, _, rungGap = GameMenuButtonMacros:GetPoint(1) local _, _, _, logoutX, logoutGap = GameMenuButtonLogout:GetPoint(1) button:SetPoint("TOP", GameMenuButtonMacros, "BOTTOM", 0, rungGap or -1) GameMenuButtonLogout:ClearAllPoints() GameMenuButtonLogout:SetPoint("TOP", button, "BOTTOM", logoutX or 0, logoutGap or -1) GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + button:GetHeight() - (rungGap or -1)) button:SetScript("OnClick", function() PlaySound("igMainMenuOption") HideUIPanel(GameMenuFrame) MoonWellUIChoice_Open() end) end -- The character models rung, under Interface Style: SD or HD, the MoonWell launcher's choice -- (MoonWell_GetCharacterModels / MoonWell_SetCharacterModels). The launcher adds those after the -- interface loads, so the rung is made once they are there, and only with the HD pack. local function MoonWellUIGameMenu_Models() return MoonWell_GetCharacterModels and MoonWell_GetCharacterModels() end StaticPopupDialogs["MOONWELLUI_MODELS"] = { text = MOONWELLUI_TEXT.MODELS_CONFIRM, button1 = ACCEPT, button2 = CANCEL, OnAccept = function() local target = (MoonWellUIGameMenu_Models() == "hd") and "sd" or "hd" MoonWell_SetCharacterModels(target) end, timeout = 0, whileDead = 1, hideOnEscape = 1, } local function MoonWellUIGameMenu_AddModelsRung() local mode = MoonWellUIGameMenu_Models() if MoonWellUIGameMenuButtonModels or not mode or not MoonWellUIGameMenuButtonStyle then return end local button = CreateFrame("Button", "MoonWellUIGameMenuButtonModels", GameMenuFrame, "GameMenuButtonTemplate") button:SetText(format(MOONWELLUI_TEXT.MODELS_BUTTON, string.upper(mode))) local _, _, _, _, rungGap = MoonWellUIGameMenuButtonStyle:GetPoint(1) local _, _, _, logoutX, logoutGap = GameMenuButtonLogout:GetPoint(1) button:SetPoint("TOP", MoonWellUIGameMenuButtonStyle, "BOTTOM", 0, rungGap or -1) GameMenuButtonLogout:ClearAllPoints() GameMenuButtonLogout:SetPoint("TOP", button, "BOTTOM", logoutX or 0, logoutGap or -1) GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + button:GetHeight() - (rungGap or -1)) button:SetScript("OnClick", function() PlaySound("igMainMenuOption") HideUIPanel(GameMenuFrame) local target = (MoonWellUIGameMenu_Models() == "hd") and "SD" or "HD" StaticPopup_Show("MOONWELLUI_MODELS", target) end) -- Forever UI lays its column out on show, before this rung existed if ForeverUI and ForeverUI.GameMenu then ForeverUI.GameMenu.Layout() end end local MoonWellUIGameMenu_Loader = CreateFrame("Frame") MoonWellUIGameMenu_Loader:RegisterEvent("VARIABLES_LOADED") MoonWellUIGameMenu_Loader:SetScript("OnEvent", function() MoonWellUIGameMenu_AddRung() -- every frame until the launcher's functions are there (a client without them: never) this:SetScript("OnUpdate", function() if MoonWell_GetCharacterModels then MoonWellUIGameMenu_AddModelsRung() this:SetScript("OnUpdate", nil) end end) end)