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.
This commit is contained in:
MaxED 2015-10-21 13:35:42 +00:00
parent 027df50640
commit a182a5098d
51 changed files with 1123 additions and 562 deletions

Binary file not shown.

View file

@ -32,6 +32,9 @@ include("Includes\\Boom_common.cfg", "mapformat_doom");
// Settings common to Doom games // Settings common to Doom games
include("Includes\\Game_Doom.cfg"); include("Includes\\Game_Doom.cfg");
//mxd. No DECORATE support in vanilla
decorategames = "";
// Default thing filters // Default thing filters
// (these are not required, just useful for new users) // (these are not required, just useful for new users)
thingsfilters thingsfilters

View file

@ -29,6 +29,9 @@ include("Includes\\Boom_common.cfg", "mapformat_doom");
// Settings common to Doom games // Settings common to Doom games
include("Includes\\Game_Doom.cfg"); include("Includes\\Game_Doom.cfg");
//mxd. No DECORATE support in vanilla
decorategames = "";
// Default thing filters // Default thing filters
// (these are not required, just useful for new users) // (these are not required, just useful for new users)
thingsfilters thingsfilters
@ -39,6 +42,9 @@ thingsfilters
//Default map name //Default map name
defaultlumpname = "E1M1"; defaultlumpname = "E1M1";
// Default testing parameters
testparameters = "-iwad \"%WP\" -skill \"%S\" -file \"%AP\" \"%F\" -warp %L1 %L2 %NM";
// THING TYPES // THING TYPES
// Each engine has its own additional thing types // Each engine has its own additional thing types
// Order should always be 1: Game; 2: ZDoom/game; 3: ZDoom/zdoom // Order should always be 1: Game; 2: ZDoom/game; 3: ZDoom/zdoom

View file

@ -32,6 +32,9 @@ include("Includes\\Doom_common.cfg", "mapformat_doom");
// Settings common to Doom games // Settings common to Doom games
include("Includes\\Game_Doom.cfg"); include("Includes\\Game_Doom.cfg");
//mxd. No DECORATE support in vanilla
decorategames = "";
// Default thing filters // Default thing filters
// (these are not required, just useful for new users) // (these are not required, just useful for new users)
thingsfilters thingsfilters

View file

@ -29,6 +29,9 @@ include("Includes\\Doom_common.cfg", "mapformat_doom");
// Settings common to Doom games // Settings common to Doom games
include("Includes\\Game_Doom.cfg"); include("Includes\\Game_Doom.cfg");
//mxd. No DECORATE support in vanilla
decorategames = "";
// Default thing filters // Default thing filters
// (these are not required, just useful for new users) // (these are not required, just useful for new users)
thingsfilters thingsfilters
@ -39,6 +42,9 @@ thingsfilters
//Default map name //Default map name
defaultlumpname = "E1M1"; defaultlumpname = "E1M1";
// Default testing parameters
testparameters = "-iwad \"%WP\" -skill \"%S\" -file \"%AP\" \"%F\" -warp %L1 %L2 %NM";
// THING TYPES // THING TYPES
// Each engine has its own additional thing types // Each engine has its own additional thing types
// Order should always be 1: Game; 2: ZDoom/game; 3: ZDoom/zdoom // Order should always be 1: Game; 2: ZDoom/game; 3: ZDoom/zdoom

View file

@ -25,6 +25,7 @@ include("Includes\\ZDoom_common.cfg", "common");
// Settings common to Doom map format // Settings common to Doom map format
include("Includes\\ZDoom_common.cfg", "mapformat_doom"); include("Includes\\ZDoom_common.cfg", "mapformat_doom");
include("Includes\\Heretic_misc.cfg", "mapformat_doom");
// Settings common to Heretic games // Settings common to Heretic games
include("Includes\\Game_Heretic.cfg"); include("Includes\\Game_Heretic.cfg");

View file

@ -0,0 +1,64 @@
/*************************************************************\
Doom Builder 2 Game Configuration for ZDoom-compatible port
\*************************************************************/
// This is required to prevent accidental use of a different configuration
type = "Doom Builder 2 Game Configuration";
// This is the title to show for this game
game = "Heretic: Heretic (Doom format)";
// This is the simplified game engine/sourceport name
engine = "heretic";
// *******************************************************
// * *
// * Note: all the elements that could be factorized *
// * because they were common to ZDoom, GZDoom and *
// * Zandronum have been moved to ZDoom_common.cfg. *
// * *
// *******************************************************
// STANDARD DOOM SETTINGS
// Settings common to all games and all map formats
include("Includes\\Doom_common.cfg", "common");
// Settings common to Doom map format
include("Includes\\Heretic_common.cfg", "mapformat_doom");
// Settings common to Doom games
include("Includes\\Game_Heretic.cfg");
//mxd. No DECORATE support in vanilla
decorategames = "";
// Default thing filters
// (these are not required, just useful for new users)
thingsfilters
{
include("Includes\\Doom_misc.cfg", "thingsfilters");
}
//Default map name
defaultlumpname = "E1M1";
// Default testing parameters
testparameters = "-iwad \"%WP\" -skill \"%S\" -file \"%AP\" \"%F\" -warp %L1 %L2 %NM";
// THING TYPES
// Each engine has its own additional thing types
// Order should always be 1: Game; 2: ZDoom/game; 3: ZDoom/zdoom
thingtypes
{
// Basic game actors
include("Includes\\Heretic_things.cfg");
}
// ENUMERATIONS
// Each engine has its own additional thing types
// These are enumerated lists for linedef types and UDMF fields.
enums
{
// Basic game enums
include("Includes\\Doom_misc.cfg", "enums");
}

View file

@ -0,0 +1,62 @@
/*************************************************************\
Doom Builder 2 Game Configuration for ZDoom-compatible port
\*************************************************************/
// This is required to prevent accidental use of a different configuration
type = "Doom Builder 2 Game Configuration";
// This is the title to show for this game
game = "Hexen: Hexen (Hexen format)";
// This is the simplified game engine/sourceport name
engine = "hexen";
// *******************************************************
// * *
// * Note: all the elements that could be factorized *
// * because they were common to ZDoom, GZDoom and *
// * Zandronum have been moved to ZDoom_common.cfg. *
// * *
// *******************************************************
// STANDARD ZDOOM SETTINGS
// Settings common to all games and all map formats
include("Includes\\Doom_common.cfg", "common");
// Settings common to Hexen map format
include("Includes\\Hexen_common.cfg", "mapformat_hexen");
// Settings common to Hexen games
include("Includes\\Game_Hexen.cfg");
//mxd. No DECORATE support in vanilla
decorategames = "";
// Default thing filters
// (these are not required, just useful for new users)
thingsfilters
{
include("Includes\\Hexen_misc.cfg", "thingsfilters");
}
// THING TYPES
// Each engine has its own additional thing types
// Order should always be 1: Game; 2: ZDoom/game; 3: ZDoom/zdoom
thingtypes
{
// Basic game actors
include("Includes\\Hexen_things.cfg");
}
// ENUMERATIONS
// Each engine has its own additional thing types
// These are enumerated lists for linedef types and UDMF fields.
enums
{
// Basic game enums
include("Includes\\Doom_misc.cfg", "enums");
// Standard ZDoom enums
include("Includes\\ZDoom_misc.cfg", "enums");
// Additional ZDoom enums for that game
include("Includes\\ZDoom_misc.cfg", "enums_hexen");
}

View file

@ -20,7 +20,7 @@ common
// Texture sources // Texture sources
textures textures
{ {
include("Doom_misc.cfg", "textures"); include("Doom_misc.cfg", "textures");
} }
// Patch sources // Patch sources

View file

@ -1,7 +1,4 @@
// Basic Doom and Vanilla engine stuff. // Basic Doom and Vanilla engine stuff.
skills skills
{ {
1 = "I'm too young to die"; 1 = "I'm too young to die";
@ -11,7 +8,6 @@ skills
5 = "Nightmare!"; 5 = "Nightmare!";
} }
linedefflags linedefflags
{ {
1 = "Impassable"; 1 = "Impassable";
@ -25,7 +21,6 @@ linedefflags
256 = "Initially shown on automap"; 256 = "Initially shown on automap";
} }
thingflags thingflags
{ {
1 = "Easy"; 1 = "Easy";
@ -35,7 +30,6 @@ thingflags
16 = "Multiplayer only"; 16 = "Multiplayer only";
} }
// Default flags for first new thing // Default flags for first new thing
defaultthingflags defaultthingflags
{ {
@ -44,18 +38,20 @@ defaultthingflags
4; 4;
} }
// How thing flags should be compared (for the stuck thing error check) // How thing flags should be compared (for the stuck thing error check)
thingflagscompare thingflagscompare
{ {
skills { skills
{
1; 1;
2; 2;
4; 4;
} }
gamemodes { gamemodes
16 { {
16
{
comparemethod = "equal"; comparemethod = "equal";
ignoredgroup = "skills"; ignoredgroup = "skills";
ingnorethisgroupwhenunset = true; ingnorethisgroupwhenunset = true;
@ -63,7 +59,6 @@ thingflagscompare
} }
} }
// Mask for the thing flags which indicates the options // Mask for the thing flags which indicates the options
// that make the same thing appear in the same modes // that make the same thing appear in the same modes
thingflagsmasks thingflagsmasks
@ -72,7 +67,6 @@ thingflagsmasks
thingflagsmask2 = 0; thingflagsmask2 = 0;
} }
// Linedef flags UDMF translation table // Linedef flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly // This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted // When the UDMF field name is prefixed with ! it is inverted
@ -89,7 +83,6 @@ linedefflagstranslation
256 = "mapped"; 256 = "mapped";
} }
// Thing flags UDMF translation table // Thing flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly // This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted // When the UDMF field name is prefixed with ! it is inverted
@ -102,7 +95,6 @@ thingflagstranslation
16 = "!single"; 16 = "!single";
} }
// Default sector brightness levels // Default sector brightness levels
sectorbrightness sectorbrightness
{ {
@ -110,7 +102,6 @@ sectorbrightness
128; 112; 96; 80; 64; 48; 32; 16; 0; 128; 112; 96; 80; 64; 48; 32; 16; 0;
} }
/* /*
TEXTURES AND FLAT SOURCES TEXTURES AND FLAT SOURCES
This tells Doom Builder where to find the information for textures This tells Doom Builder where to find the information for textures
@ -188,7 +179,6 @@ flats
} }
} }
/* /*
MAP LUMP NAMES MAP LUMP NAMES
Map lumps are loaded with the map as long as they are right after each other. When the editor Map lumps are loaded with the map as long as they are right after each other. When the editor
@ -289,7 +279,6 @@ doommaplumpnames
} }
} }
hexenmaplumpnames hexenmaplumpnames
{ {
~MAP ~MAP
@ -380,16 +369,14 @@ hexenmaplumpnames
{ {
required = false; required = false;
nodebuild = false; nodebuild = false;
script = "ZDoom_ACS.cfg"; script = "Hexen_ACS.cfg";
} }
} }
// Default thing filters // Default thing filters
// (these are not required, just useful for new users) // (these are not required, just useful for new users)
thingsfilters thingsfilters
{ {
filter0 filter0
{ {
name = "Easy skill"; name = "Easy skill";
@ -400,33 +387,9 @@ thingsfilters
{ {
1 = true; 1 = true;
} }
} }
filter1 filter1
{
name = "Hard skill";
category = "";
type = -1;
fields
{
4 = true;
}
}
filter2
{
name = "Keys only";
category = "keys";
type = -1;
}
filter3
{ {
name = "Medium skill"; name = "Medium skill";
category = ""; category = "";
@ -436,9 +399,26 @@ thingsfilters
{ {
2 = true; 2 = true;
} }
} }
filter2
{
name = "Hard skill";
category = "";
type = -1;
fields
{
4 = true;
}
}
filter3
{
name = "Keys only";
category = "keys";
type = -1;
}
filter4 filter4
{ {
@ -450,9 +430,7 @@ thingsfilters
{ {
16 = true; 16 = true;
} }
} }
} }

View file

@ -14,13 +14,7 @@
// Door making // Door making
makedoortrack = "DOORTRAK"; makedoortrack = "DOORTRAK";
makedoordoor = "BIGDOOR2"; makedoordoor = "BIGDOOR2";
makedoorceil = "FLAT20";
// Default thing filters
// (these are not required, just useful for new users)
/*thingsfilters
{
include("Doom_misc.cfg", "thingsfilters");
}*/
// Default texture sets // Default texture sets
// (these are not required, but useful for new users) // (these are not required, but useful for new users)

View file

@ -1,5 +1,5 @@
// Default lump name for new map // Default lump name for new map
defaultlumpname = "MAP01"; defaultlumpname = "E1M1";
basegame = 2; basegame = 2;
// Decorate actors to include depending on actor game property // Decorate actors to include depending on actor game property
@ -12,14 +12,9 @@
} }
// Door making // Door making
makedoortrack = "METL2"; makedoortrack = "WOODWL";
makedoordoor = "DOORWOOD";
// Default thing filters makedoorceil = "FLOOR04";
// (these are not required, just useful for new users)
/*thingsfilters
{
include("Doom_misc.cfg", "thingsfilters");
}*/
// Default texture sets // Default texture sets
// (these are not required, but useful for new users) // (these are not required, but useful for new users)

View file

@ -15,13 +15,7 @@
// Door making // Door making
makedoortrack = "D_END2"; makedoortrack = "D_END2";
makedoordoor = "D_WD07"; makedoordoor = "D_WD07";
makedoorceil = "F_092";
// Default thing filters
// (these are not required, just useful for new users)
/*thingsfilters
{
include("Hexen_misc.cfg", "thingsfilters");
} */
// Default texture sets // Default texture sets
// (these are not required, but useful for new users) // (these are not required, but useful for new users)

View file

@ -15,6 +15,7 @@
// Door making // Door making
makedoortrack = "DORTRK01"; makedoortrack = "DORTRK01";
makedoordoor = "DORML01"; makedoordoor = "DORML01";
makedoorceil = "F_UNDOOR";
// Default texture sets // Default texture sets
// (these are not required, but useful for new users) // (these are not required, but useful for new users)

View file

@ -0,0 +1,90 @@
//mxd. These settings are used only in Vanilla Heretic configuration.
mapformat_doom
{
// The format interface handles the map data format
formatinterface = "DoomMapSetIO";
maplumpnames
{
include("Doom_misc.cfg", "doommaplumpnames");
}
// When this is set to true, sectors with the same tag will light up when a line is highlighted
linetagindicatesectors = true;
// Special linedefs
include("ZDoom_misc.cfg", "speciallinedefs_doomhexen");
// Default flags for first new thing
defaultthingflags
{
include("Doom_misc.cfg", "defaultthingflags");
}
// Door making
include("ZDoom_misc.cfg", "doormaking_doom");
// Generalized actions
generalizedlinedefs = false;
generalizedsectors = false;
// DEFAULT SECTOR BRIGHTNESS LEVELS
sectorbrightness
{
include("Doom_misc.cfg", "sectorbrightness");
}
// SECTOR TYPES
sectortypes
{
include("Heretic_sectors.cfg");
}
// LINEDEF FLAGS
linedefflags
{
include("Doom_misc.cfg", "linedefflags");
}
// LINEDEF ACTIVATIONS
linedefactivations
{
}
// Linedef flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted
linedefflagstranslation
{
include("Doom_misc.cfg", "linedefflagstranslation");
}
// LINEDEF TYPES
linedeftypes
{
include("Heretic_linedefs.cfg");
}
// THING FLAGS
thingflags
{
include("Doom_misc.cfg", "thingflags");
}
// Thing flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted
thingflagstranslation
{
include("Doom_misc.cfg", "thingflagstranslation");
}
// How to compare thing flags (for the stuck things error checker)
thingflagscompare
{
include("Doom_misc.cfg", "thingflagscompare");
}
// Things flags masks
include("Doom_misc.cfg", "thingflagsmasks");
}

View file

@ -6,4 +6,14 @@ skills
3 = "Bringest them oneth"; 3 = "Bringest them oneth";
4 = "Thou art a smite-meister"; 4 = "Thou art a smite-meister";
5 = "Black plague possesses thee"; 5 = "Black plague possesses thee";
}
//mxd. These are Heretic-specific settings only.
//mxd. These settings are valid only in native Heretic map format.
mapformat_doom
{
sectortypes
{
include("Heretic_sectors.cfg");
}
} }

View file

