- the help window is the reference's own `HelpFrame.xml`, and ours was less than half its size, so this is mostly arrival: the category list, the per-category GM and harassment pages, the stuck page, the bug report, the PvP policy line; four things we had built go with the swap — one-click filing from Home, the Home unstick button, the downed-queue refusal message, and ticket abandonment, a capability loss rather than a look change, since `AbandonTicket` exists in neither the binding table nor the 1.12 FrameXML corpus and any return of it goes on top of the stock window; `GMSURVEY_DISPLAY` arrives with no producer, a real 1.12 event (`SignalEvent` `0x5e797b`) whose whole UI is a LoadOnDemand addon not on our chain; and the stock file needs two orderings ours did not, the micro-button row before its GM status ask and the buff frame before its repoll timer (1889, superseding 1687)
- the cast bar, the action-button regions and the font registry are the reference's own files too: our `CastingBar.xml` was `CastingBarFrame.xml` under another name, with the literal "Failed" where the reference reads the `FAILED` GlobalString (1886); `ActionButtonTemplate.xml` seats above our `ActionBar.xml` because the later-registered template wins, and it declares zero scripts, so the regions migrate while the handlers stay ours until `ActionButton.lua`'s verbs do (1887); `Fonts.xml` is manifest entry 0, all 51 fonts match by name, and its one real difference, `ITEM_QUALITY_COLORS`, moves to UIParent where the reference declares it (1888); the harnesses were the real cost — those reading our files off disk could not name a chain file and now read through the manifest's own rule — and the event-producer gate, having cried wolf at the cast bar's `SPELLCAST_INTERRUPTED` fired through a variable, now matches the fired tuple's shape
- of the 189 events benilla fires, three are not in the client — `BAG_UPDATE_DELAYED` (a Classic Era name), `LOOT_UPDATE` and `UPDATE_LOOT_ROLL` (invented here, no listener anywhere) — found against the reference binary's own string table, and a gate now fails any fire of a name the client cannot dispatch unless it wears a `BENILLA_` prefix (1883); two payloads the reference gives that we did not: `UNIT_HAPPINESS` carries its unit token, without which no `UNIT_*` consumer reads it, and `CHARACTER_POINTS_CHANGED` carries the point deltas `ChatFrame.lua` compares unguarded, so nil raised (1884); and `PLAYER_LEVEL_UP` carries all nine — level, health and mana gain, talent points (not on the wire: the client derives `(newLevel >= 10) ? 1 : 0` at `0x5e407c`) and the five stat gains — matched to the ding by level, a demotion's absent gains sent as zeros since a nil raises where a zero reads as no line
- the chain gap report could not run — one of its six probes had no player seated where a stock addon formats `UnitName("player")` at load, the other five each carrying an identical copy-pasted seed — and the repaired instrument prices each window's cost: 13 stock files load clean with nothing missing (the action bars, the cast bar, the fonts, the help, friends, game-menu and sound-options windows among them) and the near ones name their missing verb, with "loads clean" still not "swapped" (1885); and `UpdateNameplates`, recorded as the missing engine verb blocking the UIParent keystone, is FrameXML — defined in `UIOptionsFrame.lua`, absent from the binding table, its whole body four nameplate verbs that are already ours — so it is twelve lines transcribed into our options frame, the reference's own Show-then-Hide no-op included (1890 corrects 1878)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
104 lines
4.0 KiB
Rust
104 lines
4.0 KiB
Rust
//! The escort-quest confirm (decision 1733, `QuestShareFrame.xml`): the Lua wiring between the
|
|
//! `QUEST_ACCEPT_CONFIRM` event `ui_quest_share`'s feed fires and the shared StaticPopup engine,
|
|
//! driven exactly as that feed drives it.
|
|
//!
|
|
//! The asymmetry these tests pin is the reference's: **Yes sends, No does not**. There is no
|
|
//! decline packet for an escort confirm, so a test that only checked "the popup closes" would pass
|
|
//! against a version that silently answered No on the wire.
|
|
|
|
use benilla_ui::script::{ScriptValue, UiScript};
|
|
|
|
use super::test_ui::load_ui as load_xml;
|
|
|
|
fn setup() -> UiScript {
|
|
let mut s = UiScript::new().unwrap();
|
|
s.set_screen_size(1024.0, 768.0);
|
|
load_xml(&s, "Interface\\FrameXML\\Fonts.xml");
|
|
load_xml(&s, "MoneyFrame.xml");
|
|
load_xml(&s, "UiPanels.xml");
|
|
load_xml(&s, r"Interface\FrameXML\UIPanelTemplates.lua");
|
|
load_xml(&s, r"Interface\FrameXML\UIPanelTemplates.xml");
|
|
load_xml(&s, "QuestShareFrame.xml");
|
|
s
|
|
}
|
|
|
|
fn confirm(s: &mut UiScript, who: &str, quest: &str) {
|
|
s.fire_event(
|
|
"QUEST_ACCEPT_CONFIRM",
|
|
vec![
|
|
ScriptValue::Str(who.to_string()),
|
|
ScriptValue::Str(quest.to_string()),
|
|
],
|
|
);
|
|
}
|
|
|
|
/// The event raises the popup with BOTH args filled, in the reference's order: the player first,
|
|
/// the quest title second (`QUEST_ACCEPT = "%s is starting %s\nWould you like to as well?"`). A
|
|
/// swap would read "Escort Duty is starting Thrall", which is exactly the kind of wrong that looks
|
|
/// right at a glance.
|
|
#[test]
|
|
fn the_confirm_names_the_player_first_and_the_quest_second() {
|
|
let mut s = setup();
|
|
confirm(&mut s, "Thrall", "Escort Duty");
|
|
assert!(
|
|
s.eval::<bool>("return StaticPopup1:IsVisible()").unwrap(),
|
|
"QUEST_ACCEPT_CONFIRM shows the confirm popup"
|
|
);
|
|
assert_eq!(
|
|
s.eval::<String>("return StaticPopup1Text:GetText()")
|
|
.unwrap(),
|
|
"Thrall is starting Escort Duty\nWould you like to as well?"
|
|
);
|
|
assert!(s.errors().is_empty(), "script errors: {:?}", s.errors());
|
|
}
|
|
|
|
/// Yes queues exactly one `ConfirmAcceptQuest()` and closes the popup.
|
|
#[test]
|
|
fn yes_answers_once() {
|
|
let mut s = setup();
|
|
confirm(&mut s, "Thrall", "Escort Duty");
|
|
s.run("StaticPopup_OnClick(StaticPopup1, 1)").unwrap();
|
|
assert_eq!(s.take_quest_confirms(), 1);
|
|
assert_eq!(s.take_quest_confirms(), 0, "drained");
|
|
assert!(
|
|
!s.eval::<bool>("return StaticPopup1:IsVisible()").unwrap(),
|
|
"answering closes it"
|
|
);
|
|
}
|
|
|
|
/// **No sends nothing.** The reference's `QUEST_ACCEPT` entry has an `OnAccept` and no `OnCancel`
|
|
/// at all (`StaticPopup.lua:727-737`), because there is no decline packet — the server's pending
|
|
/// latch is cleared by the next thing that touches it. Same for ESC.
|
|
#[test]
|
|
fn no_and_escape_send_nothing() {
|
|
let mut s = setup();
|
|
confirm(&mut s, "Thrall", "Escort Duty");
|
|
s.run("StaticPopup_OnClick(StaticPopup1, 2)").unwrap();
|
|
assert_eq!(s.take_quest_confirms(), 0, "No must not answer the server");
|
|
assert!(!s.eval::<bool>("return StaticPopup1:IsVisible()").unwrap());
|
|
|
|
confirm(&mut s, "Thrall", "Escort Duty");
|
|
s.run("StaticPopup_EscapePressed()").unwrap();
|
|
assert_eq!(s.take_quest_confirms(), 0, "ESC must not answer the server");
|
|
assert!(!s.eval::<bool>("return StaticPopup1:IsVisible()").unwrap());
|
|
}
|
|
|
|
/// A second confirm replaces the first rather than stacking — the server keeps ONE share latch per
|
|
/// player, so an older question is already dead by the time a newer one arrives, and answering the
|
|
/// stale popup would send the wrong quest id.
|
|
#[test]
|
|
fn a_second_confirm_replaces_the_first() {
|
|
let mut s = setup();
|
|
confirm(&mut s, "Thrall", "Escort Duty");
|
|
confirm(&mut s, "Jaina", "Deeper Still");
|
|
assert_eq!(
|
|
s.eval::<String>("return StaticPopup1Text:GetText()")
|
|
.unwrap(),
|
|
"Jaina is starting Deeper Still\nWould you like to as well?"
|
|
);
|
|
assert!(
|
|
!s.eval::<bool>("return StaticPopup2:IsVisible()").unwrap(),
|
|
"the confirm is exclusive — it reuses the one slot"
|
|
);
|
|
}
|