Files
benilla-octo/crates/benilla-app/assets/ui/GameTime.xml
T
SamandClaude Fable 5 8a502fe1d6 the client starts remembering: zoom, camera, filters, a Combat page
- minimap zoom and the camera's distance and pitch persist across sessions
- the trainer's point-filter is a saved variable now and survives a relog, resetting per packet like the reference
- the options window gains its Combat page, over rows that can write the UI's own saved globals
- the step-up is a rise, not a jump forward — and the descent cone's cap belongs to the body, on every leg

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-08 17:13:23 +07:00

144 lines
5.8 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.
<!--
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. benilla fires that event since decision 1128 and could carry this as a saved
variable (it is on 1128's follow-on list), but the value here is a LOCALE fact, not a player
toggle: this install is enGB and enGB is a 24-hour locale. 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>