Files
Adrestie 5842eb7a2b ForeverUI : code en anglais, commentaires resserres, code mort retire
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>
2026-09-29 09:15:52 +02:00

90 lines
3.1 KiB
Lua

-- ForeverUI: the zone map (BattlefieldMinimap, Shift+M) with camelot's border
-- (blizzard_battlefieldmap). The map keeps its 3.3.5 size (225 x 150): the client places its
-- 56 px tiles. The client border is emptied and hidden, since BattlefieldMinimap_UpdateOpacity
-- resets its alpha. The client close button stays (it resets showBattlefieldMinimap).
local ForeverUI = ForeverUI or {}
_G.ForeverUI = ForeverUI
local Tpl = ForeverUI.Templates
local Z = {}
ForeverUI.ZoneMap = Z
local N = {
corners = {
{ "battlefieldminimap-border-topleft", "TOPLEFT", -11, 13 },
{ "battlefieldminimap-border-topright", "TOPRIGHT", 7, 13 },
{ "battlefieldminimap-border-bottomleft", "BOTTOMLEFT", -11, -7 },
{ "battlefieldminimap-border-bottomright", "BOTTOMRIGHT", 7, -7 },
},
closeButton = { 2, 6 },
tabText = { -5, -5 },
}
-- As camelot's RefreshAlpha: the border at 1 - opacity.
function Z.Opacity()
local edge = BattlefieldMinimap and BattlefieldMinimap.foreverEdge
if not edge then return end
local o = BattlefieldMinimapOptions and BattlefieldMinimapOptions.opacity or 0
edge:SetAlpha(1 - o)
end
function Z.Skin()
local f = BattlefieldMinimap
if not f or f.foreverEdge then return end
for _, t in ipairs({ BattlefieldMinimapBackground, BattlefieldMinimapCorner }) do
t:SetTexture(nil)
t:Hide()
end
local edge = CreateFrame("Frame", nil, f)
edge:SetFrameStrata("HIGH")
edge:SetAllPoints(f)
local p = {}
for i, c in ipairs(N.corners) do
local t = edge:CreateTexture(nil, "ARTWORK")
ForeverUI.SetAtlas(t, c[1])
t:SetPoint(c[2], edge, c[2], c[3], c[4])
p[i] = t
end
local function side(atlas, pointA, targetA, relativeA, pointB, targetB, relativeB)
local t = edge:CreateTexture(nil, "ARTWORK")
ForeverUI.SetAtlas(t, atlas, true)
t:SetPoint(pointA, targetA, relativeA, 0, 0)
t:SetPoint(pointB, targetB, relativeB, 0, 0)
return t
end
p[5] = side("battlefieldminimap-border-top", "TOPLEFT", p[1], "TOPRIGHT", "BOTTOMRIGHT", p[2], "BOTTOMLEFT")
p[6] = side("battlefieldminimap-border-bottom", "TOPLEFT", p[3], "TOPRIGHT", "BOTTOMRIGHT", p[4], "BOTTOMLEFT")
p[7] = side("battlefieldminimap-border-left", "TOPLEFT", p[1], "BOTTOMLEFT", "BOTTOMRIGHT", p[3], "TOPRIGHT")
p[8] = side("battlefieldminimap-border-right", "TOPLEFT", p[2], "BOTTOMLEFT", "BOTTOMRIGHT", p[4], "TOPRIGHT")
edge.pieces = p
f.foreverEdge = edge
-- Close button in camelot style, raised above the border
local x = BattlefieldMinimapCloseButton
Tpl.CloseButton(x, f)
x:ClearAllPoints()
x:SetPoint("TOPRIGHT", f, "TOPRIGHT", N.closeButton[1], N.closeButton[2])
x:SetFrameStrata("HIGH")
x:SetFrameLevel(edge:GetFrameLevel() + 1)
-- Tab: text at camelot's place
local text = BattlefieldMinimapTabText
if text then
text:ClearAllPoints()
text:SetPoint("LEFT", BattlefieldMinimapTabLeft, "RIGHT", N.tabText[1], N.tabText[2])
end
hooksecurefunc("BattlefieldMinimap_UpdateOpacity", Z.Opacity)
Z.Opacity()
end
Z.Skin()
-- Blizzard_BattlefieldMinimap is load-on-demand: skin it when it loads.
local watcher = CreateFrame("Frame")
watcher:RegisterEvent("ADDON_LOADED")
watcher:SetScript("OnEvent", function(_, _, name)
if name == "Blizzard_BattlefieldMinimap" then
Z.Skin()
end
end)