- Reset default drawing textures when map options are changed

- Fixed some minor bugs in the choice of default drawing textures
This commit is contained in:
codeimp 2009-05-31 10:59:42 +00:00
parent 2485c5b184
commit e62146f464
2 changed files with 24 additions and 13 deletions

View file

@ -425,16 +425,19 @@ namespace CodeImp.DoomBuilder.Config
} }
// Pick the first FLOOR from the list. // 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; if(s.StartsWith("FLOOR"))
defaultfloortexture = s; {
break; foundone = true;
defaultfloortexture = s;
break;
}
} }
} }
// Otherwise just pick the first // Otherwise just pick the first
if(!foundone) if(!foundone)
{ {
@ -454,17 +457,20 @@ namespace CodeImp.DoomBuilder.Config
defaultceiltexture = General.GetByIndex(General.Map.Map.Sectors, 0).CeilTexture; defaultceiltexture = General.GetByIndex(General.Map.Map.Sectors, 0).CeilTexture;
} }
// Pick the first FLOOR from the list. // Pick the first CEIL 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; if(s.StartsWith("CEIL"))
defaultceiltexture = s; {
break; foundone = true;
defaultceiltexture = s;
break;
}
} }
} }
// Otherwise just pick the first // Otherwise just pick the first
if(!foundone) if(!foundone)
{ {

View file

@ -183,6 +183,11 @@ namespace CodeImp.DoomBuilder.Windows
options.StrictPatches = strictpatches.Checked; options.StrictPatches = strictpatches.Checked;
options.CopyResources(datalocations.GetResources()); options.CopyResources(datalocations.GetResources());
// Reset default drawing textures
General.Settings.DefaultTexture = null;
General.Settings.DefaultFloorTexture = null;
General.Settings.DefaultCeilingTexture = null;
// Hide window // Hide window
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;
this.Close(); this.Close();