- dialogs carry the reference's toplevel bit, so the stack-split window opens above Bagnon instead of behind it - the failure line fills its blank — "Requires Blacksmith Hammer", not "Requires" — and Opening casts stop printing a label the spell itself marks "no text" - the pet bar's Attack/Follow/Stay tooltips name their keybinding, and typed text reaches the focused frame through the client's own delivery walk - AtlasLoot parses again: our Lua keeps 5.0's compatibility semicolon Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
135 lines
7.3 KiB
XML
135 lines
7.3 KiB
XML
<Ui>
|
|
<!--
|
|
The chat-link tooltip (decision 0274 P4) - ref ItemRef.xml/ItemRef.lua, quoted: a
|
|
standalone GameTooltip instance parked above the bottom center that SetItemRef fills via
|
|
SetHyperlink when a chat item link is clicked, plus its corner close button. The plate,
|
|
the status bar and the OnHide come from GameTooltipTemplate — the same inheritance the ref
|
|
uses (ref ItemRef.xml l.4) — declared in GameTooltip.xml, which the manifest loads first.
|
|
|
|
Departures, each named:
|
|
- No coin row (ref: the template's $parentMoneyFrame): our money row is the coin trio the
|
|
GameTooltip instance declares, and its OnTooltipAddMoney/OnTooltipCleared pair stays
|
|
there with it, so a chat-link tooltip renders no price line. The reasoning is on
|
|
GameTooltipTemplate.
|
|
- No drag (ref: movable + RegisterForDrag + StartMoving/StopMovingOrSizing +
|
|
ValidateFramePosition): benilla has no user-moved-frame affordance yet - the window
|
|
sits on its declared anchor.
|
|
- SetItemRef's player-link branch lands here (ref l.3-46): left-click whispers,
|
|
right-click opens the name-only FRIEND dropdown (FriendsFrame_ShowDropdown, the
|
|
minimal FriendsFrame stand-in below), shift-click inserts into the chat editbox. The
|
|
ref's shift-click friends/ignore popup fills + SendWho("n-"..name) wait on the
|
|
friends/who arc (both guarded). The ITEM branch's Ctrl-DressUp landed with the dressing
|
|
room itself (decision 1060).
|
|
- No UIPanelWindows row (the ref has none either): ShowUIPanel's unregistered branch is
|
|
a plain Show, and SetHyperlink's own empty-gate shows/hides the plate.
|
|
-->
|
|
<Script><![CDATA[
|
|
-- ref ItemRef.lua SetItemRef (l.2-63): the chat-link click router. `link` is the payload
|
|
-- inside |H...|h ("item:2947:0:0:0" / "player:Name"), `text` the full escaped link,
|
|
-- `button` the mouse button.
|
|
function SetItemRef(link, text, button)
|
|
if strsub(link, 1, 6) == "player" then
|
|
local name = strsub(link, 8)
|
|
if name and strlen(name) > 0 then
|
|
-- ref l.6-7: collapse a space-separated name to its last token (a no-op for
|
|
-- the single-token names 1.12 uses).
|
|
name = gsub(name, "([^%s]*)%s+([^%s]*)%s+([^%s]*)", "%3")
|
|
name = gsub(name, "([^%s]*)%s+([^%s]*)", "%2")
|
|
if IsShiftKeyDown() then
|
|
-- ref fills a visible ADD_IGNORE/ADD_FRIEND/… popup editbox first (those
|
|
-- dialogs are the friends/ignore arc, deferred), else the chat editbox,
|
|
-- else SendWho (the /who arc, deferred) — we take the ref's editbox tail,
|
|
-- both branches guarded.
|
|
if ChatFrameEditBox and ChatFrameEditBox:IsVisible() then
|
|
ChatFrameEditBox:Insert(name)
|
|
elseif SendWho then
|
|
SendWho("n-"..name)
|
|
end
|
|
elseif button == "RightButton" then
|
|
FriendsFrame_ShowDropdown(name, 1)
|
|
else
|
|
ChatFrame_SendTell(name)
|
|
end
|
|
end
|
|
return
|
|
end
|
|
if IsControlKeyDown() then
|
|
-- ref l.50: ctrl-clicking an item link in chat previews it on your own character
|
|
-- (decision 1060). `text` is the FULL escaped link, not the bare payload —
|
|
-- DressUpItemLink pulls the id out of it itself.
|
|
DressUpItemLink(text)
|
|
return
|
|
end
|
|
if IsShiftKeyDown() then
|
|
if ChatFrameEditBox and ChatFrameEditBox:IsVisible() then
|
|
ChatFrameEditBox:Insert(text)
|
|
end
|
|
return
|
|
end
|
|
ShowUIPanel(ItemRefTooltip)
|
|
if not ItemRefTooltip:IsVisible() then
|
|
ItemRefTooltip:SetOwner(UIParent, "ANCHOR_PRESERVE")
|
|
end
|
|
ItemRefTooltip:SetHyperlink(link)
|
|
end
|
|
|
|
-- Minimal FriendsFrame stand-in for the chat-name right-click menu (ref FriendsFrame.lua
|
|
-- l.35-47). The full social window (friends/ignore/who tabs) is a later arc; this hosts
|
|
-- only the name-only FRIEND dropdown the chat links share with the unit popups.
|
|
function FriendsFrame_ShowDropdown(name, connected)
|
|
HideDropDownMenu(1)
|
|
if connected then
|
|
FriendsDropDown.initialize = FriendsFrameDropDown_Initialize
|
|
FriendsDropDown.displayMode = "MENU"
|
|
FriendsDropDown.name = name
|
|
ToggleDropDownMenu(1, nil, FriendsDropDown, "cursor")
|
|
end
|
|
end
|
|
|
|
function FriendsFrameDropDown_Initialize()
|
|
UnitPopup_ShowMenu(getglobal(UIDROPDOWNMENU_OPEN_MENU), "FRIEND", nil, FriendsDropDown.name)
|
|
end
|
|
]]></Script>
|
|
|
|
<!-- `toplevel` is the ref's (ItemRef.xml l.3) — a linked-item tooltip is a window that must
|
|
land above the HIGH-strata frames it is opened over (decision 1318). -->
|
|
<GameTooltip name="ItemRefTooltip" inherits="GameTooltipTemplate" frameStrata="HIGH" toplevel="true" hidden="true">
|
|
<Size><AbsDimension x="128" y="64"/></Size>
|
|
<Anchors>
|
|
<Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="80"/></Offset></Anchor>
|
|
</Anchors>
|
|
<Frames>
|
|
<!-- ref ItemRefCloseButton (ItemRef.xml l.17-36, quoted): the corner minimize-style
|
|
close; OnLoad's SetPadding(16) keeps it off the text. -->
|
|
<Button name="ItemRefCloseButton">
|
|
<Size><AbsDimension x="32" y="32"/></Size>
|
|
<Anchors>
|
|
<Anchor point="TOPRIGHT"><Offset><AbsDimension x="1" y="0"/></Offset></Anchor>
|
|
</Anchors>
|
|
<Scripts>
|
|
<OnClick>HideUIPanel(ItemRefTooltip)</OnClick>
|
|
</Scripts>
|
|
<NormalTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Up"/>
|
|
<PushedTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Down"/>
|
|
<HighlightTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Highlight" alphaMode="ADD"/>
|
|
</Button>
|
|
</Frames>
|
|
<Scripts>
|
|
<!-- The template's own OnLoad, re-declared to add the padding (ref ItemRef.xml
|
|
l.38-42's shape, minus its drag arming — see the no-drag departure above); the
|
|
loader's later SetScript wins, so GameTooltip_OnLoad has to be called here too.
|
|
OnHide is the template's unchanged, so it is not re-declared — ref ItemRef.xml
|
|
declares none either. -->
|
|
<OnLoad>
|
|
GameTooltip_OnLoad(self)
|
|
self:SetPadding(16)
|
|
</OnLoad>
|
|
</Scripts>
|
|
</GameTooltip>
|
|
|
|
<!-- The chat-name dropdown host (ref FriendsFrame's FriendsDropDown): a bare UIDropDownMenu
|
|
the SetItemRef player branch toggles at the cursor. UIDropDownMenuTemplate + UnitPopup
|
|
both load before this file (the ui_script load order). -->
|
|
<Frame name="FriendsDropDown" parent="UIParent" inherits="UIDropDownMenuTemplate" hidden="true"/>
|
|
</Ui>
|