@ -0,0 +1,101 @@
//mxd. These settings are used only in Vanilla Hexen configuration.
mapformat_hexen
{
// The format interface handles the map data format
formatinterface = "HexenMapSetIO";
maplumpnames
{
include("Doom_misc.cfg", "hexenmaplumpnames");
}
// When this is set to true, sectors with the same tag will light up when a line is highlighted
linetagindicatesectors = false;
// Special linedefs
include("ZDoom_misc.cfg", "speciallinedefs_doomhexen");
// Default flags for first new thing
defaultthingflags
{
include("ZDoom_misc.cfg", "defaultthingflags");
}
// Door making
include("ZDoom_misc.cfg", "doormaking_hexen");
// Generalized actions
generalizedlinedefs = false;
generalizedsectors = false;
// DEFAULT SECTOR BRIGHTNESS LEVELS
sectorbrightness
{
include("ZDoom_misc.cfg", "sectorbrightness");
}
// SECTOR TYPES
sectortypes
{
include("Hexen_sectors.cfg");
}
// LINEDEF FLAGS
linedefflags
{
include("Doom_misc.cfg", "linedefflags");
include("Hexen_misc.cfg", "linedefflags");
}
// Activations filter for Hexen type activations
// This filters the activation bits from the flags
include("Hexen_misc.cfg", "linedefactivationsfilter");
// LINEDEF ACTIVATIONS
// Make sure these are in order from lowest value to highest value
linedefactivations
{
include("Hexen_misc.cfg", "linedefactivations");
}
// Linedef flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted
linedefflagstranslation
{
include("Doom_misc.cfg", "linedefflagstranslation");
include("Hexen_misc.cfg", "linedefflagstranslation");
}
// LINEDEF TYPES
linedeftypes
{
include("Hexen_linedefs.cfg");
}
// THING FLAGS
thingflags
{
include("Doom_misc.cfg", "thingflags");
include("Hexen_misc.cfg", "thingflags");
}
// Thing flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted
thingflagstranslation
{
include("Doom_misc.cfg", "thingflagstranslation");
include("Hexen_misc.cfg", "thingflagstranslation");
}
// How to compare thing flags (for the stuck things error checker)
thingflagscompare
{
include("Hexen_misc.cfg", "thingflagscompare");
}
// Things flags masks
include("Hexen_misc.cfg", "thingflagsmasks");
}

View file

@ -1,7 +1,4 @@
// Basic Hexen stuff. // Basic Hexen stuff.
skills skills
{ {
1 = "Squire / Altar boy / Apprentice"; 1 = "Squire / Altar boy / Apprentice";
@ -11,7 +8,6 @@ skills
5 = "Titan / Pope / Archimage"; 5 = "Titan / Pope / Archimage";
} }
linedefflags linedefflags
{ {
512 = "Repeatable Action"; 512 = "Repeatable Action";
@ -19,7 +15,6 @@ linedefflags
32768 = "Block Everything"; 32768 = "Block Everything";
} }
thingflags thingflags
{ {
16 = "Dormant"; 16 = "Dormant";
@ -31,7 +26,6 @@ thingflags
1024 = "Deathmatch"; 1024 = "Deathmatch";
} }
// Default flags for first new thing // Default flags for first new thing
defaultthingflags defaultthingflags
{ {
@ -62,18 +56,9 @@ thingflagscompare
gamemodes gamemodes
{ {
256 256 { requiredgroup = "skills"; }
{ 512 { requiredgroup = "skills"; }
requiredgroup = "skills"; 1024 { ignoredgroup = "skills"; }
}
512
{
requiredgroup = "skills";
}
1024
{
ignoredgroup = "skills";
}
} }
} }
@ -85,7 +70,6 @@ thingflagsmasks
thingflagsmask2 = 1792; // 256 + 512 + 1024 thingflagsmask2 = 1792; // 256 + 512 + 1024
} }
// Linedef flags UDMF translation table // Linedef flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly // This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted // When the UDMF field name is prefixed with ! it is inverted
@ -101,7 +85,6 @@ linedefflagstranslation
32768 = "blockeverything"; 32768 = "blockeverything";
} }
// Thing flags UDMF translation table // Thing flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly // This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted // When the UDMF field name is prefixed with ! it is inverted
@ -116,7 +99,6 @@ thingflagstranslation
1024 = "dm"; 1024 = "dm";
} }
// Activations filter for Hexen type activations // Activations filter for Hexen type activations
// This filters the activation bits from the flags // This filters the activation bits from the flags
// This is in its own structure for inclusion only, // This is in its own structure for inclusion only,
@ -126,7 +108,6 @@ linedefactivationsfilter
linedefactivationsfilter = 7168; linedefactivationsfilter = 7168;
} }
// LINEDEF ACTIVATIONS // LINEDEF ACTIVATIONS
// Make sure these are in order from lowest value to highest value // Make sure these are in order from lowest value to highest value
linedefactivations linedefactivations
@ -137,14 +118,13 @@ linedefactivations
3072 = "Projectile hits"; 3072 = "Projectile hits";
4096 = "Player bumps"; 4096 = "Player bumps";
5120 = "Projectile flies over"; 5120 = "Projectile flies over";
6144 = "Player presses Use (PassThru)";
} }
// Default thing filters // Default thing filters
// (these are not required, just useful for new users) // (these are not required, just useful for new users)
thingsfilters thingsfilters
{ {
filter0 filter0
{ {
name = "Easy skill"; name = "Easy skill";
@ -155,33 +135,9 @@ thingsfilters
{ {
1 = true; 1 = true;
} }
} }
filter1 filter1
{
name = "Hard skill";
category = "";
type = -1;
fields
{
4 = true;
}
}
filter2
{
name = "Keys only";
category = "keys";
type = -1;
}
filter3
{ {
name = "Medium skill"; name = "Medium skill";
category = ""; category = "";
@ -191,12 +147,88 @@ thingsfilters
{ {
2 = true; 2 = true;
} }
} }
filter2
{
name = "Hard skill";
category = "";
type = -1;
fields
{
4 = true;
}
}
filter3
{
name = "Fighter class";
category = "";
type = -1;
fields
{
32 = true;
}
}
filter4
{
name = "Cleric class";
category = "";
type = -1;
fields
{
64 = true;
}
}
filter5
{
name = "Mage class";
category = "";
type = -1;
fields
{
128 = true;
}
}
filter6
{
name = "Keys only";
category = "keys";
type = -1;
}
filter7
{
name = "Cooperative";
category = "";
type = -1;
fields
{
512 = true;
}
}
filter8
{
name = "Deathmatch";
category = "";
type = -1;
fields
{
1024 = true;
}
}
} }
// ENUMERATIONS // ENUMERATIONS
// These are enumerated lists for linedef types and UDMF fields. // These are enumerated lists for linedef types and UDMF fields.
enums enums
@ -224,4 +256,14 @@ enums
{ {
0 = "None"; 0 = "None";
} }
}
//mxd. These are Hexen-specific settings only.
//mxd. These settings are valid only in native Hexen map format.
mapformat_hexen
{
sectortypes
{
include("Hexen_sectors.cfg");
}
} }

View file

@ -1516,16 +1516,19 @@ other
3000 3000
{ {
title = "Polyobject Anchor"; title = "Polyobject Anchor";
sprite = "internal:anchor";
fixedrotation = true; fixedrotation = true;
} }
3001 3001
{ {
title = "Polyobject Start Spot"; title = "Polyobject Start Spot";
sprite = "internal:anchor";
fixedrotation = true; fixedrotation = true;
} }
3002 3002
{ {
title = "Polyobject Start Spot (crush)"; title = "Polyobject Start Spot (crush)";
sprite = "internal:anchor";
fixedrotation = true; fixedrotation = true;
} }
10225 10225

View file

@ -0,0 +1,93 @@
//mxd. These settings are used only in Vanilla Strife configuration.
mapformat_doom
{
// The format interface handles the map data format
formatinterface = "DoomMapSetIO";
maplumpnames
{
include("Doom_misc.cfg", "doommaplumpnames");
}
// When this is set to true, sectors with the same tag will light up when a line is highlighted
linetagindicatesectors = true;
// Special linedefs
include("ZDoom_misc.cfg", "speciallinedefs_doomhexen");
// Default flags for first new thing
defaultthingflags
{
include("Strife_misc.cfg", "mapformat_doom.defaultthingflags");
}
// Door making
include("ZDoom_misc.cfg", "doormaking_doom");
// Generalized actions
generalizedlinedefs = false;
generalizedsectors = false;
// DEFAULT SECTOR BRIGHTNESS LEVELS
sectorbrightness
{
include("Doom_misc.cfg", "sectorbrightness");
}
// SECTOR TYPES
sectortypes
{
include("Strife_misc.cfg", "mapformat_doom.sectortypes");
}
// LINEDEF FLAGS
linedefflags
{
include("Doom_misc.cfg", "linedefflags");
include("Strife_misc.cfg", "mapformat_doom.linedefflags");
}
// LINEDEF ACTIVATIONS
linedefactivations
{
}
// Linedef flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted
linedefflagstranslation
{
include("Doom_misc.cfg", "linedefflagstranslation");
include("Strife_misc.cfg", "mapformat_doom.linedefflagstranslation");
}
// LINEDEF TYPES
linedeftypes
{
include("Strife_linedefs.cfg");
}
// THING FLAGS
thingflags
{
include("Strife_misc.cfg", "mapformat_doom.thingflags");
}
// Thing flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted
thingflagstranslation
{
include("Strife_misc.cfg", "mapformat_doom.thingflagstranslation");
}
// How to compare thing flags (for the stuck things error checker)
thingflagscompare
{
include("Doom_misc.cfg", "thingflagscompare");
}
// Things flags masks
include("Strife_misc.cfg", "mapformat_doom.thingflagsmasks");
}

View file

@ -10,10 +10,15 @@ skills
5 = "Bloodbath"; 5 = "Bloodbath";
} }
//mxd. These settings are valid only in native strife map format //mxd. These are Strife-specific settings only.
//mxd. These settings are valid only in native Strife map format.
mapformat_doom mapformat_doom
{ {
sectortypes
{
include("Strife_sectors.cfg");
}
linedefflags linedefflags
{ {
512 = "Jump over railing"; 512 = "Jump over railing";
@ -80,7 +85,6 @@ mapformat_doom
// (these are not required, just useful for new users) // (these are not required, just useful for new users)
thingsfilters thingsfilters
{ {
filter0 filter0
{ {
name = "Easy skill"; name = "Easy skill";
@ -91,33 +95,9 @@ thingsfilters
{ {
1 = true; 1 = true;
} }
} }
filter1 filter1
{
name = "Hard skill";
category = "";
type = -1;
fields
{
4 = true;
}
}
filter2
{
name = "Keys only";
category = "keys";
type = -1;
}
filter3
{ {
name = "Medium skill"; name = "Medium skill";
category = ""; category = "";
@ -127,9 +107,26 @@ thingsfilters
{ {
2 = true; 2 = true;
} }
} }
filter2
{
name = "Hard skill";
category = "";
type = -1;
fields
{
4 = true;
}
}
filter3
{
name = "Keys only";
category = "keys";
type = -1;
}
filter4 filter4
{ {
@ -141,7 +138,5 @@ thingsfilters
{ {
16 = true; 16 = true;
} }
} }
} }

View file

@ -1,3 +1,18 @@
0 = "Normal";
18 = "Current Force, tag=dir&magnitude"; 1 = "Light blink random";
2 = "Light blink 0.5 second";
3 = "Light blink 1 second";
4 = "5% damage every 32 tics + light blink 0.5 sec.";
5 = "Damage: +2 to nukagecount";
7 = "Damage 5% every 32 tics";
8 = "Light oscillate";
9 = "Secret";
10 = "Ceiling closes 30 seconds after level start";
11 = "20% dmg. per sec. When player dies, level ends";
12 = "Light blink 0.5 second, synchronized";
13 = "Light blink 1 second, synchronized";
14 = "Ceiling opens 5 minutes after level start";
15 = "Instant death: 999% damage every tic";
16 = "Damage: +4 to nukagecount";
17 = "Light flicker random";
18 = "Water current, tag controls angle and strength";

View file

@ -250,7 +250,7 @@ mapformat_hexen
// Activations filter for Hexen type activations // Activations filter for Hexen type activations
// This filters the activation bits from the flags // This filters the activation bits from the flags
linedefactivationsfilter = 7168; include("Hexen_misc.cfg", "linedefactivationsfilter");
// LINEDEF ACTIVATIONS // LINEDEF ACTIVATIONS
// Make sure these are in order from lowest value to highest value // Make sure these are in order from lowest value to highest value

View file

@ -9,7 +9,6 @@ linedefflags
// Make sure these are in order from lowest value to highest value // Make sure these are in order from lowest value to highest value
linedefactivations linedefactivations
{ {
6144 = "Player presses Use (PassThru)";
7168 = "Projectile hits or crosses"; 7168 = "Projectile hits or crosses";
} }
@ -1737,7 +1736,7 @@ thingsfilters_udmf
type = -1; type = -1;
} }
filter1 filter1
{ {
name = "Deathmatch"; name = "Deathmatch";
category = ""; category = "";
@ -1747,7 +1746,6 @@ thingsfilters_udmf
{ {
dm = true; dm = true;
} }
} }
filter2 filter2
@ -1760,7 +1758,6 @@ thingsfilters_udmf
{ {
coop = true; coop = true;
} }
} }
filter3 filter3
@ -1773,10 +1770,8 @@ thingsfilters_udmf
{ {
skill1 = true; skill1 = true;
} }
} }
filter4 filter4
{ {
name = "Skill 2"; name = "Skill 2";
@ -1787,10 +1782,8 @@ thingsfilters_udmf
{ {
skill2 = true; skill2 = true;
} }
} }
filter5 filter5
{ {
name = "Skill 3"; name = "Skill 3";
@ -1801,10 +1794,8 @@ thingsfilters_udmf
{ {
skill3 = true; skill3 = true;
} }
} }
filter6 filter6
{ {
name = "Skill 4"; name = "Skill 4";
@ -1815,10 +1806,8 @@ thingsfilters_udmf
{ {
skill4 = true; skill4 = true;
} }
} }
filter7 filter7
{ {
name = "Skill 5"; name = "Skill 5";
@ -1829,10 +1818,8 @@ thingsfilters_udmf
{ {
skill5 = true; skill5 = true;
} }
} }
filter8 filter8
{ {
name = "Skill 6"; name = "Skill 6";
@ -1843,10 +1830,8 @@ thingsfilters_udmf
{ {
skill6 = true; skill6 = true;
} }
} }
filter9 filter9
{ {
name = "Skill 7"; name = "Skill 7";
@ -1857,10 +1842,8 @@ thingsfilters_udmf
{ {
skill7 = true; skill7 = true;
} }
} }
filter10 filter10
{ {
name = "Skill 8"; name = "Skill 8";
@ -1871,9 +1854,7 @@ thingsfilters_udmf
{ {
skill8 = true; skill8 = true;
} }
} }
} }
// Special linedefs // Special linedefs

View file

@ -0,0 +1,58 @@
/*************************************************************\
Doom Builder 2 Game Configuration for ZDoom-compatible port
\*************************************************************/
// This is required to prevent accidental use of a different configuration
type = "Doom Builder 2 Game Configuration";
// This is the title to show for this game
game = "Strife: Strife (Doom format)";
// This is the simplified game engine/sourceport name
engine = "strife";
// *******************************************************
// * *
// * Note: all the elements that could be factorized *
// * because they were common to ZDoom, GZDoom and *
// * Zandronum have been moved to ZDoom_common.cfg. *
// * *
// *******************************************************
// STANDARD DOOM SETTINGS
// Settings common to all games and all map formats
include("Includes\\Doom_common.cfg", "common");
// Settings common to Doom map format
include("Includes\\Strife_common.cfg", "mapformat_doom");
// Settings common to Strife games
include("Includes\\Game_Strife.cfg");
//mxd. No DECORATE support in vanilla
decorategames = "";
// Default thing filters
// (these are not required, just useful for new users)
thingsfilters
{
include("Includes\\Strife_misc.cfg", "thingsfilters");
}
// THING TYPES
// Each engine has its own additional thing types
// Order should always be 1: Game; 2: ZDoom/game; 3: ZDoom/zdoom
thingtypes
{
// Basic game actors
include("Includes\\Strife_things.cfg");
}
// ENUMERATIONS
// Each engine has its own additional thing types
// These are enumerated lists for linedef types and UDMF fields.
/*enums
{
// Basic game enums
include("Includes\\Doom_misc.cfg", "enums");
}*/

View file

@ -25,6 +25,7 @@ include("Includes\\ZDoom_common.cfg", "common");
// Settings common to Doom map format // Settings common to Doom map format
include("Includes\\ZDoom_common.cfg", "mapformat_doom"); include("Includes\\ZDoom_common.cfg", "mapformat_doom");
include("Includes\\Heretic_misc.cfg", "mapformat_doom");
// Settings common to Heretic games // Settings common to Heretic games
include("Includes\\Game_Heretic.cfg"); include("Includes\\Game_Heretic.cfg");

View file

@ -25,6 +25,7 @@ include("Includes\\ZDoom_common.cfg", "common");
// Settings common to Doom map format // Settings common to Doom map format
include("Includes\\ZDoom_common.cfg", "mapformat_doom"); include("Includes\\ZDoom_common.cfg", "mapformat_doom");
include("Includes\\Heretic_misc.cfg", "mapformat_doom");
// Settings common to Heretic games // Settings common to Heretic games
include("Includes\\Game_Heretic.cfg"); include("Includes\\Game_Heretic.cfg");

View file

