- resting flashes the zzz on your portrait, the XP bar fills its rested blue, and the exhaustion tick rides the bar with hover numerals - a dual-wielded pair keeps both hands in the dressing room - a footfall plays one sound, not two - the minimap wears the time-of-day clock, and the keybinding capsules go back to 1.12's red Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
142 lines
5.7 KiB
XML
142 lines
5.7 KiB
XML
<!--
|
||
The minimap's time-of-day indicator (GameTimeFrame) — transcribed from the 1.12 FrameXML
|
||
GameTime.xml + GameTime.lua (the reference's own file split; its TOC loads GameTime.xml right
|
||
after Minimap.xml, and the manifest mirrors that beside MinimapCluster.xml). This closes the
|
||
"day/night indicator" line in MinimapCluster.xml's OUT list.
|
||
|
||
The 50×50 frame overhanging the cluster's top-right corner shows
|
||
Interface\Minimap\UI-TOD-Indicator (128×64: the sun disc on the left half, the moon on the
|
||
right — verified by extraction); GameTimeFrame_Update re-reads GetGameTime() every OnUpdate,
|
||
and when the game minute changed it re-seats the 50-px texcoord window — +0.5 across the
|
||
dawn/dusk thresholds (before 5:30 AM / from 9:00 PM game time = night) — and refreshes the
|
||
tooltip if it is showing. Hover formats the same clock into the tooltip. GetGameTime() is the
|
||
app's SMSG_LOGIN_SETTIMESPEED clock, pushed on the minute (`crate::minimap::feed_game_time`).
|
||
|
||
The frame declares no enableMouse yet its tooltip hovers: the real XML `<Scripts>` walker
|
||
auto-enables the mouse kind when it attaches a mouse handler (wow-re
|
||
`ui/scratch/scripts-auto-enable.md`, resolved 2026-08-07) — benilla's loader models the same
|
||
law (`loader/scripts.rs`), so this file stays attribute-free like the reference.
|
||
|
||
Deltas from the reference, each deliberate:
|
||
- TEXT() is dropped (this file set's convention: the ref's build-time no-op localization
|
||
macro; CharacterFrame.xml's note).
|
||
- TwentyFourHourTime = 1 is SET here: the reference sets it in Localization.lua's
|
||
LocalizeFrames() — this install is enGB, and enGB is a 24-hour locale — called at
|
||
VARIABLES_LOADED, which benilla doesn't fire yet (no saved-variables arc; BagFrame.xml's
|
||
precedent). So the tooltip reads "21:07" exactly as the reference client on this install
|
||
does; the 12-hour AM/PM branches stay verbatim below for the day a locale/CVar drives it.
|
||
-->
|
||
<Ui xmlns="http://www.blizzard.com/wow/ui/">
|
||
<Script><![CDATA[
|
||
-- ref-GameTime.lua, verbatim (minus TEXT(); TwentyFourHourTime per the header).
|
||
TwentyFourHourTime = 1;
|
||
|
||
GAMETIME_DAWN = ( 5 * 60) + 30; -- 5:30 AM
|
||
GAMETIME_DUSK = (21 * 60) + 0; -- 9:00 PM
|
||
|
||
function GameTimeFrame_Update()
|
||
local hour, minute = GetGameTime();
|
||
local time = (hour * 60) + minute;
|
||
if(time ~= this.timeOfDay) then
|
||
this.timeOfDay = time;
|
||
local minx = 0;
|
||
local maxx = 50/128;
|
||
local miny = 0;
|
||
local maxy = 50/64;
|
||
if(time < GAMETIME_DAWN or time >= GAMETIME_DUSK) then
|
||
minx = minx + 0.5;
|
||
maxx = maxx + 0.5;
|
||
end
|
||
GameTimeTexture:SetTexCoord(minx, maxx, miny, maxy);
|
||
|
||
if(GameTooltip:IsOwned(this)) then
|
||
GameTimeFrame_UpdateTooltip(hour, minute);
|
||
end
|
||
end
|
||
end
|
||
|
||
function GameTimeFrame_UpdateTooltip(hours, minutes)
|
||
if(TwentyFourHourTime) then
|
||
GameTooltip:SetText(format(TIME_TWENTYFOURHOURS, hours, minutes));
|
||
else
|
||
local pm = 0;
|
||
if(hours >= 12) then
|
||
pm = 1;
|
||
end
|
||
if(hours > 12) then
|
||
hours = hours - 12;
|
||
end
|
||
if(hours == 0) then
|
||
hours = 12;
|
||
end
|
||
if(pm == 0) then
|
||
GameTooltip:SetText(format(TIME_TWELVEHOURAM, hours, minutes));
|
||
else
|
||
GameTooltip:SetText(format(TIME_TWELVEHOURPM, hours, minutes));
|
||
end
|
||
end
|
||
end
|
||
|
||
function GameTime_GetTime()
|
||
local hour, minute = GetGameTime();
|
||
|
||
if(TwentyFourHourTime) then
|
||
return format(TIME_TWENTYFOURHOURS, hour, minute);
|
||
else
|
||
local pm = 0;
|
||
if(hour >= 12) then
|
||
pm = 1;
|
||
end
|
||
if(hour > 12) then
|
||
hour = hour - 12;
|
||
end
|
||
if(hour == 0) then
|
||
hour = 12;
|
||
end
|
||
if(pm == 0) then
|
||
return format(TIME_TWELVEHOURAM, hour, minute);
|
||
else
|
||
return format(TIME_TWELVEHOURPM, hour, minute);
|
||
end
|
||
end
|
||
end
|
||
]]></Script>
|
||
<Frame name="GameTimeFrame" parent="MinimapCluster">
|
||
<Size>
|
||
<AbsDimension x="50" y="50"/>
|
||
</Size>
|
||
<Anchors>
|
||
<Anchor point="TOPRIGHT">
|
||
<Offset>
|
||
<AbsDimension x="4" y="-19"/>
|
||
</Offset>
|
||
</Anchor>
|
||
</Anchors>
|
||
<HitRectInsets>
|
||
<AbsInset left="6" right="0" top="5" bottom="10"/>
|
||
</HitRectInsets>
|
||
<Layers>
|
||
<Layer level="ARTWORK">
|
||
<Texture name="GameTimeTexture" file="Interface\Minimap\UI-TOD-Indicator"/>
|
||
</Layer>
|
||
</Layers>
|
||
<Scripts>
|
||
<OnLoad>
|
||
this.timeOfDay = 0;
|
||
this:SetFrameLevel(this:GetFrameLevel() + 2);
|
||
GameTimeFrame_Update();
|
||
</OnLoad>
|
||
<OnEnter>
|
||
GameTooltip:SetOwner(this, "ANCHOR_BOTTOMLEFT");
|
||
GameTimeFrame_UpdateTooltip(GetGameTime());
|
||
</OnEnter>
|
||
<OnLeave>
|
||
GameTooltip:Hide();
|
||
</OnLeave>
|
||
<OnUpdate>
|
||
GameTimeFrame_Update();
|
||
</OnUpdate>
|
||
</Scripts>
|
||
</Frame>
|
||
</Ui>
|