Files
benilla-octo/crates/benilla-app/assets/ui/DurabilityFrame.xml
T
SamandClaude Fable 5 d1140829d7 the interface code is ours: the transcription debt is paid
- forty files that carried the reference's literal Lua are rewritten as our own expression of the behaviour — worst identical run 61 lines down to 7 — and the README now says exactly that
- the overlap gate measures the code itself across all four reference corpora, and ratchets: the number may only go down
- a lost session ends at the login screen instead of silently re-authenticating and stealing the account back
- a building's skybox is a real model: Caverns of Time's white ceiling becomes its painted nebula and additive stars

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-14 19:21:03 +07:00

325 lines
16 KiB
XML

<Ui>
<!--
The durability alert — the "armor guy" under the minimap (director-directed this round,
with the doll-slot broken tint). Geometry, texture cells and colors are MEASUREMENTS of the
real 1.12 DurabilityFrame (extracted Interface\FrameXML\DurabilityFrame.xml + .lua) and the
show/hide law is the same law, written here in our own terms: 11 alert regions off one
Interface\Durability\UI-Durability-Icons atlas — 8 body pieces
(Head, Shoulders, Chest, Waist, Legs, Feet, Wrists, Hands) that show TOGETHER when
any of them alerts, plus 3 showSeparate pieces (Weapon, Shield/OffWeapon, Ranged) that each
show only when itself alerted. The whole frame hides at zero alerts.
The feed is the engine's GetInventoryAlertStatus(1..11) (benilla-ui char_stats: statuses
recomputed on every inventory push; a change fires UPDATE_INVENTORY_ALERTS — the same event
the real engine fires). Status colors are the ref's own table: 3 = yellow {1, 0.82, 0.18}
(damaged; the engine's threshold is INTERIM &lt; 20% pending the wow-re dispatch on the
0x4c94b0 binding's delegate), 4 = red {0.93, 0.07, 0.07} (broken). Statuses 1/2 are the
ref's own DISABLED enchant-expiry alerts (its color rows are commented out; its enchantTimer
arm too) — transcribed as-is, so they color nothing here either.
The XML anchor below is the ref's authored seat, and like every managed HUD frame it is
DEAD ON ARRIVAL: UIParent_ManageFramePositions re-seats the frame on every pass (ref
UIParent.lua:1758-1768 — -CONTAINER_OFFSET_X, minus 20 more when a side glyph shows; the
raw +40 hangs the sword/shield glyphs off-screen, director-caught). The loader's
post-load manage call seats it at startup; the OnShow/OnHide below (ref verbatim) re-seat
it on every alert transition.
OMITTED, named: the ref's OnUpdate — its whole body is the enchantTimer countdown, and
the timer is dead even in the ref (SetAlerts nils it; the only line setting it is
commented out) — a per-frame handler for provably dead state stays out.
SetFrameLevel(-1) in OnLoad is kept — the guy tucks under sibling HUD.
-->
<Script>
<![CDATA[
-- The alert regions, in the engine's own order: the array index IS the index
-- GetInventoryAlertStatus answers for, and `slot` names the texture that draws it. The
-- last three are the ones that speak for themselves; the eight above are one figure.
INVENTORY_ALERT_STATUS_SLOTS = {
[1] = {slot = "Head"},
[2] = {slot = "Shoulders"},
[3] = {slot = "Chest"},
[4] = {slot = "Waist"},
[5] = {slot = "Legs"},
[6] = {slot = "Feet"},
[7] = {slot = "Wrists"},
[8] = {slot = "Hands"},
[9] = {slot = "Weapon", showSeparate = 1},
[10] = {slot = "Shield", showSeparate = 1},
[11] = {slot = "Ranged", showSeparate = 1},
}
INVENTORY_ALERT_COLORS = {
-- [1]/[2]: the ref's commented-out enchant-alert colors (green/blue) — disabled there,
-- disabled here. [0] = no alert.
[3] = {r = 1, g = 0.82, b = 0.18},
[4] = {r = 0.93, g = 0.07, b = 0.07},
}
-- Which texture draws a slot. Every slot but the off hand has exactly one glyph named
-- after it; the off hand has TWO — a shield and a second sword — and only one of them is
-- ever on screen, so picking one is also hiding the other. That is the whole reason this
-- is a lookup with a branch in it rather than a name concatenation.
local function DurabilityGlyph(slot)
if slot ~= "Shield" then
return getglobal("Durability" .. slot)
end
if OffhandHasWeapon() then
DurabilityShield:Hide()
return DurabilityOffWeapon
end
DurabilityOffWeapon:Hide()
return DurabilityShield
end
-- Repaint the armour figure from the engine's per-region verdicts. Two passes, because the
-- eight body pieces are ONE alert between them: any of them alerting shows all eight, and
-- that is not known until the walk is over. (The enchantTimer nil is the reference's own
-- disabled residue — statuses 1/2 are its switched-off enchant-expiry alerts, so nothing
-- ever arms the timer and this only ever clears a field that was already nil.)
function DurabilityFrame_SetAlerts()
DurabilityFrame.enchantTimer = nil
local numAlerts = 0
local showDurability
local body, numBody = {}, 0
for index, value in pairs(INVENTORY_ALERT_STATUS_SLOTS) do
local texture = DurabilityGlyph(value.slot)
local color = INVENTORY_ALERT_COLORS[GetInventoryAlertStatus(index)]
-- Alerted pieces wear their status colour at full strength; the rest sit in the
-- faded white the art is authored against, which is what the body figure's
-- un-alerted pieces read as when one of their neighbours has lit up.
if color then
numAlerts = numAlerts + 1
texture:SetVertexColor(color.r, color.g, color.b, 1.0)
else
texture:SetVertexColor(1.0, 1.0, 1.0, 0.5)
end
if value.showSeparate then
-- Weapon, off hand, ranged: each is its own alert and its own decision.
if color then
texture:Show()
else
texture:Hide()
end
else
numBody = numBody + 1
body[numBody] = texture
if color then
showDurability = 1
end
end
end
for i = 1, numBody do
if showDurability then
body[i]:Show()
else
body[i]:Hide()
end
end
-- Nothing to warn about at all means no armour guy.
if numAlerts > 0 then
DurabilityFrame:Show()
else
DurabilityFrame:Hide()
end
end
]]>
</Script>
<Frame name="DurabilityFrame" parent="UIParent" frameStrata="LOW" hidden="false">
<Size>
<AbsDimension x="60" y="65"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="MinimapCluster" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="40" y="15"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="DurabilityHead" file="Interface\Durability\UI-Durability-Icons">
<Size>
<AbsDimension x="18" y="22"/>
</Size>
<Anchors>
<Anchor point="TOP"/>
</Anchors>
<TexCoords left="0" right="0.140625" top="0" bottom="0.171875"/>
</Texture>
<Texture name="DurabilityShoulders" file="Interface\Durability\UI-Durability-Icons">
<Size>
<AbsDimension x="48" y="22"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="DurabilityHead" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="16"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.140625" right="0.515625" top="0" bottom="0.171875"/>
</Texture>
<Texture name="DurabilityChest" file="Interface\Durability\UI-Durability-Icons">
<Size>
<AbsDimension x="20" y="22"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="DurabilityShoulders" relativePoint="TOP">
<Offset>
<AbsDimension x="0" y="-7"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.515625" right="0.6640625" top="0" bottom="0.171875"/>
</Texture>
<Texture name="DurabilityWrists" file="Interface\Durability\UI-Durability-Icons">
<Size>
<AbsDimension x="44" y="22"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="DurabilityShoulders" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="7"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.6640625" right="1.0" top="0" bottom="0.171875"/>
</Texture>
<Texture name="DurabilityHands" file="Interface\Durability\UI-Durability-Icons">
<Size>
<AbsDimension x="42" y="18"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="DurabilityWrists" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="15"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.328125" top="0.171875" bottom="0.3046875"/>
</Texture>
<Texture name="DurabilityWaist" file="Interface\Durability\UI-Durability-Icons">
<Size>
<AbsDimension x="16" y="5"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="DurabilityChest" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="6"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.328125" right="0.46875" top="0.171875" bottom="0.203125"/>
</Texture>
<Texture name="DurabilityLegs" file="Interface\Durability\UI-Durability-Icons">
<Size>
<AbsDimension x="29" y="20"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="DurabilityWaist" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.46875" right="0.6875" top="0.171875" bottom="0.3203125"/>
</Texture>
<Texture name="DurabilityFeet" file="Interface\Durability\UI-Durability-Icons">
<Size>
<AbsDimension x="41" y="32"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="DurabilityLegs" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="8"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.6875" right="1.0" top="0.171875" bottom="0.4140625"/>
</Texture>
<Texture name="DurabilityWeapon" file="Interface\Durability\UI-Durability-Icons">
<Size>
<AbsDimension x="20" y="45"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="DurabilityWrists" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="-6"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.140625" top="0.3203125" bottom="0.6640625"/>
</Texture>
<Texture name="DurabilityShield" file="Interface\Durability\UI-Durability-Icons">
<Size>
<AbsDimension x="25" y="31"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="DurabilityWrists" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="10"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.1875" right="0.375" top="0.3203125" bottom="0.5546875"/>
</Texture>
<Texture name="DurabilityOffWeapon" file="Interface\Durability\UI-Durability-Icons" hidden="true">
<Size>
<AbsDimension x="20" y="45"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="DurabilityWrists" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="-6"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.140625" top="0.3203125" bottom="0.6640625"/>
</Texture>
<Texture name="DurabilityRanged" file="Interface\Durability\UI-Durability-Icons">
<Size>
<AbsDimension x="28" y="38"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="DurabilityShield" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="5"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.1875" right="0.3984375" top="0.5546875" bottom="0.84375"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
this:SetFrameLevel(this:GetFrameLevel() - 1)
this:RegisterEvent("UPDATE_INVENTORY_ALERTS")
this:RegisterEvent("PLAYER_ENTERING_WORLD")
</OnLoad>
<OnEvent>
DurabilityFrame_SetAlerts()
-- benilla re-manages the HUD right-stack on every alert recompute. The ref keeps
-- the durability seat (and the quest tracker stacked under it) fresh because it
-- fires UIParent_ManageFramePositions from dozens of OnShow/OnHide sites; benilla
-- fires it from only a handful, so a showSeparate glyph that arrives AFTER the
-- frame is already shown — equipment streams in per-slot at login, the weapon
-- often breaking before the shield's slot lands — would otherwise leave
-- durabilityOffset stale and hang the shield off the screen's right edge
-- (director-caught). SetAlerts's own Show()/Hide() only re-manages on a
-- shown-state transition, which a mere glyph-set change is not.
UIParent_ManageFramePositions()
</OnEvent>
<OnShow>
UIParent_ManageFramePositions()
</OnShow>
<OnHide>
UIParent_ManageFramePositions()
</OnHide>
</Scripts>
</Frame>
</Ui>