When choosing a difficulty or engine in the test toolbar button the engine will not be launched immediately. This can be reverted in the preferences. Resolves #626

This commit is contained in:
biwa 2021-12-11 12:43:33 +01:00
parent a75249b315
commit 9f85f70deb
5 changed files with 2395 additions and 2351 deletions

View file

@ -97,6 +97,7 @@ namespace CodeImp.DoomBuilder.Config
private bool switchviewmodes; //mxd private bool switchviewmodes; //mxd
private bool showfps; private bool showfps;
private int[] colordialogcustomcolors; private int[] colordialogcustomcolors;
private bool autolaunchontest;
//mxd. Script editor settings //mxd. Script editor settings
private string scriptfontname; private string scriptfontname;
@ -207,6 +208,7 @@ namespace CodeImp.DoomBuilder.Config
public bool SplitJoinedSectors { get { return splitjoinedsectors; } internal set { splitjoinedsectors = value; } } //mxd public bool SplitJoinedSectors { get { return splitjoinedsectors; } internal set { splitjoinedsectors = value; } } //mxd
public bool ShowFPS { get { return showfps; } internal set { showfps = value; } } public bool ShowFPS { get { return showfps; } internal set { showfps = value; } }
public int[] ColorDialogCustomColors { get { return colordialogcustomcolors; } internal set { colordialogcustomcolors = value; } } public int[] ColorDialogCustomColors { get { return colordialogcustomcolors; } internal set { colordialogcustomcolors = value; } }
public bool AutoLaunchOnTest { get { return autolaunchontest; } internal set { autolaunchontest = value; } }
//mxd. Highlight mode //mxd. Highlight mode
public bool UseHighlight public bool UseHighlight
@ -354,6 +356,7 @@ namespace CodeImp.DoomBuilder.Config
usehighlight = cfg.ReadSetting("usehighlight", true); //mxd usehighlight = cfg.ReadSetting("usehighlight", true); //mxd
switchviewmodes = cfg.ReadSetting("switchviewmodes", false); //mxd switchviewmodes = cfg.ReadSetting("switchviewmodes", false); //mxd
showfps = cfg.ReadSetting("showfps", false); showfps = cfg.ReadSetting("showfps", false);
autolaunchontest = cfg.ReadSetting("autolaunchontest", false);
//mxd. Script editor //mxd. Script editor
scriptfontname = cfg.ReadSetting("scriptfontname", "Courier New"); scriptfontname = cfg.ReadSetting("scriptfontname", "Courier New");
@ -491,6 +494,7 @@ namespace CodeImp.DoomBuilder.Config
cfg.WriteSetting("usehighlight", usehighlight); //mxd cfg.WriteSetting("usehighlight", usehighlight); //mxd
cfg.WriteSetting("switchviewmodes", switchviewmodes); //mxd cfg.WriteSetting("switchviewmodes", switchviewmodes); //mxd
cfg.WriteSetting("showfps", showfps); cfg.WriteSetting("showfps", showfps);
cfg.WriteSetting("autolaunchontest", autolaunchontest);
//mxd. Script editor //mxd. Script editor
cfg.WriteSetting("scriptfontname", scriptfontname); cfg.WriteSetting("scriptfontname", scriptfontname);

View file

