The core 'single-player without the operator console' capability: a
zero-argument launch now builds its own mission and plays.
- game/reconstructed/btl4fe.{hpp,cpp}: the BattleTech catalog (8 maps,
8 mechs + variants, colors) and BTFeMission_WriteEgg -- emits the exact
console egg format (verified against content/MP.EGG): [mission],
[ordinals] + the 4 static rank-place plasma bitmaps, [pilots],
per-pilot loadout sections, and [largebitmap]/[smallbitmap] with
GDI-rendered 128x32 / 64x16 pilot-name plasma bitmaps.
- L4APP.H: SetEggNotationFileName / SetNetworkCommonFlatAddress setters
(from RP412) so the front end feeds the standard -egg load path.
- btl4main.cpp WinMain: front-end mode -- no -egg and no -net builds
frontend.egg locally (BTFrontEnd_Run) and boots it. -egg/-net runs
are untouched.
Verified: no-args launch -> '[frontend] built frontend.egg' -> mission
loads and runs; the generated egg is structurally identical to MP.EGG
(32x32/16x16 name bitmaps with real glyph pixels, all sections present).
Remaining in Phase 5 (deferred): the interactive on-screen catalog menu,
the in-process LocalConsole marshal (mission clock + StopMission at
expiry + single-binary loop), and the score-intake/results screen (new
for BT -- no mission-end flow exists yet). (Phase 5 of the roadmap)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
73 lines
3.2 KiB
C++
73 lines
3.2 KiB
C++
//===========================================================================//
|
|
// btl4fe.hpp -- BT412 in-game front end: local mission-egg builder.
|
|
//
|
|
// Replaces the external operator console for solo / host play: a race is
|
|
// configured from an in-process catalog and the mission egg is built LOCALLY
|
|
// (the exact NotationFile the console used to stream), then fed through the
|
|
// standard -egg load path (L4Application::SetEggNotationFileName).
|
|
//
|
|
// This is the Workstream B foundation (docs/BT412-ROADMAP.md Phase 5); the
|
|
// interactive on-screen menu, the LocalConsole marshal, and the results
|
|
// screen build on top of this egg builder.
|
|
//===========================================================================//
|
|
#ifndef BTL4FE_HPP
|
|
#define BTL4FE_HPP
|
|
|
|
//---------------------------------------------------------------------------//
|
|
// Catalogs (the console's RPConfig.xml equivalent for BattleTech).
|
|
//---------------------------------------------------------------------------//
|
|
extern const char *const kBTMaps[]; // NULL-terminated
|
|
extern const char *const kBTMechs[]; // NULL-terminated (base + variants)
|
|
extern const char *const kBTColors[]; // NULL-terminated
|
|
extern int BTCatalogCount(const char *const *list);
|
|
|
|
//---------------------------------------------------------------------------//
|
|
// One participant's loadout.
|
|
//---------------------------------------------------------------------------//
|
|
struct BTFePilot
|
|
{
|
|
char address[32]; // "ip[:port]" -- the mesh roster key
|
|
char name[24]; // pilot name (also the plasma name bitmap)
|
|
char vehicle[16]; // mech, e.g. "bhk1"
|
|
char color[16]; // "White" / "Red" / ...
|
|
char badge[8]; // e.g. "VGL"
|
|
char patch[16]; // e.g. "Yellow"
|
|
char dropzone[8]; // "one" ...
|
|
int bitmapindex; // 1..N (which ordinal/name slot)
|
|
int advancedDamage; // 0/1
|
|
int loadzones; // 0/1
|
|
};
|
|
|
|
//---------------------------------------------------------------------------//
|
|
// A whole mission before it becomes an egg.
|
|
//---------------------------------------------------------------------------//
|
|
struct BTFeMission
|
|
{
|
|
char map[16]; // e.g. "cavern"
|
|
char scenario[16]; // "freeforall"
|
|
char timeOfDay[8]; // "day" / "night"
|
|
char weather[16]; // "clear" ...
|
|
int temperature; // e.g. 27
|
|
int lengthSeconds; // mission time limit
|
|
int pilotCount;
|
|
BTFePilot pilots[8];
|
|
};
|
|
|
|
// Fill a mission with sensible solo defaults (map=grass, one local pilot).
|
|
void BTFeMission_Default(BTFeMission *mission);
|
|
|
|
// Write the mission as an egg NotationFile to `path`. Returns True on success.
|
|
// Emits [mission] / [ordinals]+4 rank bitmaps / [pilots] / per-pilot sections /
|
|
// [largebitmap]+[smallbitmap] (GDI-rendered pilot names) / role models -- the
|
|
// exact structure the console streamed (verified against content/MP.EGG).
|
|
int BTFeMission_WriteEgg(const BTFeMission *mission, const char *path);
|
|
|
|
//---------------------------------------------------------------------------//
|
|
// Front-end mode: no -egg, no -net on the command line. Build a solo egg
|
|
// from the default loadout and point the engine at it. Returns True if it
|
|
// took over (an egg was built + set), False to fall through to the old path.
|
|
//---------------------------------------------------------------------------//
|
|
int BTFrontEnd_Run();
|
|
|
|
#endif // BTL4FE_HPP
|