5842eb7a2b
Traduction - Identifiants en anglais dans tout le module : addon, ecrans d'accueil, outils Python, banc d'essai et patcheur C#. - Fichiers au nom francais renommes (Gabarits.lua -> Templates.lua, Textes_*.lua -> Texts_*.lua, deployer.py -> deploy.py, tools/patcheur -> tools/patcher, etc.). - Commandes /fui et options de deploy.py en anglais (--check, --server, --remove-dbc). - Cles des variables sauvegardees et de data/dbc/statistics.json traduites, sans reprise des anciennes cles. - API de la micro-barre : ForeverUI.AddMicroButton(def) avec les champs name, atlasSet, after, tooltip, onClick, ready, et ForeverUI.UpdateMicro(name, isOpen). - Commentaires reecrits en anglais, courts, sans dates ni historique ; les fonctions au nom peu parlant et leurs parametres sont expliques. Code mort - Exports, fonctions et variables jamais lus retires. - Retires a la demande des modules : ForeverUI.PvPJauge, les exports FondEntete / TuilerEntete / Polices de TradeSkill, l'art legacy-up-c60, honorfill(half)blue et inv_misc_book_09, leurs entrees d'atlas et les parties d'outils correspondantes. Verifications : liaisons des noms comparees avant et apres, banc vert, chemins de textures inchanges, generateurs reproduisant les fichiers, patcheur identique octet pour octet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
108 lines
2.9 KiB
Lua
108 lines
2.9 KiB
Lua
-- ForeverUI: the Esc menu (GameMenuFrame) in Camelot's style (MainMenuFrameTemplate: column
|
|
-- margins 48 top, 34 bottom, 28 sides; a section adds 20 above its first button).
|
|
-- The client's buttons stay, in their order: their clicks are secure (Logout, Quit) and a
|
|
-- button of ours would not be.
|
|
|
|
local ForeverUI = ForeverUI or {}
|
|
_G.ForeverUI = ForeverUI
|
|
|
|
local Tpl = ForeverUI.Templates
|
|
|
|
local M = {}
|
|
ForeverUI.GameMenu = M
|
|
|
|
local N = {
|
|
top = 48, down = 34, side = 28,
|
|
button = { 200, 36 },
|
|
section = 20,
|
|
}
|
|
|
|
-- camelot GameFontNormalMed1: SystemFont_Med2 (FRIZQT 13), shadow (1, -1), yellow
|
|
local function headerFont()
|
|
local f = CreateFont("ForeverUIGameMenuHeaderFont")
|
|
f:SetFontObject(SystemFont_Med2 or GameFontNormal)
|
|
f:SetShadowOffset(1, -1)
|
|
f:SetShadowColor(0, 0, 0)
|
|
f:SetTextColor(1, 0.82, 0)
|
|
return f
|
|
end
|
|
|
|
-- buttons, top to bottom; section: a gap above the button
|
|
local function entries()
|
|
return {
|
|
{ GameMenuButtonOptions },
|
|
{ GameMenuButtonSoundOptions },
|
|
{ GameMenuButtonMacOptions },
|
|
{ GameMenuButtonUIOptions },
|
|
{ GameMenuButtonKeybindings },
|
|
{ GameMenuButtonMacros },
|
|
{ GameMenuButtonRatings },
|
|
{ _G["GameMenuButtonAddOns"] },
|
|
{ _G["ForeverUIGameMenuButtonHelp"], section = true },
|
|
{ GameMenuButtonLogout, section = true },
|
|
{ GameMenuButtonQuit },
|
|
{ GameMenuButtonContinue, section = true },
|
|
}
|
|
end
|
|
|
|
local FONTS = { GameFontHighlightLarge, GameFontHighlightLarge, GameFontDisableLarge }
|
|
|
|
local function skinButton(b)
|
|
if b.foreverThreeSlice then return end
|
|
b:SetWidth(N.button[1])
|
|
b:SetHeight(N.button[2])
|
|
Tpl.ThreeSliceButton(b, "128-redbutton", FONTS)
|
|
b:HookScript("OnShow", M.Layout)
|
|
end
|
|
|
|
-- Lays out the column: each shown button in place, then the menu size.
|
|
-- Runs on every button's OnShow: ACP's AddOns button and Log Out (when Ratings is shown)
|
|
-- re-anchor Log Out in their own OnShow, after the menu.
|
|
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
|
|
|
|
if GameMenuFrame then
|
|
local f = GameMenuFrame
|
|
f:SetBackdrop(nil)
|
|
if GameMenuFrameHeader then
|
|
GameMenuFrameHeader:SetAlpha(0)
|
|
end
|
|
-- 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, MAINMENU_BUTTON, headerFont())
|
|
for _, e in ipairs(entries()) do
|
|
if e[1] then
|
|
skinButton(e[1])
|
|
end
|
|
end
|
|
-- a button added after us (ACP's AddOns) is skinned by the layout on first show
|
|
f:HookScript("OnShow", M.Layout)
|
|
M.Layout()
|
|
end
|