@ -586,6 +586,9 @@ namespace CodeImp.DoomBuilder.Windows
this.DragEnter += OnDragEnter; this.DragEnter += OnDragEnter;
this.DragDrop += OnDragDrop; this.DragDrop += OnDragDrop;
// For checking if the drop down should really be closed
buttontest.DropDown.Closing += ButtonTestDropDown_Closing;
// Info panel state? // Info panel state?
bool expandedpanel = General.Settings.ReadSetting("windows." + configname + ".expandedinfopanel", true); bool expandedpanel = General.Settings.ReadSetting("windows." + configname + ".expandedinfopanel", true);
if(expandedpanel != IsInfoPanelExpanded) ToggleInfoPanel(); if(expandedpanel != IsInfoPanelExpanded) ToggleInfoPanel();
@ -1608,7 +1611,10 @@ namespace CodeImp.DoomBuilder.Windows
{ {
General.Map.ConfigSettings.CurrentEngineIndex = (int)(((ToolStripMenuItem)sender).Tag); General.Map.ConfigSettings.CurrentEngineIndex = (int)(((ToolStripMenuItem)sender).Tag);
General.Map.ConfigSettings.Changed = true; General.Map.ConfigSettings.Changed = true;
General.Map.Launcher.TestAtSkill(General.Map.ConfigSettings.TestSkill);
if(General.Settings.AutoLaunchOnTest)
General.Map.Launcher.TestAtSkill(General.Map.ConfigSettings.TestSkill);
UpdateSkills(); UpdateSkills();
} }
@ -1618,7 +1624,10 @@ namespace CodeImp.DoomBuilder.Windows
int skill = (int)((sender as ToolStripMenuItem).Tag); int skill = (int)((sender as ToolStripMenuItem).Tag);
General.Settings.TestMonsters = (skill > 0); General.Settings.TestMonsters = (skill > 0);
General.Map.ConfigSettings.TestSkill = Math.Abs(skill); General.Map.ConfigSettings.TestSkill = Math.Abs(skill);
General.Map.Launcher.TestAtSkill(Math.Abs(skill));
if(General.Settings.AutoLaunchOnTest)
General.Map.Launcher.TestAtSkill(Math.Abs(skill));
UpdateSkills(); UpdateSkills();
} }
@ -2294,6 +2303,19 @@ namespace CodeImp.DoomBuilder.Windows
} }
} }
/// <summary>
/// Called when the test button drop down wants to close. Prevents closing when auto-launching is disabled
/// </summary>
/// <param name="sender">The sneder</param>
/// <param name="e">The event</param>
private void ButtonTestDropDown_Closing(object sender, ToolStripDropDownClosingEventArgs e)
{
if (General.Settings.AutoLaunchOnTest == false && e.CloseReason == ToolStripDropDownCloseReason.ItemClicked)
{
e.Cancel = true;
}
}
#endregion #endregion
#region ================== Toolbar context menu (mxd) #region ================== Toolbar context menu (mxd)

File diff suppressed because it is too large Load diff

View file

@ -96,6 +96,7 @@ namespace CodeImp.DoomBuilder.Windows
showtexturesizes.Checked = General.Settings.ShowTextureSizes; showtexturesizes.Checked = General.Settings.ShowTextureSizes;
texturesizesbelow.Checked = General.Settings.TextureSizesBelow; texturesizesbelow.Checked = General.Settings.TextureSizesBelow;
cbShowFPS.Checked = General.Settings.ShowFPS; cbShowFPS.Checked = General.Settings.ShowFPS;
autolaunchontest.Checked = General.Settings.AutoLaunchOnTest;
//mxd //mxd
locatetexturegroup.Checked = General.Settings.LocateTextureGroup; locatetexturegroup.Checked = General.Settings.LocateTextureGroup;
@ -333,6 +334,7 @@ namespace CodeImp.DoomBuilder.Windows
General.Settings.MaxRecentFiles = recentFiles.Value; //mxd General.Settings.MaxRecentFiles = recentFiles.Value; //mxd
General.Settings.ScreenshotsPath = screenshotsfolderpath.Text.Trim(); //mxd General.Settings.ScreenshotsPath = screenshotsfolderpath.Text.Trim(); //mxd
General.Settings.ShowFPS = cbShowFPS.Checked; General.Settings.ShowFPS = cbShowFPS.Checked;
General.Settings.AutoLaunchOnTest = autolaunchontest.Checked;
// Script settings // Script settings
General.Settings.ScriptFontBold = scriptfontbold.Checked; General.Settings.ScriptFontBold = scriptfontbold.Checked;

View file

@ -141,6 +141,9 @@
<metadata name="label1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="label1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
</metadata> </metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="scriptallmanstyle.ToolTip" xml:space="preserve"> <data name="scriptallmanstyle.ToolTip" xml:space="preserve">
<value>When enabled, the opening brace <value>When enabled, the opening brace
will be placed on a new line when will be placed on a new line when