Console: move DOSBox IP shift from game pages into game defaults
The per-page "DOSBox IPs (+100)" checkbox becomes a single machine-level setting per game, edited in Settings > Change <game> Defaults (a "DOSBox Build" row below Autotranslocate Delay) and persisted in the game's defaults file (RPDefaults.rpd / BTDefaults.btd) as a top-level DosBoxAddressShift element. The game pages no longer carry the checkbox; each RPGame/BTGame reads the stored default once at construction into a readonly field and applies it when enabling a pod (MungaGame.DosBoxAddressShift) and when building the mission egg (MissionAddress). Since it is read at construction, an already-open game page keeps its shift until reopened -- consistent with how every other game default behaves. Verified against vPOD: enabling the DOSBox default drives a freshly opened game page's pod connection to 127.0.0.101 and the egg to pilot=127.0.0.101 with no per-page control; unchecking round-trips to False in the defaults file. All 103 diff tests pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -89,6 +89,10 @@ public class BTDefaultsDialog : Form
|
||||
|
||||
private NumericUpDown mNoReturnLaunchDelay;
|
||||
|
||||
private Label mDosBoxLabel;
|
||||
|
||||
private CheckBox mDosBoxShift;
|
||||
|
||||
private TableLayoutPanel mButtonsTable;
|
||||
|
||||
private Button mCancel;
|
||||
@@ -124,6 +128,7 @@ public class BTDefaultsDialog : Form
|
||||
BTScenario scenario = BTConfig.FreeForAll;
|
||||
BuildColumn(scenario, BTDefaults.FreeForAll, mFfaMap, mFfaWeather, mFfaTimeOfDay, mFfaAdvancedDamage, mFfaMissionLength, mFfaVehicle, mFfaCamo, mFfaPatch, mFfaBadge, mFfaExperience, mFfaLaunchDelay);
|
||||
BuildColumn(scenario, BTDefaults.NoReturn, mNoReturnMap, mNoReturnWeather, mNoReturnTimeOfDay, mNoReturnAdvancedDamage, mNoReturnMissionLength, mNoReturnVehicle, mNoReturnCamo, mNoReturnPatch, mNoReturnBadge, mNoReturnExperience, mNoReturnLaunchDelay);
|
||||
mDosBoxShift.Checked = BTDefaults.DosBoxAddressShift;
|
||||
}
|
||||
|
||||
private static void BuildColumn(BTScenario scenario, BTDefaults.BattleDefaults defaults, ComboBox map, ComboBox weather, ComboBox timeOfDay, ComboBox advancedDamage, MaskedTextBox missionLength, ComboBox vehicle, ComboBox camo, ComboBox patch, ComboBox badge, ComboBox experience, NumericUpDown launchDelay)
|
||||
@@ -208,6 +213,7 @@ public class BTDefaultsDialog : Form
|
||||
{
|
||||
SaveColumn(BTDefaults.FreeForAll, mFfaMap, mFfaWeather, mFfaTimeOfDay, mFfaAdvancedDamage, mFfaMissionLength, mFfaVehicle, mFfaCamo, mFfaPatch, mFfaBadge, mFfaExperience, mFfaLaunchDelay);
|
||||
SaveColumn(BTDefaults.NoReturn, mNoReturnMap, mNoReturnWeather, mNoReturnTimeOfDay, mNoReturnAdvancedDamage, mNoReturnMissionLength, mNoReturnVehicle, mNoReturnCamo, mNoReturnPatch, mNoReturnBadge, mNoReturnExperience, mNoReturnLaunchDelay);
|
||||
BTDefaults.DosBoxAddressShift = mDosBoxShift.Checked;
|
||||
BTDefaults.Save();
|
||||
Hide();
|
||||
}
|
||||
@@ -274,6 +280,8 @@ public class BTDefaultsDialog : Form
|
||||
this.mNoReturnExperience = new System.Windows.Forms.ComboBox();
|
||||
this.mFfaLaunchDelay = new System.Windows.Forms.NumericUpDown();
|
||||
this.mNoReturnLaunchDelay = new System.Windows.Forms.NumericUpDown();
|
||||
this.mDosBoxLabel = new System.Windows.Forms.Label();
|
||||
this.mDosBoxShift = new System.Windows.Forms.CheckBox();
|
||||
this.mButtonsTable = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.mCancel = new System.Windows.Forms.Button();
|
||||
this.mOK = new System.Windows.Forms.Button();
|
||||
@@ -321,17 +329,19 @@ public class BTDefaultsDialog : Form
|
||||
this.mMainTable.Controls.Add(this.mLaunchDelayLabel, 0, 11);
|
||||
this.mMainTable.Controls.Add(this.mFfaLaunchDelay, 1, 11);
|
||||
this.mMainTable.Controls.Add(this.mNoReturnLaunchDelay, 2, 11);
|
||||
this.mMainTable.Controls.Add(this.mButtonsTable, 0, 12);
|
||||
this.mMainTable.Controls.Add(this.mDosBoxLabel, 0, 12);
|
||||
this.mMainTable.Controls.Add(this.mDosBoxShift, 1, 12);
|
||||
this.mMainTable.Controls.Add(this.mButtonsTable, 0, 13);
|
||||
this.mMainTable.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.mMainTable.Location = new System.Drawing.Point(3, 3);
|
||||
this.mMainTable.Name = "mMainTable";
|
||||
this.mMainTable.RowCount = 13;
|
||||
for (int i = 0; i < 12; i++)
|
||||
this.mMainTable.RowCount = 14;
|
||||
for (int i = 0; i < 13; i++)
|
||||
{
|
||||
this.mMainTable.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
}
|
||||
this.mMainTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100f));
|
||||
this.mMainTable.Size = new System.Drawing.Size(478, 384);
|
||||
this.mMainTable.Size = new System.Drawing.Size(478, 414);
|
||||
this.mMainTable.TabIndex = 0;
|
||||
this.mFfaHeaderLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.mFfaHeaderLabel.AutoSize = true;
|
||||
@@ -352,6 +362,7 @@ public class BTDefaultsDialog : Form
|
||||
ConfigureRowLabel(this.mBadgeLabel, "mBadgeLabel", "Badge:");
|
||||
ConfigureRowLabel(this.mExperienceLabel, "mExperienceLabel", "Experience:");
|
||||
ConfigureRowLabel(this.mLaunchDelayLabel, "mLaunchDelayLabel", "Autotranslocate Delay:");
|
||||
ConfigureRowLabel(this.mDosBoxLabel, "mDosBoxLabel", "DOSBox Build:");
|
||||
ConfigureOptionCombo(this.mFfaMap, "mFfaMap");
|
||||
ConfigureOptionCombo(this.mNoReturnMap, "mNoReturnMap");
|
||||
ConfigureOptionCombo(this.mFfaWeather, "mFfaWeather");
|
||||
@@ -378,6 +389,12 @@ public class BTDefaultsDialog : Form
|
||||
this.mFfaLaunchDelay.Name = "mFfaLaunchDelay";
|
||||
this.mNoReturnLaunchDelay.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.mNoReturnLaunchDelay.Name = "mNoReturnLaunchDelay";
|
||||
this.mMainTable.SetColumnSpan(this.mDosBoxShift, 2);
|
||||
this.mDosBoxShift.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.mDosBoxShift.AutoSize = true;
|
||||
this.mDosBoxShift.Name = "mDosBoxShift";
|
||||
this.mDosBoxShift.Text = "Shift all pod IPs +100 (DOSBox-X preservation build)";
|
||||
this.mDosBoxShift.UseVisualStyleBackColor = true;
|
||||
this.mButtonsTable.ColumnCount = 2;
|
||||
this.mMainTable.SetColumnSpan(this.mButtonsTable, 3);
|
||||
this.mButtonsTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100f));
|
||||
@@ -408,7 +425,7 @@ public class BTDefaultsDialog : Form
|
||||
base.AcceptButton = this.mOK;
|
||||
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
|
||||
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
base.ClientSize = new System.Drawing.Size(484, 390);
|
||||
base.ClientSize = new System.Drawing.Size(484, 420);
|
||||
base.Controls.Add(this.mMainTable);
|
||||
base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
base.MaximizeBox = false;
|
||||
|
||||
Reference in New Issue
Block a user