Files
BT411/game/reconstructed/btl4console.hpp
T
CydandClaude Fable 5 e74957758b Front end: post-mission results screen (kills/deaths scoreboard)
Completes the marshal chain: menu -> mission -> timed stop -> results ->
relaunch.  BT had no mission-end score flow; this builds one from the
data the Comm MFD pilotList already tracks.

- btl4console: at the timed stop (game thread, state still live) snapshot
  each roster pilot's kills/deaths via the BTResolveRosterPilot /
  BTPilotKills / BTPilotDeaths bridges; expose BTLocalConsole_ResultCount
  / GetResult.
- btl4fe: BTFrontEnd_ShowResults -- a GDI green-on-black 'MISSION COMPLETE'
  scoreboard (PILOT / KILLS / DEATHS, slot 0 named from the menu), any
  key or ~12s to dismiss; store the last pilot name.
- btl4main: show the scoreboard after a marshaled mission, before the
  relaunch.

Verified: MISSION COMPLETE screen renders with the pilot row and the
snapshotted score (0/0 on a no-combat test run; the data path is the
same one the live Comm MFD reads).

Phase 5 (front end) COMPLETE: menu + egg builder + marshal + timed stop
+ results + single-binary (relaunch) loop.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 22:48:09 -05:00

32 lines
1.4 KiB
C++

//===========================================================================//
// btl4console.hpp -- BT412 in-process LocalConsole marshal.
//
// A front-end-launched solo mission has no operator console, so the mission
// clock would count up forever. This marshal plays the console's role in
// process: it watches the mission via the engine's per-frame hook
// (gPerFrameHook, called on the game thread in RunMissions) and dispatches
// StopMissionMessage when the selected length expires, exactly as the arcade
// console did. The single-binary WinMain loop then collects the result and
// cycles back to the setup menu.
//===========================================================================//
#ifndef BTL4CONSOLE_HPP
#define BTL4CONSOLE_HPP
// Arm the marshal for the next mission: it stops the mission after
// `mission_seconds` (0 = endless -- never auto-stops). Registers the
// per-frame hook.
void BTLocalConsole_Install(int mission_seconds);
// True once the marshaled mission has stopped (time expired, or ended some
// other way while armed) -- the WinMain loop cycles back to the menu.
int BTLocalConsole_MissionCompleted();
// Final scores snapshotted at the stop (roster order; slot 0 = local pilot).
int BTLocalConsole_ResultCount();
int BTLocalConsole_GetResult(int index, int *kills, int *deaths);
// Drop the marshal + clear the per-frame hook.
void BTLocalConsole_Uninstall();
#endif // BTL4CONSOLE_HPP