Fixed: Map options form window would become squished if the starting game configuration is invalid

This commit is contained in:
ZZYZX 2022-09-19 10:13:27 +03:00
parent ca5c77251e
commit 85a4c3a651
3 changed files with 7 additions and 10 deletions

View file

@ -56,7 +56,8 @@ namespace CodeImp.DoomBuilder.Windows
// Initialize
InitializeComponent();
CodeImp.DoomBuilder.General.ApplyMonoListViewFix(listtextures);
this.initialformheight = Height;
General.ApplyMonoListViewFix(listtextures);
#if NO_WIN32
// Linux doesn't require .exe or .bat file extensions
@ -110,9 +111,6 @@ namespace CodeImp.DoomBuilder.Windows
//mxd. Trigger change to update the right panel...
listconfigs_MouseUp(this, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0));
//
initialformheight = Height;
}
// This shows a specific page

View file

@ -51,6 +51,7 @@ namespace CodeImp.DoomBuilder.Windows
// Initialize
InitializeComponent();
this.initialformheight = Height;
// Keep settings
this.options = options;
@ -128,8 +129,6 @@ namespace CodeImp.DoomBuilder.Windows
datalocations.EditResourceLocationList(options.Resources);
//reloadresourceprecmd.Text = options.ReloadResourcePreCommand;
this.initialformheight = Height;
}
private GameConfiguration GetGameConfiguration()

View file

@ -41,7 +41,7 @@ namespace CodeImp.DoomBuilder.Windows
private string selectedmapname;
private static readonly Regex episodemapregex = new Regex("^E[1-9]M[1-9]$");
private static readonly Regex noepisodemapregex = new Regex("^MAP[0-9][0-9]$");
private readonly int initialformsize;
private readonly int initialformheight;
// Properties
//public string FilePathName { get { return filepathname; } }
@ -52,13 +52,13 @@ namespace CodeImp.DoomBuilder.Windows
{
// Initialize
InitializeComponent();
this.initialformheight = Height;
General.ApplyMonoListViewFix(mapslist);
this.Text = "Open Map from " + Path.GetFileName(filepathname);
this.filepathname = filepathname;
datalocations.StartPath = filepathname; //mxd
datalocations.IsMapControl = true;
this.options = null;
this.initialformsize = Height;
}
// Constructor
@ -66,13 +66,13 @@ namespace CodeImp.DoomBuilder.Windows
{
// Initialize
InitializeComponent();
this.initialformheight = Height;
General.ApplyMonoListViewFix(mapslist);
this.Text = "Open Map from " + Path.GetFileName(filepathname);
this.filepathname = filepathname;
this.options = options;
datalocations.StartPath = filepathname; //mxd
datalocations.IsMapControl = true;
this.initialformsize = Height;
}
private GameConfiguration GetGameConfiguration()
@ -643,7 +643,7 @@ namespace CodeImp.DoomBuilder.Windows
private void datalocations_OnWarningsChanged(int size)
{
Height = initialformsize + size;
Height = initialformheight + size;
Refresh();
}
}