Comments in benilla-app, the UI script layer: one line of fact each, no history, no record numbers (#184)
Part of #41: the first of five `benilla-app` pieces. This one is the UI script layer: `ui_script` with its test harnesses, the text engine and layout (`ui_text`), the UI pass and the UI model panes. Its comments are rewritten to the rule in `docs/METHOD.md`, which is what the code does and the reference fact behind it, in a line. 22,041 comment lines become 7,133. - **The mechanical strip.** The citations that were only a private record number go first, and each edit is shown to be a pure removal. - **Wrong facts corrected.** The rewrite corrects the comments that stated wrong facts. Among them: - On a fresh login the reference fires `PLAYER_LOGIN` and `PLAYER_ENTERING_WORLD` from the player's create (`0x5deb60` → `0x4908c0`); only a `/reload` goes through `0x490168`. The comments now state both paths. - `ComputeStep` (`0x5ca2d0`) applies negative pair kerns and rounds up. It does have a kerning term. - A fallback icon global and the retired `UiPanels.xml` panels no longer exist. The comments that named them now describe the stock FrameXML mechanism that replaced them. - Stock FrameXML line citations are checked against the stock 1.12 files and corrected, and several misattributed files are fixed (`MainMenuBarArtFrame` lives in `MainMenuBar.xml`). - Dozens more turned up on the way: docs sitting on the wrong item, removed functions, stale counts and links. - **Deviation labels.** "Deviation:" now marks only a choice with a reason. An unbuilt behaviour says so plainly. - **Verification.** Every file strips to identical code, and `cargo fmt --check` is clean. Five second readers compared every file old against new, restored the facts the rewrite had dropped, and checked each new citation against the code, the stock files, vmangos and the reference. Behaviour differences the rewrite surfaced are filed as their own issues (#183 among them). The comments here state what the code does. String literals are untouched; they are #92. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
fd386e75ae
commit
eba558a5d2
@@ -1,7 +1,4 @@
|
||||
//! The stock `TutorialFrame.xml` (decision 1976) driven engine-only: an alert button per
|
||||
//! `TUTORIAL_TRIGGER`, the window a click opens over the published id's strings, the
|
||||
//! `FlagTutorial` it makes, the unticked checkbox's `ClearTutorials` on hide, and
|
||||
//! `CINEMATIC_STOP` clicking the Welcome alert.
|
||||
//! The stock tutorial alerts and window (`TutorialFrame.xml`), driven by `TUTORIAL_TRIGGER`.
|
||||
|
||||
use benilla_ui::script::{ScriptValue, UiScript};
|
||||
|
||||
@@ -40,8 +37,7 @@ fn trigger(s: &mut UiScript, published: i64) {
|
||||
s.fire_event("TUTORIAL_TRIGGER", vec![ScriptValue::Int(published)]);
|
||||
}
|
||||
|
||||
/// A trigger queues an alert button; its click opens the window on the id's title and text and
|
||||
/// acknowledges the id (0-based on the drain); a second trigger queues a second button.
|
||||
/// The click's `FlagTutorial` takes the published id; the app drains it 0-based.
|
||||
#[test]
|
||||
fn a_trigger_queues_an_alert_whose_click_opens_the_window_and_flags_it() {
|
||||
let _data = benilla_formats::wow_data_or_skip!();
|
||||
@@ -93,7 +89,7 @@ fn a_trigger_queues_an_alert_whose_click_opens_the_window_and_flags_it() {
|
||||
assert_eq!(s.take_tutorial_clears(), 0);
|
||||
}
|
||||
|
||||
/// Unticking "Display Tips" and closing calls `ClearTutorials` and drops every alert.
|
||||
/// Hiding with "Display Tips" unticked clears every tutorial (`TutorialFrame.lua:7`).
|
||||
#[test]
|
||||
fn an_unticked_checkbox_clears_the_tutorials_on_hide() {
|
||||
let _data = benilla_formats::wow_data_or_skip!();
|
||||
@@ -111,8 +107,8 @@ fn an_unticked_checkbox_clears_the_tutorials_on_hide() {
|
||||
);
|
||||
}
|
||||
|
||||
/// `CINEMATIC_STOP` clicks the Welcome alert (id 42) if it is queued — the first thing a new
|
||||
/// character sees after the intro — and moves the window to the screen's centre.
|
||||
/// `CINEMATIC_STOP` clicks a queued Welcome alert, id 42, and centres the window
|
||||
/// (`TutorialFrame.lua:104`).
|
||||
#[test]
|
||||
fn cinematic_stop_opens_the_welcome_window() {
|
||||
let _data = benilla_formats::wow_data_or_skip!();
|
||||
|
||||
Reference in New Issue
Block a user