The ESC menu's Support rung was greyed with nothing behind it. The 1.15 era menu that the layer's ladder follows opens the help window from Support. In 1.12 that window is the stock `HelpFrame`, opened by the "?" micro button's `ToggleHelpFrame()` (`MainMenuBarMicroButtons.xml:217`). Support is now live: it plays the menu click, closes the menu as the Macros rung does, and toggles the help window. Edit Mode stays greyed. Test: `support_closes_the_menu_and_toggles_the_help_window` clicks the rung and checks the toggle and the closed menu; the live-entries test now lists Support. Fixes #1800 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit bb434a181f6a3815ec6fe3e5ace89c864fa1808c) Absorbed into the octo fork. Ported by hand: upstream wires Support in GameMenuAdapters.xml, a Lua adapter layered over stock FrameXML that this fork does not carry — our menu declares its own rungs in GameMenuFrame.xml, where GameMenuButtonSupport was GameMenuButton_Pending (SetText + Disable). It now sets its text on load and, on click, plays igMainMenuOption, hides the menu as the Macros rung does and calls ToggleHelpFrame(). Our rungs carry no Benilla prefix, so upstream's test names are retargeted; our own narrowing_the_frame_keeps_the_button_column_centred test is kept. The 6 FloatingChatFrame failures in this module are pre-existing baseline (10 passed/6 failed before, 11/6 after). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
234 lines
11 KiB
XML
234 lines
11 KiB
XML
<Ui>
|
|
<!--
|
|
The game menu ESC opens, in the chrome of the reference's GameMenuFrame.xml.
|
|
Deviation: the rungs are the 1.15 era client's ESC menu, because its settings screens
|
|
replace 1.12's, which are much worse to use; the era's AddOns rung is dropped, since the
|
|
character-select AddOns screen is the only addon UI. Addons address `GameMenuFrame` by name.
|
|
-->
|
|
<Script><![CDATA[
|
|
-- Label strings as `X = X or "..."`, so a stock GlobalStrings value wins where one exists.
|
|
MAIN_MENU = MAIN_MENU or "Main Menu"
|
|
HUD_EDIT_MODE_MENU = HUD_EDIT_MODE_MENU or "Edit Mode"
|
|
GAMEMENU_SUPPORT = GAMEMENU_SUPPORT or "Support"
|
|
MACROS = MACROS or "Macros"
|
|
LOGOUT = LOGOUT or "Logout"
|
|
EXIT_GAME = EXIT_GAME or "Exit Game"
|
|
RETURN_TO_GAME = RETURN_TO_GAME or "Return to Game"
|
|
CANCEL = CANCEL or "Cancel"
|
|
|
|
-- A rung with nothing behind it yet (Edit Mode, Support), disabled.
|
|
function GameMenuButton_Pending(button, text)
|
|
button:SetText(text)
|
|
button:Disable()
|
|
end
|
|
|
|
-- ══ Our options window in the stock "is an options window open?" checks ══
|
|
-- Each wraps the stock body to add `BenillaOptionsFrame`; here because this file loads
|
|
-- last, after MainMenuBarMicroButtons.xml.
|
|
local Ref_IsOptionFrameOpen = IsOptionFrameOpen
|
|
local Ref_ToggleGameMenu = ToggleGameMenu
|
|
local Ref_UpdateMicroButtons = UpdateMicroButtons
|
|
|
|
-- Guarded for a test kit that loads the game menu without the options window.
|
|
local function BenillaOptions_IsOpen()
|
|
return BenillaOptionsFrame and BenillaOptionsFrame:IsVisible()
|
|
end
|
|
|
|
-- `UIParent.lua:996`: a yes keeps the ESC sweep off the centre panel, which our window is.
|
|
function IsOptionFrameOpen()
|
|
if BenillaOptions_IsOpen() then
|
|
return 1
|
|
end
|
|
return Ref_IsOptionFrameOpen()
|
|
end
|
|
|
|
-- `UIParent.lua:1465-1497`: static popup, then an open options window, then the stock
|
|
-- ladder. Our Close click is the discard-and-hide of the reference's `OptionsFrameCancel`.
|
|
function ToggleGameMenu(clicked)
|
|
if clicked then
|
|
-- As the reference's `clicked` arm: close an options window, then toggle.
|
|
if BenillaOptions_IsOpen() then
|
|
BenillaOptionsFrameCloseButton:Click()
|
|
end
|
|
return Ref_ToggleGameMenu(clicked)
|
|
end
|
|
if StaticPopup_EscapePressed() then
|
|
return
|
|
end
|
|
if BenillaOptions_IsOpen() then
|
|
BenillaOptionsFrameCloseButton:Click()
|
|
return
|
|
end
|
|
return Ref_ToggleGameMenu(clicked)
|
|
end
|
|
|
|
-- `MainMenuBarMicroButtons.lua:47-58`: only ever pushes the button, so the stock decision
|
|
-- stands and ours adds our window.
|
|
function UpdateMicroButtons()
|
|
if Ref_UpdateMicroButtons then
|
|
Ref_UpdateMicroButtons()
|
|
end
|
|
if MainMenuMicroButton and BenillaOptions_IsOpen() then
|
|
MainMenuMicroButton:SetButtonState("PUSHED", 1)
|
|
end
|
|
end
|
|
|
|
]]></Script>
|
|
|
|
<!-- The era's header font, which 1.12's Fonts.xml lacks. -->
|
|
<Font name="GameFontNormalMed1" inherits="GameFontNormal" virtual="true">
|
|
<FontHeight><AbsValue val="13"/></FontHeight>
|
|
</Font>
|
|
|
|
|
|
<!-- GameMenuFrame.xml:4's attributes but `movable`, inert there: it has no drag scripts. -->
|
|
<Frame name="GameMenuFrame" parent="UIParent" frameStrata="DIALOG" toplevel="true" enableMouse="true" hidden="true">
|
|
<!-- The era layout: 28+144+28 wide, 32 top, 28 bottom, 7 rungs of 21, 3 gaps of 20. -->
|
|
<Size><AbsDimension x="200" y="267"/></Size>
|
|
<Anchors><Anchor point="CENTER"/></Anchors>
|
|
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
|
|
<BackgroundInsets><AbsInset left="11" right="12" top="12" bottom="11"/></BackgroundInsets>
|
|
<TileSize><AbsValue val="32"/></TileSize>
|
|
<EdgeSize><AbsValue val="32"/></EdgeSize>
|
|
</Backdrop>
|
|
<Layers>
|
|
<Layer level="ARTWORK">
|
|
<Texture name="GameMenuFrameHeader" file="Interface\DialogFrame\UI-DialogBox-Header">
|
|
<Size><AbsDimension x="256" y="64"/></Size>
|
|
<Anchors><Anchor point="TOP"><Offset><AbsDimension x="0" y="12"/></Offset></Anchor></Anchors>
|
|
</Texture>
|
|
<!-- The era's 13px font on the 1.12 seat, within half a unit of the era's. -->
|
|
<FontString name="GameMenuFrameTitle" inherits="GameFontNormalMed1" text="MAIN_MENU">
|
|
<Anchors>
|
|
<Anchor point="TOP" relativeTo="GameMenuFrameHeader"><Offset><AbsDimension x="0" y="-14"/></Offset></Anchor>
|
|
</Anchors>
|
|
</FontString>
|
|
</Layer>
|
|
</Layers>
|
|
<Frames>
|
|
|
|
<!-- Literal: 1.12 has no GAMEMENU_OPTIONS; its OPTIONS_MENU is "Options Menu". -->
|
|
<Button name="GameMenuButtonOptions" inherits="GameMenuButtonTemplate" text="Options">
|
|
<Anchors>
|
|
<!-- Centred, not TOPLEFT+28. The 28 was (200-144)/2, the centring offset baked in as an
|
|
absolute left edge, and it is right only while the frame is 200 wide. Skins resize this
|
|
frame and keep the anchor: pfUI's Game Menu skin takes 30 off the width and re-applies
|
|
the button's own point verbatim (skins/blizzard/game_menu.lua), which leaves a TOPLEFT
|
|
offset pointing 15 too far right — the column then hangs 2px past the frame's right
|
|
edge. A TOP anchor re-centres on any width, which is what the reference's own chain
|
|
root does (CENTER to the frame's TOP) and what every skin assumes. -->
|
|
<Anchor point="TOP"><Offset><AbsDimension x="0" y="-32"/></Offset></Anchor>
|
|
</Anchors>
|
|
<Scripts>
|
|
<OnClick>
|
|
PlaySound("igMainMenuOption")
|
|
HideUIPanel(GameMenuFrame)
|
|
ShowUIPanel(BenillaOptionsFrame)
|
|
</OnClick>
|
|
</Scripts>
|
|
</Button>
|
|
|
|
<Button name="GameMenuButtonEditMode" inherits="GameMenuButtonTemplate">
|
|
<Anchors>
|
|
<Anchor point="TOPLEFT" relativeTo="GameMenuButtonOptions" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-20"/></Offset></Anchor>
|
|
</Anchors>
|
|
<Scripts><OnLoad>GameMenuButton_Pending(self, HUD_EDIT_MODE_MENU)</OnLoad></Scripts>
|
|
</Button>
|
|
<Button name="GameMenuButtonSupport" inherits="GameMenuButtonTemplate">
|
|
<Anchors>
|
|
<Anchor point="TOPLEFT" relativeTo="GameMenuButtonEditMode" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
|
</Anchors>
|
|
<!-- The era's Support opens the help window, which 1.12 opens from its "?"
|
|
micro button (`MainMenuBarMicroButtons.xml:217`); the menu closes first, as
|
|
the Macros rung below does. -->
|
|
<Scripts>
|
|
<OnLoad>self:SetText(GAMEMENU_SUPPORT)</OnLoad>
|
|
<OnClick>
|
|
PlaySound("igMainMenuOption")
|
|
HideUIPanel(getglobal("GameMenuFrame"))
|
|
ToggleHelpFrame()
|
|
</OnClick>
|
|
</Scripts>
|
|
</Button>
|
|
<Button name="GameMenuButtonMacros" inherits="GameMenuButtonTemplate" text="MACROS">
|
|
<Anchors>
|
|
<Anchor point="TOPLEFT" relativeTo="GameMenuButtonSupport" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
|
</Anchors>
|
|
<!-- GameMenuFrame.xml:118-122. -->
|
|
<Scripts>
|
|
<OnClick>
|
|
PlaySound("igMainMenuOption")
|
|
HideUIPanel(getglobal("GameMenuFrame"))
|
|
ShowMacroFrame()
|
|
</OnClick>
|
|
</Scripts>
|
|
</Button>
|
|
|
|
<!-- As the reference: disabled while a CAMP or QUIT countdown is up. -->
|
|
<Button name="GameMenuButtonLogout" inherits="GameMenuButtonTemplate" text="LOGOUT">
|
|
<Anchors>
|
|
<Anchor point="TOPLEFT" relativeTo="GameMenuButtonMacros" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-20"/></Offset></Anchor>
|
|
</Anchors>
|
|
<Scripts>
|
|
<OnShow>
|
|
if not StaticPopup_Visible("CAMP") and not StaticPopup_Visible("QUIT") then
|
|
self:Enable()
|
|
else
|
|
self:Disable()
|
|
end
|
|
</OnShow>
|
|
<OnClick>
|
|
PlaySound("igMainMenuLogout")
|
|
Logout()
|
|
HideUIPanel(GameMenuFrame)
|
|
</OnClick>
|
|
</Scripts>
|
|
</Button>
|
|
<Button name="GameMenuButtonQuit" inherits="GameMenuButtonTemplate" text="EXIT_GAME">
|
|
<Anchors>
|
|
<Anchor point="TOPLEFT" relativeTo="GameMenuButtonLogout" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
|
</Anchors>
|
|
<Scripts>
|
|
<OnShow>
|
|
if not StaticPopup_Visible("CAMP") and not StaticPopup_Visible("QUIT") then
|
|
self:Enable()
|
|
else
|
|
self:Disable()
|
|
end
|
|
</OnShow>
|
|
<OnClick>
|
|
PlaySound("igMainMenuQuit")
|
|
Quit()
|
|
HideUIPanel(GameMenuFrame)
|
|
</OnClick>
|
|
</Scripts>
|
|
</Button>
|
|
<Button name="GameMenuButtonContinue" inherits="GameMenuButtonTemplate" text="RETURN_TO_GAME">
|
|
<Anchors>
|
|
<Anchor point="TOPLEFT" relativeTo="GameMenuButtonQuit" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-20"/></Offset></Anchor>
|
|
</Anchors>
|
|
<Scripts>
|
|
<OnClick>
|
|
PlaySound("igMainMenuContinue")
|
|
HideUIPanel(GameMenuFrame)
|
|
</OnClick>
|
|
</Scripts>
|
|
</Button>
|
|
</Frames>
|
|
<!-- The reference's OnShow/OnHide, guarded for a test that loads no action bar. -->
|
|
<Scripts>
|
|
<OnShow>
|
|
-- ERA_WINDOW_SCALE (OptionsFrame.xml) stands in for the era's UIParent scale. A
|
|
-- second OnShow on this frame would replace this one.
|
|
this:SetScale(ERA_WINDOW_SCALE or 1)
|
|
if UpdateMicroButtons then UpdateMicroButtons() end
|
|
if Disable_BagButtons then Disable_BagButtons() end
|
|
</OnShow>
|
|
<OnHide>
|
|
if UpdateMicroButtons then UpdateMicroButtons() end
|
|
if Enable_BagButtons then Enable_BagButtons() end
|
|
</OnHide>
|
|
</Scripts>
|
|
</Frame>
|
|
</Ui>
|