Files
moon-well-ui/vanilla/Interface/FrameXML/MoonWellUI/Forever/GameMenu.lua
T
sindoring 8c365bba50 Port the dialogs, color picker and game menu to 1.12
Templates gains camelot's dialog pieces at their logical sizes (the
DiamondMetal frame and header, which the atlas holds at double density)
and the three-slice red button. Dialogs.lua borders StaticPopup1-4,
ColorPicker.lua lays out the picker with camelot's opacity column on
the stock slider, GameMenu.lua turns the Esc menu into camelot's column
of red buttons, keeping benilla's and the Interface Style rungs.

Verified in the live client: the menu with its sections, a confirmation
box, and the picker with opacity, all without errors.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-19 21:51:10 +04:00

95 lines
2.7 KiB
Lua

-- After data/addon/ForeverUI/GameMenu.lua: the Esc menu (GameMenuFrame) in camelot's style
-- (MainMenuFrameTemplate: the column 48 from the top, 34 from the bottom, 28 at the sides; a
-- section adds 20 above its first button), the DiamondMetal frame and header, the buttons as
-- 128-RedButton three-slices 200 x 36.
-- The client's buttons stay, in their order, with benilla's (Edit Mode, Support) and the
-- Interface Style rung (MoonWellUI\GameMenu.lua); the column is laid out on every show, after
-- their own layout.
if not MoonWellUI_IsForever() then
return
end
local Tpl = ForeverUI.Templates
local M = {}
ForeverUI.GameMenu = M
local N = {
top = 48, down = 34, side = 28,
button = { 200, 36 },
section = 20,
prefix = "128-redbutton",
}
-- camelot's GameFontNormalMed1: 13, shadow (1, -1), yellow
local headerFont = CreateFont("ForeverUIGameMenuHeaderFont")
headerFont:SetFont((GameFontNormal:GetFont()), 13)
headerFont:SetShadowOffset(1, -1)
headerFont:SetShadowColor(0, 0, 0, 1)
headerFont:SetTextColor(1, 0.82, 0)
-- the buttons, top to bottom; section: a gap above the button
local function entries()
return {
{ GameMenuButtonOptions },
{ GameMenuButtonSoundOptions },
{ GameMenuButtonUIOptions },
{ GameMenuButtonKeybindings },
{ getglobal("BenillaGameMenuButtonEditMode") },
{ getglobal("BenillaGameMenuButtonSupport") },
{ GameMenuButtonMacros },
{ getglobal("MoonWellUIGameMenuButtonStyle") },
{ GameMenuButtonLogout, section = true },
{ GameMenuButtonQuit },
{ GameMenuButtonContinue, section = true },
}
end
local FONTS = { GameFontHighlightLarge, GameFontHighlightLarge, GameFontDisableLarge }
local function skinButton(b)
b:SetWidth(N.button[1])
b:SetHeight(N.button[2])
Tpl.RedButton(b, N.prefix, FONTS)
Tpl.PaintRed(b, false)
end
-- each shown button in its place, then the menu's size
function M.Layout()
local f = GameMenuFrame
local y = N.top
local queued = false
for _, e in ipairs(entries()) do
local b = e[1]
if e.section then
queued = true
end
if b and b:IsShown() then
skinButton(b)
if queued then
y = y + N.section
queued = false
end
b:ClearAllPoints()
b:SetPoint("TOPLEFT", f, "TOPLEFT", N.side, -y)
y = y + N.button[2]
end
end
f:SetWidth(N.side + N.button[1] + N.side)
f:SetHeight(y + N.down)
end
local f = GameMenuFrame
f:SetBackdrop(nil)
GameMenuFrameHeader:SetAlpha(0)
-- the client's title has no name: it is the frame's MAIN_MENU text
for _, r in ipairs({ f:GetRegions() }) do
if r:GetObjectType() == "FontString" and r:GetText() == MAIN_MENU then
r:SetAlpha(0)
end
end
Tpl.DialogFrame(f)
M.header = Tpl.Header(f, MAIN_MENU, headerFont)
ForeverUI.HookScript(f, "OnShow", M.Layout)