Files
benilla-octo/crates/benilla-app/assets/ui/TradeFrame.xml
T
SamandClaude Fable 5.1 ad7edb3198 a 40-man raid costs less per frame, and the money frames go stock
- a 40-man raid cost +5 to +8 ms of CPU per frame — a population, not a hot function — and three cuts landed where it was measured: the rig palette upload sends one `write_buffer` per run, bridging the gaps parked bodies leave between live rigs (calls 93 → 3); a built material becomes an asset when something visible binds it, not when a spawner builds it — 9.9k material assets were alive for 36 drawn batches, so a material is realized only once bound and visible, readers that clone before binding doing it themselves through one new function in the engine's wall (172 → 173): a 17× cut in live GPU objects; and a body's batches spawn as material groups — a geared body stood as 12–27 mesh parts, its skin composite drawn as five separate batches, and two visible batches now join when nothing downstream can tell them apart: parts per body 17 → 12, the Stormwind raid leg 17.0–21.0 → 15.65–15.82 `cpu_ms` (1929, 1940)
- the instruments that priced it, all on the probe line: wgpu's own resource census, because a sampled profile put roughly half of the pass encoder in usage trackers sized to the device's live buffer and texture counts — a term that scales with residency, not with what is drawn, and nothing printed the number; the active camera count, since every view is its own pass set; the UI's live texture-identity runs, one 2D draw each, which is the number a UI change moves, not the quad count; and parts and materials per dressed body on the dress census, the ceiling on merging a body's batches read off a real body instead of guessed from a model's batch table (1940)
- the coin kit retires: every remaining money display — quest progress, the mail purse and postage, the trade recipient, the tooltip, the quest log, the trainer's purse and cost — moves onto the reference's `MoneyFrameTemplate`, each seat already matching ours; the progress panel's required-money flow is ported in full — `QuestFrame.lua:168-190` colours the FRAME red/white AND the LABEL black/dark-grey when the quest costs more than you hold, where ours had neither colour; the mail postage takes the reference's name and label, trade and mail issue no explicit update because the frames repaint on their own events, and the trainer's cost label is shown or hidden with its `local COSTS_LABEL` shadow deleted; with the trainer converted the hand-built coin trios have no consumer, so their templates and the `BenillaMoney_*` helpers are deleted and `MoneyFrame.xml` is the only money kit (1937)
- the crowd-control ladder's aura exemption exists, and it is a join between two `Spell.dbc` records — each arm asks whether the spell being cast is itself an immunity covering the aura that blocks it (Ice Block cast while stunned), the school arm shifting because `School` is an index and `EffectMiscValue` a mask; what the scan mostly decides is WHICH message a refusal carries — a blocking aura the cast does not counter renames the reason to "Can't do that while %s" (1941); bevy_audio leaves the build — its plugin had been disabled since 0530, but disabling a plugin does not remove a crate, and rodio, a second cpal and an Ogg/Vorbis decoder were still linked into a client that mixes through kira (1932); and cpal has four stream errors, not two — a routine ALSA underrun was treated as "the device is gone", tearing the stream down on every hiccup; now only a lost or invalidated device rebuilds (1939)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 20:53:37 +07:00