@ -126,13 +126,13 @@ namespace CodeImp.DoomBuilder.Config
this.startmode = General.Settings.ReadSetting("configurations." + settingskey + ".startmode", "VerticesMode"); this.startmode = General.Settings.ReadSetting("configurations." + settingskey + ".startmode", "VerticesMode");
this.enabled = General.Settings.ReadSetting("configurations." + settingskey + ".enabled", config.ReadSetting("enabledbydefault", false)); //mxd this.enabled = General.Settings.ReadSetting("configurations." + settingskey + ".enabled", config.ReadSetting("enabledbydefault", false)); //mxd
//mxd. read test engines //mxd. Read test engines
testEngines = new List<EngineInfo>(); testEngines = new List<EngineInfo>();
IDictionary list = General.Settings.ReadSetting("configurations." + settingskey + ".engines", new ListDictionary()); IDictionary list = General.Settings.ReadSetting("configurations." + settingskey + ".engines", new ListDictionary());
currentEngineIndex = Math.Max(0, General.Settings.ReadSetting("configurations." + settingskey + ".currentengineindex", 0)); currentEngineIndex = Math.Max(0, General.Settings.ReadSetting("configurations." + settingskey + ".currentengineindex", 0));
//no engine list found? use old engine properties // No engine list found? Use old engine properties
if (list.Count == 0) if(list.Count == 0)
{ {
EngineInfo info = new EngineInfo(); EngineInfo info = new EngineInfo();
info.TestProgram = General.Settings.ReadSetting("configurations." + settingskey + ".testprogram", ""); info.TestProgram = General.Settings.ReadSetting("configurations." + settingskey + ".testprogram", "");
@ -147,7 +147,7 @@ namespace CodeImp.DoomBuilder.Config
else else
{ {
//read engines settings from config //read engines settings from config
foreach (DictionaryEntry de in list) foreach(DictionaryEntry de in list)
{ {
string path = "configurations." + settingskey + ".engines." + de.Key; string path = "configurations." + settingskey + ".engines." + de.Key;
EngineInfo info = new EngineInfo(); EngineInfo info = new EngineInfo();
@ -248,7 +248,7 @@ namespace CodeImp.DoomBuilder.Config
public int CompareTo(ConfigurationInfo other) public int CompareTo(ConfigurationInfo other)
{ {
// Compare // Compare
return name.CompareTo(other.name); return String.Compare(name, other.name, StringComparison.Ordinal);
} }
// This saves the settings to program configuration // This saves the settings to program configuration

View file

@ -66,6 +66,7 @@ namespace CodeImp.DoomBuilder.Config
private readonly bool testshortpaths; private readonly bool testshortpaths;
private readonly string makedoortrack; private readonly string makedoortrack;
private readonly string makedoordoor; //mxd private readonly string makedoordoor; //mxd
private readonly string makedoorceil; //mxd
private readonly int makedooraction; private readonly int makedooraction;
private readonly int makedooractivate; private readonly int makedooractivate;
private readonly int[] makedoorargs; private readonly int[] makedoorargs;
@ -178,6 +179,7 @@ namespace CodeImp.DoomBuilder.Config
public bool TestShortPaths { get { return testshortpaths; } } public bool TestShortPaths { get { return testshortpaths; } }
public string MakeDoorTrack { get { return makedoortrack; } } public string MakeDoorTrack { get { return makedoortrack; } }
public string MakeDoorDoor { get { return makedoordoor; } } //mxd public string MakeDoorDoor { get { return makedoordoor; } } //mxd
public string MakeDoorCeiling { get { return makedoorceil; } } //mxd
public int MakeDoorAction { get { return makedooraction; } } public int MakeDoorAction { get { return makedooraction; } }
public int MakeDoorActivate { get { return makedooractivate; } } public int MakeDoorActivate { get { return makedooractivate; } }
public Dictionary<string, bool> MakeDoorFlags { get { return makedoorflags; } } public Dictionary<string, bool> MakeDoorFlags { get { return makedoorflags; } }
@ -323,6 +325,7 @@ namespace CodeImp.DoomBuilder.Config
testshortpaths = cfg.ReadSetting("testshortpaths", false); testshortpaths = cfg.ReadSetting("testshortpaths", false);
makedoortrack = cfg.ReadSetting("makedoortrack", "-"); makedoortrack = cfg.ReadSetting("makedoortrack", "-");
makedoordoor = cfg.ReadSetting("makedoordoor", "-"); //mxd makedoordoor = cfg.ReadSetting("makedoordoor", "-"); //mxd
makedoorceil = cfg.ReadSetting("makedoorceil", "-"); //mxd
makedooraction = cfg.ReadSetting("makedooraction", 0); makedooraction = cfg.ReadSetting("makedooraction", 0);
makedooractivate = cfg.ReadSetting("makedooractivate", 0); makedooractivate = cfg.ReadSetting("makedooractivate", 0);
linetagindicatesectors = cfg.ReadSetting("linetagindicatesectors", false); linetagindicatesectors = cfg.ReadSetting("linetagindicatesectors", false);

View file

@ -505,6 +505,7 @@ namespace CodeImp.DoomBuilder.Controls
buttonsave.Enabled = (t != null) && t.ExplicitSave; buttonsave.Enabled = (t != null) && t.ExplicitSave;
buttonsaveall.Enabled = (explicitsavescripts > 0); buttonsaveall.Enabled = (explicitsavescripts > 0);
buttoncompile.Enabled = (t != null) && (t.Config.Compiler != null); buttoncompile.Enabled = (t != null) && (t.Config.Compiler != null);
buttonsearch.Enabled = (t != null); //mxd
buttonkeywordhelp.Enabled = (t != null) && !string.IsNullOrEmpty(t.Config.KeywordHelp); buttonkeywordhelp.Enabled = (t != null) && !string.IsNullOrEmpty(t.Config.KeywordHelp);
buttonscriptconfig.Enabled = (t != null) && t.IsReconfigurable; buttonscriptconfig.Enabled = (t != null) && t.IsReconfigurable;
buttonundo.Enabled = (t != null); buttonundo.Enabled = (t != null);

View file

@ -1707,9 +1707,10 @@ namespace CodeImp.DoomBuilder.Data
private Dictionary<string, List<int>> CreateActorsByClassList() private Dictionary<string, List<int>> CreateActorsByClassList()
{ {
Dictionary<string, List<int>> actors = new Dictionary<string, List<int>>(StringComparer.Ordinal); Dictionary<string, List<int>> actors = new Dictionary<string, List<int>>(StringComparer.Ordinal);
if(string.IsNullOrEmpty(General.Map.Config.DecorateGames)) return actors;
//read our new shiny ClassNames for default game things //read our new shiny ClassNames for default game things
foreach (KeyValuePair<int, ThingTypeInfo> ti in thingtypes) foreach(KeyValuePair<int, ThingTypeInfo> ti in thingtypes)
{ {
if(!string.IsNullOrEmpty(ti.Value.ClassName)) if(!string.IsNullOrEmpty(ti.Value.ClassName))
{ {
@ -1719,7 +1720,7 @@ namespace CodeImp.DoomBuilder.Data
} }
} }
if (actors.Count == 0) if(actors.Count == 0)
General.ErrorLogger.Add(ErrorType.Warning, "Warning: unable to find any DECORATE actor definitions!"); General.ErrorLogger.Add(ErrorType.Warning, "Warning: unable to find any DECORATE actor definitions!");
return actors; return actors;
@ -1728,12 +1729,15 @@ namespace CodeImp.DoomBuilder.Data
//mxd //mxd
public void ReloadModeldef() public void ReloadModeldef()
{ {
if (modeldefentries != null) if(modeldefentries != null)
{ {
foreach (KeyValuePair<int, ModelData> group in modeldefentries) foreach(KeyValuePair<int, ModelData> group in modeldefentries)
group.Value.Dispose(); group.Value.Dispose();
} }
// Bail out when not supported by currect game configuration
if(string.IsNullOrEmpty(General.Map.Config.DecorateGames)) return;
General.MainWindow.DisplayStatus(StatusType.Busy, "Reloading model definitions..."); General.MainWindow.DisplayStatus(StatusType.Busy, "Reloading model definitions...");
LoadModeldefs(CreateActorsByClassList()); LoadModeldefs(CreateActorsByClassList());
@ -1743,7 +1747,7 @@ namespace CodeImp.DoomBuilder.Data
foreach(Thing t in General.Map.Map.Things) t.UpdateCache(); foreach(Thing t in General.Map.Map.Things) t.UpdateCache();
//rebuild geometry if in Visual mode //rebuild geometry if in Visual mode
if (General.Editing.Mode != null && General.Editing.Mode.GetType().Name == "BaseVisualMode") if(General.Editing.Mode != null && General.Editing.Mode.GetType().Name == "BaseVisualMode")
{ {
General.Editing.Mode.OnReloadResources(); General.Editing.Mode.OnReloadResources();
} }
@ -1754,6 +1758,9 @@ namespace CodeImp.DoomBuilder.Data
//mxd //mxd
public void ReloadGldefs() public void ReloadGldefs()
{ {
// Bail out when not supported by currect game configuration
if(string.IsNullOrEmpty(General.Map.Config.DecorateGames)) return;
General.MainWindow.DisplayStatus(StatusType.Busy, "Reloading GLDEFS..."); General.MainWindow.DisplayStatus(StatusType.Busy, "Reloading GLDEFS...");
try try
@ -1768,7 +1775,7 @@ namespace CodeImp.DoomBuilder.Data
} }
//rebuild geometry if in Visual mode //rebuild geometry if in Visual mode
if (General.Editing.Mode != null && General.Editing.Mode.GetType().Name == "BaseVisualMode") if(General.Editing.Mode != null && General.Editing.Mode.GetType().Name == "BaseVisualMode")
{ {
General.Editing.Mode.OnReloadResources(); General.Editing.Mode.OnReloadResources();
} }
@ -1780,24 +1787,24 @@ namespace CodeImp.DoomBuilder.Data
private void LoadModeldefs(Dictionary<string, List<int>> actorsByClass) private void LoadModeldefs(Dictionary<string, List<int>> actorsByClass)
{ {
//if no actors defined in DECORATE or game config... //if no actors defined in DECORATE or game config...
if (actorsByClass.Count == 0) return; if(actorsByClass.Count == 0) return;
Dictionary<string, ModelData> modelDefEntriesByName = new Dictionary<string, ModelData>(StringComparer.Ordinal); Dictionary<string, ModelData> modelDefEntriesByName = new Dictionary<string, ModelData>(StringComparer.Ordinal);
ModeldefParser parser = new ModeldefParser(); ModeldefParser parser = new ModeldefParser();
foreach (DataReader dr in containers) foreach(DataReader dr in containers)
{ {
currentreader = dr; currentreader = dr;
Dictionary<string, Stream> streams = dr.GetModeldefData(); Dictionary<string, Stream> streams = dr.GetModeldefData();
foreach (KeyValuePair<string, Stream> group in streams) foreach(KeyValuePair<string, Stream> group in streams)
{ {
// Parse the data // Parse the data
if(parser.Parse(group.Value, currentreader.Location.location + "\\" + group.Key)) if(parser.Parse(group.Value, currentreader.Location.location + "\\" + group.Key))
{ {
foreach(KeyValuePair<string, ModelData> g in parser.Entries) foreach(KeyValuePair<string, ModelData> g in parser.Entries)
{ {
if (modelDefEntriesByName.ContainsKey(g.Key)) if(modelDefEntriesByName.ContainsKey(g.Key))
{ {
General.ErrorLogger.Add(ErrorType.Warning, "Model definition for actor '" + g.Key + "' is double-defined in '" + group.Key + "'"); General.ErrorLogger.Add(ErrorType.Warning, "Model definition for actor '" + g.Key + "' is double-defined in '" + group.Key + "'");
modelDefEntriesByName[g.Key] = g.Value; modelDefEntriesByName[g.Key] = g.Value;
@ -1813,7 +1820,7 @@ namespace CodeImp.DoomBuilder.Data
currentreader = null; currentreader = null;
foreach (KeyValuePair<string, ModelData> e in modelDefEntriesByName) foreach(KeyValuePair<string, ModelData> e in modelDefEntriesByName)
{ {
if(actorsByClass.ContainsKey(e.Key)) if(actorsByClass.ContainsKey(e.Key))
{ {
@ -1829,6 +1836,9 @@ namespace CodeImp.DoomBuilder.Data
//mxd //mxd
private void LoadVoxels() private void LoadVoxels()
{ {
// Bail out when not supported by currect game configuration
if(string.IsNullOrEmpty(General.Map.Config.DecorateGames)) return;
//Get names of all voxel models, which can be used "as is" //Get names of all voxel models, which can be used "as is"
Dictionary<string, bool> voxelNames = new Dictionary<string, bool>(StringComparer.Ordinal); Dictionary<string, bool> voxelNames = new Dictionary<string, bool>(StringComparer.Ordinal);
@ -1863,7 +1873,7 @@ namespace CodeImp.DoomBuilder.Data
sprite = ti.Sprite; sprite = ti.Sprite;
} }
if (string.IsNullOrEmpty(sprite)) continue; if(string.IsNullOrEmpty(sprite)) continue;
if(!sprites.ContainsKey(sprite)) sprites.Add(sprite, new List<int>()); if(!sprites.ContainsKey(sprite)) sprites.Add(sprite, new List<int>());
sprites[sprite].Add(ti.Index); sprites[sprite].Add(ti.Index);
} }
@ -1883,7 +1893,7 @@ namespace CodeImp.DoomBuilder.Data
{ {
foreach(KeyValuePair<string, List<int>> sc in sprites) foreach(KeyValuePair<string, List<int>> sc in sprites)
{ {
if (sc.Key.Contains(entry.Key)) if(sc.Key.Contains(entry.Key))
{ {
foreach(int id in sc.Value) modeldefentries[id] = entry.Value; foreach(int id in sc.Value) modeldefentries[id] = entry.Value;
processed.Add(entry.Key, false); processed.Add(entry.Key, false);
@ -1899,7 +1909,7 @@ namespace CodeImp.DoomBuilder.Data
foreach(KeyValuePair<string, bool> group in voxelNames) foreach(KeyValuePair<string, bool> group in voxelNames)
{ {
if(processed.ContainsKey(group.Key)) continue; if(processed.ContainsKey(group.Key)) continue;
foreach (KeyValuePair<string, List<int>> sc in sprites) foreach(KeyValuePair<string, List<int>> sc in sprites)
{ {
if(sc.Key.Contains(group.Key)) if(sc.Key.Contains(group.Key))
{ {
@ -1917,26 +1927,26 @@ namespace CodeImp.DoomBuilder.Data
private void LoadGldefs(Dictionary<string, List<int>> actorsByClass) private void LoadGldefs(Dictionary<string, List<int>> actorsByClass)
{ {
//if no actors defined in DECORATE or game config... //if no actors defined in DECORATE or game config...
if (actorsByClass.Count == 0) return; if(actorsByClass.Count == 0) return;
GldefsParser parser = new GldefsParser { OnInclude = ParseFromLocation }; GldefsParser parser = new GldefsParser { OnInclude = ParseFromLocation };
//load gldefs from resources //load gldefs from resources
foreach (DataReader dr in containers) foreach(DataReader dr in containers)
{ {
currentreader = dr; currentreader = dr;
parser.ClearIncludesList(); parser.ClearIncludesList();
Dictionary<string, Stream> streams = dr.GetGldefsData(General.Map.Config.GameType); Dictionary<string, Stream> streams = dr.GetGldefsData(General.Map.Config.GameType);
foreach (KeyValuePair<string, Stream> group in streams) foreach(KeyValuePair<string, Stream> group in streams)
parser.Parse(group.Value, group.Key); parser.Parse(group.Value, group.Key);
} }
//create gldefsEntries dictionary //create gldefsEntries dictionary
foreach (KeyValuePair<string, string> e in parser.Objects) //ClassName, Light name foreach(KeyValuePair<string, string> e in parser.Objects) //ClassName, Light name
{ {
//if we have decorate actor and light definition for given ClassName... //if we have decorate actor and light definition for given ClassName...
if (actorsByClass.ContainsKey(e.Key) && parser.LightsByName.ContainsKey(e.Value)) if(actorsByClass.ContainsKey(e.Key) && parser.LightsByName.ContainsKey(e.Value))
{ {
foreach(int i in actorsByClass[e.Key]) foreach(int i in actorsByClass[e.Key])
{ {
@ -1961,12 +1971,12 @@ namespace CodeImp.DoomBuilder.Data
{ {
MapinfoParser parser = new MapinfoParser { OnInclude = ParseFromLocation }; MapinfoParser parser = new MapinfoParser { OnInclude = ParseFromLocation };
foreach (DataReader dr in containers) foreach(DataReader dr in containers)
{ {
currentreader = dr; currentreader = dr;
Dictionary<string, Stream> streams = dr.GetMapinfoData(); Dictionary<string, Stream> streams = dr.GetMapinfoData();
foreach (KeyValuePair<string, Stream> group in streams) foreach(KeyValuePair<string, Stream> group in streams)
{ {
// Parse the data // Parse the data
parser.Parse(group.Value, Path.Combine(currentreader.Location.location, group.Key), General.Map.Options.LevelName); parser.Parse(group.Value, Path.Combine(currentreader.Location.location, group.Key), General.Map.Options.LevelName);
@ -1992,9 +2002,12 @@ namespace CodeImp.DoomBuilder.Data
//mxd. This loads REVERBS //mxd. This loads REVERBS
private void LoadReverbs() private void LoadReverbs()
{ {
ReverbsParser parser = new ReverbsParser();
reverbs.Clear(); reverbs.Clear();
// Bail out when not supported by currect game configuration
if(string.IsNullOrEmpty(General.Map.Config.DecorateGames)) return;
ReverbsParser parser = new ReverbsParser();
foreach(DataReader dr in containers) foreach(DataReader dr in containers)
{ {
currentreader = dr; currentreader = dr;
@ -2013,16 +2026,19 @@ namespace CodeImp.DoomBuilder.Data
//mxd. This loads SNDSEQ //mxd. This loads SNDSEQ
private void LoadSndSeq() private void LoadSndSeq()
{ {
SndSeqParser parser = new SndSeqParser();
soundsequences.Clear(); soundsequences.Clear();
// Bail out when not supported by currect game configuration
if(string.IsNullOrEmpty(General.Map.Config.DecorateGames)) return;
SndSeqParser parser = new SndSeqParser();
foreach(DataReader dr in containers) foreach(DataReader dr in containers)
{ {
currentreader = dr; currentreader = dr;
List<Stream> streams = dr.GetSndSeqData(); List<Stream> streams = dr.GetSndSeqData();
// Parse the data // Parse the data
foreach (Stream s in streams) foreach(Stream s in streams)
{ {
if(s != null) parser.Parse(s, "SNDSEQ"); if(s != null) parser.Parse(s, "SNDSEQ");
} }

View file

@ -646,7 +646,7 @@ namespace CodeImp.DoomBuilder
bool localscriptschanged = CheckScriptChanged(); bool localscriptschanged = CheckScriptChanged();
// If the scripts window is open, save the scripts first // If the scripts window is open, save the scripts first
if (IsScriptsWindowOpen) scriptwindow.Editor.ImplicitSave(); if(IsScriptsWindowOpen) scriptwindow.Editor.ImplicitSave();
// Only recompile scripts when the scripts have changed // Only recompile scripts when the scripts have changed
// (not when only the map changed) // (not when only the map changed)
@ -661,20 +661,20 @@ namespace CodeImp.DoomBuilder
// Show script window if there are any errors and we are going to test the map // Show script window if there are any errors and we are going to test the map
// and always update the errors on the scripts window. // and always update the errors on the scripts window.
if ((errors.Count > 0) && (scriptwindow == null) && (purpose == SavePurpose.Testing)) ShowScriptEditor(); if((errors.Count > 0) && (scriptwindow == null) && (purpose == SavePurpose.Testing)) ShowScriptEditor();
if (scriptwindow != null) scriptwindow.Editor.ShowErrors(errors); if(scriptwindow != null) scriptwindow.Editor.ShowErrors(errors);
// Only write the map and rebuild nodes when the actual map has changed // Only write the map and rebuild nodes when the actual map has changed
// (not when only scripts have changed) // (not when only scripts have changed)
if (changed) if(changed)
{ {
// Make a copy of the map data // Make a copy of the map data
MapSet outputset = map.Clone(); MapSet outputset = map.Clone();
// Remove all flags from all 3D Start things // Remove all flags from all 3D Start things
foreach (Thing t in outputset.Things) foreach(Thing t in outputset.Things)
{ {
if (t.Type == config.Start3DModeThingType) if(t.Type == config.Start3DModeThingType)
{ {
// We're not using SetFlag here, this doesn't have to be undone. // We're not using SetFlag here, this doesn't have to be undone.
// Please note that this is totally exceptional! // Please note that this is totally exceptional!
@ -685,7 +685,7 @@ namespace CodeImp.DoomBuilder
// Do we need sidedefs compression? // Do we need sidedefs compression?
StatusInfo oldstatus; StatusInfo oldstatus;
if (map.Sidedefs.Count > io.MaxSidedefs) if(map.Sidedefs.Count > io.MaxSidedefs)
{ {
// Compress sidedefs // Compress sidedefs
oldstatus = General.MainWindow.Status; oldstatus = General.MainWindow.Status;
@ -694,7 +694,7 @@ namespace CodeImp.DoomBuilder
General.MainWindow.DisplayStatus(oldstatus); General.MainWindow.DisplayStatus(oldstatus);
// Check if it still doesnt fit // Check if it still doesnt fit
if (outputset.Sidedefs.Count > io.MaxSidedefs) if(outputset.Sidedefs.Count > io.MaxSidedefs)
{ {
// Problem! Can't save the map like this! // Problem! Can't save the map like this!
General.ShowErrorMessage("Unable to save the map: There are too many unique sidedefs!", MessageBoxButtons.OK); General.ShowErrorMessage("Unable to save the map: There are too many unique sidedefs!", MessageBoxButtons.OK);
@ -703,28 +703,28 @@ namespace CodeImp.DoomBuilder
} }
// Check things // Check things
if (map.Things.Count > io.MaxThings) if(map.Things.Count > io.MaxThings)
{ {
General.ShowErrorMessage("Unable to save the map: There are too many things!", MessageBoxButtons.OK); General.ShowErrorMessage("Unable to save the map: There are too many things!", MessageBoxButtons.OK);
return false; return false;
} }
// Check sectors // Check sectors
if (map.Sectors.Count > io.MaxSectors) if(map.Sectors.Count > io.MaxSectors)
{ {
General.ShowErrorMessage("Unable to save the map: There are too many sectors!", MessageBoxButtons.OK); General.ShowErrorMessage("Unable to save the map: There are too many sectors!", MessageBoxButtons.OK);
return false; return false;
} }
// Check linedefs // Check linedefs
if (map.Linedefs.Count > io.MaxLinedefs) if(map.Linedefs.Count > io.MaxLinedefs)
{ {
General.ShowErrorMessage("Unable to save the map: There are too many linedefs!", MessageBoxButtons.OK); General.ShowErrorMessage("Unable to save the map: There are too many linedefs!", MessageBoxButtons.OK);
return false; return false;
} }
// Check vertices // Check vertices
if (map.Vertices.Count > io.MaxVertices) if(map.Vertices.Count > io.MaxVertices)
{ {
General.ShowErrorMessage("Unable to save the map: There are too many vertices!", MessageBoxButtons.OK); General.ShowErrorMessage("Unable to save the map: There are too many vertices!", MessageBoxButtons.OK);
return false; return false;
@ -1061,7 +1061,7 @@ namespace CodeImp.DoomBuilder
// Find the nodebuilder // Find the nodebuilder
NodebuilderInfo nodebuilder = General.GetNodebuilderByName(nodebuildername); NodebuilderInfo nodebuilder = General.GetNodebuilderByName(nodebuildername);
if (nodebuilder == null) if(nodebuilder == null)
{ {
// Problem! Can't find that nodebuilder! // Problem! Can't find that nodebuilder!
General.ShowWarningMessage("Unable to build the nodes: The configured nodebuilder cannot be found.\nPlease check your game configuration settings!", MessageBoxButtons.OK); General.ShowWarningMessage("Unable to build the nodes: The configured nodebuilder cannot be found.\nPlease check your game configuration settings!", MessageBoxButtons.OK);
@ -1103,7 +1103,7 @@ namespace CodeImp.DoomBuilder
buildwad.Dispose(); buildwad.Dispose();
// Does the nodebuilder require an output file? // Does the nodebuilder require an output file?
if (nodebuilder.HasSpecialOutputFile) if(nodebuilder.HasSpecialOutputFile)
{ {
// Make a temporary output file for the nodebuilder // Make a temporary output file for the nodebuilder
tempfile2 = General.MakeTempFilename(compiler.Location); tempfile2 = General.MakeTempFilename(compiler.Location);
@ -1121,23 +1121,23 @@ namespace CodeImp.DoomBuilder
compiler.OutputFile = Path.GetFileName(tempfile2); compiler.OutputFile = Path.GetFileName(tempfile2);
compiler.SourceFile = sourcefile; compiler.SourceFile = sourcefile;
compiler.WorkingDirectory = Path.GetDirectoryName(tempfile1); compiler.WorkingDirectory = Path.GetDirectoryName(tempfile1);
if (compiler.Run()) if(compiler.Run())
{ {
// Open the output file // Open the output file
try { buildwad = new WAD(tempfile2); } try { buildwad = new WAD(tempfile2); }
catch (Exception e) catch(Exception e)
{ {
General.WriteLogLine(e.GetType().Name + " while reading build wad file: " + e.Message); General.WriteLogLine(e.GetType().Name + " while reading build wad file: " + e.Message);
buildwad = null; buildwad = null;
} }
if (buildwad != null) if(buildwad != null)
{ {
// Output lumps complete? // Output lumps complete?
lumpscomplete = VerifyNodebuilderLumps(buildwad, BUILD_MAP_HEADER); lumpscomplete = VerifyNodebuilderLumps(buildwad, BUILD_MAP_HEADER);
} }
if (lumpscomplete) if(lumpscomplete)
{ {
// Copy nodebuilder lumps to temp file // Copy nodebuilder lumps to temp file
General.WriteLogLine("Copying nodebuilder lumps to temporary file..."); General.WriteLogLine("Copying nodebuilder lumps to temporary file...");
@ -1151,20 +1151,20 @@ namespace CodeImp.DoomBuilder
compilererrors += Environment.NewLine + e.description; compilererrors += Environment.NewLine + e.description;
// Nodebuilder did not build the lumps! // Nodebuilder did not build the lumps!
if (failaswarning) if(failaswarning)
General.ShowWarningMessage("Unable to build the nodes: The nodebuilder failed to build the expected data structures.\nThe map will be saved without the nodes." + (compiler.Errors.Length > 0 ? Environment.NewLine + compilererrors : ""), MessageBoxButtons.OK); General.ShowWarningMessage("Unable to build the nodes: The nodebuilder failed to build the expected data structures.\nThe map will be saved without the nodes." + (compiler.Errors.Length > 0 ? Environment.NewLine + compilererrors : ""), MessageBoxButtons.OK);
else else
General.ShowErrorMessage("Unable to build the nodes: The nodebuilder failed to build the expected data structures." + (compiler.Errors.Length > 0 ? Environment.NewLine + compilererrors : ""), MessageBoxButtons.OK); General.ShowErrorMessage("Unable to build the nodes: The nodebuilder failed to build the expected data structures." + (compiler.Errors.Length > 0 ? Environment.NewLine + compilererrors : ""), MessageBoxButtons.OK);
} }
// Done with the build wad // Done with the build wad
if (buildwad != null) buildwad.Dispose(); if(buildwad != null) buildwad.Dispose();
} }
else //mxd else //mxd
{ {
//collect errors //collect errors
string compilererrors = ""; string compilererrors = "";
foreach (CompilerError e in compiler.Errors) foreach(CompilerError e in compiler.Errors)
compilererrors += Environment.NewLine + e.description; compilererrors += Environment.NewLine + e.description;
// Nodebuilder did not build the lumps! // Nodebuilder did not build the lumps!
@ -1187,19 +1187,19 @@ namespace CodeImp.DoomBuilder
// Find the map header in source // Find the map header in source
int srcindex = wad.FindLumpIndex(mapheader); int srcindex = wad.FindLumpIndex(mapheader);
if (srcindex > -1) if(srcindex > -1)
{ {
// Go for all the map lump names // Go for all the map lump names
lumpscomplete = true; lumpscomplete = true;
foreach (KeyValuePair<string, MapLumpInfo> group in config.MapLumps) foreach(KeyValuePair<string, MapLumpInfo> group in config.MapLumps)
{ {
// Check if this lump should exist // Check if this lump should exist
if(group.Value.NodeBuild && !group.Value.AllowEmpty && group.Value.Required) if(group.Value.NodeBuild && !group.Value.AllowEmpty && group.Value.Required)
{ {
//mxd //mxd
string lumpname = group.Key; string lumpname = group.Key;
if (lumpname.Contains(CONFIG_MAP_HEADER)) lumpname = lumpname.Replace(CONFIG_MAP_HEADER, mapheader); if(lumpname.Contains(CONFIG_MAP_HEADER)) lumpname = lumpname.Replace(CONFIG_MAP_HEADER, mapheader);
// Find the lump in the source // Find the lump in the source
if(wad.FindLump(lumpname, srcindex, srcindex + config.MapLumps.Count + 2) == null) if(wad.FindLump(lumpname, srcindex, srcindex + config.MapLumps.Count + 2) == null)
@ -1224,7 +1224,7 @@ namespace CodeImp.DoomBuilder
public MemoryStream GetLumpData(string lumpname) public MemoryStream GetLumpData(string lumpname)
{ {
Lump l = tempwad.FindLump(lumpname); Lump l = tempwad.FindLump(lumpname);
if (l != null) if(l != null)
{ {
l.Stream.Seek(0, SeekOrigin.Begin); l.Stream.Seek(0, SeekOrigin.Begin);
return new MemoryStream(l.Stream.ReadAllBytes()); return new MemoryStream(l.Stream.ReadAllBytes());
@ -1239,7 +1239,7 @@ namespace CodeImp.DoomBuilder
// Remove the lump if it already exists // Remove the lump if it already exists
int li = tempwad.FindLumpIndex(lumpname); int li = tempwad.FindLumpIndex(lumpname);
if (li > -1) if(li > -1)
{ {
insertindex = li; insertindex = li;
tempwad.RemoveAt(li); tempwad.RemoveAt(li);
@ -1262,7 +1262,7 @@ namespace CodeImp.DoomBuilder
{ {
// Find the map header in target // Find the map header in target
int headerindex = target.FindLumpIndex(mapname); int headerindex = target.FindLumpIndex(mapname);
if (headerindex == -1) if(headerindex == -1)
{ {
// If this header doesnt exists in the target // If this header doesnt exists in the target
// then insert at the end of the target // then insert at the end of the target
@ -1273,7 +1273,7 @@ namespace CodeImp.DoomBuilder
int insertindex = headerindex; int insertindex = headerindex;
// Go for all the map lump names // Go for all the map lump names
foreach (KeyValuePair<string, MapLumpInfo> group in config.MapLumps) foreach(KeyValuePair<string, MapLumpInfo> group in config.MapLumps)
{ {
// Check if this lump is required // Check if this lump is required
if(group.Value.Required) if(group.Value.Required)
@ -1283,7 +1283,7 @@ namespace CodeImp.DoomBuilder
// Check if the lump is missing at the target // Check if the lump is missing at the target
int targetindex = FindSpecificLump(target, lumpname, headerindex, mapname, config.MapLumps); int targetindex = FindSpecificLump(target, lumpname, headerindex, mapname, config.MapLumps);
if (targetindex == -1) if(targetindex == -1)
{ {
// Determine target index // Determine target index
insertindex++; insertindex++;
@ -1321,8 +1321,8 @@ namespace CodeImp.DoomBuilder
//Remove lumps, which are not required //Remove lumps, which are not required
List<Lump> toRemove = new List<Lump>(); List<Lump> toRemove = new List<Lump>();
foreach (Lump lump in target.Lumps) foreach(Lump lump in target.Lumps)
if (!requiredLumps.Contains(lump.Name)) toRemove.Add(lump); if(!requiredLumps.Contains(lump.Name)) toRemove.Add(lump);
foreach (Lump lump in toRemove) target.Remove(lump); foreach (Lump lump in toRemove) target.Remove(lump);
} }
@ -1332,16 +1332,16 @@ namespace CodeImp.DoomBuilder
{ {
// Go for all lumps // Go for all lumps
bool skipping = false; bool skipping = false;
foreach (Lump srclump in source.Lumps) foreach(Lump srclump in source.Lumps)
{ {
// Check if we should stop skipping lumps here // Check if we should stop skipping lumps here
if (skipping) if(skipping)
{ {
//mxd //mxd
string srclumpname = srclump.Name; string srclumpname = srclump.Name;
if (srclumpname.Contains(sourcemapname)) srclumpname = srclumpname.Replace(sourcemapname, CONFIG_MAP_HEADER); if(srclumpname.Contains(sourcemapname)) srclumpname = srclumpname.Replace(sourcemapname, CONFIG_MAP_HEADER);
if (!mapconfig.MapLumps.ContainsKey(srclumpname)) if(!mapconfig.MapLumps.ContainsKey(srclumpname))
{ {
// Stop skipping // Stop skipping
skipping = false; skipping = false;
@ -1349,14 +1349,14 @@ namespace CodeImp.DoomBuilder
} }
// Check if we should start skipping lumps here // Check if we should start skipping lumps here
if (!skipping && (srclump.Name == sourcemapname)) if(!skipping && (srclump.Name == sourcemapname))
{ {
// We have encountered the map header, start skipping! // We have encountered the map header, start skipping!
skipping = true; skipping = true;
} }
// Not skipping this lump? // Not skipping this lump?
if (!skipping) if(!skipping)
{ {
// Copy lump over! // Copy lump over!
Lump tgtlump = target.Insert(srclump.Name, target.Lumps.Count, srclump.Length); Lump tgtlump = target.Insert(srclump.Name, target.Lumps.Count, srclump.Length);
@ -1373,7 +1373,7 @@ namespace CodeImp.DoomBuilder
{ {
// Find the map header in target // Find the map header in target
int tgtheaderindex = target.FindLumpIndex(targetmapname); int tgtheaderindex = target.FindLumpIndex(targetmapname);
if (tgtheaderindex == -1) if(tgtheaderindex == -1)
{ {
// If this header doesnt exists in the target // If this header doesnt exists in the target
// then insert at the end of the target // then insert at the end of the target
@ -1385,10 +1385,10 @@ namespace CodeImp.DoomBuilder
// Find the map header in source // Find the map header in source
int srcheaderindex = source.FindLumpIndex(sourcemapname); int srcheaderindex = source.FindLumpIndex(sourcemapname);
if (srcheaderindex > -1) if(srcheaderindex > -1)
{ {
// Go for all the map lump names // Go for all the map lump names
foreach (KeyValuePair<string, MapLumpInfo> group in config.MapLumps) foreach(KeyValuePair<string, MapLumpInfo> group in config.MapLumps)
{ {
// Check if this lump should be copied // Check if this lump should be copied
if((group.Value.Required && copyrequired) || (group.Value.BlindCopy && copyblindcopy) || if((group.Value.Required && copyrequired) || (group.Value.BlindCopy && copyblindcopy) ||
@ -1400,7 +1400,7 @@ namespace CodeImp.DoomBuilder
// Find the lump in the source // Find the lump in the source
int sourceindex = FindSpecificLump(source, srclumpname, srcheaderindex, sourcemapname, config.MapLumps); int sourceindex = FindSpecificLump(source, srclumpname, srcheaderindex, sourcemapname, config.MapLumps);
if (sourceindex > -1) if(sourceindex > -1)
{ {
// Remove lump at target // Remove lump at target
int lumpindex = RemoveSpecificLump(target, tgtlumpname, tgtheaderindex, targetmapname, config.MapLumps); int lumpindex = RemoveSpecificLump(target, tgtlumpname, tgtheaderindex, targetmapname, config.MapLumps);
@ -1439,19 +1439,19 @@ namespace CodeImp.DoomBuilder
// because when an unknown lump is met, this search must stop. // because when an unknown lump is met, this search must stop.
// Go for all lumps in order to find the specified lump // Go for all lumps in order to find the specified lump
for (int i = 0; i < maplumps.Count + 1; i++) for(int i = 0; i < maplumps.Count + 1; i++)
{ {
// Still within bounds? // Still within bounds?
if ((mapheaderindex + i) < source.Lumps.Count) if((mapheaderindex + i) < source.Lumps.Count)
{ {
// Check if this is a known lump name // Check if this is a known lump name
string srclumpname = source.Lumps[mapheaderindex + i].Name; //mxd string srclumpname = source.Lumps[mapheaderindex + i].Name; //mxd
if (srclumpname.Contains(mapheadername)) srclumpname = srclumpname.Replace(mapheadername, CONFIG_MAP_HEADER); if(srclumpname.Contains(mapheadername)) srclumpname = srclumpname.Replace(mapheadername, CONFIG_MAP_HEADER);
if (maplumps.ContainsKey(srclumpname)) //mxd if(maplumps.ContainsKey(srclumpname)) //mxd
{ {
// Is this the lump we are looking for? // Is this the lump we are looking for?
if (source.Lumps[mapheaderindex + i].Name == lumpname) if(source.Lumps[mapheaderindex + i].Name == lumpname)
{ {
// Return this index // Return this index
return mapheaderindex + i; return mapheaderindex + i;
@ -1475,7 +1475,7 @@ namespace CodeImp.DoomBuilder
{ {
// Find the specific lump index // Find the specific lump index
int lumpindex = FindSpecificLump(source, lumpname, mapheaderindex, mapheadername, maplumps); int lumpindex = FindSpecificLump(source, lumpname, mapheaderindex, mapheadername, maplumps);
if (lumpindex > -1) if(lumpindex > -1)
{ {
// Remove this lump // Remove this lump
//General.WriteLogLine(lumpname + " removed"); //General.WriteLogLine(lumpname + " removed");
@ -1610,24 +1610,24 @@ namespace CodeImp.DoomBuilder
{ {
Cursor.Current = Cursors.WaitCursor; Cursor.Current = Cursors.WaitCursor;
if (scriptwindow == null) if(scriptwindow == null)
{ {
// Load the window // Load the window
scriptwindow = new ScriptEditorForm(); scriptwindow = new ScriptEditorForm();
} }
// Window not yet visible? // Window not yet visible?
if (!scriptwindow.Visible) if(!scriptwindow.Visible)
{ {
// Show the window // Show the window
if (General.Settings.ScriptOnTop) if(General.Settings.ScriptOnTop)
{ {
if (scriptwindow.Visible && (scriptwindow.Owner == null)) scriptwindow.Hide(); if(scriptwindow.Visible && (scriptwindow.Owner == null)) scriptwindow.Hide();
scriptwindow.Show(General.MainWindow); scriptwindow.Show(General.MainWindow);
} }
else else
{ {
if (scriptwindow.Visible && (scriptwindow.Owner != null)) scriptwindow.Hide(); if(scriptwindow.Visible && (scriptwindow.Owner != null)) scriptwindow.Hide();
scriptwindow.Show(); scriptwindow.Show();
} }
} }
@ -1643,7 +1643,7 @@ namespace CodeImp.DoomBuilder
internal bool AskSaveScriptChanges() internal bool AskSaveScriptChanges()
{ {
// Window open? // Window open?
if (scriptwindow != null) if(scriptwindow != null)
{ {
// Ask to save changes // Ask to save changes
// This also saves implicitly // This also saves implicitly
@ -1666,15 +1666,15 @@ namespace CodeImp.DoomBuilder
// the window is already in the closing process // the window is already in the closing process
internal void CloseScriptEditor(bool closing) internal void CloseScriptEditor(bool closing)
{ {
if (scriptwindow != null) if(scriptwindow != null)
{ {
if (!scriptwindow.IsDisposed) if(!scriptwindow.IsDisposed)
{ {
// Remember what files were open // Remember what files were open
scriptwindow.Editor.WriteOpenFilesToConfiguration(); scriptwindow.Editor.WriteOpenFilesToConfiguration();
// Close now // Close now
if (!closing) scriptwindow.Close(); if(!closing) scriptwindow.Close();
} }
// Done // Done
@ -1685,7 +1685,7 @@ namespace CodeImp.DoomBuilder
// This checks if the scripts are changed // This checks if the scripts are changed
internal bool CheckScriptChanged() internal bool CheckScriptChanged()
{ {
if (scriptwindow != null) if(scriptwindow != null)
{ {
// Check if scripts are changed // Check if scripts are changed
return scriptschanged || scriptwindow.Editor.CheckImplicitChanges(); return scriptschanged || scriptwindow.Editor.CheckImplicitChanges();
@ -1702,7 +1702,7 @@ namespace CodeImp.DoomBuilder
errors.Clear(); errors.Clear();
// Go for all the map lumps // Go for all the map lumps
foreach (MapLumpInfo lumpinfo in config.MapLumps.Values) foreach(MapLumpInfo lumpinfo in config.MapLumps.Values)
{ {
// Is this a script lump? // Is this a script lump?
if(lumpinfo.Script != null || lumpinfo.ScriptBuild) if(lumpinfo.Script != null || lumpinfo.ScriptBuild)
@ -1750,9 +1750,9 @@ namespace CodeImp.DoomBuilder
if (scriptconfig.Compiler == null) return true; if (scriptconfig.Compiler == null) return true;
// Find the lump // Find the lump
if (lumpname == CONFIG_MAP_HEADER) reallumpname = TEMP_MAP_HEADER; if(lumpname == CONFIG_MAP_HEADER) reallumpname = TEMP_MAP_HEADER;
Lump lump = tempwad.FindLump(reallumpname); Lump lump = tempwad.FindLump(reallumpname);
if (lump == null) throw new Exception("No such lump in temporary wad file '" + reallumpname + "'."); if(lump == null) throw new Exception("No such lump in temporary wad file '" + reallumpname + "'.");
// Determine source file // Determine source file
string sourcefile = (filepathname.Length > 0 ? filepathname : tempwad.Filename); string sourcefile = (filepathname.Length > 0 ? filepathname : tempwad.Filename);
@ -1870,14 +1870,14 @@ namespace CodeImp.DoomBuilder
List<ScriptItem> numberedscriptslist = new List<ScriptItem>(); List<ScriptItem> numberedscriptslist = new List<ScriptItem>();
// Load the script lumps // Load the script lumps
foreach (MapLumpInfo maplumpinfo in config.MapLumps.Values) foreach(MapLumpInfo maplumpinfo in config.MapLumps.Values)
{ {
// Is this a script lump? // Is this a script lump?
if ((maplumpinfo.ScriptBuild || maplumpinfo.Script != null) && maplumpinfo.Name == "SCRIPTS") if((maplumpinfo.ScriptBuild || maplumpinfo.Script != null) && maplumpinfo.Name == "SCRIPTS")
{ {
// Load the lump data // Load the lump data
MemoryStream stream = GetLumpData(maplumpinfo.Name); MemoryStream stream = GetLumpData(maplumpinfo.Name);
if (stream != null) if(stream != null)
{ {
// Get script names // Get script names
AcsParserSE parser = new AcsParserSE(); AcsParserSE parser = new AcsParserSE();
@ -1941,10 +1941,10 @@ namespace CodeImp.DoomBuilder
public void ChangeThingFilter(ThingsFilter newfilter) public void ChangeThingFilter(ThingsFilter newfilter)
{ {
// We have a special filter for null // We have a special filter for null
if (newfilter == null) newfilter = new NullThingsFilter(); if(newfilter == null) newfilter = new NullThingsFilter();
// Deactivate old filter // Deactivate old filter
if (thingsfilter != null) thingsfilter.Deactivate(); if(thingsfilter != null) thingsfilter.Deactivate();
// Change // Change
thingsfilter = newfilter; thingsfilter = newfilter;
@ -1964,7 +1964,7 @@ namespace CodeImp.DoomBuilder
{ {
// Let the plugin and editing mode know // Let the plugin and editing mode know
General.Plugins.OnMapSetChangeBegin(); General.Plugins.OnMapSetChangeBegin();
if (General.Editing.Mode != null) General.Editing.Mode.OnMapSetChangeBegin(); if(General.Editing.Mode != null) General.Editing.Mode.OnMapSetChangeBegin();
this.visualcamera.Sector = null; this.visualcamera.Sector = null;
// Can't have a selection in an old map set // Can't have a selection in an old map set
@ -1983,7 +1983,7 @@ namespace CodeImp.DoomBuilder
// Let the plugin and editing mode know // Let the plugin and editing mode know
General.Plugins.OnMapSetChangeEnd(); General.Plugins.OnMapSetChangeEnd();
if (General.Editing.Mode != null) General.Editing.Mode.OnMapSetChangeEnd(); if(General.Editing.Mode != null) General.Editing.Mode.OnMapSetChangeEnd();
} }
// This reloads resources // This reloads resources
@ -2002,11 +2002,11 @@ namespace CodeImp.DoomBuilder
ReloadResources(); ReloadResources();
if (General.ErrorLogger.IsErrorAdded) if(General.ErrorLogger.IsErrorAdded)
{ {
// Show any errors if preferred // Show any errors if preferred
General.MainWindow.DisplayStatus(StatusType.Warning, "There were errors during resources loading!"); General.MainWindow.DisplayStatus(StatusType.Warning, "There were errors during resources loading!");
if (General.Settings.ShowErrorsWindow) General.MainWindow.ShowErrors(); if(General.Settings.ShowErrorsWindow) General.MainWindow.ShowErrors();
} }
else else
{ {
@ -2046,7 +2046,7 @@ namespace CodeImp.DoomBuilder
// Reload data resources // Reload data resources
General.WriteLogLine("Reloading data resources..."); General.WriteLogLine("Reloading data resources...");
data = new DataManager(); data = new DataManager();
if (!string.IsNullOrEmpty(filepathname)) if(!string.IsNullOrEmpty(filepathname))
{ {
DataLocation maplocation = new DataLocation(DataLocation.RESOURCE_WAD, filepathname, false, false, false); DataLocation maplocation = new DataLocation(DataLocation.RESOURCE_WAD, filepathname, false, false, false);
data.Load(configinfo.Resources, options.Resources, maplocation); data.Load(configinfo.Resources, options.Resources, maplocation);
@ -2066,7 +2066,7 @@ namespace CodeImp.DoomBuilder
General.Plugins.ReloadResources(); General.Plugins.ReloadResources();
// Inform editing mode that the resources are reloaded // Inform editing mode that the resources are reloaded
if (General.Editing.Mode != null) General.Editing.Mode.OnReloadResources(); if(General.Editing.Mode != null) General.Editing.Mode.OnReloadResources();
// Reset status // Reset status
General.MainWindow.DisplayStatus(oldstatus); General.MainWindow.DisplayStatus(oldstatus);
@ -2085,7 +2085,7 @@ namespace CodeImp.DoomBuilder
// Show map options dialog // Show map options dialog
MapOptionsForm optionsform = new MapOptionsForm(options, false); MapOptionsForm optionsform = new MapOptionsForm(options, false);
if (optionsform.ShowDialog(General.MainWindow) == DialogResult.OK) if(optionsform.ShowDialog(General.MainWindow) == DialogResult.OK)
{ {
// Update interface // Update interface
//General.MainWindow.UpdateInterface(); //General.MainWindow.UpdateInterface();
@ -2211,7 +2211,7 @@ namespace CodeImp.DoomBuilder
} }
// Anything to snap? // Anything to snap?
if (vertstosnap.Count == 0 && things.Count == 0) if(vertstosnap.Count == 0 && things.Count == 0)
{ {
General.Interface.DisplayStatus(StatusType.Warning, "Select any map element first!"); General.Interface.DisplayStatus(StatusType.Warning, "Select any map element first!");
return; return;
@ -2235,17 +2235,17 @@ namespace CodeImp.DoomBuilder
if(snappedthings > 0) message.Add(snappedthings + " things"); if(snappedthings > 0) message.Add(snappedthings + " things");
// Map changed? // Map changed?
if (message.Count > 0) if(message.Count > 0)
{ {
// Display status // Display status
General.Interface.DisplayStatus(StatusType.Info, "Snapped " + string.Join(" and ", message.ToArray())); General.Interface.DisplayStatus(StatusType.Info, "Snapped " + string.Join(" and ", message.ToArray()));
// Warn the user // Warn the user
if(snappedverts > 0) /*if(snappedverts > 0)
{ {
MessageBox.Show("Snapped " + snappedverts + " vertices to grid." + Environment.NewLine + MessageBox.Show("Snapped " + snappedverts + " vertices to grid." + Environment.NewLine +
"It's a good idea to run Map Analysis Mode now."); "It's a good idea to run Map Analysis Mode now.");
} }*/
// Invoke clear selection to update sector highlight overlay // Invoke clear selection to update sector highlight overlay
General.Actions.InvokeAction("builder_clearselection"); General.Actions.InvokeAction("builder_clearselection");

View file

@ -377,67 +377,53 @@ namespace CodeImp.DoomBuilder.Rendering
// This resets the device and returns true on success // This resets the device and returns true on success
internal bool Reset() internal bool Reset()
{ {
// Test the cooperative level // Unload all Direct3D resources
//Result coopresult = device.TestCooperativeLevel(); foreach(ID3DResource res in resources.Values) res.UnloadResource();
// Can we reset? // Lose backbuffers
//if(coopresult.Name != "D3DERR_DEVICENOTRESET") if(backbuffer != null) backbuffer.Dispose();
if(depthbuffer != null) depthbuffer.Dispose();
backbuffer = null;
depthbuffer = null;
try
{ {
// Unload all Direct3D resources // Make present parameters
foreach(ID3DResource res in resources.Values) res.UnloadResource(); PresentParameters displaypp = CreatePresentParameters(adapter);
// Lose backbuffers
if(backbuffer != null) backbuffer.Dispose();
if(depthbuffer != null) depthbuffer.Dispose();
backbuffer = null;
depthbuffer = null;
try
{
// Make present parameters
PresentParameters displaypp = CreatePresentParameters(adapter);
// Reset the device
device.Reset(displaypp);
}
#if DEBUG
catch(Exception e)
{
// Failed to re-initialize
Console.WriteLine("Device reset failed: " + e.Message);
return false;
}
#else
catch (Exception)
{
// Failed to re-initialize
return false;
}
#endif
// Keep a reference to the original buffers
backbuffer = device.GetBackBuffer(0, 0);
depthbuffer = device.DepthStencilSurface;
// Get the viewport
viewport = device.Viewport;
// Reload all Direct3D resources
foreach(ID3DResource res in resources.Values) res.ReloadResource();
// Re-apply settings
SetupSettings();
// Success // Reset the device
return true; device.Reset(displaypp);
} }
/* #if DEBUG
else catch(Exception e)
{ {
// Failed // Failed to re-initialize
Console.WriteLine("Device reset failed: " + e.Message);
return false; return false;
} }
*/ #else
catch(Exception)
{
// Failed to re-initialize
return false;
}
#endif
// Keep a reference to the original buffers
backbuffer = device.GetBackBuffer(0, 0);
depthbuffer = device.DepthStencilSurface;
// Get the viewport
viewport = device.Viewport;
// Reload all Direct3D resources
foreach(ID3DResource res in resources.Values) res.ReloadResource();
// Re-apply settings
SetupSettings();
// Success
return true;
} }
#endregion #endregion

View file

@ -58,6 +58,7 @@ namespace CodeImp.DoomBuilder.VisualModes
private VertexBuffer cagebuffer; //mxd private VertexBuffer cagebuffer; //mxd
private int cagelength; //mxd private int cagelength; //mxd
private bool updategeo; private bool updategeo;
private bool updatecage; //mxd
private int triangles; private int triangles;
// Rendering // Rendering
@ -212,10 +213,13 @@ namespace CodeImp.DoomBuilder.VisualModes
// This is called before a device is reset (when resized or display adapter was changed) // This is called before a device is reset (when resized or display adapter was changed)
public void UnloadResource() public void UnloadResource()
{ {
// Trash geometry buffer // Trash geometry buffers
if(geobuffer != null) geobuffer.Dispose(); if(geobuffer != null) geobuffer.Dispose();
geobuffer = null; geobuffer = null;
if(cagebuffer != null) cagebuffer.Dispose(); //mxd
cagebuffer = null; //mxd
updategeo = true; updategeo = true;
updatecage = true; //mxd
} }
// This is called resets when the device is reset // This is called resets when the device is reset
@ -229,83 +233,10 @@ namespace CodeImp.DoomBuilder.VisualModes
/// <summary> /// <summary>
/// Sets the color of the cage around the thing geometry and rebuilds the thing cage. /// Sets the color of the cage around the thing geometry and rebuilds the thing cage.
/// </summary> /// </summary>
protected void UpdateThingCage(PixelColor color) protected void SetCageColor(PixelColor color)
{ {
cagecolor = color.ToColorValue(); cagecolor = color.ToColorValue();
updatecage = true;
// Trash cage buffer
if(cagebuffer != null) cagebuffer.Dispose();
cagebuffer = null;
// Make a new cage
List<WorldVertex> cageverts;
if(sizeless)
{
WorldVertex v0 = new WorldVertex(-info.Radius + position_v3.X, -info.Radius + position_v3.Y, position_v3.Z);
WorldVertex v1 = new WorldVertex(info.Radius + position_v3.X, info.Radius + position_v3.Y, position_v3.Z);
WorldVertex v2 = new WorldVertex(info.Radius + position_v3.X, -info.Radius + position_v3.Y, position_v3.Z);
WorldVertex v3 = new WorldVertex(-info.Radius + position_v3.X, info.Radius + position_v3.Y, position_v3.Z);
WorldVertex v4 = new WorldVertex(position_v3.X, position_v3.Y, info.Radius + position_v3.Z);
WorldVertex v5 = new WorldVertex(position_v3.X, position_v3.Y, -info.Radius + position_v3.Z);
cageverts = new List<WorldVertex>(new[] { v0, v1, v2, v3, v4, v5 });
}
else
{
float top = position_v3.Z + info.Height;
float bottom = position_v3.Z;
WorldVertex v0 = new WorldVertex(-info.Radius + position_v3.X, -info.Radius + position_v3.Y, bottom);
WorldVertex v1 = new WorldVertex(-info.Radius + position_v3.X, info.Radius + position_v3.Y, bottom);
WorldVertex v2 = new WorldVertex(info.Radius + position_v3.X, info.Radius + position_v3.Y, bottom);
WorldVertex v3 = new WorldVertex(info.Radius + position_v3.X, -info.Radius + position_v3.Y, bottom);
WorldVertex v4 = new WorldVertex(-info.Radius + position_v3.X, -info.Radius + position_v3.Y, top);
WorldVertex v5 = new WorldVertex(-info.Radius + position_v3.X, info.Radius + position_v3.Y, top);
WorldVertex v6 = new WorldVertex(info.Radius + position_v3.X, info.Radius + position_v3.Y, top);
WorldVertex v7 = new WorldVertex(info.Radius + position_v3.X, -info.Radius + position_v3.Y, top);
cageverts = new List<WorldVertex>(new[] { v0, v1,
v1, v2,
v2, v3,
v3, v0,
v4, v5,
v5, v6,
v6, v7,
v7, v4,
v0, v4,
v1, v5,
v2, v6,
v3, v7 });
}
// Make new arrow
if(Thing.IsDirectional)
{
Matrix transform = Matrix.Scaling(info.Radius, info.Radius, info.Radius)
* (Matrix.RotationY(-Thing.RollRad) * Matrix.RotationX(-Thing.PitchRad) * Matrix.RotationZ(Thing.Angle))
* (sizeless ? position : position * Matrix.Translation(0.0f, 0.0f, thingheight / 2f));
WorldVertex a0 = new WorldVertex(Vector3D.Transform(0.0f, 0.0f, 0.0f, transform)); //start
WorldVertex a1 = new WorldVertex(Vector3D.Transform(0.0f, -1.5f, 0.0f, transform)); //end
WorldVertex a2 = new WorldVertex(Vector3D.Transform(0.2f, -1.1f, 0.2f, transform));
WorldVertex a3 = new WorldVertex(Vector3D.Transform(-0.2f, -1.1f, 0.2f, transform));
WorldVertex a4 = new WorldVertex(Vector3D.Transform(0.2f, -1.1f, -0.2f, transform));
WorldVertex a5 = new WorldVertex(Vector3D.Transform(-0.2f, -1.1f, -0.2f, transform));
cageverts.AddRange(new[] { a0, a1,
a1, a2,
a1, a3,
a1, a4,
a1, a5 });
}
// Create buffer
WorldVertex[] cv = cageverts.ToArray();
cagelength = cv.Length / 2;
cagebuffer = new VertexBuffer(General.Map.Graphics.Device, WorldVertex.Stride * cv.Length, Usage.WriteOnly | Usage.Dynamic, VertexFormat.None, Pool.Default);
cagebuffer.Lock(0, WorldVertex.Stride * cv.Length, LockFlags.None).WriteRange(cv);
cagebuffer.Unlock();
} }
/// <summary> /// <summary>
@ -316,6 +247,7 @@ namespace CodeImp.DoomBuilder.VisualModes
position_v3 = D3DDevice.V3(pos); //mxd position_v3 = D3DDevice.V3(pos); //mxd
position = Matrix.Translation(position_v3); position = Matrix.Translation(position_v3);
updategeo = true; updategeo = true;
updatecage = true; //mxd
//mxd. update bounding box? //mxd. update bounding box?
if(lightType != DynamicLightType.NONE && lightRadius > thing.Size) if(lightType != DynamicLightType.NONE && lightRadius > thing.Size)
@ -484,6 +416,87 @@ namespace CodeImp.DoomBuilder.VisualModes
// Done // Done
updategeo = false; updategeo = false;
} }
//mxd. Need to update thing cage?
if(updatecage)
{
// Trash cage buffer
if(cagebuffer != null) cagebuffer.Dispose();
cagebuffer = null;
// Make a new cage
List<WorldVertex> cageverts;
if(sizeless)
{
WorldVertex v0 = new WorldVertex(-info.Radius + position_v3.X, -info.Radius + position_v3.Y, position_v3.Z);
WorldVertex v1 = new WorldVertex(info.Radius + position_v3.X, info.Radius + position_v3.Y, position_v3.Z);
WorldVertex v2 = new WorldVertex(info.Radius + position_v3.X, -info.Radius + position_v3.Y, position_v3.Z);
WorldVertex v3 = new WorldVertex(-info.Radius + position_v3.X, info.Radius + position_v3.Y, position_v3.Z);
WorldVertex v4 = new WorldVertex(position_v3.X, position_v3.Y, info.Radius + position_v3.Z);
WorldVertex v5 = new WorldVertex(position_v3.X, position_v3.Y, -info.Radius + position_v3.Z);
cageverts = new List<WorldVertex>(new[] { v0, v1, v2, v3, v4, v5 });
}
else
{
float top = position_v3.Z + info.Height;
float bottom = position_v3.Z;
WorldVertex v0 = new WorldVertex(-info.Radius + position_v3.X, -info.Radius + position_v3.Y, bottom);
WorldVertex v1 = new WorldVertex(-info.Radius + position_v3.X, info.Radius + position_v3.Y, bottom);
WorldVertex v2 = new WorldVertex(info.Radius + position_v3.X, info.Radius + position_v3.Y, bottom);
WorldVertex v3 = new WorldVertex(info.Radius + position_v3.X, -info.Radius + position_v3.Y, bottom);
WorldVertex v4 = new WorldVertex(-info.Radius + position_v3.X, -info.Radius + position_v3.Y, top);
WorldVertex v5 = new WorldVertex(-info.Radius + position_v3.X, info.Radius + position_v3.Y, top);
WorldVertex v6 = new WorldVertex(info.Radius + position_v3.X, info.Radius + position_v3.Y, top);
WorldVertex v7 = new WorldVertex(info.Radius + position_v3.X, -info.Radius + position_v3.Y, top);
cageverts = new List<WorldVertex>(new[] { v0, v1,
v1, v2,
v2, v3,
v3, v0,
v4, v5,
v5, v6,
v6, v7,
v7, v4,
v0, v4,
v1, v5,
v2, v6,
v3, v7 });
}
// Make new arrow
if(Thing.IsDirectional)
{
Matrix transform = Matrix.Scaling(info.Radius, info.Radius, info.Radius)
* (Matrix.RotationY(-Thing.RollRad) * Matrix.RotationX(-Thing.PitchRad) * Matrix.RotationZ(Thing.Angle))
* (sizeless ? position : position * Matrix.Translation(0.0f, 0.0f, thingheight / 2f));
WorldVertex a0 = new WorldVertex(Vector3D.Transform(0.0f, 0.0f, 0.0f, transform)); //start
WorldVertex a1 = new WorldVertex(Vector3D.Transform(0.0f, -1.5f, 0.0f, transform)); //end
WorldVertex a2 = new WorldVertex(Vector3D.Transform(0.2f, -1.1f, 0.2f, transform));
WorldVertex a3 = new WorldVertex(Vector3D.Transform(-0.2f, -1.1f, 0.2f, transform));
WorldVertex a4 = new WorldVertex(Vector3D.Transform(0.2f, -1.1f, -0.2f, transform));
WorldVertex a5 = new WorldVertex(Vector3D.Transform(-0.2f, -1.1f, -0.2f, transform));
cageverts.AddRange(new[] { a0, a1,
a1, a2,
a1, a3,
a1, a4,
a1, a5 });
}
// Create buffer
WorldVertex[] cv = cageverts.ToArray();
cagelength = cv.Length / 2;
cagebuffer = new VertexBuffer(General.Map.Graphics.Device, WorldVertex.Stride * cv.Length, Usage.WriteOnly | Usage.Dynamic, VertexFormat.None, Pool.Default);
cagebuffer.Lock(0, WorldVertex.Stride * cv.Length, LockFlags.None).WriteRange(cv);
cagebuffer.Unlock();
// Done
updatecage = false;
}
} }
//mxd //mxd

View file

@ -793,9 +793,9 @@ namespace CodeImp.DoomBuilder.Windows
bool formatinterfacesmatch = havecopiedconfig && current.FormatInterface == configinfocopy.FormatInterface; bool formatinterfacesmatch = havecopiedconfig && current.FormatInterface == configinfocopy.FormatInterface;
pasteall.Enabled = formatinterfacesmatch; pasteall.Enabled = formatinterfacesmatch;
pasteengines.Enabled = havecopiedconfig; pasteengines.Enabled = (havecopiedconfig && configinfocopy.TestEngines.Count > 0);
pasteresources.Enabled = havecopiedconfig; pasteresources.Enabled = (havecopiedconfig && configinfocopy.Resources.Count > 0);
pastecolorpresets.Enabled = formatinterfacesmatch; pastecolorpresets.Enabled = (formatinterfacesmatch && configinfocopy.LinedefColorPresets.Length > 0);
} }
private void copyall_Click(object sender, EventArgs e) private void copyall_Click(object sender, EventArgs e)
@ -817,6 +817,7 @@ namespace CodeImp.DoomBuilder.Windows
current.PasteFrom(configinfocopy); current.PasteFrom(configinfocopy);
//update display //update display
cbEngineSelector.Text = string.Empty; // Otherwise current text from cbEngineSelector will override the pasted one
listconfigs_SelectedIndexChanged(listconfigs, EventArgs.Empty); listconfigs_SelectedIndexChanged(listconfigs, EventArgs.Empty);
General.Interface.DisplayStatus(StatusType.Info, "Pasted game configuration from '" + configinfocopy.Name + "'"); General.Interface.DisplayStatus(StatusType.Info, "Pasted game configuration from '" + configinfocopy.Name + "'");
} }
@ -843,6 +844,7 @@ namespace CodeImp.DoomBuilder.Windows
current.PasteTestEnginesFrom(configinfocopy); current.PasteTestEnginesFrom(configinfocopy);
//update display //update display
cbEngineSelector.Text = string.Empty; // Otherwise current text from cbEngineSelector will override the pasted one
listconfigs_SelectedIndexChanged(listconfigs, EventArgs.Empty); listconfigs_SelectedIndexChanged(listconfigs, EventArgs.Empty);
General.Interface.DisplayStatus(StatusType.Info, "Pasted engines list from '" + configinfocopy.Name + "'"); General.Interface.DisplayStatus(StatusType.Info, "Pasted engines list from '" + configinfocopy.Name + "'");
} }

View file

@ -130,8 +130,8 @@ namespace CodeImp.DoomBuilder.Windows
this.configurationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.configurationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.preferencesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.preferencesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.seperatortoolsconfig = new System.Windows.Forms.ToolStripSeparator(); this.seperatortoolsconfig = new System.Windows.Forms.ToolStripSeparator();
this.screenshotToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.itemsavescreenshot = new System.Windows.Forms.ToolStripMenuItem();
this.editAreaScreenshotToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.itemsaveeditareascreenshot = new System.Windows.Forms.ToolStripMenuItem();
this.separatortoolsscreenshots = new System.Windows.Forms.ToolStripSeparator(); this.separatortoolsscreenshots = new System.Windows.Forms.ToolStripSeparator();
this.itemtestmap = new System.Windows.Forms.ToolStripMenuItem(); this.itemtestmap = new System.Windows.Forms.ToolStripMenuItem();
this.menuhelp = new System.Windows.Forms.ToolStripMenuItem(); this.menuhelp = new System.Windows.Forms.ToolStripMenuItem();
@ -1034,8 +1034,8 @@ namespace CodeImp.DoomBuilder.Windows
this.configurationToolStripMenuItem, this.configurationToolStripMenuItem,
this.preferencesToolStripMenuItem, this.preferencesToolStripMenuItem,
this.seperatortoolsconfig, this.seperatortoolsconfig,
this.screenshotToolStripMenuItem, this.itemsavescreenshot,
this.editAreaScreenshotToolStripMenuItem, this.itemsaveeditareascreenshot,
this.separatortoolsscreenshots, this.separatortoolsscreenshots,
this.itemtestmap}); this.itemtestmap});
this.menutools.Name = "menutools"; this.menutools.Name = "menutools";
@ -1108,23 +1108,23 @@ namespace CodeImp.DoomBuilder.Windows
this.seperatortoolsconfig.Name = "seperatortoolsconfig"; this.seperatortoolsconfig.Name = "seperatortoolsconfig";
this.seperatortoolsconfig.Size = new System.Drawing.Size(243, 6); this.seperatortoolsconfig.Size = new System.Drawing.Size(243, 6);
// //
// screenshotToolStripMenuItem // itemsavescreenshot
// //
this.screenshotToolStripMenuItem.Image = global::CodeImp.DoomBuilder.Properties.Resources.Screenshot; this.itemsavescreenshot.Image = global::CodeImp.DoomBuilder.Properties.Resources.Screenshot;
this.screenshotToolStripMenuItem.Name = "screenshotToolStripMenuItem"; this.itemsavescreenshot.Name = "itemsavescreenshot";
this.screenshotToolStripMenuItem.Size = new System.Drawing.Size(246, 22); this.itemsavescreenshot.Size = new System.Drawing.Size(246, 22);
this.screenshotToolStripMenuItem.Tag = "builder_savescreenshot"; this.itemsavescreenshot.Tag = "builder_savescreenshot";
this.screenshotToolStripMenuItem.Text = "Save Screenshot"; this.itemsavescreenshot.Text = "Save Screenshot";
this.screenshotToolStripMenuItem.Click += new System.EventHandler(this.InvokeTaggedAction); this.itemsavescreenshot.Click += new System.EventHandler(this.InvokeTaggedAction);
// //
// editAreaScreenshotToolStripMenuItem // itemsaveeditareascreenshot
// //
this.editAreaScreenshotToolStripMenuItem.Image = global::CodeImp.DoomBuilder.Properties.Resources.ScreenshotActiveWindow; this.itemsaveeditareascreenshot.Image = global::CodeImp.DoomBuilder.Properties.Resources.ScreenshotActiveWindow;
this.editAreaScreenshotToolStripMenuItem.Name = "editAreaScreenshotToolStripMenuItem"; this.itemsaveeditareascreenshot.Name = "itemsaveeditareascreenshot";
this.editAreaScreenshotToolStripMenuItem.Size = new System.Drawing.Size(246, 22); this.itemsaveeditareascreenshot.Size = new System.Drawing.Size(246, 22);
this.editAreaScreenshotToolStripMenuItem.Tag = "builder_saveeditareascreenshot"; this.itemsaveeditareascreenshot.Tag = "builder_saveeditareascreenshot";
this.editAreaScreenshotToolStripMenuItem.Text = "Save Screenshot (active window)"; this.itemsaveeditareascreenshot.Text = "Save Screenshot (active window)";
this.editAreaScreenshotToolStripMenuItem.Click += new System.EventHandler(this.InvokeTaggedAction); this.itemsaveeditareascreenshot.Click += new System.EventHandler(this.InvokeTaggedAction);
// //
// separatortoolsscreenshots // separatortoolsscreenshots
// //
@ -2638,8 +2638,8 @@ namespace CodeImp.DoomBuilder.Windows
private System.Windows.Forms.ToolStripMenuItem toggleTesting; private System.Windows.Forms.ToolStripMenuItem toggleTesting;
private System.Windows.Forms.ToolStripMenuItem toggleRendering; private System.Windows.Forms.ToolStripMenuItem toggleRendering;
private System.Windows.Forms.ToolStripSeparator separatortoolsscreenshots; private System.Windows.Forms.ToolStripSeparator separatortoolsscreenshots;
private System.Windows.Forms.ToolStripMenuItem screenshotToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem itemsavescreenshot;
private System.Windows.Forms.ToolStripMenuItem editAreaScreenshotToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem itemsaveeditareascreenshot;
private System.Windows.Forms.ToolStripMenuItem itemShortcutReference; private System.Windows.Forms.ToolStripMenuItem itemShortcutReference;
private System.Windows.Forms.ToolStripMenuItem itemopenconfigfolder; private System.Windows.Forms.ToolStripMenuItem itemopenconfigfolder;
private System.Windows.Forms.ToolStripMenuItem itemopenmapincurwad; private System.Windows.Forms.ToolStripMenuItem itemopenmapincurwad;

View file

@ -2499,7 +2499,6 @@ namespace CodeImp.DoomBuilder.Windows
itemsavemap.Enabled = (General.Map != null); itemsavemap.Enabled = (General.Map != null);
itemsavemapas.Enabled = (General.Map != null); itemsavemapas.Enabled = (General.Map != null);
itemsavemapinto.Enabled = (General.Map != null); itemsavemapinto.Enabled = (General.Map != null);
itemtestmap.Enabled = (General.Map != null);
itemopenmapincurwad.Enabled = (General.Map != null); //mxd itemopenmapincurwad.Enabled = (General.Map != null); //mxd
itemimport.Enabled = (General.Map != null); //mxd itemimport.Enabled = (General.Map != null); //mxd
itemexport.Enabled = (General.Map != null); //mxd itemexport.Enabled = (General.Map != null); //mxd
@ -3075,13 +3074,18 @@ namespace CodeImp.DoomBuilder.Windows
// This sets up the tools menu // This sets up the tools menu
private void UpdateToolsMenu() private void UpdateToolsMenu()
{ {
// Enable/disable items //mxd. Enable/disable items
bool enabled = (General.Map != null); bool enabled = (General.Map != null);
itemreloadresources.Enabled = enabled; itemreloadresources.Visible = enabled;
seperatortoolsconfig.Visible = enabled;
//mxd itemsavescreenshot.Visible = enabled;
itemReloadGldefs.Enabled = enabled; itemsaveeditareascreenshot.Visible = enabled;
itemReloadModedef.Enabled = enabled; separatortoolsscreenshots.Visible = enabled;
itemtestmap.Visible = enabled;
bool supported = (enabled && !string.IsNullOrEmpty(General.Map.Config.DecorateGames));
itemReloadGldefs.Visible = supported;
itemReloadModedef.Visible = supported;
} }
// Errors and Warnings // Errors and Warnings

View file

@ -34,7 +34,6 @@ namespace CodeImp.DoomBuilder.Windows
// Variables // Variables
private readonly MapOptions options; private readonly MapOptions options;
private readonly bool newmap; private readonly bool newmap;
private string previousdefaultmaplumpname; //mxd
// Properties // Properties
public MapOptions Options { get { return options; } } public MapOptions Options { get { return options; } }
@ -50,6 +49,12 @@ namespace CodeImp.DoomBuilder.Windows
// Keep settings // Keep settings
this.options = options; this.options = options;
//mxd. Add script compilers
foreach(KeyValuePair<string, ScriptConfiguration> group in General.CompiledScriptConfigs)
{
scriptcompiler.Items.Add(group.Value);
}
//mxd. Go for all enabled configurations //mxd. Go for all enabled configurations
for(int i = 0; i < General.Configs.Count; i++) for(int i = 0; i < General.Configs.Count; i++)
{ {
@ -59,13 +64,13 @@ namespace CodeImp.DoomBuilder.Windows
// Add config name to list // Add config name to list
int index = config.Items.Add(General.Configs[i]); int index = config.Items.Add(General.Configs[i]);
//mxd. //mxd
if(newmap && !string.IsNullOrEmpty(General.Settings.LastUsedConfigName) && General.Configs[i].Name == General.Settings.LastUsedConfigName) if(newmap && !string.IsNullOrEmpty(General.Settings.LastUsedConfigName) && General.Configs[i].Name == General.Settings.LastUsedConfigName)
{ {
// Select this item // Select this item
config.SelectedIndex = index; config.SelectedIndex = index;
}
} // Is this configuration currently selected? // Is this configuration currently selected?
else if(string.Compare(General.Configs[i].Filename, options.ConfigFile, true) == 0) // Is this configuration currently selected? else if(string.Compare(General.Configs[i].Filename, options.ConfigFile, true) == 0) // Is this configuration currently selected?
{ {
// Select this item // Select this item
@ -97,48 +102,8 @@ namespace CodeImp.DoomBuilder.Windows
//mxd //mxd
if(General.Map != null) datalocations.StartPath = General.Map.FilePathName; if(General.Map != null) datalocations.StartPath = General.Map.FilePathName;
//mxd. Set script compiler
if (config.SelectedIndex != -1)
{
ConfigurationInfo ci = config.SelectedItem as ConfigurationInfo;
foreach(KeyValuePair<string, ScriptConfiguration> group in General.CompiledScriptConfigs)
{
scriptcompiler.Items.Add(group.Value);
if(group.Key == options.ScriptCompiler)
scriptcompiler.SelectedIndex = scriptcompiler.Items.Count - 1;
}
//Nothing selected? Let's try default one form the game configuration, if we have any
if(scriptcompiler.SelectedIndex == -1 && !string.IsNullOrEmpty(ci.DefaultScriptCompiler))
{
int cfgindex = 0;
foreach(KeyValuePair<string, ScriptConfiguration> group in General.CompiledScriptConfigs)
{
if(group.Key == ci.DefaultScriptCompiler)
{
scriptcompiler.SelectedIndex = cfgindex;
break;
}
cfgindex++;
}
}
if(General.CompiledScriptConfigs.Count == 0 || string.IsNullOrEmpty(ci.DefaultScriptCompiler))
{
scriptcompiler.Enabled = false;
scriptcompilerlabel.Enabled = false;
}
else if (scriptcompiler.SelectedIndex == -1 && scriptcompiler.Items.Count > 0)
{
scriptcompiler.SelectedIndex = 0;
}
}
// Set the level name // Set the level name
if (!string.IsNullOrEmpty(options.CurrentName)) levelname.Text = options.CurrentName; //mxd if(!string.IsNullOrEmpty(options.CurrentName)) levelname.Text = options.CurrentName; //mxd
// Set strict patches loading // Set strict patches loading
strictpatches.Checked = options.StrictPatches; strictpatches.Checked = options.StrictPatches;
@ -158,6 +123,15 @@ namespace CodeImp.DoomBuilder.Windows
config.Focus(); config.Focus();
return; return;
} }
//mxd. Script configuration selected?
if(scriptcompiler.Enabled && scriptcompiler.SelectedIndex == -1)
{
// Select a configuration!
MessageBox.Show(this, "Please select a script type to use for editing your map.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
scriptcompiler.Focus();
return;
}
// Level name empty? // Level name empty?
if(levelname.Text.Length == 0) if(levelname.Text.Length == 0)
@ -274,10 +248,9 @@ namespace CodeImp.DoomBuilder.Windows
options.CopyResources(datalocations.GetResources()); options.CopyResources(datalocations.GetResources());
//mxd. Store script compiler //mxd. Store script compiler
if(scriptcompiler.Enabled && scriptcompiler.SelectedIndex > -1) if(scriptcompiler.Enabled)
{ {
ScriptConfiguration scriptcfg = scriptcompiler.SelectedItem as ScriptConfiguration; ScriptConfiguration scriptcfg = scriptcompiler.SelectedItem as ScriptConfiguration;
foreach(KeyValuePair<string, ScriptConfiguration> group in General.CompiledScriptConfigs) foreach(KeyValuePair<string, ScriptConfiguration> group in General.CompiledScriptConfigs)
{ {
if(group.Value == scriptcfg) if(group.Value == scriptcfg)
@ -311,38 +284,47 @@ namespace CodeImp.DoomBuilder.Windows
if(config.SelectedIndex < 0) return; if(config.SelectedIndex < 0) return;
// Get the info // Get the info
ConfigurationInfo ci = config.SelectedItem as ConfigurationInfo; ConfigurationInfo info = config.SelectedItem as ConfigurationInfo;
if(info == null) return; //mxd. Some boilerplate
// No lump name in the name field? // No lump name in the name field?
if(levelname.Text.Trim().Length == 0 || levelname.Text.Trim() == previousdefaultmaplumpname) if(newmap || levelname.Text.Trim().Length == 0)
{ {
// Get default lump name from configuration // Get default lump name from configuration
levelname.Text = ci.DefaultLumpName; levelname.Text = info.DefaultLumpName;
examplelabel.Text = ci.DefaultLumpName; //mxd }
examplelabel.Text = info.DefaultLumpName; //mxd
//mxd. Select script compiler
string scriptconfig = string.Empty;
if(!string.IsNullOrEmpty(options.ScriptCompiler) && General.CompiledScriptConfigs.ContainsKey(options.ScriptCompiler))
{
scriptconfig = options.ScriptCompiler;
}
else if(!string.IsNullOrEmpty(info.DefaultScriptCompiler) && General.CompiledScriptConfigs.ContainsKey(info.DefaultScriptCompiler))
{
scriptconfig = info.DefaultScriptCompiler;
} }
//mxd //mxd. Select proper script compiler
bool enablescriptcompiler = !string.IsNullOrEmpty(ci.DefaultScriptCompiler); if(!string.IsNullOrEmpty(scriptconfig))
scriptcompiler.Enabled = enablescriptcompiler;
scriptcompilerlabel.Enabled = enablescriptcompiler;
previousdefaultmaplumpname = ci.DefaultLumpName;
//mxd. Select default script compiler for this game configuration
if(scriptcompiler.Enabled)
{ {
if(General.CompiledScriptConfigs.ContainsKey(ci.DefaultScriptCompiler)) scriptcompiler.Enabled = true;
scriptcompiler.SelectedItem = General.CompiledScriptConfigs[ci.DefaultScriptCompiler]; scriptcompiler.SelectedItem = General.CompiledScriptConfigs[scriptconfig];
} scriptcompilerlabel.Enabled = true;
else }
else
{ {
scriptcompiler.Enabled = false;
scriptcompiler.SelectedIndex = -1; scriptcompiler.SelectedIndex = -1;
scriptcompilerlabel.Enabled = false;
} }
// Show resources // Show resources
datalocations.FixedResourceLocationList(ci.Resources); datalocations.FixedResourceLocationList(info.Resources);
// Update long texture names checkbox (mxd) // Update long texture names checkbox (mxd)
longtexturenames.Enabled = ci.Configuration.ReadSetting("longtexturenames", false); longtexturenames.Enabled = info.Configuration.ReadSetting("longtexturenames", false);
longtexturenames.Checked = longtexturenames.Enabled && options.UseLongTextureNames; longtexturenames.Checked = longtexturenames.Enabled && options.UseLongTextureNames;
} }

View file

@ -109,7 +109,7 @@ namespace CodeImp.DoomBuilder.Windows
mapsettings = new Configuration(true); mapsettings = new Configuration(true);
// Check strict patches box, check what game configuration is preferred // Check strict patches box, check what game configuration is preferred
if (options != null) if(options != null)
{ {
strictpatches.Checked = options.StrictPatches; strictpatches.Checked = options.StrictPatches;
gameconfig = options.ConfigFile; gameconfig = options.ConfigFile;
@ -251,7 +251,7 @@ namespace CodeImp.DoomBuilder.Windows
} }
// Map found? Let's call it a day :) // Map found? Let's call it a day :)
if (lumpsfound >= lumpsrequired) return true; if(lumpsfound >= lumpsrequired) return true;
} }
} }
@ -380,13 +380,22 @@ namespace CodeImp.DoomBuilder.Windows
config.Focus(); config.Focus();
return; return;
} }
//mxd. Script configuration selected?
if(scriptcompiler.Enabled && scriptcompiler.SelectedIndex == -1)
{
// Select a configuration!
MessageBox.Show(this, "Please select a script type to use for editing your map.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
scriptcompiler.Focus();
return;
}
// Collect information // Collect information
ConfigurationInfo configinfo = (config.SelectedItem as ConfigurationInfo); //mxd ConfigurationInfo configinfo = (config.SelectedItem as ConfigurationInfo); //mxd
DataLocationList locations = datalocations.GetResources(); DataLocationList locations = datalocations.GetResources();
// Resources are valid? (mxd) // Resources are valid? (mxd)
if (!datalocations.ResourcesAreValid()) if(!datalocations.ResourcesAreValid())
{ {
MessageBox.Show(this, "Cannot open map: at least one resource doesn't exist!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show(this, "Cannot open map: at least one resource doesn't exist!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
datalocations.Focus(); datalocations.Focus();
@ -430,10 +439,9 @@ namespace CodeImp.DoomBuilder.Windows
options.CopyResources(locations); options.CopyResources(locations);
//mxd. Store script compiler //mxd. Store script compiler
if(scriptcompiler.Enabled && scriptcompiler.SelectedIndex > -1) if(scriptcompiler.Enabled)
{ {
ScriptConfiguration scriptcfg = scriptcompiler.SelectedItem as ScriptConfiguration; ScriptConfiguration scriptcfg = scriptcompiler.SelectedItem as ScriptConfiguration;
foreach(KeyValuePair<string, ScriptConfiguration> group in General.CompiledScriptConfigs) foreach(KeyValuePair<string, ScriptConfiguration> group in General.CompiledScriptConfigs)
{ {
if(group.Value == scriptcfg) if(group.Value == scriptcfg)
@ -486,7 +494,7 @@ namespace CodeImp.DoomBuilder.Windows
DataLocationList locations; DataLocationList locations;
DataLocationList listedlocations; DataLocationList listedlocations;
string scriptconfig = string.Empty; string scriptconfig = string.Empty; //mxd
// Map previously selected? // Map previously selected?
if(!string.IsNullOrEmpty(selectedmapname)) if(!string.IsNullOrEmpty(selectedmapname))
@ -525,26 +533,28 @@ namespace CodeImp.DoomBuilder.Windows
datalocations.EditResourceLocationList(listedlocations); datalocations.EditResourceLocationList(listedlocations);
//mxd. Select script compiler //mxd. Select script compiler
if (!string.IsNullOrEmpty(options.ScriptCompiler) && General.CompiledScriptConfigs.ContainsKey(options.ScriptCompiler)) ConfigurationInfo info = config.SelectedItem as ConfigurationInfo;
if(info != null)
{ {
scriptconfig = options.ScriptCompiler; if(!string.IsNullOrEmpty(options.ScriptCompiler) && General.CompiledScriptConfigs.ContainsKey(options.ScriptCompiler))
} {
else scriptconfig = options.ScriptCompiler;
{ }
string defaultscriptconfig = (config.SelectedItem as ConfigurationInfo).Configuration.ReadSetting("defaultscriptcompiler", string.Empty); else if(!string.IsNullOrEmpty(info.DefaultScriptCompiler) && General.CompiledScriptConfigs.ContainsKey(info.DefaultScriptCompiler))
if(!string.IsNullOrEmpty(defaultscriptconfig) && General.CompiledScriptConfigs.ContainsKey(defaultscriptconfig)) {
scriptconfig = defaultscriptconfig; scriptconfig = info.DefaultScriptCompiler;
}
} }
} }
//mxd. Select proper script compiler //mxd. Select proper script compiler
if (!string.IsNullOrEmpty(scriptconfig)) if(!string.IsNullOrEmpty(scriptconfig))
{ {
scriptcompiler.Enabled = true; scriptcompiler.Enabled = true;
scriptcompiler.SelectedItem = General.CompiledScriptConfigs[scriptconfig]; scriptcompiler.SelectedItem = General.CompiledScriptConfigs[scriptconfig];
scriptcompilerlabel.Enabled = true; scriptcompilerlabel.Enabled = true;
} }
else else
{ {
scriptcompiler.Enabled = false; scriptcompiler.Enabled = false;
scriptcompiler.SelectedIndex = -1; scriptcompiler.SelectedIndex = -1;

View file

@ -171,7 +171,7 @@ namespace CodeImp.DoomBuilder.BuilderEffects
form.Location = formLocation; form.Location = formLocation;
form.FormClosed += form_FormClosed; form.FormClosed += form_FormClosed;
form.ShowDialog(Form.ActiveForm); form.ShowDialog(General.Interface);
} }
//events //events

View file

@ -88,14 +88,14 @@ namespace CodeImp.DoomBuilder.BuilderModes.ClassicModes
ICollection<Linedef> selection = General.Map.Map.GetSelectedLinedefs(true); ICollection<Linedef> selection = General.Map.Map.GetSelectedLinedefs(true);
List<Line> lines = new List<Line>(); List<Line> lines = new List<Line>();
foreach (Linedef ld in selection) foreach(Linedef ld in selection)
{ {
Line l = new Line(ld); Line l = new Line(ld);
lines.Add(l); lines.Add(l);
} }
//do we have valid selection? //do we have valid selection?
if (!Setup(lines)) if(!Setup(lines))
{ {
FinishDraw(); FinishDraw();
return; return;
@ -107,7 +107,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.ClassicModes
form.OnOkClick += form_OnOkClick; form.OnOkClick += form_OnOkClick;
form.OnFlipClick += form_OnFlipClick; form.OnFlipClick += form_OnFlipClick;
form.OnSubdivisionChanged += form_OnSubdivisionChanged; form.OnSubdivisionChanged += form_OnSubdivisionChanged;
form.Show(Form.ActiveForm); form.Show(General.Interface);
General.Interface.FocusDisplay(); General.Interface.FocusDisplay();
handleColor = General.Colors.BrightColors[new Random().Next(General.Colors.BrightColors.Length - 1)]; handleColor = General.Colors.BrightColors[new Random().Next(General.Colors.BrightColors.Length - 1)];

View file

@ -960,7 +960,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(sel != null) if(sel != null)
{ {
PastePropertiesOptionsForm form = new PastePropertiesOptionsForm(); PastePropertiesOptionsForm form = new PastePropertiesOptionsForm();
if(form.Setup(MapElementType.LINEDEF) && form.ShowDialog(Form.ActiveForm) == DialogResult.OK) if(form.Setup(MapElementType.LINEDEF) && form.ShowDialog(General.Interface) == DialogResult.OK)
{ {
// Apply properties to selection // Apply properties to selection
string rest = (sel.Count == 1 ? "a single linedef" : sel.Count + " linedefs"); string rest = (sel.Count == 1 ? "a single linedef" : sel.Count + " linedefs");

View file

@ -69,11 +69,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
private Dictionary<Sector, string[]> selectedEffectLabels; private Dictionary<Sector, string[]> selectedEffectLabels;
private Dictionary<Sector, string[]> unselectedEffectLabels; private Dictionary<Sector, string[]> unselectedEffectLabels;
//mxd. "Make Door" textures
private static string doortex = "-";
private static string tracktex = "-";
private static bool resetoffsets = true;
#endregion #endregion
#region ================== Properties #region ================== Properties
@ -1446,7 +1441,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(sel != null) if(sel != null)
{ {
PastePropertiesOptionsForm form = new PastePropertiesOptionsForm(); PastePropertiesOptionsForm form = new PastePropertiesOptionsForm();
if(form.Setup(MapElementType.SECTOR) && form.ShowDialog(Form.ActiveForm) == DialogResult.OK) if(form.Setup(MapElementType.SECTOR) && form.ShowDialog(General.Interface) == DialogResult.OK)
{ {
// Apply properties to selection // Apply properties to selection
string rest = (sel.Count == 1 ? "a single sector" : sel.Count + " sectors"); string rest = (sel.Count == 1 ? "a single sector" : sel.Count + " sectors");
@ -1508,16 +1503,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(orderedselection.Count > 0) if(orderedselection.Count > 0)
{ {
if(doortex == "-") doortex = General.Map.Config.MakeDoorDoor; //mxd string doortex = BuilderPlug.Me.MakeDoor.DoorTexture;
if(tracktex == "-") tracktex = General.Map.Config.MakeDoorTrack; //mxd string tracktex = BuilderPlug.Me.MakeDoor.TrackTexture;
string ceiltex = BuilderPlug.Me.MakeDoor.CeilingTexture;
string floortex = null; string floortex = null;
string ceiltex = null; bool resetoffsets = BuilderPlug.Me.MakeDoor.ResetOffsets;
// Find ceiling and floor textures // Find floor texture
foreach(Sector s in orderedselection) foreach(Sector s in orderedselection)
{ {
if(floortex == null) floortex = s.FloorTexture; else if(floortex != s.FloorTexture) floortex = ""; if(floortex == null) floortex = s.FloorTexture; else if(floortex != s.FloorTexture) floortex = "";
if(ceiltex == null) ceiltex = s.CeilTexture; else if(ceiltex != s.CeilTexture) ceiltex = "";
} }
// Show the dialog // Show the dialog
@ -1529,6 +1524,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
ceiltex = form.CeilingTexture; ceiltex = form.CeilingTexture;
floortex = form.FloorTexture; floortex = form.FloorTexture;
resetoffsets = form.ResetOffsets; resetoffsets = form.ResetOffsets;
//mxd. Store new settings
BuilderPlug.Me.MakeDoor = new BuilderPlug.MakeDoorSettings(doortex, tracktex, ceiltex, resetoffsets);
// Create undo // Create undo
General.Map.UndoRedo.CreateUndo("Make door (" + doortex + ")"); General.Map.UndoRedo.CreateUndo("Make door (" + doortex + ")");
@ -1551,7 +1549,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
// Make this a doortrak // Make this a doortrak
sd.SetTextureHigh("-"); sd.SetTextureHigh("-");
sd.SetTextureMid(tracktex); if(!string.IsNullOrEmpty(tracktex)) sd.SetTextureMid(tracktex);
sd.SetTextureLow("-"); sd.SetTextureLow("-");
// Set upper/lower unpegged flags // Set upper/lower unpegged flags
@ -1561,9 +1559,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
else else
{ {
// Set textures // Set textures
if(floortex.Length > 0) s.SetFloorTexture(floortex); if(!string.IsNullOrEmpty(floortex)) s.SetFloorTexture(floortex);
if(ceiltex.Length > 0) s.SetCeilTexture(ceiltex); if(!string.IsNullOrEmpty(ceiltex)) s.SetCeilTexture(ceiltex);
if(doortex.Length > 0) sd.Other.SetTextureHigh(doortex); if(!string.IsNullOrEmpty(doortex)) sd.Other.SetTextureHigh(doortex);
// Set upper/lower unpegged flags // Set upper/lower unpegged flags
sd.Line.SetFlag(General.Map.Config.UpperUnpeggedFlag, false); sd.Line.SetFlag(General.Map.Config.UpperUnpeggedFlag, false);
@ -1605,12 +1603,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
} }
// Reset the texture offsets if required // Reset the texture offsets if required
if (resetoffsets) if(resetoffsets)
{ {
sd.OffsetX = 0; sd.OffsetX = 0;
sd.OffsetY = 0; sd.OffsetY = 0;
if (sd.Other != null) if(sd.Other != null)
{ {
sd.Other.OffsetX = 0; sd.Other.OffsetX = 0;
sd.Other.OffsetY = 0; sd.Other.OffsetY = 0;
@ -1631,7 +1629,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
} }
else //mxd else //mxd
{ {
General.Interface.DisplayStatus(StatusType.Warning, "This action requires a selection!"); General.Interface.DisplayStatus(StatusType.Warning, "This action requires a highlight or selection!");
} }
} }

View file

@ -859,7 +859,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(sel != null) if(sel != null)
{ {
PastePropertiesOptionsForm form = new PastePropertiesOptionsForm(); PastePropertiesOptionsForm form = new PastePropertiesOptionsForm();
if(form.Setup(MapElementType.THING) && form.ShowDialog(Form.ActiveForm) == DialogResult.OK) if(form.Setup(MapElementType.THING) && form.ShowDialog(General.Interface) == DialogResult.OK)
{ {
// Apply properties to selection // Apply properties to selection
string rest = (sel.Count == 1 ? "a single thing" : sel.Count + " things"); string rest = (sel.Count == 1 ? "a single thing" : sel.Count + " things");

View file

@ -783,7 +783,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(sel != null) if(sel != null)
{ {
PastePropertiesOptionsForm form = new PastePropertiesOptionsForm(); PastePropertiesOptionsForm form = new PastePropertiesOptionsForm();
if(form.Setup(MapElementType.VERTEX) && form.ShowDialog(Form.ActiveForm) == DialogResult.OK) if(form.Setup(MapElementType.VERTEX) && form.ShowDialog(General.Interface) == DialogResult.OK)
{ {
// Apply properties to selection // Apply properties to selection
string rest = (sel.Count == 1 ? "a single vertex" : sel.Count + " vertices"); string rest = (sel.Count == 1 ? "a single vertex" : sel.Count + " vertices");

View file

@ -59,6 +59,26 @@ namespace CodeImp.DoomBuilder.BuilderModes
#endregion #endregion
#region ================== Structs (mxd)
public struct MakeDoorSettings
{
public readonly string DoorTexture;
public readonly string TrackTexture;
public readonly string CeilingTexture;
public readonly bool ResetOffsets;
public MakeDoorSettings(string doortexture, string tracktexture, string ceilingtexture, bool resetoffsets)
{
DoorTexture = doortexture;
TrackTexture = tracktexture;
CeilingTexture = ceilingtexture;
ResetOffsets = resetoffsets;
}
}
#endregion
#region ================== Variables #region ================== Variables
// Static instance // Static instance
@ -151,11 +171,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
public float HighlightRange { get { return highlightrange; } } public float HighlightRange { get { return highlightrange; } }
public float HighlightThingsRange { get { return highlightthingsrange; } } public float HighlightThingsRange { get { return highlightthingsrange; } }
public float SplitLinedefsRange { get { return splitlinedefsrange; } } public float SplitLinedefsRange { get { return splitlinedefsrange; } }
public bool UseHighlight { public bool UseHighlight
get { {
return usehighlight; get { return usehighlight; }
} set
set { {
usehighlight = value; usehighlight = value;
General.Map.Renderer3D.ShowSelection = usehighlight; General.Map.Renderer3D.ShowSelection = usehighlight;
General.Map.Renderer3D.ShowHighlight = usehighlight; General.Map.Renderer3D.ShowHighlight = usehighlight;
@ -169,7 +189,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
public bool SyncSelection { get { return syncSelection; } set { syncSelection = value; } } //mxd public bool SyncSelection { get { return syncSelection; } set { syncSelection = value; } } //mxd
public bool LockSectorTextureOffsetsWhileDragging { get { return lockSectorTextureOffsetsWhileDragging; } internal set { lockSectorTextureOffsetsWhileDragging = value; } } //mxd public bool LockSectorTextureOffsetsWhileDragging { get { return lockSectorTextureOffsetsWhileDragging; } internal set { lockSectorTextureOffsetsWhileDragging = value; } } //mxd
public bool DragThingsInSectorsMode { get { return dragThingsInSectorsMode; } internal set { dragThingsInSectorsMode = value; } } //mxd public bool DragThingsInSectorsMode { get { return dragThingsInSectorsMode; } internal set { dragThingsInSectorsMode = value; } } //mxd
//mxd. "Make Door" action persistent settings
internal MakeDoorSettings MakeDoor;
#endregion #endregion
#region ================== Initialize / Dispose #region ================== Initialize / Dispose
@ -286,6 +309,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Settings.WritePluginSetting("dragthingsinsectorsmode", dragThingsInSectorsMode); General.Settings.WritePluginSetting("dragthingsinsectorsmode", dragThingsInSectorsMode);
} }
//mxd. These should be reset when changing maps
private void ResetCopyProperties()
{
copiedvertexprops = null;
copiedthingprops = null;
copiedlinedefprops = null;
copiedsidedefprops = null;
copiedsectorprops = null;
}
#endregion #endregion
#region ================== Events #region ================== Events
@ -436,6 +469,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
//mxd //mxd
General.Interface.AddDocker(drawingOverridesDocker); General.Interface.AddDocker(drawingOverridesDocker);
drawingOverridesPanel.Setup(); drawingOverridesPanel.Setup();
MakeDoor = new MakeDoorSettings(General.Map.Config.MakeDoorDoor, General.Map.Config.MakeDoorTrack, General.Map.Config.MakeDoorCeiling, MakeDoor.ResetOffsets);
ResetCopyProperties();
} }
// Map opened // Map opened
@ -448,7 +483,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
//mxd //mxd
General.Interface.AddDocker(drawingOverridesDocker); General.Interface.AddDocker(drawingOverridesDocker);
drawingOverridesPanel.Setup(); drawingOverridesPanel.Setup();
General.Map.Renderer2D.UpdateExtraFloorFlag(); //mxd General.Map.Renderer2D.UpdateExtraFloorFlag();
MakeDoor = new MakeDoorSettings(General.Map.Config.MakeDoorDoor, General.Map.Config.MakeDoorTrack, General.Map.Config.MakeDoorCeiling, MakeDoor.ResetOffsets);
ResetCopyProperties();
} }
//mxd //mxd

View file

@ -332,6 +332,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
s.SetFlag(f.Key, f.Value); s.SetFlag(f.Key, f.Value);
} }
// Should we bother?
if(!General.Map.UDMF) return;
// Apply fields // Apply fields
s.Fields.BeforeFieldsChange(); s.Fields.BeforeFieldsChange();
@ -455,6 +458,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
s.SetFlag(f.Key, f.Value); s.SetFlag(f.Key, f.Value);
} }
// Should we bother?
if(!General.Map.UDMF) return;
// Apply fields // Apply fields
s.Fields.BeforeFieldsChange(); s.Fields.BeforeFieldsChange();
@ -573,6 +579,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
l.Args[i] = args[i]; l.Args[i] = args[i];
} }
// Should we bother?
if(!General.Map.UDMF) return;
// Apply fields // Apply fields
l.Fields.BeforeFieldsChange(); l.Fields.BeforeFieldsChange();
@ -727,6 +736,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
t.Args[i] = args[i]; t.Args[i] = args[i];
} }
// Should we bother?
if(!General.Map.UDMF) return;
// Apply fields // Apply fields
t.Fields.BeforeFieldsChange(); t.Fields.BeforeFieldsChange();

View file

@ -140,7 +140,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Interface
this.tracktexture.Location = new System.Drawing.Point(101, 29); this.tracktexture.Location = new System.Drawing.Point(101, 29);
this.tracktexture.MultipleTextures = false; this.tracktexture.MultipleTextures = false;
this.tracktexture.Name = "tracktexture"; this.tracktexture.Name = "tracktexture";
this.tracktexture.Required = true; this.tracktexture.Required = false;
this.tracktexture.Size = new System.Drawing.Size(83, 105); this.tracktexture.Size = new System.Drawing.Size(83, 105);
this.tracktexture.TabIndex = 6; this.tracktexture.TabIndex = 6;
this.tracktexture.TextureName = ""; this.tracktexture.TextureName = "";

View file

@ -414,7 +414,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Apply settings // Apply settings
SetPosition(pos); SetPosition(pos);
UpdateThingCage(Thing.Color); SetCageColor(Thing.Color);
// Keep info for object picking // Keep info for object picking
cageradius2 = thingradius * Angle2D.SQRT2; cageradius2 = thingradius * Angle2D.SQRT2;

View file

@ -148,7 +148,7 @@ namespace CodeImp.DoomBuilder.ColorPicker
} }
form.Location = formLocation; form.Location = formLocation;
form.FormClosed += form_FormClosed; form.FormClosed += form_FormClosed;
form.ShowDialog(Form.ActiveForm); form.ShowDialog(General.Interface);
} }
else else
{ {

View file

@ -79,10 +79,10 @@ namespace CodeImp.DoomBuilder.TagRange
TagRangeForm f = new TagRangeForm(); TagRangeForm f = new TagRangeForm();
f.Setup(); f.Setup();
if(f.SelectionCount > 0) if(f.SelectionCount > 0)
f.ShowDialog(Form.ActiveForm); f.ShowDialog(General.Interface);
else else
General.Interface.DisplayStatus(StatusType.Warning, "This action requires a selection!"); //mxd General.Interface.DisplayStatus(StatusType.Warning, "This action requires a selection!"); //mxd
f.Dispose(); f.Dispose();
} }
} }
} }