2009-04-19 18:07:22 +00:00
#region = = = = = = = = = = = = = = = = = = Copyright ( c ) 2007 Pascal vd Heiden
/ *
* Copyright ( c ) 2007 Pascal vd Heiden , www . codeimp . com
* This program is released under GNU General Public License
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* /
#endregion
#region = = = = = = = = = = = = = = = = = = Namespaces
using CodeImp.DoomBuilder.IO ;
#endregion
namespace CodeImp.DoomBuilder.Config
{
public struct MapLumpInfo
{
// Members
2014-07-11 10:13:26 +00:00
public readonly string name ;
public readonly bool required ;
public readonly bool blindcopy ;
public readonly bool nodebuild ;
public readonly bool allowempty ;
public readonly bool scriptbuild ; //mxd
internal readonly ScriptConfiguration script ;
2009-04-19 18:07:22 +00:00
// Construct from IDictionary
internal MapLumpInfo ( string name , Configuration cfg )
{
// Apply settings
this . name = name ;
this . script = null ;
this . required = cfg . ReadSetting ( "maplumpnames." + name + ".required" , false ) ;
this . blindcopy = cfg . ReadSetting ( "maplumpnames." + name + ".blindcopy" , false ) ;
this . nodebuild = cfg . ReadSetting ( "maplumpnames." + name + ".nodebuild" , false ) ;
this . allowempty = cfg . ReadSetting ( "maplumpnames." + name + ".allowempty" , false ) ;
2014-07-11 10:13:26 +00:00
this . scriptbuild = cfg . ReadSetting ( "maplumpnames." + name + ".scriptbuild" , false ) ; //mxd
2014-02-21 14:42:12 +00:00
string scriptconfig = cfg . ReadSetting ( "maplumpnames." + name + ".script" , "" ) ;
2009-04-19 18:07:22 +00:00
// Find script configuration
if ( scriptconfig . Length > 0 )
{
if ( General . ScriptConfigs . ContainsKey ( scriptconfig . ToLowerInvariant ( ) ) )
{
this . script = General . ScriptConfigs [ scriptconfig . ToLowerInvariant ( ) ] ;
}
else
{
2009-05-10 16:02:08 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "Map lump '" + name + "' in the current game configuration specifies an unknown script configuration '" + scriptconfig + "'. Using plain text instead." ) ;
2009-04-19 18:07:22 +00:00
this . script = new ScriptConfiguration ( ) ;
}
}
}
}
}