mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-02-22 11:52:00 +00:00
Fixed, Map Options window: game configurations were checked in incorrect order when opening a map without a .dbs file.
This commit is contained in:
parent
3f9aba44bd
commit
035849b421
1 changed files with 59 additions and 32 deletions
|
@ -126,44 +126,30 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
scriptcompiler.Items.Add(group.Value);
|
scriptcompiler.Items.Add(group.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//mxd. Go for all enabled configurations
|
// Go for all configurations
|
||||||
for(int i = 0; i < General.Configs.Count; i++)
|
foreach(ConfigurationInfo info in General.Configs)
|
||||||
{
|
{
|
||||||
if(!General.Configs[i].Enabled) continue;
|
|
||||||
|
|
||||||
// Add config name to list
|
// Add config name to list
|
||||||
index = config.Items.Add(General.Configs[i]);
|
index = config.Items.Add(info);
|
||||||
|
|
||||||
// Select this item
|
// Select this item
|
||||||
if(General.Configs[i].Filename == gameconfig) config.SelectedIndex = index;
|
if(info.Filename == gameconfig) config.SelectedIndex = index;
|
||||||
}
|
|
||||||
|
|
||||||
//mxd. No dice? Try disabled ones
|
|
||||||
if(config.SelectedIndex == -1)
|
|
||||||
{
|
|
||||||
for(int i = 0; i < General.Configs.Count; i++)
|
|
||||||
{
|
|
||||||
if(General.Configs[i].Enabled) continue;
|
|
||||||
if(General.Configs[i].Filename == gameconfig)
|
|
||||||
{
|
|
||||||
//add and Select this item
|
|
||||||
config.SelectedIndex = config.Items.Add(General.Configs[i]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Still no configuration selected?
|
// Still no configuration selected?
|
||||||
if(config.SelectedIndex == -1)
|
if(config.SelectedIndex == -1)
|
||||||
{
|
{
|
||||||
// Then go for all configurations with resources to find a suitable one
|
//mxd. Then go for all ENABLED configurations with resources to find a suitable one
|
||||||
for(int i = 0; i < General.Configs.Count; i++)
|
foreach(ConfigurationInfo info in General.Configs)
|
||||||
{
|
{
|
||||||
// Check if a resource location is set for this configuration, if so, match the wad against this configuration
|
// Check if a resource location is set for this configuration, if so, match the wad against this configuration
|
||||||
if(General.Configs[i].Resources.Count > 0 && MatchConfiguration(General.Configs[i].Configuration, wadfile))
|
if(info.Enabled && info.Resources.Count > 0 && MatchConfiguration(info.Configuration, wadfile))
|
||||||
{
|
{
|
||||||
index = config.Items.IndexOf(General.Configs[i]); //mxd. Already added?
|
//mxd. Already added?
|
||||||
config.SelectedIndex = (index != -1 ? index : config.Items.Add(General.Configs[i])); // Select or add and select this item
|
index = config.Items.IndexOf(info);
|
||||||
|
|
||||||
|
// Select or add and select this item
|
||||||
|
config.SelectedIndex = (index != -1 ? index : config.Items.Add(info));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -172,14 +158,55 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
//mxd. Still no configuration selected?
|
//mxd. Still no configuration selected?
|
||||||
if(config.SelectedIndex == -1)
|
if(config.SelectedIndex == -1)
|
||||||
{
|
{
|
||||||
// Then go for all configurations without resources to find a suitable one
|
// Then go for all DISABLED configurations with resources to find a suitable one
|
||||||
for(int i = 0; i < General.Configs.Count; i++)
|
foreach(ConfigurationInfo info in General.Configs)
|
||||||
|
{
|
||||||
|
// Check if a resource location is set for this configuration, if so, match the wad against this configuration
|
||||||
|
if(!info.Enabled && info.Resources.Count > 0 && MatchConfiguration(info.Configuration, wadfile))
|
||||||
|
{
|
||||||
|
//mxd. Already added?
|
||||||
|
index = config.Items.IndexOf(info);
|
||||||
|
|
||||||
|
// Select or add and select this item
|
||||||
|
config.SelectedIndex = (index != -1 ? index : config.Items.Add(info));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//mxd. Still no configuration selected?
|
||||||
|
if(config.SelectedIndex == -1)
|
||||||
|
{
|
||||||
|
//mxd. Then go for all ENABLED configurations without resources to find a suitable one
|
||||||
|
foreach(ConfigurationInfo info in General.Configs)
|
||||||
{
|
{
|
||||||
// Check if a resource location is not set for this configuration, if so, match the wad against this configuration
|
// Check if a resource location is not set for this configuration, if so, match the wad against this configuration
|
||||||
if(General.Configs[i].Resources.Count == 0 && MatchConfiguration(General.Configs[i].Configuration, wadfile))
|
if(info.Enabled && info.Resources.Count == 0 && MatchConfiguration(info.Configuration, wadfile))
|
||||||
{
|
{
|
||||||
index = config.Items.IndexOf(General.Configs[i]); //mxd. Already added?
|
//mxd. Already added?
|
||||||
config.SelectedIndex = (index != -1 ? index : config.Items.Add(General.Configs[i])); // Select or add and select this item
|
index = config.Items.IndexOf(info);
|
||||||
|
|
||||||
|
// Select or add and select this item
|
||||||
|
config.SelectedIndex = (index != -1 ? index : config.Items.Add(info));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//mxd. Still no configuration selected?
|
||||||
|
if(config.SelectedIndex == -1)
|
||||||
|
{
|
||||||
|
// Then go for all DISABLED configurations without resources to find a suitable one
|
||||||
|
foreach(ConfigurationInfo info in General.Configs)
|
||||||
|
{
|
||||||
|
// Check if a resource location is not set for this configuration, if so, match the wad against this configuration
|
||||||
|
if(!info.Enabled && info.Resources.Count == 0 && MatchConfiguration(info.Configuration, wadfile))
|
||||||
|
{
|
||||||
|
//mxd. Already added?
|
||||||
|
index = config.Items.IndexOf(info);
|
||||||
|
|
||||||
|
// Select or add and select this item
|
||||||
|
config.SelectedIndex = (index != -1 ? index : config.Items.Add(info));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue