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 System ;
using System.Collections ;
using System.Collections.Generic ;
2021-03-22 09:41:21 +00:00
using System.Collections.Specialized ;
2009-04-19 18:07:22 +00:00
using System.Globalization ;
2020-06-19 21:30:01 +00:00
using System.Linq ;
2021-03-21 21:58:06 +00:00
using System.Reflection ;
using System.Runtime.CompilerServices ;
2021-09-05 12:59:31 +00:00
using CodeImp.DoomBuilder.Dehacked ;
2009-04-19 18:07:22 +00:00
using CodeImp.DoomBuilder.IO ;
using CodeImp.DoomBuilder.Map ;
using CodeImp.DoomBuilder.Editing ;
2012-06-01 10:17:47 +00:00
using CodeImp.DoomBuilder.GZBuilder.Data ;
2014-11-25 11:52:01 +00:00
using CodeImp.DoomBuilder.Data ;
2012-06-01 10:17:47 +00:00
2009-04-19 18:07:22 +00:00
#endregion
namespace CodeImp.DoomBuilder.Config
{
2021-05-16 14:47:42 +00:00
public struct CompatibilityOptions
{
2021-05-16 20:48:45 +00:00
public bool FixNegativePatchOffsets ;
public bool FixMaskedPatchOffsets ;
2021-05-16 14:47:42 +00:00
public CompatibilityOptions ( Configuration cfg )
{
FixNegativePatchOffsets = cfg . ReadSetting ( "compatibility.fixnegativepatchoffsets" , false ) ;
2021-05-16 20:48:45 +00:00
FixMaskedPatchOffsets = cfg . ReadSetting ( "compatibility.fixmaskedpatchoffsets" , false ) ;
2021-05-16 14:47:42 +00:00
}
}
2009-04-19 18:07:22 +00:00
public class GameConfiguration
{
#region = = = = = = = = = = = = = = = = = = Constants
#endregion
#region = = = = = = = = = = = = = = = = = = Variables
// Original configuration
2014-05-05 14:24:57 +00:00
private readonly Configuration cfg ;
2009-04-19 18:07:22 +00:00
// General settings
2014-05-05 14:24:57 +00:00
private readonly string configname ;
private readonly string enginename ;
private readonly float defaulttexturescale ;
private readonly float defaultflatscale ;
2015-10-23 12:01:27 +00:00
private readonly string defaultwalltexture ; //mxd
private readonly string defaultfloortexture ; //mxd
private readonly string defaultceilingtexture ; //mxd
2014-05-05 14:24:57 +00:00
private readonly bool scaledtextureoffsets ;
private readonly string defaultsavecompiler ;
private readonly string defaulttestcompiler ;
private readonly string formatinterface ;
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
private readonly string defaultlinedefactivation ; //mxd
2014-05-05 14:24:57 +00:00
private readonly string singlesidedflag ;
private readonly string doublesidedflag ;
private readonly string impassableflag ;
private readonly string upperunpeggedflag ;
private readonly string lowerunpeggedflag ;
private readonly bool mixtexturesflats ;
private readonly bool generalizedactions ;
private readonly bool generalizedeffects ;
private readonly int start3dmodethingtype ;
private readonly int linedefactivationsfilter ;
private readonly string testparameters ;
private readonly bool testshortpaths ;
2019-12-25 17:45:19 +00:00
private readonly bool testlinuxpaths ;
2014-05-05 14:24:57 +00:00
private readonly string makedoortrack ;
private readonly string makedoordoor ; //mxd
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
private readonly string makedoorceil ; //mxd
2014-05-05 14:24:57 +00:00
private readonly int makedooraction ;
private readonly int makedooractivate ;
private readonly int [ ] makedoorargs ;
private readonly Dictionary < string , bool > makedoorflags ;
private readonly bool linetagindicatesectors ;
private readonly string decorategames ;
2015-05-23 21:40:21 +00:00
private string skyflatname ;
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
private readonly Dictionary < string , string > defaultskytextures ; //mxd <map name, sky texture name>
2014-05-05 14:24:57 +00:00
private readonly int maxtexturenamelength ;
2014-12-03 09:06:05 +00:00
private readonly bool longtexturenames ; //mxd
2014-05-05 14:24:57 +00:00
private readonly int leftboundary ;
private readonly int rightboundary ;
private readonly int topboundary ;
private readonly int bottomboundary ;
2016-05-18 23:31:12 +00:00
private readonly int safeboundary ; //mxd
2014-05-05 14:24:57 +00:00
private readonly bool doomlightlevels ;
2016-06-15 22:02:51 +00:00
private readonly bool doomthingrotationangles ; //mxd
2014-12-05 14:33:31 +00:00
private readonly string actionspecialhelp ; //mxd
2015-03-17 12:28:42 +00:00
private readonly string thingclasshelp ; //mxd
2016-05-07 20:21:53 +00:00
private readonly bool sidedefcompressionignoresaction ; //mxd
2016-09-05 18:36:22 +00:00
private readonly bool localsidedeftextureoffsets ; //MaxW
2021-03-21 21:58:06 +00:00
private readonly bool effect3dfloorsupport ;
private readonly bool planeequationsupport ;
2021-09-13 19:19:48 +00:00
private readonly bool distinctfloorandceilingbrightness ;
private readonly bool distinctwallbrightness ;
2022-01-29 17:59:24 +00:00
private readonly bool distinctsidedefpartbrightness ;
2022-11-04 18:49:53 +00:00
private readonly bool sectormultitag ;
2023-07-08 20:39:50 +00:00
private readonly bool sidedeftextureskewing ;
2021-03-21 21:58:06 +00:00
2009-04-19 18:07:22 +00:00
// Skills
2014-05-05 14:24:57 +00:00
private readonly List < SkillInfo > skills ;
2009-04-19 18:07:22 +00:00
// Map lumps
2014-05-05 14:24:57 +00:00
private readonly Dictionary < string , MapLumpInfo > maplumps ;
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
//mxd. Map format
2015-12-28 15:01:53 +00:00
private readonly bool doommapformat ;
private readonly bool hexenmapformat ;
private readonly bool universalmapformat ;
2021-04-08 19:41:40 +00:00
// Static limits for the base game and map format.
private readonly StaticLimits staticlimits ;
2021-08-21 07:28:05 +00:00
// Visplane Explorer plugin settings.
private readonly int visplaneviewheightdefault ;
private readonly Dictionary < string , string > visplaneviewheights ;
2014-01-08 09:46:57 +00:00
// Texture/flat/voxel sources
2014-05-05 14:24:57 +00:00
private readonly IDictionary textureranges ;
2016-03-04 08:10:56 +00:00
private readonly IDictionary hiresranges ; //mxd
2014-05-05 14:24:57 +00:00
private readonly IDictionary flatranges ;
private readonly IDictionary patchranges ;
private readonly IDictionary spriteranges ;
private readonly IDictionary colormapranges ;
private readonly IDictionary voxelranges ; //mxd
2009-04-19 18:07:22 +00:00
// Things
2014-05-05 14:24:57 +00:00
private readonly List < string > defaultthingflags ;
private readonly Dictionary < string , string > thingflags ;
private readonly List < ThingCategory > thingcategories ;
private readonly Dictionary < int , ThingTypeInfo > things ;
private readonly List < FlagTranslation > thingflagstranslation ;
2015-12-28 15:01:53 +00:00
private readonly Dictionary < string , ThingFlagsCompareGroup > thingflagscompare ; //mxd
2014-05-05 14:24:57 +00:00
private readonly Dictionary < string , string > thingrenderstyles ; //mxd
2009-04-19 18:07:22 +00:00
// Linedefs
2014-05-05 14:24:57 +00:00
private readonly Dictionary < string , string > linedefflags ;
private readonly List < string > sortedlinedefflags ;
private readonly Dictionary < int , LinedefActionInfo > linedefactions ;
private readonly List < LinedefActionInfo > sortedlinedefactions ;
private readonly List < LinedefActionCategory > actioncategories ;
private readonly List < LinedefActivateInfo > linedefactivates ;
private readonly List < GeneralizedCategory > genactioncategories ;
private readonly List < FlagTranslation > linedefflagstranslation ;
private readonly Dictionary < string , string > linedefrenderstyles ; //mxd
2013-07-19 15:30:58 +00:00
//mxd. Sidedefs
2014-05-05 14:24:57 +00:00
private readonly Dictionary < string , string > sidedefflags ; //mxd
2009-04-19 18:07:22 +00:00
// Sectors
2014-05-05 14:24:57 +00:00
private readonly Dictionary < string , string > sectorflags ; //mxd
2016-10-11 12:58:35 +00:00
private readonly Dictionary < string , string > ceilportalflags ; //mxd
private readonly Dictionary < string , string > floorportalflags ; //mxd
2014-05-05 14:24:57 +00:00
private readonly Dictionary < int , SectorEffectInfo > sectoreffects ;
private readonly List < SectorEffectInfo > sortedsectoreffects ;
private readonly List < GeneralizedOption > geneffectoptions ;
private readonly StepsList brightnesslevels ;
private readonly Dictionary < string , string > sectorrenderstyles ; //mxd
2016-10-11 12:58:35 +00:00
private readonly Dictionary < string , string > sectorportalrenderstyles ; //mxd
2009-04-19 18:07:22 +00:00
// Universal fields
2014-05-05 14:24:57 +00:00
private readonly List < UniversalFieldInfo > linedeffields ;
private readonly List < UniversalFieldInfo > sectorfields ;
private readonly List < UniversalFieldInfo > sidedeffields ;
private readonly List < UniversalFieldInfo > thingfields ;
private readonly List < UniversalFieldInfo > vertexfields ;
2009-04-19 18:07:22 +00:00
// Enums
2014-05-05 14:24:57 +00:00
private readonly Dictionary < string , EnumList > enums ;
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
//mxd. DamageTypes
2016-10-04 09:53:38 +00:00
private HashSet < string > damagetypes ;
//mxd. Internal sounds. These logical sound names won't trigger a warning when they are not bound to actual sounds in SOUNDINFO.
private HashSet < string > internalsoundnames ;
2016-10-24 19:19:11 +00:00
//mxd. Stuff to ignore
private HashSet < string > ignoreddirectories ;
private HashSet < string > ignoredextensions ;
2022-08-07 18:26:22 +00:00
// [ZZ] This implements error message if GZDoom.pk3 is required but not loaded
private List < RequiredArchive > requiredarchives ;
2009-04-19 18:07:22 +00:00
// Defaults
2014-05-05 14:24:57 +00:00
private readonly List < DefinedTextureSet > texturesets ;
private readonly List < ThingsFilter > thingfilters ;
2012-06-01 10:17:47 +00:00
2013-09-11 09:47:53 +00:00
//mxd. Holds base game type (doom, heretic, hexen or strife)
2016-07-14 23:39:48 +00:00
private readonly string basegame ;
2009-04-19 18:07:22 +00:00
2017-05-10 03:13:23 +00:00
// [ZZ] compat
private readonly bool buggymodeldefpitch ;
2009-04-19 18:07:22 +00:00
2021-05-16 14:47:42 +00:00
// Compatibility options
CompatibilityOptions compatibility ;
2021-09-05 12:59:31 +00:00
// Dehacked
private DehackedData dehackeddata ;
2017-05-10 03:13:23 +00:00
#endregion
#region = = = = = = = = = = = = = = = = = = Properties
// General settings
public string Name { get { return configname ; } }
2009-04-19 18:07:22 +00:00
public string EngineName { get { return enginename ; } }
public string DefaultSaveCompiler { get { return defaultsavecompiler ; } }
public string DefaultTestCompiler { get { return defaulttestcompiler ; } }
public float DefaultTextureScale { get { return defaulttexturescale ; } }
public float DefaultFlatScale { get { return defaultflatscale ; } }
2015-10-23 12:01:27 +00:00
public string DefaultWallTexture { get { return defaultwalltexture ; } } //mxd
public string DefaultFloorTexture { get { return defaultfloortexture ; } } //mxd
public string DefaultCeilingTexture { get { return defaultceilingtexture ; } } //mxd
2010-01-02 20:54:35 +00:00
public bool ScaledTextureOffsets { get { return scaledtextureoffsets ; } }
2009-04-19 18:07:22 +00:00
public string FormatInterface { get { return formatinterface ; } }
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
public string DefaultLinedefActivationFlag { get { return defaultlinedefactivation ; } } //mxd
2009-04-19 18:07:22 +00:00
public string SingleSidedFlag { get { return singlesidedflag ; } }
public string DoubleSidedFlag { get { return doublesidedflag ; } }
public string ImpassableFlag { get { return impassableflag ; } }
public string UpperUnpeggedFlag { get { return upperunpeggedflag ; } }
public string LowerUnpeggedFlag { get { return lowerunpeggedflag ; } }
public bool MixTexturesFlats { get { return mixtexturesflats ; } }
public bool GeneralizedActions { get { return generalizedactions ; } }
public bool GeneralizedEffects { get { return generalizedeffects ; } }
public int Start3DModeThingType { get { return start3dmodethingtype ; } }
public int LinedefActivationsFilter { get { return linedefactivationsfilter ; } }
public string TestParameters { get { return testparameters ; } }
public bool TestShortPaths { get { return testshortpaths ; } }
2019-12-25 17:45:19 +00:00
public bool TestLinuxPaths { get ; internal set ; }
2009-04-19 18:07:22 +00:00
public string MakeDoorTrack { get { return makedoortrack ; } }
2014-03-06 09:08:21 +00:00
public string MakeDoorDoor { get { return makedoordoor ; } } //mxd
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
public string MakeDoorCeiling { get { return makedoorceil ; } } //mxd
2009-04-19 18:07:22 +00:00
public int MakeDoorAction { get { return makedooraction ; } }
2012-04-14 12:22:19 +00:00
public int MakeDoorActivate { get { return makedooractivate ; } }
public Dictionary < string , bool > MakeDoorFlags { get { return makedoorflags ; } }
2009-04-19 18:07:22 +00:00
public int [ ] MakeDoorArgs { get { return makedoorargs ; } }
public bool LineTagIndicatesSectors { get { return linetagindicatesectors ; } }
public string DecorateGames { get { return decorategames ; } }
2015-05-23 21:40:21 +00:00
public string SkyFlatName { get { return skyflatname ; } internal set { skyflatname = value ; } } //mxd. Added setter
2016-01-11 13:00:52 +00:00
public Dictionary < string , string > DefaultSkyTextures { get { return defaultskytextures ; } } //mxd
2014-05-19 13:33:38 +00:00
public int MaxTextureNameLength { get { return maxtexturenamelength ; } }
2014-12-03 09:06:05 +00:00
public bool UseLongTextureNames { get { return longtexturenames ; } } //mxd
2010-08-13 18:32:21 +00:00
public int LeftBoundary { get { return leftboundary ; } }
public int RightBoundary { get { return rightboundary ; } }
public int TopBoundary { get { return topboundary ; } }
public int BottomBoundary { get { return bottomboundary ; } }
2016-05-18 23:31:12 +00:00
public int SafeBoundary { get { return safeboundary ; } } //mxd
2009-07-12 09:58:05 +00:00
public bool DoomLightLevels { get { return doomlightlevels ; } }
2016-06-15 22:02:51 +00:00
public bool DoomThingRotationAngles { get { return doomthingrotationangles ; } } //mxd. When set to true, thing rotation angles will be clamped to the nearest 45 deg increment
2014-12-05 14:33:31 +00:00
public string ActionSpecialHelp { get { return actionspecialhelp ; } } //mxd
2015-03-17 12:28:42 +00:00
public string ThingClassHelp { get { return thingclasshelp ; } } //mxd
2016-05-07 20:21:53 +00:00
internal bool SidedefCompressionIgnoresAction { get { return sidedefcompressionignoresaction ; } } //mxd
2014-12-05 14:33:31 +00:00
2009-04-19 18:07:22 +00:00
// Skills
public List < SkillInfo > Skills { get { return skills ; } }
// Map lumps
public Dictionary < string , MapLumpInfo > MapLumps { get { return maplumps ; } }
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
//mxd. Map format
public bool UDMF { get { return universalmapformat ; } }
public bool HEXEN { get { return hexenmapformat ; } }
public bool DOOM { get { return doommapformat ; } }
2021-04-08 19:41:40 +00:00
// Static limits for the base game and map format.
public StaticLimits StaticLimits { get { return staticlimits ; } }
2021-08-21 07:28:05 +00:00
public int VisplaneViewHeightDefault { get { return visplaneviewheightdefault ; } }
public Dictionary < string , string > VisplaneViewHeights { get { return visplaneviewheights ; } }
2016-09-05 18:36:22 +00:00
public bool UseLocalSidedefTextureOffsets { get { return localsidedeftextureoffsets ; } } //MaxW
2021-03-21 21:58:06 +00:00
public bool Effect3DFloorSupport { get { return effect3dfloorsupport ; } }
public bool PlaneEquationSupport { get { return planeequationsupport ; } }
2021-09-13 19:19:48 +00:00
public bool DistinctFloorAndCeilingBrightness { get { return distinctfloorandceilingbrightness ; } }
public bool DistinctWallBrightness { get { return distinctwallbrightness ; } }
2022-01-29 17:59:24 +00:00
public bool DistinctSidedefPartBrightness { get { return distinctsidedefpartbrightness ; } }
2022-11-04 18:49:53 +00:00
public bool SectorMultiTag { get { return sectormultitag ; } }
2023-07-08 20:39:50 +00:00
public bool SidedefTextureSkewing { get { return sidedeftextureskewing ; } }
2016-09-05 18:36:22 +00:00
2014-01-08 09:46:57 +00:00
// Texture/flat/voxel sources
2009-04-19 18:07:22 +00:00
public IDictionary TextureRanges { get { return textureranges ; } }
2016-03-04 08:10:56 +00:00
public IDictionary HiResRanges { get { return hiresranges ; } } //mxd
2009-04-19 18:07:22 +00:00
public IDictionary FlatRanges { get { return flatranges ; } }
public IDictionary PatchRanges { get { return patchranges ; } }
public IDictionary SpriteRanges { get { return spriteranges ; } }
2009-05-12 09:50:08 +00:00
public IDictionary ColormapRanges { get { return colormapranges ; } }
2014-01-08 09:46:57 +00:00
public IDictionary VoxelRanges { get { return voxelranges ; } } //mxd
2009-04-19 18:07:22 +00:00
// Things
public ICollection < string > DefaultThingFlags { get { return defaultthingflags ; } }
public IDictionary < string , string > ThingFlags { get { return thingflags ; } }
public List < FlagTranslation > ThingFlagsTranslation { get { return thingflagstranslation ; } }
2015-12-28 15:01:53 +00:00
public Dictionary < string , ThingFlagsCompareGroup > ThingFlagsCompare { get { return thingflagscompare ; } } //mxd
2014-05-05 14:24:57 +00:00
public Dictionary < string , string > ThingRenderStyles { get { return thingrenderstyles ; } } //mxd
2009-04-19 18:07:22 +00:00
// Linedefs
public IDictionary < string , string > LinedefFlags { get { return linedefflags ; } }
2009-07-31 11:00:11 +00:00
public List < string > SortedLinedefFlags { get { return sortedlinedefflags ; } }
2009-04-19 18:07:22 +00:00
public IDictionary < int , LinedefActionInfo > LinedefActions { get { return linedefactions ; } }
public List < LinedefActionInfo > SortedLinedefActions { get { return sortedlinedefactions ; } }
public List < LinedefActionCategory > ActionCategories { get { return actioncategories ; } }
public List < LinedefActivateInfo > LinedefActivates { get { return linedefactivates ; } }
public List < GeneralizedCategory > GenActionCategories { get { return genactioncategories ; } }
public List < FlagTranslation > LinedefFlagsTranslation { get { return linedefflagstranslation ; } }
2014-05-05 14:24:57 +00:00
public Dictionary < string , string > LinedefRenderStyles { get { return linedefrenderstyles ; } } //mxd
2009-04-19 18:07:22 +00:00
2013-07-19 15:30:58 +00:00
//mxd. Sidedefs
public IDictionary < string , string > SidedefFlags { get { return sidedefflags ; } }
2009-04-19 18:07:22 +00:00
// Sectors
2013-07-19 15:30:58 +00:00
public IDictionary < string , string > SectorFlags { get { return sectorflags ; } } //mxd
2016-10-11 12:58:35 +00:00
public IDictionary < string , string > CeilingPortalFlags { get { return ceilportalflags ; } } //mxd
public IDictionary < string , string > FloorPortalFlags { get { return floorportalflags ; } } //mxd
2009-04-19 18:07:22 +00:00
public IDictionary < int , SectorEffectInfo > SectorEffects { get { return sectoreffects ; } }
public List < SectorEffectInfo > SortedSectorEffects { get { return sortedsectoreffects ; } }
public List < GeneralizedOption > GenEffectOptions { get { return geneffectoptions ; } }
2009-07-10 19:15:22 +00:00
public StepsList BrightnessLevels { get { return brightnesslevels ; } }
2014-05-05 14:24:57 +00:00
public Dictionary < string , string > SectorRenderStyles { get { return sectorrenderstyles ; } } //mxd
2016-10-11 12:58:35 +00:00
public Dictionary < string , string > SectorPortalRenderStyles { get { return sectorportalrenderstyles ; } } //mxd
2009-04-19 18:07:22 +00:00
// Universal fields
public List < UniversalFieldInfo > LinedefFields { get { return linedeffields ; } }
public List < UniversalFieldInfo > SectorFields { get { return sectorfields ; } }
public List < UniversalFieldInfo > SidedefFields { get { return sidedeffields ; } }
public List < UniversalFieldInfo > ThingFields { get { return thingfields ; } }
public List < UniversalFieldInfo > VertexFields { get { return vertexfields ; } }
// Enums
public IDictionary < string , EnumList > Enums { get { return enums ; } }
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
//mxd. DamageTypes
internal IEnumerable < string > DamageTypes { get { return damagetypes ; } }
2016-10-04 09:53:38 +00:00
//mxd. Internal sounds
internal HashSet < string > InternalSoundNames { get { return internalsoundnames ; } }
2016-10-24 19:19:11 +00:00
//mxd. Stuff to ignore
internal HashSet < string > IgnoredFileExtensions { get { return ignoredextensions ; } }
internal HashSet < string > IgnoredDirectoryNames { get { return ignoreddirectories ; } }
2022-08-07 18:26:22 +00:00
// [ZZ] This implements error message if GZDoom.pk3 is required but not loaded
internal List < RequiredArchive > RequiredArchives { get { return requiredarchives ; } }
2009-04-19 18:07:22 +00:00
// Defaults
internal List < DefinedTextureSet > TextureSets { get { return texturesets ; } }
2009-07-05 10:26:57 +00:00
public List < ThingsFilter > ThingsFilters { get { return thingfilters ; } }
2012-06-01 10:17:47 +00:00
2013-09-11 09:47:53 +00:00
//mxd
2016-07-14 23:39:48 +00:00
public string BaseGame { get { return basegame ; } }
2017-05-10 03:13:23 +00:00
// [ZZ] compat
public bool BuggyModelDefPitch { get { return buggymodeldefpitch ; } } // reverses +USEACTORPITCH (as in before GZDoom 2.4, but after +INHERITACTORPITCH)
2021-05-16 14:47:42 +00:00
// Compatibility options
public CompatibilityOptions Compatibility { get { return compatibility ; } }
2021-09-05 12:59:31 +00:00
// Dehacked
public DehackedData DehackedData { get { return dehackeddata ; } }
2009-04-19 18:07:22 +00:00
#endregion
#region = = = = = = = = = = = = = = = = = = Constructor / Disposer
// Constructor
internal GameConfiguration ( Configuration cfg )
{
// Initialize
this . cfg = cfg ;
2014-02-26 14:11:06 +00:00
this . thingflags = new Dictionary < string , string > ( StringComparer . Ordinal ) ;
2009-04-19 18:07:22 +00:00
this . defaultthingflags = new List < string > ( ) ;
this . thingcategories = new List < ThingCategory > ( ) ;
this . things = new Dictionary < int , ThingTypeInfo > ( ) ;
2014-02-26 14:11:06 +00:00
this . linedefflags = new Dictionary < string , string > ( StringComparer . Ordinal ) ;
2009-07-31 11:00:11 +00:00
this . sortedlinedefflags = new List < string > ( ) ;
2009-04-19 18:07:22 +00:00
this . linedefactions = new Dictionary < int , LinedefActionInfo > ( ) ;
this . actioncategories = new List < LinedefActionCategory > ( ) ;
this . sortedlinedefactions = new List < LinedefActionInfo > ( ) ;
this . linedefactivates = new List < LinedefActivateInfo > ( ) ;
2014-02-26 14:11:06 +00:00
this . sidedefflags = new Dictionary < string , string > ( StringComparer . Ordinal ) ; //mxd
2009-04-19 18:07:22 +00:00
this . genactioncategories = new List < GeneralizedCategory > ( ) ;
2014-02-26 14:11:06 +00:00
this . sectorflags = new Dictionary < string , string > ( StringComparer . Ordinal ) ; //mxd
2016-10-11 12:58:35 +00:00
this . ceilportalflags = new Dictionary < string , string > ( StringComparer . Ordinal ) ; //mxd
this . floorportalflags = new Dictionary < string , string > ( StringComparer . Ordinal ) ; //mxd
2009-04-19 18:07:22 +00:00
this . sectoreffects = new Dictionary < int , SectorEffectInfo > ( ) ;
this . sortedsectoreffects = new List < SectorEffectInfo > ( ) ;
this . geneffectoptions = new List < GeneralizedOption > ( ) ;
2014-02-26 14:11:06 +00:00
this . enums = new Dictionary < string , EnumList > ( StringComparer . Ordinal ) ;
2009-04-19 18:07:22 +00:00
this . skills = new List < SkillInfo > ( ) ;
this . texturesets = new List < DefinedTextureSet > ( ) ;
this . makedoorargs = new int [ Linedef . NUM_ARGS ] ;
2014-02-26 14:11:06 +00:00
this . maplumps = new Dictionary < string , MapLumpInfo > ( StringComparer . Ordinal ) ;
2009-04-19 18:07:22 +00:00
this . thingflagstranslation = new List < FlagTranslation > ( ) ;
this . linedefflagstranslation = new List < FlagTranslation > ( ) ;
this . thingfilters = new List < ThingsFilter > ( ) ;
2015-12-28 15:01:53 +00:00
this . thingflagscompare = new Dictionary < string , ThingFlagsCompareGroup > ( ) ; //mxd
2009-07-10 19:15:22 +00:00
this . brightnesslevels = new StepsList ( ) ;
2014-02-26 14:11:06 +00:00
this . makedoorflags = new Dictionary < string , bool > ( StringComparer . Ordinal ) ;
2014-05-05 14:24:57 +00:00
this . linedefrenderstyles = new Dictionary < string , string > ( StringComparer . Ordinal ) ; //mxd
this . sectorrenderstyles = new Dictionary < string , string > ( StringComparer . Ordinal ) ; //mxd
2016-10-11 12:58:35 +00:00
this . sectorportalrenderstyles = new Dictionary < string , string > ( StringComparer . Ordinal ) ; //mxd
2014-05-05 14:24:57 +00:00
this . thingrenderstyles = new Dictionary < string , string > ( StringComparer . Ordinal ) ; //mxd
2016-01-11 13:00:52 +00:00
this . defaultskytextures = new Dictionary < string , string > ( StringComparer . OrdinalIgnoreCase ) ; //mxd
2009-04-19 18:07:22 +00:00
// Read general settings
configname = cfg . ReadSetting ( "game" , "<unnamed game>" ) ;
2012-06-01 10:17:47 +00:00
2013-09-11 09:47:53 +00:00
//mxd
2016-07-14 23:39:48 +00:00
basegame = cfg . ReadSetting ( "basegame" , string . Empty ) . ToLowerInvariant ( ) ;
if ( ! GameType . GameTypes . Contains ( basegame ) )
{
if ( ! string . IsNullOrEmpty ( basegame ) )
General . ErrorLogger . Add ( ErrorType . Error , "Unknown basegame value specified in current Game Configuration: \"" + basegame + "\"" ) ;
basegame = GameType . UNKNOWN ;
}
2012-06-01 10:17:47 +00:00
2009-04-19 18:07:22 +00:00
enginename = cfg . ReadSetting ( "engine" , "" ) ;
defaultsavecompiler = cfg . ReadSetting ( "defaultsavecompiler" , "" ) ;
defaulttestcompiler = cfg . ReadSetting ( "defaulttestcompiler" , "" ) ;
defaulttexturescale = cfg . ReadSetting ( "defaulttexturescale" , 1f ) ;
defaultflatscale = cfg . ReadSetting ( "defaultflatscale" , 1f ) ;
2015-10-23 12:01:27 +00:00
defaultwalltexture = cfg . ReadSetting ( "defaultwalltexture" , "STARTAN" ) ; //mxd
defaultfloortexture = cfg . ReadSetting ( "defaultfloortexture" , "FLOOR0_1" ) ; //mxd
defaultceilingtexture = cfg . ReadSetting ( "defaultceilingtexture" , "CEIL1_1" ) ; //mxd
2010-01-02 20:54:35 +00:00
scaledtextureoffsets = cfg . ReadSetting ( "scaledtextureoffsets" , true ) ;
2009-04-19 18:07:22 +00:00
formatinterface = cfg . ReadSetting ( "formatinterface" , "" ) ;
mixtexturesflats = cfg . ReadSetting ( "mixtexturesflats" , false ) ;
generalizedactions = cfg . ReadSetting ( "generalizedlinedefs" , false ) ;
generalizedeffects = cfg . ReadSetting ( "generalizedsectors" , false ) ;
start3dmodethingtype = cfg . ReadSetting ( "start3dmode" , 0 ) ;
linedefactivationsfilter = cfg . ReadSetting ( "linedefactivationsfilter" , 0 ) ;
testparameters = cfg . ReadSetting ( "testparameters" , "" ) ;
testshortpaths = cfg . ReadSetting ( "testshortpaths" , false ) ;
2019-12-25 17:45:19 +00:00
testlinuxpaths = cfg . ReadSetting ( "testlinuxpaths" , false ) ;
2009-04-19 18:07:22 +00:00
makedoortrack = cfg . ReadSetting ( "makedoortrack" , "-" ) ;
2014-03-06 09:08:21 +00:00
makedoordoor = cfg . ReadSetting ( "makedoordoor" , "-" ) ; //mxd
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
makedoorceil = cfg . ReadSetting ( "makedoorceil" , "-" ) ; //mxd
2009-04-19 18:07:22 +00:00
makedooraction = cfg . ReadSetting ( "makedooraction" , 0 ) ;
2012-04-14 12:22:19 +00:00
makedooractivate = cfg . ReadSetting ( "makedooractivate" , 0 ) ;
2009-04-19 18:07:22 +00:00
linetagindicatesectors = cfg . ReadSetting ( "linetagindicatesectors" , false ) ;
decorategames = cfg . ReadSetting ( "decorategames" , "" ) ;
2013-09-11 09:47:53 +00:00
skyflatname = cfg . ReadSetting ( "skyflatname" , "F_SKY1" ) ;
2010-08-13 18:32:21 +00:00
leftboundary = cfg . ReadSetting ( "leftboundary" , - 32768 ) ;
rightboundary = cfg . ReadSetting ( "rightboundary" , 32767 ) ;
topboundary = cfg . ReadSetting ( "topboundary" , 32767 ) ;
bottomboundary = cfg . ReadSetting ( "bottomboundary" , - 32768 ) ;
2016-05-18 23:31:12 +00:00
safeboundary = cfg . ReadSetting ( "safeboundary" , 32767 ) ; //mxd
2009-07-12 09:58:05 +00:00
doomlightlevels = cfg . ReadSetting ( "doomlightlevels" , true ) ;
2016-06-15 22:02:51 +00:00
doomthingrotationangles = cfg . ReadSetting ( "doomthingrotationangles" , false ) ; //mxd
2014-12-05 14:33:31 +00:00
actionspecialhelp = cfg . ReadSetting ( "actionspecialhelp" , string . Empty ) ; //mxd
2015-03-17 12:28:42 +00:00
thingclasshelp = cfg . ReadSetting ( "thingclasshelp" , string . Empty ) ; //mxd
2016-05-07 20:21:53 +00:00
sidedefcompressionignoresaction = cfg . ReadSetting ( "sidedefcompressionignoresaction" , false ) ; //mxd
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
defaultlinedefactivation = cfg . ReadSetting ( "defaultlinedefactivation" , "" ) ; //mxd
2016-09-05 18:36:22 +00:00
localsidedeftextureoffsets = ( cfg . ReadSetting ( "localsidedeftextureoffsets" , false ) ) ; //MaxW
2021-03-21 21:58:06 +00:00
effect3dfloorsupport = cfg . ReadSetting ( "effect3dfloorsupport" , false ) ;
planeequationsupport = cfg . ReadSetting ( "planeequationsupport" , false ) ;
2023-07-08 20:39:50 +00:00
sidedeftextureskewing = cfg . ReadSetting ( "sidedeftextureskewing" , false ) ;
2021-09-13 19:19:48 +00:00
distinctfloorandceilingbrightness = cfg . ReadSetting ( "distinctfloorandceilingbrightness" , false ) ;
distinctwallbrightness = cfg . ReadSetting ( "distinctwallbrightness" , false ) ;
2022-01-29 17:59:24 +00:00
distinctsidedefpartbrightness = cfg . ReadSetting ( "distinctsidedefpartbrightness" , false ) ;
2022-11-04 18:49:53 +00:00
sectormultitag = cfg . ReadSetting ( "sectormultitag" , false ) ;
2021-03-21 21:58:06 +00:00
for ( int i = 0 ; i < Linedef . NUM_ARGS ; i + + ) makedoorargs [ i ] = cfg . ReadSetting ( "makedoorarg" + i . ToString ( CultureInfo . InvariantCulture ) , 0 ) ;
2012-04-14 12:22:19 +00:00
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
//mxd. Update map format flags
universalmapformat = ( formatinterface = = "UniversalMapSetIO" ) ;
hexenmapformat = ( formatinterface = = "HexenMapSetIO" ) ;
doommapformat = ( formatinterface = = "DoomMapSetIO" ) ;
2021-04-08 19:41:40 +00:00
// Read static limits for the base game and map format.
staticlimits = new StaticLimits ( cfg ) ;
2021-08-21 07:28:05 +00:00
// Read the Visplane Explorer plugin's default selectable view heights.
visplaneviewheightdefault = cfg . ReadSetting ( "visplaneexplorer.viewheightdefault" , 41 ) ;
visplaneviewheights = new Dictionary < string , string > ( StringComparer . Ordinal ) ;
LoadStringDictionary ( visplaneviewheights , "visplaneexplorer.viewheights" ) ;
2014-11-25 11:52:01 +00:00
//mxd. Texture names length
2014-12-03 09:06:05 +00:00
longtexturenames = cfg . ReadSetting ( "longtexturenames" , false ) ;
maxtexturenamelength = ( longtexturenames ? short . MaxValue : DataManager . CLASIC_IMAGE_NAME_LENGTH ) ;
2014-11-25 11:52:01 +00:00
2017-05-10 03:13:23 +00:00
// [ZZ] compat
buggymodeldefpitch = cfg . ReadSetting ( "buggymodeldefpitch" , false ) ;
2009-04-19 18:07:22 +00:00
// Flags have special (invariant culture) conversion
// because they are allowed to be written as integers in the configs
2014-03-05 12:26:09 +00:00
object obj = cfg . ReadSettingObject ( "singlesidedflag" , 0 ) ;
2009-04-19 18:07:22 +00:00
if ( obj is int ) singlesidedflag = ( ( int ) obj ) . ToString ( CultureInfo . InvariantCulture ) ; else singlesidedflag = obj . ToString ( ) ;
obj = cfg . ReadSettingObject ( "doublesidedflag" , 0 ) ;
if ( obj is int ) doublesidedflag = ( ( int ) obj ) . ToString ( CultureInfo . InvariantCulture ) ; else doublesidedflag = obj . ToString ( ) ;
obj = cfg . ReadSettingObject ( "impassableflag" , 0 ) ;
if ( obj is int ) impassableflag = ( ( int ) obj ) . ToString ( CultureInfo . InvariantCulture ) ; else impassableflag = obj . ToString ( ) ;
obj = cfg . ReadSettingObject ( "upperunpeggedflag" , 0 ) ;
if ( obj is int ) upperunpeggedflag = ( ( int ) obj ) . ToString ( CultureInfo . InvariantCulture ) ; else upperunpeggedflag = obj . ToString ( ) ;
obj = cfg . ReadSettingObject ( "lowerunpeggedflag" , 0 ) ;
if ( obj is int ) lowerunpeggedflag = ( ( int ) obj ) . ToString ( CultureInfo . InvariantCulture ) ; else lowerunpeggedflag = obj . ToString ( ) ;
// Get texture and flat sources
textureranges = cfg . ReadSetting ( "textures" , new Hashtable ( ) ) ;
2016-03-04 08:10:56 +00:00
hiresranges = cfg . ReadSetting ( "hires" , new Hashtable ( ) ) ; //mxd
2009-04-19 18:07:22 +00:00
flatranges = cfg . ReadSetting ( "flats" , new Hashtable ( ) ) ;
patchranges = cfg . ReadSetting ( "patches" , new Hashtable ( ) ) ;
spriteranges = cfg . ReadSetting ( "sprites" , new Hashtable ( ) ) ;
2009-05-12 09:50:08 +00:00
colormapranges = cfg . ReadSetting ( "colormaps" , new Hashtable ( ) ) ;
2014-01-08 09:46:57 +00:00
voxelranges = cfg . ReadSetting ( "voxels" , new Hashtable ( ) ) ; //mxd
2009-04-19 18:07:22 +00:00
// Map lumps
LoadMapLumps ( ) ;
// Skills
LoadSkills ( ) ;
// Enums
LoadEnums ( ) ;
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
2016-10-04 09:53:38 +00:00
//mxd. Load damage types and internal sound names
char [ ] splitter = { ' ' } ;
damagetypes = new HashSet < string > ( cfg . ReadSetting ( "damagetypes" , "None" ) . Split ( splitter , StringSplitOptions . RemoveEmptyEntries ) , StringComparer . OrdinalIgnoreCase ) ;
internalsoundnames = new HashSet < string > ( cfg . ReadSetting ( "internalsoundnames" , string . Empty ) . Split ( splitter , StringSplitOptions . RemoveEmptyEntries ) , StringComparer . OrdinalIgnoreCase ) ;
2009-04-19 18:07:22 +00:00
2016-10-24 19:19:11 +00:00
//mxd. Load stuff to ignore
ignoreddirectories = new HashSet < string > ( cfg . ReadSetting ( "ignoreddirectories" , string . Empty ) . Split ( splitter , StringSplitOptions . RemoveEmptyEntries ) , StringComparer . OrdinalIgnoreCase ) ;
ignoredextensions = new HashSet < string > ( cfg . ReadSetting ( "ignoredextensions" , string . Empty ) . Split ( splitter , StringSplitOptions . RemoveEmptyEntries ) , StringComparer . OrdinalIgnoreCase ) ;
2022-08-07 18:26:22 +00:00
// [ZZ]
IDictionary requiredArchives = cfg . ReadSetting ( "requiredarchives" , new Hashtable ( ) ) ;
requiredarchives = new List < RequiredArchive > ( ) ;
foreach ( DictionaryEntry cde in requiredArchives )
{
string filename = cfg . ReadSetting ( "requiredarchives." + cde . Key + ".filename" , "gzdoom.pk3" ) ;
bool exclude = cfg . ReadSetting ( "requiredarchives." + cde . Key + ".need_exclude" , true ) ;
IDictionary entries = cfg . ReadSetting ( "requiredarchives." + cde . Key , new Hashtable ( ) ) ;
List < RequiredArchiveEntry > reqEntries = new List < RequiredArchiveEntry > ( ) ;
foreach ( DictionaryEntry cde2 in entries )
{
if ( ( string ) cde2 . Key = = "filename" ) continue ;
string lumpname = cfg . ReadSetting ( "requiredarchives." + cde . Key + "." + cde2 . Key + ".lump" , ( string ) null ) ;
string classname = cfg . ReadSetting ( "requiredarchives." + cde . Key + "." + cde2 . Key + ".class" , ( string ) null ) ;
reqEntries . Add ( new RequiredArchiveEntry ( classname , lumpname ) ) ;
}
2022-09-18 17:54:53 +00:00
requiredarchives . Add ( new RequiredArchive ( ( string ) cde . Key , filename , exclude , reqEntries ) ) ;
2022-08-07 18:26:22 +00:00
}
2009-04-19 18:07:22 +00:00
// Things
LoadThingFlags ( ) ;
LoadDefaultThingFlags ( ) ;
LoadThingCategories ( ) ;
2014-05-05 14:24:57 +00:00
LoadStringDictionary ( thingrenderstyles , "thingrenderstyles" ) ; //mxd
2009-04-19 18:07:22 +00:00
// Linedefs
LoadLinedefFlags ( ) ;
LoadLinedefActions ( ) ;
LoadLinedefActivations ( ) ;
LoadLinedefGeneralizedActions ( ) ;
2014-05-05 14:24:57 +00:00
LoadStringDictionary ( linedefrenderstyles , "linedefrenderstyles" ) ; //mxd
2009-04-19 18:07:22 +00:00
2013-07-19 15:30:58 +00:00
//mxd. Sidedefs
2014-05-05 14:24:57 +00:00
LoadStringDictionary ( sidedefflags , "sidedefflags" ) ;
2013-07-19 15:30:58 +00:00
2009-04-19 18:07:22 +00:00
// Sectors
2014-05-05 14:24:57 +00:00
LoadStringDictionary ( sectorflags , "sectorflags" ) ; //mxd
2016-10-11 12:58:35 +00:00
LoadStringDictionary ( ceilportalflags , "ceilingportalflags" ) ; //mxd
LoadStringDictionary ( floorportalflags , "floorportalflags" ) ; //mxd
2009-04-19 18:07:22 +00:00
LoadBrightnessLevels ( ) ;
LoadSectorEffects ( ) ;
LoadSectorGeneralizedEffects ( ) ;
2014-05-05 14:24:57 +00:00
LoadStringDictionary ( sectorrenderstyles , "sectorrenderstyles" ) ; //mxd
2016-10-11 12:58:35 +00:00
LoadStringDictionary ( sectorportalrenderstyles , "sectorportalrenderstyles" ) ; //mxd
2009-04-19 18:07:22 +00:00
// Universal fields
linedeffields = LoadUniversalFields ( "linedef" ) ;
sectorfields = LoadUniversalFields ( "sector" ) ;
sidedeffields = LoadUniversalFields ( "sidedef" ) ;
thingfields = LoadUniversalFields ( "thing" ) ;
vertexfields = LoadUniversalFields ( "vertex" ) ;
// Defaults
LoadTextureSets ( ) ;
LoadThingFilters ( ) ;
2012-04-14 12:22:19 +00:00
2016-01-11 13:00:52 +00:00
//mxd. Vanilla sky textures
LoadDefaultSkies ( ) ;
2012-04-14 12:22:19 +00:00
// Make door flags
LoadMakeDoorFlags ( ) ;
2021-05-16 14:47:42 +00:00
// Compatibility options
compatibility = new CompatibilityOptions ( cfg ) ;
2021-09-05 12:59:31 +00:00
// Dehacked
dehackeddata = new DehackedData ( cfg , "dehacked" ) ;
2009-04-19 18:07:22 +00:00
}
// Destructor
~ GameConfiguration ( )
{
foreach ( ThingCategory tc in thingcategories ) tc . Dispose ( ) ;
foreach ( LinedefActionCategory ac in actioncategories ) ac . Dispose ( ) ;
2015-09-16 12:10:43 +00:00
foreach ( ThingsFilter tf in thingfilters ) tf . Dispose ( ) ; //mxd
2015-12-27 21:54:50 +00:00
foreach ( GeneralizedCategory gc in genactioncategories ) gc . Dispose ( ) ; //mxd
2009-04-19 18:07:22 +00:00
}
#endregion
#region = = = = = = = = = = = = = = = = = = Loading
// This loads the map lumps
2014-12-03 23:15:26 +00:00
private void LoadMapLumps ( )
{
2009-04-19 18:07:22 +00:00
// Get map lumps list
2014-03-05 12:26:09 +00:00
IDictionary dic = cfg . ReadSetting ( "maplumpnames" , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry de in dic )
{
// Make map lumps
MapLumpInfo lumpinfo = new MapLumpInfo ( de . Key . ToString ( ) , cfg ) ;
maplumps . Add ( de . Key . ToString ( ) , lumpinfo ) ;
}
}
// This loads the enumerations
2014-12-03 23:15:26 +00:00
private void LoadEnums ( )
{
2009-04-19 18:07:22 +00:00
// Get enums list
2014-05-05 14:24:57 +00:00
IDictionary dic = cfg . ReadSetting ( "enums" , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry de in dic )
{
// Make new enum
EnumList list = new EnumList ( de . Key . ToString ( ) , cfg ) ;
enums . Add ( de . Key . ToString ( ) , list ) ;
}
}
// This loads a universal fields list
private List < UniversalFieldInfo > LoadUniversalFields ( string elementname )
{
List < UniversalFieldInfo > list = new List < UniversalFieldInfo > ( ) ;
2014-05-05 14:24:57 +00:00
2009-04-19 18:07:22 +00:00
// Get fields
2014-05-05 14:24:57 +00:00
IDictionary dic = cfg . ReadSetting ( "universalfields." + elementname , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry de in dic )
{
2016-11-14 10:22:24 +00:00
#if ! DEBUG
2009-04-19 18:07:22 +00:00
try
{
2016-11-14 10:22:24 +00:00
#endif
2009-04-19 18:07:22 +00:00
// Read the field info and add to list
2016-11-14 10:22:24 +00:00
UniversalFieldInfo uf = new UniversalFieldInfo ( elementname , de . Key . ToString ( ) , this . Name , cfg , enums ) ;
2009-04-19 18:07:22 +00:00
list . Add ( uf ) ;
2016-11-14 10:22:24 +00:00
#if ! DEBUG
2009-04-19 18:07:22 +00:00
}
catch ( Exception )
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "Unable to read universal field definition \"universalfields." + elementname + "." + de . Key + "\" from game configuration \"" + this . Name + "\"" ) ;
2009-04-19 18:07:22 +00:00
}
2016-11-14 10:22:24 +00:00
#endif
2009-04-19 18:07:22 +00:00
}
// Return result
return list ;
}
// Things and thing categories
private void LoadThingCategories ( )
{
// Get thing categories
2014-03-05 12:26:09 +00:00
IDictionary dic = cfg . ReadSetting ( "thingtypes" , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry de in dic )
{
2009-08-01 07:45:12 +00:00
if ( de . Value is IDictionary )
2009-04-19 18:07:22 +00:00
{
2009-08-01 07:45:12 +00:00
// Make a category
2015-12-28 15:01:53 +00:00
ThingCategory thingcat = new ThingCategory ( cfg , null , de . Key . ToString ( ) , enums ) ;
2009-08-01 07:45:12 +00:00
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
//mxd. Otherwise nesting problems might occure
if ( thingcat . IsValid )
{
// Add all things in category to the big list
AddThingsFromCategory ( thingcat ) ; //mxd
// Add category to list
thingcategories . Add ( thingcat ) ;
}
2009-08-01 07:45:12 +00:00
}
2009-04-19 18:07:22 +00:00
}
}
2015-06-01 21:46:28 +00:00
//mxd. This recursively adds all things from a ThingCategory and it's children
private void AddThingsFromCategory ( ThingCategory thingcat )
{
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
if ( ! thingcat . IsValid ) return ;
2015-06-01 21:46:28 +00:00
// Add all things in category to the big list
foreach ( ThingTypeInfo t in thingcat . Things )
{
if ( ! things . ContainsKey ( t . Index ) )
things . Add ( t . Index , t ) ;
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
else
General . ErrorLogger . Add ( ErrorType . Warning , "Thing number " + t . Index + " is defined more than once (as \"" + things [ t . Index ] . Title + "\" and \"" + t . Title + "\") in the \"" + this . Name + "\" game configuration" ) ;
2015-06-01 21:46:28 +00:00
}
// Recursively add things from child categories
foreach ( ThingCategory c in thingcat . Children ) AddThingsFromCategory ( c ) ;
}
2009-04-19 18:07:22 +00:00
// Linedef flags
private void LoadLinedefFlags ( )
{
// Get linedef flags
2014-05-05 14:24:57 +00:00
LoadStringDictionary ( linedefflags , "linedefflags" ) ; //mxd
2009-07-31 11:00:11 +00:00
2009-04-19 18:07:22 +00:00
// Get translations
2014-05-05 14:24:57 +00:00
IDictionary dic = cfg . ReadSetting ( "linedefflagstranslation" , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry de in dic )
linedefflagstranslation . Add ( new FlagTranslation ( de ) ) ;
2009-07-31 11:00:11 +00:00
// Sort flags?
MapSetIO io = MapSetIO . Create ( formatinterface ) ;
if ( io . HasNumericLinedefFlags )
{
// Make list for integers that we can sort
List < int > sortlist = new List < int > ( linedefflags . Count ) ;
foreach ( KeyValuePair < string , string > f in linedefflags )
{
int num ;
if ( int . TryParse ( f . Key , NumberStyles . Integer , CultureInfo . InvariantCulture , out num ) ) sortlist . Add ( num ) ;
}
// Sort
sortlist . Sort ( ) ;
// Make list of strings
foreach ( int i in sortlist )
sortedlinedefflags . Add ( i . ToString ( CultureInfo . InvariantCulture ) ) ;
}
// Sort the flags, because they must be compared highest first!
2009-04-19 18:07:22 +00:00
linedefflagstranslation . Sort ( ) ;
}
// Linedef actions and action categories
private void LoadLinedefActions ( )
{
2014-02-26 14:11:06 +00:00
Dictionary < string , LinedefActionCategory > cats = new Dictionary < string , LinedefActionCategory > ( StringComparer . Ordinal ) ;
2015-12-28 15:01:53 +00:00
2009-04-19 18:07:22 +00:00
// Get linedef categories
2014-02-26 14:11:06 +00:00
IDictionary dic = cfg . ReadSetting ( "linedeftypes" , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry cde in dic )
{
2009-08-01 07:45:12 +00:00
if ( cde . Value is IDictionary )
2009-04-19 18:07:22 +00:00
{
2009-08-01 07:45:12 +00:00
// Read category title
string cattitle = cfg . ReadSetting ( "linedeftypes." + cde . Key + ".title" , "" ) ;
// Make or get category
2015-12-28 15:01:53 +00:00
LinedefActionCategory ac ;
2009-08-01 07:45:12 +00:00
if ( cats . ContainsKey ( cde . Key . ToString ( ) ) )
ac = cats [ cde . Key . ToString ( ) ] ;
else
2009-04-19 18:07:22 +00:00
{
2009-08-01 07:45:12 +00:00
ac = new LinedefActionCategory ( cde . Key . ToString ( ) , cattitle ) ;
cats . Add ( cde . Key . ToString ( ) , ac ) ;
}
2009-04-19 18:07:22 +00:00
2009-08-01 07:45:12 +00:00
// Go for all line types in category
IDictionary catdic = cfg . ReadSetting ( "linedeftypes." + cde . Key , new Hashtable ( ) ) ;
foreach ( DictionaryEntry de in catdic )
{
// Check if the item key is numeric
2015-12-28 15:01:53 +00:00
int actionnumber ;
2009-08-01 07:45:12 +00:00
if ( int . TryParse ( de . Key . ToString ( ) ,
NumberStyles . AllowLeadingWhite | NumberStyles . AllowTrailingWhite ,
CultureInfo . InvariantCulture , out actionnumber ) )
2009-04-19 18:07:22 +00:00
{
2009-08-01 07:45:12 +00:00
// Check if the item value is a structure
if ( de . Value is IDictionary )
{
2017-01-07 20:53:13 +00:00
//mxd. Sanity check...
if ( linedefactions . ContainsKey ( actionnumber ) )
{
General . ErrorLogger . Add ( ErrorType . Error , "Structure \"linedeftypes\" contains duplicate action definition for action " + actionnumber
+ " in the \"" + this . Name + "\" game configuration. If you want to override the existing action definition, make sure to put it in the same category (\""
+ linedefactions [ actionnumber ] . Category + "\")." ) ;
}
else
{
// Make the line type
LinedefActionInfo ai = new LinedefActionInfo ( actionnumber , cfg , cde . Key . ToString ( ) , enums ) ;
// Add action to category and sorted list
sortedlinedefactions . Add ( ai ) ;
linedefactions . Add ( actionnumber , ai ) ;
ac . Add ( ai ) ;
}
2009-08-01 07:45:12 +00:00
}
else
{
// Failure
if ( de . Value ! = null )
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "Structure \"linedeftypes\" contains invalid types in the \"" + this . Name + "\" game configuration. All types must be expanded structures." ) ;
2009-08-01 07:45:12 +00:00
}
2009-04-19 18:07:22 +00:00
}
}
}
}
// Sort the actions list
sortedlinedefactions . Sort ( ) ;
// Copy categories to final list
actioncategories . Clear ( ) ;
actioncategories . AddRange ( cats . Values ) ;
// Sort the categories list
actioncategories . Sort ( ) ;
}
// Linedef activates
private void LoadLinedefActivations ( )
{
// Get linedef activations
2014-03-05 12:26:09 +00:00
IDictionary dic = cfg . ReadSetting ( "linedefactivations" , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry de in dic )
{
2021-03-22 09:41:21 +00:00
// If the value is a dictionary read the values from that
if ( de . Value is ICollection )
{
string name = cfg . ReadSetting ( "linedefactivations." + de . Key . ToString ( ) + ".name" , de . Key . ToString ( ) ) ;
bool istrigger = cfg . ReadSetting ( "linedefactivations." + de . Key . ToString ( ) + ".istrigger" , true ) ;
linedefactivates . Add ( new LinedefActivateInfo ( de . Key . ToString ( ) , name , istrigger ) ) ;
}
else
{
// Add to the list
linedefactivates . Add ( new LinedefActivateInfo ( de . Key . ToString ( ) , de . Value . ToString ( ) , true ) ) ;
}
2009-04-19 18:07:22 +00:00
}
2015-01-26 09:45:27 +00:00
//mxd. Sort only when activations are numeric
MapSetIO io = MapSetIO . Create ( formatinterface ) ;
if ( io . HasNumericLinedefActivations )
{
linedefactivates . Sort ( ) ;
}
2009-04-19 18:07:22 +00:00
}
// Linedef generalized actions
private void LoadLinedefGeneralizedActions ( )
{
// Get linedef activations
2014-03-05 12:26:09 +00:00
IDictionary dic = cfg . ReadSetting ( "gen_linedeftypes" , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry de in dic )
{
// Check for valid structure
if ( de . Value is IDictionary )
{
// Add category
genactioncategories . Add ( new GeneralizedCategory ( "gen_linedeftypes" , de . Key . ToString ( ) , cfg ) ) ;
}
else
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "Structure \"gen_linedeftypes\" contains invalid entries in the \"" + this . Name + "\" game configuration" ) ;
2009-04-19 18:07:22 +00:00
}
}
}
// Sector effects
private void LoadSectorEffects ( )
{
// Get sector effects
2014-03-05 12:26:09 +00:00
IDictionary dic = cfg . ReadSetting ( "sectortypes" , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry de in dic )
{
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
// Try parsing the action number
2015-12-28 15:01:53 +00:00
int actionnumber ;
2009-04-19 18:07:22 +00:00
if ( int . TryParse ( de . Key . ToString ( ) ,
NumberStyles . AllowLeadingWhite | NumberStyles . AllowTrailingWhite ,
CultureInfo . InvariantCulture , out actionnumber ) )
{
// Make effects
2015-12-28 15:01:53 +00:00
SectorEffectInfo si = new SectorEffectInfo ( actionnumber , de . Value . ToString ( ) , true , false ) ;
2009-04-19 18:07:22 +00:00
// Add action to category and sorted list
sortedsectoreffects . Add ( si ) ;
sectoreffects . Add ( actionnumber , si ) ;
}
else
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "Structure \"sectortypes\" contains invalid keys in the \"" + this . Name + "\" game configuration" ) ;
2009-04-19 18:07:22 +00:00
}
}
// Sort the actions list
sortedsectoreffects . Sort ( ) ;
}
// Brightness levels
private void LoadBrightnessLevels ( )
{
// Get brightness levels structure
2014-03-05 12:26:09 +00:00
IDictionary dic = cfg . ReadSetting ( "sectorbrightness" , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry de in dic )
{
// Try paring the level
2015-12-28 15:01:53 +00:00
int level ;
2009-04-19 18:07:22 +00:00
if ( int . TryParse ( de . Key . ToString ( ) ,
NumberStyles . AllowLeadingWhite | NumberStyles . AllowTrailingWhite ,
CultureInfo . InvariantCulture , out level ) )
{
brightnesslevels . Add ( level ) ;
}
else
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "Structure \"sectorbrightness\" contains invalid keys in the \"" + this . Name + "\" game configuration" ) ;
2009-04-19 18:07:22 +00:00
}
}
// Sort the list
brightnesslevels . Sort ( ) ;
}
// Sector generalized effects
private void LoadSectorGeneralizedEffects ( )
{
// Get sector effects
2014-03-05 12:26:09 +00:00
IDictionary dic = cfg . ReadSetting ( "gen_sectortypes" , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry de in dic )
{
// Check for valid structure
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
IDictionary value = de . Value as IDictionary ;
if ( value ! = null )
2009-04-19 18:07:22 +00:00
{
// Add option
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
geneffectoptions . Add ( new GeneralizedOption ( "gen_sectortypes" , "" , de . Key . ToString ( ) , value ) ) ;
2009-04-19 18:07:22 +00:00
}
else
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "Structure \"gen_sectortypes\" contains invalid entries in the \"" + this . Name + "\" game configuration" ) ;
2009-04-19 18:07:22 +00:00
}
}
}
// Thing flags
private void LoadThingFlags ( )
{
2014-05-05 14:24:57 +00:00
// Get thing flags
LoadStringDictionary ( thingflags , "thingflags" ) ; //mxd
2009-04-19 18:07:22 +00:00
// Get translations
2014-05-05 14:24:57 +00:00
IDictionary dic = cfg . ReadSetting ( "thingflagstranslation" , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry de in dic )
thingflagstranslation . Add ( new FlagTranslation ( de ) ) ;
2012-08-27 11:39:14 +00:00
// Get thing compare flag info (for the stuck thing error checker
2015-12-28 15:01:53 +00:00
HashSet < string > flagscache = new HashSet < string > ( ) ;
2013-06-03 11:32:29 +00:00
dic = cfg . ReadSetting ( "thingflagscompare" , new Hashtable ( ) ) ;
2015-12-28 15:01:53 +00:00
foreach ( DictionaryEntry de in dic )
2014-09-29 20:49:41 +00:00
{
2015-12-28 15:01:53 +00:00
string group = de . Key . ToString ( ) ; //mxd
thingflagscompare [ group ] = new ThingFlagsCompareGroup ( cfg , group ) ; //mxd
foreach ( string s in thingflagscompare [ group ] . Flags . Keys )
2014-09-29 20:49:41 +00:00
{
2015-12-28 15:01:53 +00:00
if ( flagscache . Contains ( s ) )
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "ThingFlagsCompare flag \"" + s + "\" is double defined in the \"" + group + "\" group of the \"" + this . Name + "\" game configuration" ) ;
2015-12-28 15:01:53 +00:00
else
flagscache . Add ( s ) ;
2013-06-03 11:32:29 +00:00
}
}
2009-04-19 18:07:22 +00:00
2014-11-03 13:02:59 +00:00
//mxd. Integrity check
2015-12-28 15:01:53 +00:00
foreach ( KeyValuePair < string , ThingFlagsCompareGroup > group in thingflagscompare )
2014-11-03 13:02:59 +00:00
{
2015-12-28 15:01:53 +00:00
foreach ( ThingFlagsCompare flag in group . Value . Flags . Values )
2014-11-03 13:02:59 +00:00
{
2015-12-28 15:01:53 +00:00
// Required groups are missing?
foreach ( string s in flag . RequiredGroups )
2014-11-03 13:02:59 +00:00
{
2015-12-28 15:01:53 +00:00
if ( ! thingflagscompare . ContainsKey ( s ) )
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "ThingFlagsCompare group \"" + s + "\" required by flag \"" + flag . Flag + "\" does not exist in the \"" + this . Name + "\" game configuration" ) ;
2015-12-28 15:01:53 +00:00
flag . RequiredGroups . Remove ( s ) ;
}
2014-11-03 13:02:59 +00:00
}
2015-12-28 15:01:53 +00:00
// Ignored groups are missing?
foreach ( string s in flag . IgnoredGroups )
2014-11-03 13:02:59 +00:00
{
2015-12-28 15:01:53 +00:00
if ( ! thingflagscompare . ContainsKey ( s ) )
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "ThingFlagsCompare group \"" + s + "\", ignored by flag \"" + flag . Flag + "\" does not exist in the \"" + this . Name + "\" game configuration" ) ;
2015-12-28 15:01:53 +00:00
flag . IgnoredGroups . Remove ( s ) ;
}
2014-11-03 13:02:59 +00:00
}
// Required flag is missing?
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
if ( ! string . IsNullOrEmpty ( flag . RequiredFlag ) & & ! flagscache . Contains ( flag . RequiredFlag ) )
2014-11-03 13:02:59 +00:00
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "ThingFlagsCompare flag \"" + flag . RequiredFlag + "\", required by flag \"" + flag . Flag + "\" does not exist in the \"" + this . Name + "\" game configuration" ) ;
2015-12-28 15:01:53 +00:00
flag . RequiredFlag = string . Empty ;
2014-11-03 13:02:59 +00:00
}
}
}
2009-04-19 18:07:22 +00:00
// Sort the translation flags, because they must be compared highest first!
thingflagstranslation . Sort ( ) ;
}
// Default thing flags
private void LoadDefaultThingFlags ( )
{
// Get linedef flags
2014-03-05 12:26:09 +00:00
IDictionary dic = cfg . ReadSetting ( "defaultthingflags" , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry de in dic )
{
// Check if flag exists
if ( thingflags . ContainsKey ( de . Key . ToString ( ) ) )
{
defaultthingflags . Add ( de . Key . ToString ( ) ) ;
}
else
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "Structure \"defaultthingflags\" contains unknown thing flags in the \"" + this . Name + "\" game configuration" ) ;
2009-04-19 18:07:22 +00:00
}
}
}
// Skills
private void LoadSkills ( )
{
// Get skills
2014-03-05 12:26:09 +00:00
IDictionary dic = cfg . ReadSetting ( "skills" , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry de in dic )
{
2014-02-21 14:42:12 +00:00
int num ;
2009-04-19 18:07:22 +00:00
if ( int . TryParse ( de . Key . ToString ( ) , out num ) )
{
skills . Add ( new SkillInfo ( num , de . Value . ToString ( ) ) ) ;
}
else
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "Structure \"skills\" contains invalid skill numbers in the \"" + this . Name + "\" game configuration" ) ;
2009-04-19 18:07:22 +00:00
}
}
}
// Texture Sets
2014-12-03 23:15:26 +00:00
private void LoadTextureSets ( )
{
2009-04-19 18:07:22 +00:00
// Get sets
2014-03-05 12:26:09 +00:00
IDictionary dic = cfg . ReadSetting ( "texturesets" , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry de in dic )
{
2014-02-21 14:42:12 +00:00
DefinedTextureSet s = new DefinedTextureSet ( cfg , "texturesets." + de . Key ) ;
2009-04-19 18:07:22 +00:00
texturesets . Add ( s ) ;
}
}
// Thing Filters
private void LoadThingFilters ( )
{
// Get sets
2014-03-05 12:26:09 +00:00
IDictionary dic = cfg . ReadSetting ( "thingsfilters" , new Hashtable ( ) ) ;
2009-04-19 18:07:22 +00:00
foreach ( DictionaryEntry de in dic )
{
2014-02-21 14:42:12 +00:00
ThingsFilter f = new ThingsFilter ( cfg , "thingsfilters." + de . Key ) ;
2009-04-19 18:07:22 +00:00
thingfilters . Add ( f ) ;
}
}
2012-04-14 12:22:19 +00:00
// Make door flags
private void LoadMakeDoorFlags ( )
{
2014-03-05 12:26:09 +00:00
IDictionary dic = cfg . ReadSetting ( "makedoorflags" , new Hashtable ( ) ) ;
2015-12-28 15:01:53 +00:00
foreach ( DictionaryEntry de in dic )
2012-04-14 12:22:19 +00:00
{
// Using minus will unset the flag
2015-12-28 15:01:53 +00:00
if ( de . Key . ToString ( ) [ 0 ] = = '-' )
2012-04-14 12:22:19 +00:00
{
makedoorflags [ de . Key . ToString ( ) . TrimStart ( '-' ) ] = false ;
}
else
{
makedoorflags [ de . Key . ToString ( ) ] = true ;
}
}
}
2014-05-05 14:24:57 +00:00
2016-01-11 13:00:52 +00:00
//mxd
private void LoadDefaultSkies ( )
{
IDictionary dic = cfg . ReadSetting ( "defaultskytextures" , new Hashtable ( ) ) ;
char [ ] separator = new [ ] { ',' } ;
foreach ( DictionaryEntry de in dic )
{
string skytex = de . Key . ToString ( ) ;
if ( defaultskytextures . ContainsKey ( skytex ) )
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "Sky texture \"" + skytex + "\" is double defined in the \"" + this . Name + "\" game configuration" ) ;
2016-01-11 13:00:52 +00:00
continue ;
}
string [ ] maps = de . Value . ToString ( ) . Split ( separator , StringSplitOptions . RemoveEmptyEntries ) ;
if ( maps . Length = = 0 )
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "Sky texture \"" + skytex + "\" has no map names defined in the \"" + this . Name + "\" game configuration" ) ;
2016-01-11 13:00:52 +00:00
continue ;
}
foreach ( string map in maps )
{
if ( defaultskytextures . ContainsKey ( map ) )
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
General . ErrorLogger . Add ( ErrorType . Warning , "Map \"" + map + "\" is double defined in the \"DefaultSkyTextures\" block of \"" + this . Name + "\" game configuration" ) ;
2016-01-11 13:00:52 +00:00
continue ;
}
defaultskytextures [ map ] = skytex ;
}
}
}
2014-05-05 14:24:57 +00:00
//mxd
2014-12-03 23:15:26 +00:00
private void LoadStringDictionary ( Dictionary < string , string > target , string settingname )
{
2014-05-05 14:24:57 +00:00
IDictionary dic = cfg . ReadSetting ( settingname , new Hashtable ( ) ) ;
foreach ( DictionaryEntry de in dic )
target . Add ( de . Key . ToString ( ) , de . Value . ToString ( ) ) ;
}
2009-04-19 18:07:22 +00:00
#endregion
#region = = = = = = = = = = = = = = = = = = Methods
// ReadSetting
public string ReadSetting ( string setting , string defaultsetting ) { return cfg . ReadSetting ( setting , defaultsetting ) ; }
public int ReadSetting ( string setting , int defaultsetting ) { return cfg . ReadSetting ( setting , defaultsetting ) ; }
public float ReadSetting ( string setting , float defaultsetting ) { return cfg . ReadSetting ( setting , defaultsetting ) ; }
2020-05-23 08:37:42 +00:00
public double ReadSetting ( string setting , double defaultsetting ) { return cfg . ReadSetting ( setting , defaultsetting ) ; }
2009-04-19 18:07:22 +00:00
public short ReadSetting ( string setting , short defaultsetting ) { return cfg . ReadSetting ( setting , defaultsetting ) ; }
public long ReadSetting ( string setting , long defaultsetting ) { return cfg . ReadSetting ( setting , defaultsetting ) ; }
public bool ReadSetting ( string setting , bool defaultsetting ) { return cfg . ReadSetting ( setting , defaultsetting ) ; }
public byte ReadSetting ( string setting , byte defaultsetting ) { return cfg . ReadSetting ( setting , defaultsetting ) ; }
public IDictionary ReadSetting ( string setting , IDictionary defaultsetting ) { return cfg . ReadSetting ( setting , defaultsetting ) ; }
// This gets a list of things categories
internal List < ThingCategory > GetThingCategories ( )
{
return new List < ThingCategory > ( thingcategories ) ;
}
// This gets a list of things
internal Dictionary < int , ThingTypeInfo > GetThingTypes ( )
{
return new Dictionary < int , ThingTypeInfo > ( things ) ;
}
// This checks if an action is generalized or predefined
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
public static bool IsGeneralized ( int action ) { return IsGeneralized ( action , General . Map . Config . GenActionCategories ) ; }
public static bool IsGeneralized ( int action , IEnumerable < GeneralizedCategory > categories )
2009-04-19 18:07:22 +00:00
{
// Only actions above 0
if ( action > 0 )
{
// Go for all categories
foreach ( GeneralizedCategory ac in categories )
{
// Check if the action is within range of this category
if ( ( action > = ac . Offset ) & & ( action < ( ac . Offset + ac . Length ) ) ) return true ;
}
}
// Not generalized
return false ;
}
// This gets the generalized action category from action number
public GeneralizedCategory GetGeneralizedActionCategory ( int action )
{
// Only actions above 0
if ( action > 0 )
{
// Go for all categories
foreach ( GeneralizedCategory ac in genactioncategories )
{
// Check if the action is within range of this category
if ( ( action > = ac . Offset ) & & ( action < ( ac . Offset + ac . Length ) ) ) return ac ;
}
}
// Not generalized
return null ;
}
2014-09-04 12:34:26 +00:00
//mxd
2016-05-13 14:42:15 +00:00
public static bool IsGeneralizedSectorEffect ( int effect ) { return IsGeneralizedSectorEffect ( effect , General . Map . Config . GenEffectOptions ) ; }
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
public static bool IsGeneralizedSectorEffect ( int effect , List < GeneralizedOption > options )
2014-09-04 12:34:26 +00:00
{
2015-12-28 15:01:53 +00:00
if ( effect = = 0 ) return false ;
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
int cureffect = effect ;
for ( int i = options . Count - 1 ; i > - 1 ; i - - )
2014-09-04 12:34:26 +00:00
{
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
for ( int j = options [ i ] . Bits . Count - 1 ; j > - 1 ; j - - )
2014-09-04 12:34:26 +00:00
{
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
GeneralizedBit bit = options [ i ] . Bits [ j ] ;
2016-05-16 14:04:04 +00:00
if ( bit . Index > cureffect ) continue ;
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
if ( bit . Index > 0 & & ( cureffect & bit . Index ) = = bit . Index ) return true ;
cureffect - = bit . Index ;
2014-09-04 12:34:26 +00:00
}
}
return false ;
}
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
//mxd
2016-06-18 00:10:35 +00:00
public SectorEffectData GetSectorEffectData ( int effect ) { return GetSectorEffectData ( effect , General . Map . Config . GenEffectOptions ) ; }
public SectorEffectData GetSectorEffectData ( int effect , List < GeneralizedOption > options )
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
{
2016-06-18 00:10:35 +00:00
SectorEffectData result = new SectorEffectData ( ) ;
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
if ( effect > 0 )
{
int cureffect = effect ;
2016-06-22 13:38:27 +00:00
if ( General . Map . Config . GeneralizedEffects )
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
{
2016-06-22 13:38:27 +00:00
for ( int i = options . Count - 1 ; i > - 1 ; i - - )
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
{
2016-06-22 13:38:27 +00:00
for ( int j = options [ i ] . Bits . Count - 1 ; j > - 1 ; j - - )
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
{
2016-06-22 13:38:27 +00:00
GeneralizedBit bit = options [ i ] . Bits [ j ] ;
if ( bit . Index > 0 & & ( cureffect & bit . Index ) = = bit . Index )
{
cureffect - = bit . Index ;
result . GeneralizedBits . Add ( bit . Index ) ;
}
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
}
}
}
2016-06-18 00:10:35 +00:00
if ( cureffect > 0 ) result . Effect = cureffect ;
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
}
return result ;
}
2014-09-04 12:34:26 +00:00
//mxd
public string GetGeneralizedSectorEffectName ( int effect )
{
2015-12-28 15:01:53 +00:00
if ( effect = = 0 ) return "None" ;
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
string title = "Unknown generalized effect" ;
2014-09-04 12:34:26 +00:00
int matches = 0 ;
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
int nongeneralizedeffect = effect ;
// Check all options, in bigger to smaller order
for ( int i = geneffectoptions . Count - 1 ; i > - 1 ; i - - )
2014-09-04 12:34:26 +00:00
{
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
for ( int j = geneffectoptions [ i ] . Bits . Count - 1 ; j > - 1 ; j - - )
2014-09-04 12:34:26 +00:00
{
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
GeneralizedBit bit = geneffectoptions [ i ] . Bits [ j ] ;
if ( bit . Index > 0 & & ( effect & bit . Index ) = = bit . Index )
2014-09-04 12:34:26 +00:00
{
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
title = geneffectoptions [ i ] . Name + ": " + bit . Title ;
nongeneralizedeffect - = bit . Index ;
2014-09-04 12:34:26 +00:00
matches + + ;
2015-09-02 11:28:44 +00:00
break ;
2014-09-04 12:34:26 +00:00
}
}
}
Changed, Select Similar Sectors action: when "Effect" option is enabled, all sectors with at least one matching generalized/predefined effect will be selected.
Added, Tag Explorer plugin: a separate category for each generalized/predefined effect is now created when "Sort by action special" sort mode is used.
Added, Edit Effect window: normal and generalized effects can now be set at the same time.
Fixed, Edit Action window: in some cases Generalized actions were incorrectly processed.
Fixed, Edit Effect window: in some cases Generalized effects were incorrectly processed.
Fixed, Select Similar window: Tab control was incorrectly anchored.
Fixed, Nodes Viewer mode, cosmetic: segs angles were calculated incorrectly when showing nodes in classic format.
Fixed: HiRes textures, which didn't override any texture or flat were not loaded.
Fixed, Tag Explorer plugin: linedef action categories were missing title when "Sort by action special" sort mode was used.
Cosmetic: renamed "Grid Setup" action to "Grid and Backdrop Setup".
2016-03-21 15:19:14 +00:00
// Make generalized effect title
string gentitle = ( matches > 1 ? "Generalized (" + matches + " effects)" : title ) ;
// Generalized effect only
if ( nongeneralizedeffect < = 0 ) return gentitle ;
// Classic and generalized effects
if ( General . Map . Config . SectorEffects . ContainsKey ( nongeneralizedeffect ) )
return General . Map . Config . SectorEffects [ nongeneralizedeffect ] . Title + " + " + gentitle ;
if ( matches > 0 ) return "Unknown effect + " + gentitle ;
return "Unknown effect" ;
2014-09-04 12:34:26 +00:00
}
2009-04-19 18:07:22 +00:00
// This checks if a specific edit mode class is listed
public bool IsEditModeSpecified ( string classname )
{
return cfg . SettingExists ( "editingmodes." + classname . ToString ( CultureInfo . InvariantCulture ) ) ;
}
// This returns information on a linedef type
public LinedefActionInfo GetLinedefActionInfo ( int action )
{
2015-10-23 12:01:27 +00:00
// No action?
if ( action = = 0 ) return new LinedefActionInfo ( 0 , "None" , true , false ) ;
2009-04-19 18:07:22 +00:00
// Known type?
2015-10-23 12:01:27 +00:00
if ( linedefactions . ContainsKey ( action ) ) return linedefactions [ action ] ;
// Generalized action?
if ( IsGeneralized ( action , genactioncategories ) )
2009-04-19 18:07:22 +00:00
return new LinedefActionInfo ( action , "Generalized (" + GetGeneralizedActionCategory ( action ) + ")" , true , true ) ;
2015-10-23 12:01:27 +00:00
// Unknown action...
return new LinedefActionInfo ( action , "Unknown" , false , false ) ;
2009-04-19 18:07:22 +00:00
}
// This returns information on a sector effect
public SectorEffectInfo GetSectorEffectInfo ( int effect )
{
2015-10-23 12:01:27 +00:00
// No effect?
if ( effect = = 0 ) return new SectorEffectInfo ( 0 , "None" , true , false ) ;
2009-04-19 18:07:22 +00:00
// Known type?
2015-10-23 12:01:27 +00:00
if ( sectoreffects . ContainsKey ( effect ) ) return sectoreffects [ effect ] ;
//mxd. Generalized sector effect?
if ( IsGeneralizedSectorEffect ( effect , geneffectoptions ) )
2014-09-04 12:34:26 +00:00
return new SectorEffectInfo ( effect , GetGeneralizedSectorEffectName ( effect ) , true , true ) ;
2015-10-23 12:01:27 +00:00
// Unknown sector effect...
return new SectorEffectInfo ( effect , "Unknown" , false , false ) ;
2009-04-19 18:07:22 +00:00
}
2020-06-19 21:30:01 +00:00
/// <summary>
/// Checks if there a script lumps defined in the configuration
/// </summary>
/// <returns>true if there are script lumps defined, false if not</returns>
public bool HasScriptLumps ( )
{
2020-06-20 13:13:49 +00:00
return maplumps . Values . Count ( o = > o . ScriptBuild | | o . Script ! = null ) > 0 ;
2020-06-19 21:30:01 +00:00
}
2021-03-21 21:58:06 +00:00
/// <summary>
/// Checks if this game configuration supports the requested map feature(s)
/// </summary>
/// <param name="features">Array of strings of property names of the GameConfiguration class</param>
/// <returns></returns>
public bool SupportsMapFeatures ( string [ ] features , [ CallerMemberName ] string callername = "" )
{
bool supported = true ;
foreach ( string rmf in features )
{
PropertyInfo pi = GetType ( ) . GetProperty ( rmf ) ;
if ( pi = = null )
{
General . ErrorLogger . Add ( ErrorType . Error , "Check for supported map features (" + string . Join ( ", " , features ) + ") was requested my " + callername + ", but property \"" + rmf + "\" does not exist." ) ;
return false ;
}
object value = pi . GetValue ( this ) ;
if ( value is bool & & ( bool ) value = = false )
{
supported = false ;
break ;
}
}
return supported ;
}
2009-04-19 18:07:22 +00:00
#endregion
}
}