Skip to content
Snippets Groups Projects
Commit e62146f4 authored by codeimp's avatar codeimp
Browse files

- Reset default drawing textures when map options are changed

- Fixed some minor bugs in the choice of default drawing textures
parent 2485c5b1
No related branches found
No related tags found
No related merge requests found
......@@ -425,16 +425,19 @@ namespace CodeImp.DoomBuilder.Config
}
// Pick the first FLOOR from the list.
foreach(string s in General.Map.Data.FlatNames)
if(!foundone)
{
if(s.StartsWith("FLOOR"))
foreach(string s in General.Map.Data.FlatNames)
{
foundone = true;
defaultfloortexture = s;
break;
if(s.StartsWith("FLOOR"))
{
foundone = true;
defaultfloortexture = s;
break;
}
}
}
// Otherwise just pick the first
if(!foundone)
{
......@@ -454,17 +457,20 @@ namespace CodeImp.DoomBuilder.Config
defaultceiltexture = General.GetByIndex(General.Map.Map.Sectors, 0).CeilTexture;
}
// Pick the first FLOOR from the list.
foreach(string s in General.Map.Data.FlatNames)
// Pick the first CEIL from the list.
if(!foundone)
{
if(s.StartsWith("FLOOR"))
foreach(string s in General.Map.Data.FlatNames)
{
foundone = true;
defaultceiltexture = s;
break;
if(s.StartsWith("CEIL"))
{
foundone = true;
defaultceiltexture = s;
break;
}
}
}
// Otherwise just pick the first
if(!foundone)
{
......
......@@ -183,6 +183,11 @@ namespace CodeImp.DoomBuilder.Windows
options.StrictPatches = strictpatches.Checked;
options.CopyResources(datalocations.GetResources());
// Reset default drawing textures
General.Settings.DefaultTexture = null;
General.Settings.DefaultFloorTexture = null;
General.Settings.DefaultCeilingTexture = null;
// Hide window
this.DialogResult = DialogResult.OK;
this.Close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment