- The main menu bar's two empty recesses fill. The micro menu — the eight arched buttons: character, spellbook, talents, quest log, socials, world map, main menu, help — sits in the dark panel between the page arrows and the bags, transcribed from the reference's own layout: the character button wears your portrait, a button holds itself down while its panel is up, and the talent button appears at level 10. The latency meter fills the one slot the bar art leaves transparent for exactly it, tinted green/yellow/red on the reference's 300/600 ms thresholds and drawn UNDER the bar art, seen through its window, the way 1.12 actually does it. The socials and main-menu buttons find their panels one snapshot later; help still waits. - The UI explains itself on hover: 1.12 ships its detailed two-line tooltips ON — a FrameXML default, not the opt-in extra it is often remembered as — so the micro buttons, your own portrait, the XP bar, the five bag buttons and the ping meter all answer a hover with the reference's own explanations. - The PvP flag, end to end: crossed swords on the player, target and party frames, driven by the two descriptor bits the wire actually carries, and `/pvp` speaks — the yellow toast plus the system chat line, the OFF sentence being the one that warns the flag lingers for five minutes. It really does linger: turning it off waits out the server's timer, which looks like a bug and is the reference. - Quest markers stopped freezing. The grey `!` over a questgiver above your level goes gold the moment you ding, an NPC re-entering view is asked afresh instead of wearing a session-old answer, and the marker drops when the questgiver bit goes off — the re-ask triggers mirror the reference's own set, plus one named addition (your own level changing). - Water and heights: swimming downhill no longer bounces between swim and fall ten times a second — the surface line is a two-sided constraint, so the swimmer settles with the river instead of being left behind by it. And collision height is per-unit now, read from the unit's own model: a gnome used to swim with a third of a yard of water over her head because five depth lines were quoting a human's number. - A round of pixel honesty in text and chat: the newest chat line no longer wears a wider drop shadow than every line above it (shadows move in whole pixels now), keeps its descenders, and hover boxes stop painting over the chat body. The chat input's history browse survives programmatic edits, a failed script chunk warns instead of vanishing, and recall deepens to 64 lines. Idle animation got honest too: a model's idle is Stand resolved through its own lookup table — never file order, which had the duel flag bobbing on its spawn clip — and an armed idle is culled on the box its animation authors, not the bind pose, so the flag stops vanishing at most camera angles. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
41 lines
2.1 KiB
Rust
41 lines
2.1 KiB
Rust
//! `GetNetStats()` — the connection-telemetry read the main bar's performance ("ping") meter polls.
|
|
//!
|
|
//! One global over one pushed number. The reference binding (`0x48b8b0`, wow-re
|
|
//! `system/ui/scratch/bindings.md`) returns `bandwidthIn, bandwidthOut, latency`; its latency is
|
|
//! **not** the last round trip but the average over the connection's RTT ring — wow-re net W1
|
|
//! records `HandlePong 0x537d60` as "RTT into ring, head/tail wrap 16" feeding
|
|
//! `0x537f20 throughput/avg-RTT math (host telemetry; no wire bytes)". The app owns that ring
|
|
//! ([`crate`]'s consumer keeps it beside its ping clock) and pushes the average here; the engine
|
|
//! stays free of ECS/net reach (decision 0068 §3), exactly as [`super::unit`]'s `GetMoney` does.
|
|
//!
|
|
//! **The two bandwidth returns are `0`.** benilla measures no throughput — its socket threads tally
|
|
//! no bytes — and nothing in the 1.12 UI reads them: `MainMenuBarPerformanceBarFrame` is the whole
|
|
//! shipped caller of `GetNetStats` and discards both. They stay in the signature (numbers, not
|
|
//! `nil`, so arithmetic on them can't error) as a named gap, not a claim.
|
|
|
|
use mlua::Lua;
|
|
|
|
use super::Model;
|
|
|
|
impl super::UiScript {
|
|
/// Push the reported round trip (ms) — the app's average over its RTT ring. `None` = no sample
|
|
/// yet (before the connection's first pong, or after a disconnect), which reads as `0` through
|
|
/// `GetNetStats`: the reference reports 0 for an unmeasured connection too, and the bar's
|
|
/// thresholds put 0 in the green band, which is what the real client shows at login.
|
|
pub fn set_latency_ms(&mut self, ms: Option<u32>) {
|
|
self.model_mut().net_latency_ms = ms.unwrap_or(0);
|
|
}
|
|
}
|
|
|
|
/// Register the net-stats globals.
|
|
pub(super) fn install(lua: &Lua) -> mlua::Result<()> {
|
|
// GetNetStats() → bandwidthIn, bandwidthOut, latency (see the module doc for the two zeros).
|
|
lua.globals().set(
|
|
"GetNetStats",
|
|
lua.create_function(|lua, ()| {
|
|
let model = lua.app_data_ref::<Model>().expect("model app_data");
|
|
Ok((0.0_f64, 0.0_f64, i64::from(model.net_latency_ms)))
|
|
})?,
|
|
)
|
|
}
|