worldLatency or homeLatency never fell back because 0 is truthy in Lua, so servers that never populate world latency showed a stuck 0 ms. Also guard every XML script hook with a nil check so a failed Lua load degrades silently instead of spamming attempt to call global 'OctoLatency_OnUpdate' (a nil value) every frame and blocking chat input. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
66 lines
1.7 KiB
XML
66 lines
1.7 KiB
XML
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
|
|
<Script file="OctoLatency.lua"/>
|
|
<Frame name="OctoLatencyFrame" parent="UIParent" movable="true" enableMouse="true" clampedToScreen="true">
|
|
<Size>
|
|
<AbsDimension x="90" y="24"/>
|
|
</Size>
|
|
<Anchors>
|
|
<Anchor point="CENTER"/>
|
|
</Anchors>
|
|
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
|
|
<BackgroundInsets>
|
|
<AbsInset left="4" right="4" top="4" bottom="4"/>
|
|
</BackgroundInsets>
|
|
<TileSize>
|
|
<AbsValue val="16"/>
|
|
</TileSize>
|
|
<EdgeSize>
|
|
<AbsValue val="16"/>
|
|
</EdgeSize>
|
|
<Color r="0" g="0" b="0" a="0.7"/>
|
|
</Backdrop>
|
|
<Layers>
|
|
<Layer level="ARTWORK">
|
|
<FontString name="OctoLatencyText" inherits="GameFontNormalSmall" justifyH="CENTER" justifyV="CENTER">
|
|
<Size>
|
|
<AbsDimension x="80" y="16"/>
|
|
</Size>
|
|
<Anchors>
|
|
<Anchor point="CENTER">
|
|
<AbsDimension x="0" y="0"/>
|
|
</Anchor>
|
|
</Anchors>
|
|
</FontString>
|
|
</Layer>
|
|
</Layers>
|
|
<Scripts>
|
|
<OnLoad>
|
|
if (OctoLatency_OnLoad) then
|
|
OctoLatency_OnLoad(this);
|
|
end
|
|
</OnLoad>
|
|
<OnUpdate>
|
|
if (OctoLatency_OnUpdate) then
|
|
OctoLatency_OnUpdate(arg1);
|
|
end
|
|
</OnUpdate>
|
|
<OnMouseDown>
|
|
if (arg1 == "LeftButton") then
|
|
this:StartMoving();
|
|
this.isMoving = true;
|
|
end
|
|
</OnMouseDown>
|
|
<OnMouseUp>
|
|
if (arg1 == "LeftButton" and OctoLatency_StopMoving) then
|
|
OctoLatency_StopMoving(this);
|
|
end
|
|
</OnMouseUp>
|
|
<OnHide>
|
|
if (OctoLatency_StopMoving) then
|
|
OctoLatency_StopMoving(this);
|
|
end
|
|
</OnHide>
|
|
</Scripts>
|
|
</Frame>
|
|
</Ui>
|