513 lines
32 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<Ui>
<!--
benilla's player-to-player trade window (decision 0592 P1). The geometry/art/texcoords are
transcribed from the reference `TradeFrame.xml` (WoW/_extracted_framexml/TradeFrame.xml) —
sizes, offsets, anchors, art files, texcoords — adapted only in (a) naming (every `Foo` →
`BenillaFoo`) and (b) feed/intent wiring onto the trade script API
(`benilla-ui/src/script/trade.rs`) + `crate::ui_trade`'s feed/drain. The house dressing
convention (decisions 0084/0112/0120/0544).
Where the reference inherits a shared template benilla does NOT ship (ItemButtonTemplate,
UIPanelButtonTemplate, UIPanelCloseButton, MoneyInputFrameTemplate, SmallMoneyFrameTemplate),
the body is inlined with the reference's own geometry/art (the MailFrame.xml precedent). The
two money displays reuse `MerchantFrame.xml`'s global `BenillaMoney_*` coin trio (read-only in
P1); the reference's editable `MoneyInputFrame` on the player's side is decision 0592 P2.
SCOPE (decision 0592 P1): the window opens on an incoming/initiated trade and mirrors both
sides' items + gold live, the partner's portrait (the shared "npc" booth) + name, and the
accept glow; the Trade/Cancel buttons drive the accept/cancel verbs. DEFERRED to P2: setting
items/gold onto the window (the drag-drop slots + the editable money widget), so the item
slots carry NO OnClick/OnEnter here, and the slot tooltips (GameTooltip:SetTradePlayerItem)
are P2. The enchant-slot spell name (slot 7's "enchantment") is decision 0592 P3.
-->
<Script><![CDATA[
MAX_TRADE_ITEMS = 7 -- MAX_TRADE_ITEMS (ref TradeFrame.lua l.1)
-- One side's accept glow. A column's highlight and the enchant slot's below it are one
-- indicator in two frames — they light and drop together, never apart — so both the repaint
-- and TradeFrame_SetAcceptState go through here rather than each spelling out four calls.
-- The four frames are TradeHighlight{Player,Recipient}[Enchant], declared at the bottom.
local function setTradeGlow(column, enchantSlot, lit)
if lit then
column:Show()
enchantSlot:Show()
else
column:Hide()
enchantSlot:Hide()
end
end
-- ── Load / event dispatch (ref TradeFrame_OnLoad l.4 / TradeFrame_OnEvent l.18) ───────────
function TradeFrame_OnLoad()
local frame = this
frame:RegisterEvent("TRADE_SHOW")
frame:RegisterEvent("TRADE_UPDATE")
frame:RegisterEvent("TRADE_CLOSED")
frame:RegisterEvent("TRADE_PLAYER_ITEM_CHANGED")
frame:RegisterEvent("TRADE_TARGET_ITEM_CHANGED")
frame:RegisterEvent("TRADE_ACCEPT_UPDATE")
-- Our accepted gold, echoed back so the input reflects the server's clamp (ref
-- TradePlayerInputMoneyFrame's own PLAYER_TRADE_MONEY registration, l.565). Kept off the
-- general TRADE_UPDATE repaint so it never overwrites what the player is mid-typing.
frame:RegisterEvent("PLAYER_TRADE_MONEY")
end
function TradeFrame_OnEvent()
local frame = this
if event == "TRADE_SHOW" or event == "TRADE_UPDATE" then
ShowUIPanel(frame)
if not frame:IsVisible() then
CloseTrade()
return
end
TradeFrameTradeButton:Enable()
TradeFrame_Update()
elseif event == "PLAYER_TRADE_MONEY" then
MoneyInputFrame_SetCopper(TradePlayerInputMoney, GetPlayerTradeMoney())
elseif event == "TRADE_CLOSED" then
HideUIPanel(frame)
elseif event == "TRADE_PLAYER_ITEM_CHANGED" then
TradeFrame_UpdatePlayerItem(arg1)
elseif event == "TRADE_TARGET_ITEM_CHANGED" then
TradeFrame_UpdateTargetItem(arg1)
elseif event == "TRADE_ACCEPT_UPDATE" then
TradeFrame_SetAcceptState(arg1, arg2)
end
end
function TradeFrame_OnShow()
TradeFrame.acceptState = 0
end
function TradeFrame_OnHide()
-- The client-side close verb (ref TradeFrame_OnHide l.144) → CMSG_CANCEL_TRADE + a local
-- clear (the app's drain); clear our money entry so a later trade opens fresh (ref l.146).
MoneyInputFrame_ResetMoney(TradePlayerInputMoney)
CloseTrade()
end
-- A keystroke in our money input (ref TradeFrame_UpdateMoney l.162): read the copper total,
-- clamp to what we actually carry, and offer it → SetTradeMoney → CMSG_SET_TRADE_GOLD.
function TradeFrame_UpdateMoney()
local copper = MoneyInputFrame_GetCopper(TradePlayerInputMoney)
if GetMoney and copper > GetMoney() then
copper = GetPlayerTradeMoney()
MoneyInputFrame_SetCopper(TradePlayerInputMoney, copper)
end
SetTradeMoney(copper)
end
-- ── Full repaint (ref TradeFrame_Update l.39): portraits, names, all 7 slots each side, the
-- two money displays, the accept highlights hidden. ────────────────────────────────────
function TradeFrame_Update()
SetPortraitTexture(TradeFramePlayerPortrait, "player")
-- The partner rides the shared "npc" portrait booth (the app points it at the partner
-- entity, decision 0592); the name comes from GetTradePartnerName() in place of the
-- reference's UnitName("NPC").
SetPortraitTexture(TradeFrameRecipientPortrait, "npc")
TradeFramePlayerNameText:SetText(UnitName("player") or "")
TradeFrameRecipientNameText:SetText(GetTradePartnerName() or "")
for i = 1, MAX_TRADE_ITEMS do
TradeFrame_UpdatePlayerItem(i)
TradeFrame_UpdateTargetItem(i)
end
-- Our gold is the editable input, reflected via PLAYER_TRADE_MONEY (not repainted here, so
-- the repaint never clobbers mid-typing); only the partner's read-only gold repaints.
-- The recipient's money frame is type TARGET_TRADE and repaints itself on
-- TRADE_MONEY_CHANGED (MoneyFrame_OnEvent); the reference issues no explicit update
-- here and neither do we (1937).
-- A repaint puts both glows down. TRADE_ACCEPT_UPDATE is the only thing that raises
-- them, so whatever is standing comes straight back on the next one.
setTradeGlow(TradeHighlightPlayer, TradeHighlightPlayerEnchant, false)
setTradeGlow(TradeHighlightRecipient, TradeHighlightRecipientEnchant, false)
end
-- One slot's paint, shared by both columns (ref TradeFrame_UpdatePlayerItem l.54 /
-- UpdateTargetItem l.83). `isTarget` gates the recipient-only not-usable red tint.
function BenillaTradeSlot_SetItem(prefix, id, name, texture, numItems, isUsable, enchantment, isTarget)
local nameText = getglobal(prefix.."Name")
local icon = getglobal(prefix.."ItemButtonIcon")
local count = getglobal(prefix.."ItemButtonCount")
-- The enchant slot (id 7): the enchant name (P3) or the "will not be traded" note.
if id == MAX_TRADE_ITEMS then
if name then
if enchantment then
nameText:SetText("|cff20ff20"..enchantment.."|r")
else
nameText:SetText("|cffffffffWill Not Be Traded|r")
end
else
nameText:SetText("")
end
else
nameText:SetText(name or "")
end
if texture then
icon:SetTexture(texture)
icon:Show()
else
icon:Hide()
end
if numItems and numItems > 1 then
count:SetText(numItems)
count:Show()
else
count:SetText("")
count:Hide()
end
-- The recipient not-usable red tint (ref l.105-113): red when the partner offers an item
-- our class/level/skill can't use; white otherwise (and always white on our own column).
local slotTex = getglobal(prefix.."SlotTexture")
local nameFrame = getglobal(prefix.."NameFrame")
if isTarget and name and not isUsable then
icon:SetVertexColor(0.9, 0, 0)
nameFrame:SetVertexColor(0.9, 0, 0)
slotTex:SetVertexColor(1.0, 0, 0)
else
icon:SetVertexColor(1, 1, 1)
nameFrame:SetVertexColor(1, 1, 1)
slotTex:SetVertexColor(1, 1, 1)
end
end
function TradeFrame_UpdatePlayerItem(id)
local name, texture, numItems, isUsable, enchantment = GetTradePlayerItemInfo(id)
BenillaTradeSlot_SetItem("TradePlayerItem"..id, id, name, texture, numItems, isUsable, enchantment, nil)
end
function TradeFrame_UpdateTargetItem(id)
local name, texture, numItems, quality, isUsable, enchantment = GetTradeTargetItemInfo(id)
BenillaTradeSlot_SetItem("TradeRecipientItem"..id, id, name, texture, numItems, isUsable, enchantment, 1)
end
-- A trade slot's item button as a cursor drop target (decision 0592 P2, ref ClickTradeButton /
-- ClickTargetTradeButton, TradeFrame.xml l.135/101). Both columns share the slot template, so
-- player-vs-recipient is read off the slot frame's name; the slot number is its frame id. Our
-- slot drops/clears a bag item (SET/CLEAR_TRADE_ITEM); the partner's column is read-only.
function BenillaTradeSlot_OnClick(button)
local slot = button:GetParent()
local id = slot:GetID()
if string.find(slot:GetName(), "Player", 1, true) then
ClickTradeButton(id)
else
ClickTargetTradeButton(id)
end
end
-- Who has pressed Trade (spec: ref TradeFrame_SetAcceptState l.116). The event carries BOTH
-- sides' states, so this is a straight repaint of two indicators rather than a toggle — and
-- our own half is kept on the frame, because the Cancel button below is the only reader of
-- whether there is an accept of ours to withdraw.
--
-- The extra thing our own accept does is lock the Trade button, so a standing accept cannot
-- be sent a second time; Cancel is what takes it back.
function TradeFrame_SetAcceptState(playerState, targetState)
TradeFrame.acceptState = playerState
local weAccepted = playerState == 1
setTradeGlow(TradeHighlightPlayer, TradeHighlightPlayerEnchant, weAccepted)
setTradeGlow(TradeHighlightRecipient, TradeHighlightRecipientEnchant, targetState == 1)
if weAccepted then
TradeFrameTradeButton:Disable()
else
TradeFrameTradeButton:Enable()
end
end
-- Cancel is two verbs on one button (spec: ref TradeFrameCancelButton_OnClick l.136). With
-- an accept of ours standing it withdraws only THAT and the trade stays open — the button
-- is the only way back out of the lock above. With no accept up there is nothing to
-- withdraw, so it means "leave", and closing the window is what sends that (→ OnHide →
-- CloseTrade).
function TradeFrameCancelButton_OnClick()
if TradeFrame.acceptState ~= 1 then
HideUIPanel(TradeFrame)
return
end
CancelTradeAccept()
end
]]></Script>
<!-- The accept-glow highlight (ref TradeHighlightTemplate l.4): a 3-slice UI-TradeFrame-Highlight
(top/bottom caps + a stretched middle), sized per-instance. -->
<Frame name="BenillaTradeHighlightTemplate" hidden="false" virtual="true">
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentTop" file="Interface\TradeFrame\UI-TradeFrame-Highlight">
<Size><AbsDimension x="161" y="16"/></Size>
<Anchors><Anchor point="TOPLEFT"/></Anchors>
<TexCoords left="0" right="0.62890625" top="0" bottom="0.0625"/>
</Texture>
<Texture name="$parentBottom" file="Interface\TradeFrame\UI-TradeFrame-Highlight">
<Size><AbsDimension x="161" y="16"/></Size>
<Anchors><Anchor point="BOTTOMLEFT"/></Anchors>
<TexCoords left="0" right="0.62890625" top="0.9375" bottom="1.0"/>
</Texture>
<Texture name="$parentMiddle" file="Interface\TradeFrame\UI-TradeFrame-Highlight">
<Size><AbsDimension x="161" y="10"/></Size>
<Anchors>
<Anchor point="TOP" relativeTo="$parentTop" relativePoint="BOTTOM"/>
<Anchor point="BOTTOM" relativeTo="$parentBottom" relativePoint="TOP"/>
</Anchors>
<TexCoords left="0" right="0.62890625" top="0.0625" bottom="0.9375"/>
</Texture>
</Layer>
</Layers>
</Frame>
<!-- One trade slot (ref TradeItemTemplate l.38 + PlayerTradeItemTemplate's inlined ItemButton
l.120): the empty-slot art, the name plate, the item name, and a 37px item button (icon +
stack count). Display-only in P1 — no OnClick/OnEnter (decision 0592 P2). -->
<Frame name="BenillaTradeItemTemplate" virtual="true">
<Size><AbsDimension x="153" y="37"/></Size>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentSlotTexture" file="Interface\Buttons\UI-EmptySlot">
<Size><AbsDimension x="64" y="64"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-13" y="13"/></Offset></Anchor></Anchors>
</Texture>
<Texture name="$parentNameFrame" file="Interface\QuestFrame\UI-QuestItemNameFrame">
<Size><AbsDimension x="124" y="64"/></Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentSlotTexture" relativePoint="RIGHT"><Offset><AbsDimension x="-20" y="0"/></Offset></Anchor>
</Anchors>
</Texture>
<FontString name="$parentName" inherits="GameFontNormalSmall" text="" justifyH="LEFT">
<Size><AbsDimension x="90" y="30"/></Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentNameFrame"><Offset><AbsDimension x="15" y="0"/></Offset></Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="$parentItemButton">
<Size><AbsDimension x="37" y="37"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="$parent"/></Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentIcon" hidden="true" setAllPoints="true"/>
</Layer>
<Layer level="ARTWORK">
<FontString name="$parentCount" inherits="NumberFontNormal" hidden="true" justifyH="RIGHT">
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-2" y="2"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
<HighlightTexture file="Interface\Buttons\ButtonHilight-Square" alphaMode="ADD"/>
<!-- A cursor drop target (decision 0592 P2): a click or a drag-release routes through
the shared slot handler, which places/clears on our side and is inert on the
partner's. Both gestures share one path, the reference's drag/click contract. -->
<Scripts>
<OnClick>BenillaTradeSlot_OnClick(self)</OnClick>
<OnReceiveDrag>BenillaTradeSlot_OnClick(self)</OnReceiveDrag>
</Scripts>
</Button>
</Frames>
</Frame>
<!-- The enchant / non-traded slot art (ref TradeRecipientItem7/TradePlayerItem7 l.393): the
EnchantIcon overlay sits over slot 7's item button. A virtual twin of the base slot with the
extra icon, instantiated only for id 7. -->
<Frame name="BenillaTradeEnchantItemTemplate" inherits="BenillaTradeItemTemplate" virtual="true">
<Frames>
<Frame name="$parentEnchant" setAllPoints="false">
<Size><AbsDimension x="62" y="62"/></Size>
<Anchors><Anchor point="TOPLEFT"/></Anchors>
<Layers>
<Layer level="OVERLAY">
<Texture file="Interface\TradeFrame\UI-TradeFrame-EnchantIcon" setAllPoints="true"/>
</Layer>
</Layers>
</Frame>
</Frames>
</Frame>
<Frame name="TradeFrame" parent="UIParent" toplevel="true" movable="true" enableMouse="true" hidden="true">
<!-- ref TradeFrame l.164: 384×512; ShowUIPanel slots it left. -->
<Size><AbsDimension x="384" y="512"/></Size>
<HitRectInsets><AbsInset left="0" right="35" top="0" bottom="72"/></HitRectInsets>
<Layers>
<Layer level="BACKGROUND">
<!-- ref l.180: the two 60×60 unit portraits (recipient right, player left). -->
<Texture name="TradeFrameRecipientPortrait">
<Size><AbsDimension x="60" y="60"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="183" y="-6"/></Offset></Anchor></Anchors>
</Texture>
<Texture name="TradeFramePlayerPortrait">
<Size><AbsDimension x="60" y="60"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="7" y="-6"/></Offset></Anchor></Anchors>
</Texture>
</Layer>
<Layer level="ARTWORK">
<!-- ref l.205: the four corner slabs. -->
<Texture file="Interface\TradeFrame\UI-TradeFrame-TopLeft">
<Size><AbsDimension x="256" y="256"/></Size>
<Anchors><Anchor point="TOPLEFT"/></Anchors>
</Texture>
<Texture file="Interface\TradeFrame\UI-TradeFrame-TopRight">
<Size><AbsDimension x="128" y="256"/></Size>
<Anchors><Anchor point="TOPRIGHT"/></Anchors>
</Texture>
<Texture file="Interface\TradeFrame\UI-TradeFrame-BotLeft">
<Size><AbsDimension x="256" y="256"/></Size>
<Anchors><Anchor point="BOTTOMLEFT"/></Anchors>
</Texture>
<Texture file="Interface\TradeFrame\UI-TradeFrame-BotRight">
<Size><AbsDimension x="128" y="256"/></Size>
<Anchors><Anchor point="BOTTOMRIGHT"/></Anchors>
</Texture>
<FontString name="TradeFrameRecipientNameText" inherits="GameFontNormal" text="">
<Size><AbsDimension x="80" y="12"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="TradeFrame"><Offset><AbsDimension x="245" y="-17"/></Offset></Anchor></Anchors>
</FontString>
<FontString name="TradeFramePlayerNameText" inherits="GameFontNormal" text="">
<Size><AbsDimension x="100" y="12"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="TradeFrame"><Offset><AbsDimension x="75" y="-17"/></Offset></Anchor></Anchors>
</FontString>
<!-- ref l.262: the "Will Be Enchanted" column labels above the enchant slots. -->
<FontString name="TradeFramePlayerEnchantText" inherits="GameFontHighlightSmall" text="Will Be Enchanted">
<Anchors><Anchor point="TOPLEFT" relativeTo="TradeFrame"><Offset><AbsDimension x="26" y="-374"/></Offset></Anchor></Anchors>
</FontString>
<FontString name="TradeFrameRecipientEnchantText" inherits="GameFontHighlightSmall" text="Will Be Enchanted">
<Anchors><Anchor point="LEFT" relativeTo="TradeFramePlayerEnchantText"><Offset><AbsDimension x="170" y="0"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<!-- The accept-glow highlights, one per column + its enchant slot (ref l.283). -->
<Frame name="TradeHighlightPlayer" inherits="BenillaTradeHighlightTemplate" hidden="true">
<Size><AbsDimension x="161" y="266"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="TradeFrame"><Offset><AbsDimension x="19" y="-100"/></Offset></Anchor></Anchors>
</Frame>
<Frame name="TradeHighlightRecipient" inherits="BenillaTradeHighlightTemplate" hidden="true">
<Size><AbsDimension x="161" y="266"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="189" y="-100"/></Offset></Anchor></Anchors>
</Frame>
<Frame name="TradeHighlightPlayerEnchant" inherits="BenillaTradeHighlightTemplate" hidden="true">
<Size><AbsDimension x="161" y="61"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="TradeHighlightPlayer" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-4"/></Offset></Anchor></Anchors>
</Frame>
<Frame name="TradeHighlightRecipientEnchant" inherits="BenillaTradeHighlightTemplate" hidden="true">
<Size><AbsDimension x="161" y="61"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="TradeHighlightRecipient" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-4"/></Offset></Anchor></Anchors>
</Frame>
<!-- The partner's 6 trade slots + the 7th enchant slot (ref TradeRecipientItem1..7 l.331). -->
<Frame name="TradeRecipientItem1" inherits="BenillaTradeItemTemplate" id="1">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="195" y="-104"/></Offset></Anchor></Anchors>
</Frame>
<Frame name="TradeRecipientItem2" inherits="BenillaTradeItemTemplate" id="2">
<Anchors><Anchor point="TOPLEFT" relativeTo="TradeRecipientItem1" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-7"/></Offset></Anchor></Anchors>
</Frame>
<Frame name="TradeRecipientItem3" inherits="BenillaTradeItemTemplate" id="3">
<Anchors><Anchor point="TOPLEFT" relativeTo="TradeRecipientItem2" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-7"/></Offset></Anchor></Anchors>
</Frame>
<Frame name="TradeRecipientItem4" inherits="BenillaTradeItemTemplate" id="4">
<Anchors><Anchor point="TOPLEFT" relativeTo="TradeRecipientItem3" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-7"/></Offset></Anchor></Anchors>
</Frame>
<Frame name="TradeRecipientItem5" inherits="BenillaTradeItemTemplate" id="5">
<Anchors><Anchor point="TOPLEFT" relativeTo="TradeRecipientItem4" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-7"/></Offset></Anchor></Anchors>
</Frame>
<Frame name="TradeRecipientItem6" inherits="BenillaTradeItemTemplate" id="6">
<Anchors><Anchor point="TOPLEFT" relativeTo="TradeRecipientItem5" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-7"/></Offset></Anchor></Anchors>
</Frame>
<Frame name="TradeRecipientItem7" inherits="BenillaTradeEnchantItemTemplate" id="7">
<Anchors><Anchor point="TOPLEFT" relativeTo="TradeRecipientItem6" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-28"/></Offset></Anchor></Anchors>
</Frame>
<!-- Our 6 trade slots + the 7th enchant slot (ref TradePlayerItem1..7 l.410). -->
<Frame name="TradePlayerItem1" inherits="BenillaTradeItemTemplate" id="1">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="26" y="-104"/></Offset></Anchor></Anchors>
</Frame>
<Frame name="TradePlayerItem2" inherits="BenillaTradeItemTemplate" id="2">
<Anchors><Anchor point="TOPLEFT" relativeTo="TradePlayerItem1" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-7"/></Offset></Anchor></Anchors>
</Frame>
<Frame name="TradePlayerItem3" inherits="BenillaTradeItemTemplate" id="3">
<Anchors><Anchor point="TOPLEFT" relativeTo="TradePlayerItem2" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-7"/></Offset></Anchor></Anchors>
</Frame>
<Frame name="TradePlayerItem4" inherits="BenillaTradeItemTemplate" id="4">
<Anchors><Anchor point="TOPLEFT" relativeTo="TradePlayerItem3" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-7"/></Offset></Anchor></Anchors>
</Frame>
<Frame name="TradePlayerItem5" inherits="BenillaTradeItemTemplate" id="5">
<Anchors><Anchor point="TOPLEFT" relativeTo="TradePlayerItem4" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-7"/></Offset></Anchor></Anchors>
</Frame>
<Frame name="TradePlayerItem6" inherits="BenillaTradeItemTemplate" id="6">
<Anchors><Anchor point="TOPLEFT" relativeTo="TradePlayerItem5" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-7"/></Offset></Anchor></Anchors>
</Frame>
<Frame name="TradePlayerItem7" inherits="BenillaTradeEnchantItemTemplate" id="7">
<Anchors><Anchor point="TOPLEFT" relativeTo="TradePlayerItem6" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-28"/></Offset></Anchor></Anchors>
</Frame>
<!-- The Trade button (ref l.502, UIPanelButtonTemplate inlined): OnClick → AcceptTrade. -->
<Button name="TradeFrameTradeButton" text="Trade">
<Size><AbsDimension x="85" y="22"/></Size>
<Anchors><Anchor point="BOTTOMRIGHT" relativeTo="TradeFrame" relativePoint="BOTTOMRIGHT"><Offset><AbsDimension x="-113" y="55"/></Offset></Anchor></Anchors>
<NormalTexture file="Interface\Buttons\UI-Panel-Button-Up"><TexCoords left="0" right="0.625" top="0" bottom="0.6875"/></NormalTexture>
<PushedTexture file="Interface\Buttons\UI-Panel-Button-Down"><TexCoords left="0" right="0.625" top="0" bottom="0.6875"/></PushedTexture>
<DisabledTexture file="Interface\Buttons\UI-Panel-Button-Disabled"><TexCoords left="0" right="0.625" top="0" bottom="0.6875"/></DisabledTexture>
<HighlightTexture file="Interface\Buttons\UI-Panel-Button-Highlight" alphaMode="ADD"><TexCoords left="0" right="0.625" top="0" bottom="0.6875"/></HighlightTexture>
<ButtonText name="$parentText"/>
<NormalFont inherits="GameFontNormal"/><HighlightFont inherits="GameFontHighlight"/><DisabledFont inherits="GameFontDisable"/>
<Scripts><OnClick>AcceptTrade()</OnClick></Scripts>
</Button>
<Button name="TradeFrameCancelButton" text="Cancel">
<Size><AbsDimension x="77" y="22"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="TradeFrameTradeButton" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
<NormalTexture file="Interface\Buttons\UI-Panel-Button-Up"><TexCoords left="0" right="0.625" top="0" bottom="0.6875"/></NormalTexture>
<PushedTexture file="Interface\Buttons\UI-Panel-Button-Down"><TexCoords left="0" right="0.625" top="0" bottom="0.6875"/></PushedTexture>
<HighlightTexture file="Interface\Buttons\UI-Panel-Button-Highlight" alphaMode="ADD"><TexCoords left="0" right="0.625" top="0" bottom="0.6875"/></HighlightTexture>
<ButtonText name="$parentText"/>
<NormalFont inherits="GameFontNormal"/><HighlightFont inherits="GameFontHighlight"/><DisabledFont inherits="GameFontDisable"/>
<Scripts><OnClick>TradeFrameCancelButton_OnClick()</OnClick></Scripts>
</Button>
<!-- The window close X (ref l.544, UIPanelCloseButton inlined). -->
<Button name="TradeFrameCloseButton">
<Size><AbsDimension x="32" y="32"/></Size>
<Anchors><Anchor point="TOPRIGHT" relativeTo="TradeFrame" relativePoint="TOPRIGHT"><Offset><AbsDimension x="-25" y="-8"/></Offset></Anchor></Anchors>
<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"/>
<Scripts><OnClick>HideUIPanel(TradeFrame)</OnClick></Scripts>
</Button>
<!-- Our gold — EDITABLE (ref TradeFrame.xml l.553 `TradePlayerInputMoneyFrame`). The three
boxes come off the chain now: `MoneyInputFrameTemplate` out of
`Interface\FrameXML\MoneyInputFrame.xml`, which benilla.toc has sourced since 1751
window 23. Our inline trio was a verbatim copy of it — same child names, same
textures and TexCoords, same tab chain, same 58/30/30 geometry — so this is the
rare swap that changes no pixel by itself (1882).
`SetMode("compact")` is the reference's own call on this frame and DOES move
things: Gold 58->56 wide, Silver's offset 26->22, Copper's 16->11. We did not have
it, so the trade money boxes tighten by a few pixels. That is the migration
restoring the reference's layout, not a new choice.
A keystroke drives TradeFrame_UpdateMoney -> SetTradeMoney -> CMSG_SET_TRADE_GOLD,
registered through the reference's own callback slot rather than a hand-written
OnTextChanged on each box; the server's echo comes back on PLAYER_TRADE_MONEY. -->
<Frame name="TradePlayerInputMoney" inherits="MoneyInputFrameTemplate">
<Size><AbsDimension x="176" y="18"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="26" y="-73"/></Offset></Anchor></Anchors>
<Scripts>
<OnLoad>
MoneyInputFrame_SetMode(this, "compact")
MoneyInputFrame_SetOnvalueChangedFunc(this, TradeFrame_UpdateMoney)
</OnLoad>
</Scripts>
</Frame>
<!-- The partner's gold (read-only — GetTargetTradeMoney; ref TradeRecipientMoneyFrame l.574). -->
<!-- ref TradeFrame.xml:574-588: a SmallMoneyFrameTemplate of type TARGET_TRADE, which repaints
itself on TRADE_MONEY_CHANGED through MoneyFrame_OnEvent — no explicit update anywhere in
the reference's Lua, and none here now. Same TOPRIGHT (-40,-80) seat as before (1937). -->
<Frame name="TradeRecipientMoneyFrame" inherits="SmallMoneyFrameTemplate">
<Anchors><Anchor point="TOPRIGHT"><Offset><AbsDimension x="-40" y="-80"/></Offset></Anchor></Anchors>
<Scripts><OnLoad>SmallMoneyFrame_OnLoad(); MoneyFrame_SetType("TARGET_TRADE");</OnLoad></Scripts>
</Frame>
</Frames>
<Scripts>
<OnLoad>TradeFrame_OnLoad()</OnLoad>
<OnEvent>TradeFrame_OnEvent()</OnEvent>
<OnShow>TradeFrame_OnShow(); PlaySound("igCharacterInfoOpen")</OnShow>
<OnHide>TradeFrame_OnHide(); PlaySound("igCharacterInfoClose")</OnHide>
</Scripts>
</Frame>
</Ui>