Add the recon UI and diagnostic layer to the smart enemy (#135)
The core recon flights and partial reports (9d8f3da57) had no player-facing or diagnostic consumer: enemy_picture().recon/recon_sorties were read only by core tests. This adds the missing layer on top, without touching the mechanics, models or textures. - Map: a tracked recon aircraft is a recognisable yellow hollow diamond with a "разведчик" label, a role line in the selection panel and a filter legend; in the sandbox truth mode it gets an amber marker of its own. - Battle UI: the summary panel and the map show the flight's coarse phase (разведка → донесение → завершение) only while the player's network actually holds a recon aircraft — what the visible aircraft are doing, not what the enemy learned. The truth mode adds a recon count line. - Diagnostics and after-action review: /airdef recon and the menu page "Разведка противника (разбор)" (from Main and Replays) list the enemy's marks best-first with the reason each outranks the rest — priority = freshness×4 + quality×3 + observed role (recon::priority_parts, cross-checked against Mark::priority by a test) — plus the sortie phases and the drones aimed at a mark. The omniscient enemy picture is never shown in the normal HUD; it is explicit debug/review only. recon_view reads only the current report types (EnemyPictureReport, ReconReport, ReconSortieReport); the sim side only widens visibility and adds priority_parts and the is_recon_drone/recon_status read helpers. Tests: recon_view, panel, command tree, priority_parts cross-check. README and IMPLEMENTATION-STATUS updated. Co-Authored-By: Kimi Code <noreply@moonshot.ai>
This commit is contained in:
@@ -24,6 +24,7 @@ mod monitor;
|
||||
mod panel;
|
||||
mod presentation;
|
||||
mod radar;
|
||||
mod recon_view;
|
||||
mod replay;
|
||||
mod scene;
|
||||
mod smoke;
|
||||
@@ -200,6 +201,8 @@ enum Page {
|
||||
More,
|
||||
/// The last raid's events and its replays.
|
||||
Replays,
|
||||
/// The enemy's recon picture and why it prices each mark: debug and after-action review (#135).
|
||||
Recon,
|
||||
/// The systems with their doctrines, and one system's doctrine (by id) (#47).
|
||||
Fleet,
|
||||
Doctrine(u32),
|
||||
@@ -235,7 +238,9 @@ const BTN_LAUNCH: u32 = 34;
|
||||
const BTN_NEXT: u32 = 35;
|
||||
const BTN_MORE: u32 = 17;
|
||||
const BTN_REPLAYS: u32 = 18;
|
||||
const BTN_RECON: u32 = 23;
|
||||
const REPLAY_EVENTS: u32 = 3;
|
||||
const RECON_ROWS: u32 = 6;
|
||||
const BTN_MAP: u32 = 40;
|
||||
const BTN_FULL: u32 = 41;
|
||||
const BTN_REEL: u32 = 42;
|
||||
@@ -1583,6 +1588,7 @@ impl AirDef {
|
||||
widgets.push(Widget::Button(ButtonWidget { id: BTN_DOCTRINE, label: format!("Доктрины: охрана, сектор, резерв (особых: {custom})…") }));
|
||||
widgets.push(Widget::Button(ButtonWidget { id: BTN_WAVE, label: "Налёт: состав и запуск…".into() }));
|
||||
widgets.push(Widget::Button(ButtonWidget { id: BTN_REPLAYS, label: "Повторы…".into() }));
|
||||
widgets.push(Widget::Button(ButtonWidget { id: BTN_RECON, label: "Разведка противника (разбор)…".into() }));
|
||||
widgets.push(Widget::Button(ButtonWidget { id: BTN_MORE, label: "Огонь, ремонт, эффекты…".into() }));
|
||||
}
|
||||
Page::BatteryDeploy => {
|
||||
@@ -1604,6 +1610,7 @@ impl AirDef {
|
||||
widgets.push(Widget::Button(ButtonWidget { id: BTN_MAP, label: "Карта налёта (R)".into() }));
|
||||
widgets.push(Widget::Button(ButtonWidget { id: BTN_FULL, label: "Полный повтор".into() }));
|
||||
widgets.push(Widget::Button(ButtonWidget { id: BTN_REEL, label: format!("Лучшие моменты ({})", replay::reel(rec).len()) }));
|
||||
widgets.push(Widget::Button(ButtonWidget { id: BTN_RECON, label: "Разведка противника (разбор)".into() }));
|
||||
}
|
||||
None => {
|
||||
title = "Повторы".into();
|
||||
@@ -1612,10 +1619,17 @@ impl AirDef {
|
||||
text: "Повторов пока нет: налёт записывается сам и появится здесь, когда небо очистится".into(),
|
||||
color: 0,
|
||||
}));
|
||||
widgets.push(Widget::Button(ButtonWidget { id: BTN_RECON, label: "Разведка противника (разбор)".into() }));
|
||||
widgets.push(Widget::Button(ButtonWidget { id: BTN_BACK, label: "← Назад".into() }));
|
||||
}
|
||||
}
|
||||
}
|
||||
Page::Recon => {
|
||||
title = "Разведка противника — разбор (debug): что враг запомнил и почему".into();
|
||||
let rows: Vec<String> = recon_view::picture_lines(&self.sim.enemy_picture()).into_iter().take(200).collect();
|
||||
widgets.push(Widget::List(ListWidget { id: RECON_ROWS, rows, selected: None }));
|
||||
widgets.push(Widget::Button(ButtonWidget { id: BTN_BACK, label: "← Назад".into() }));
|
||||
}
|
||||
Page::More => {
|
||||
title = "AirDef — управление".to_string();
|
||||
widgets.push(Widget::Button(ButtonWidget {
|
||||
@@ -2263,6 +2277,16 @@ impl Mod for AirDef {
|
||||
self.open_menu(Page::Main);
|
||||
return;
|
||||
}
|
||||
(Page::Main, BTN_RECON) | (Page::Replays, BTN_RECON) => {
|
||||
self.open_menu(Page::Recon);
|
||||
return;
|
||||
}
|
||||
(Page::Recon, BTN_BACK) => {
|
||||
self.open_menu(Page::Main);
|
||||
return;
|
||||
}
|
||||
// The review is read-only: a row click changes nothing.
|
||||
(Page::Recon, RECON_ROWS) => return,
|
||||
(Page::Main, BTN_MORE) => {
|
||||
self.open_menu(Page::More);
|
||||
return;
|
||||
@@ -2588,6 +2612,14 @@ impl Mod for AirDef {
|
||||
self.set_effects(*v != "off", *v == "hd");
|
||||
Some(format!("Эффекты: {}", match *v { "off" => "выкл", "hd" => "HD", _ => "обычные" }))
|
||||
}
|
||||
["recon"] => {
|
||||
// The enemy's partial picture and why it prices each mark: explicit debug, never the
|
||||
// normal HUD (#135). The same lines fill the after-action review page.
|
||||
for l in recon_view::picture_lines(&self.sim.enemy_picture()) {
|
||||
say(&l);
|
||||
}
|
||||
None
|
||||
}
|
||||
["stats"] => Some(format!(
|
||||
"В воздухе: {}, ракет: {}, ПВО: {}, сбито: {}, поражений: {}, разбились о препятствия: {}; удары по ПУ: пущено {}, уничтожено {}, подавлено {}, промахов {}, сбито ПВО {}; {}",
|
||||
self.sim.drones.iter().filter(|d| d.alive()).count(),
|
||||
|
||||
Reference in New Issue
Block a user