BTGame pane + shell de-hardcode for multi-game pods (BT port phase 3)

BTGame mirrors RPGame - same GameStateData/state-machine/NetworkScan engine
driving each pod's MungaGame (take ownership, stream egg on WaitingForEgg,
Run/Abort/Stop, countdown) - with the BT differences: ApplicationID.BTL4, a
pilots grid carrying Mech/Camo/Patch/Badge/Experience, an Advanced Damage
checkbox in place of RP's Score Compression, and the Mech* in-match messages
recorded via BTMissionRecorder into BTMissionResults (.btm, gzip +
BinaryFormatter like .rpm; scores are 1000-based like RP). Free For All and
No Return share the pane; the mode selects the pilots' role. BTDefaults
persists per-mode operator defaults to BTDefaults.btd (no dialog yet).
RPGame's dead decompile members (sStopToIdleStates, IsAllPodsAppState) were
not carried over.

TeslaConsoleForm no longer assumes RP: the "AppID != 0 -> Pod Not Running RP"
check becomes a GameTag map (RPL4 -> RP, BTL4 -> BT, otherwise Unknown Pod
Application) feeding the per-game status strings, and the Games menu gains
BattleTech: Free For All / No Return.

Deferred to phase 4: mech/arena art, BT defaults dialog, BT score-sheet
print document, Apps.xml BT411 product, live-pod verification.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-07 22:29:20 -05:00
co-authored by Claude Fable 5
parent 9148ce2cca
commit 36166a95b0
11 changed files with 2345 additions and 5 deletions
+57 -4
View File
@@ -5,6 +5,7 @@ using System.Drawing.Drawing2D;
using System.Drawing.Printing;
using System.Windows.Forms;
using Munga.Net;
using TeslaConsole.BattleTech;
using TeslaConsole.RedPlanet;
using WeifenLuo.WinFormsUI.Docking;
@@ -38,6 +39,10 @@ public class TeslaConsoleForm : Form
private ToolStripMenuItem mRpMartianFootball;
private ToolStripMenuItem mBtFreeForAll;
private ToolStripMenuItem mBtNoReturn;
private ToolStripMenuItem mPlasmaFontTool;
private ToolStripMenuItem mRpMissionPrintPreview;
@@ -136,15 +141,16 @@ public class TeslaConsoleForm : Form
pod.MungaGame.SetStatus(ImageCache.PodQuestion16, "Waiting For State Update...");
break;
}
if (pod.MungaGame.AppID.Value != 0)
string gameTag = GameTag(pod.MungaGame.AppID.Value);
if (gameTag == null)
{
pod.MungaGame.SetStatus(ImageCache.PodBad16, "Pod Not Running RP");
pod.MungaGame.SetStatus(ImageCache.PodBad16, "Unknown Pod Application");
break;
}
switch (pod.MungaGame.AppState.Value)
{
case ApplicationState.InitializingState:
pod.MungaGame.SetStatus(ImageCache.PodQuestion16, "RP Initalizing");
pod.MungaGame.SetStatus(ImageCache.PodQuestion16, gameTag + " Initalizing");
break;
case ApplicationState.WaitingForEgg:
pod.MungaGame.SetStatus(ImageCache.PodOnline16, "Waiting For A Game");
@@ -202,6 +208,26 @@ public class TeslaConsoleForm : Form
}
}
/// <summary>
/// Short display tag for a pod's reported application, or null when the
/// console has no game module for it. RPL4 is Red Planet, BTL4 is
/// BattleTech; NDL4 (the never-released air-combat game) has no console
/// support. The "Initalizing" spelling in the status strings is preserved
/// from the original console.
/// </summary>
private static string GameTag(ApplicationID appID)
{
switch (appID)
{
case ApplicationID.RPL4:
return "RP";
case ApplicationID.BTL4:
return "BT";
default:
return null;
}
}
private void redPlanetDeathRaceToolStripMenuItem_Click(object sender, EventArgs e)
{
CreateNewRPGame(footballMode: false);
@@ -219,6 +245,23 @@ public class TeslaConsoleForm : Form
rPGame.Show(mMainDockPanel, DockState.Document);
}
private void battleTechFreeForAllToolStripMenuItem_Click(object sender, EventArgs e)
{
CreateNewBTGame(noReturnMode: false);
}
private void battleTechNoReturnToolStripMenuItem_Click(object sender, EventArgs e)
{
CreateNewBTGame(noReturnMode: true);
}
private void CreateNewBTGame(bool noReturnMode)
{
BTGame bTGame = new BTGame(TeslaConsole.Site.Active, noReturnMode);
bTGame.MdiParent = this;
bTGame.Show(mMainDockPanel, DockState.Document);
}
private void plasmaEditorToolStripMenuItem_Click(object sender, EventArgs e)
{
new PlasmaEditor().Show();
@@ -409,6 +452,8 @@ public class TeslaConsoleForm : Form
this.mGamesMenu = new System.Windows.Forms.ToolStripMenuItem();
this.mRpDeathRace = new System.Windows.Forms.ToolStripMenuItem();
this.mRpMartianFootball = new System.Windows.Forms.ToolStripMenuItem();
this.mBtFreeForAll = new System.Windows.Forms.ToolStripMenuItem();
this.mBtNoReturn = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.mExceptionsMenu = new System.Windows.Forms.ToolStripMenuItem();
@@ -540,7 +585,7 @@ public class TeslaConsoleForm : Form
this.enableCustomBitmapsToolStripMenuItem.Size = new System.Drawing.Size(220, 22);
this.enableCustomBitmapsToolStripMenuItem.Text = "Enable Custom Bitmaps";
this.enableCustomBitmapsToolStripMenuItem.Click += new System.EventHandler(enableCustomBitmapsToolStripMenuItem_Click);
this.mGamesMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[2] { this.mRpDeathRace, this.mRpMartianFootball });
this.mGamesMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[4] { this.mRpDeathRace, this.mRpMartianFootball, this.mBtFreeForAll, this.mBtNoReturn });
this.mGamesMenu.Name = "mGamesMenu";
this.mGamesMenu.Size = new System.Drawing.Size(55, 20);
this.mGamesMenu.Text = "Games";
@@ -552,6 +597,14 @@ public class TeslaConsoleForm : Form
this.mRpMartianFootball.Size = new System.Drawing.Size(223, 22);
this.mRpMartianFootball.Text = "Red Planet: Martian Football";
this.mRpMartianFootball.Click += new System.EventHandler(redPlanetMartianFootballToolStripMenuItem_Click);
this.mBtFreeForAll.Name = "mBtFreeForAll";
this.mBtFreeForAll.Size = new System.Drawing.Size(223, 22);
this.mBtFreeForAll.Text = "BattleTech: Free For All";
this.mBtFreeForAll.Click += new System.EventHandler(battleTechFreeForAllToolStripMenuItem_Click);
this.mBtNoReturn.Name = "mBtNoReturn";
this.mBtNoReturn.Size = new System.Drawing.Size(223, 22);
this.mBtNoReturn.Text = "BattleTech: No Return";
this.mBtNoReturn.Click += new System.EventHandler(battleTechNoReturnToolStripMenuItem_Click);
this.aboutToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[1] { this.aboutToolStripMenuItem1 });
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(52, 20);