2009-04-19 18:07:22 +00:00
#region = = = = = = = = = = = = = = = = = = Copyright ( c ) 2007 Pascal vd Heiden
/ *
* Copyright ( c ) 2007 Pascal vd Heiden , www . codeimp . com
* This program is released under GNU General Public License
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* /
#endregion
#region = = = = = = = = = = = = = = = = = = Namespaces
using System ;
2014-07-11 10:13:26 +00:00
using System.Collections.Generic ;
2009-04-19 18:07:22 +00:00
using System.Windows.Forms ;
using CodeImp.DoomBuilder.Map ;
using CodeImp.DoomBuilder.Data ;
using CodeImp.DoomBuilder.IO ;
using System.IO ;
using CodeImp.DoomBuilder.Config ;
#endregion
namespace CodeImp.DoomBuilder.Windows
{
internal partial class MapOptionsForm : DelayedForm
{
// Variables
2014-11-25 11:52:01 +00:00
private readonly MapOptions options ;
private readonly bool newmap ;
2009-04-19 18:07:22 +00:00
// Properties
public MapOptions Options { get { return options ; } }
// Constructor
2013-03-21 11:23:29 +00:00
public MapOptionsForm ( MapOptions options , bool newmap )
2009-04-19 18:07:22 +00:00
{
2013-03-21 11:23:29 +00:00
this . newmap = newmap ;
2014-12-03 09:06:05 +00:00
2009-04-19 18:07:22 +00:00
// Initialize
InitializeComponent ( ) ;
// Keep settings
this . options = options ;
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
//mxd. Add script compilers
foreach ( KeyValuePair < string , ScriptConfiguration > group in General . CompiledScriptConfigs )
{
scriptcompiler . Items . Add ( group . Value ) ;
}
2014-02-18 14:04:14 +00:00
//mxd. Go for all enabled configurations
2009-04-19 18:07:22 +00:00
for ( int i = 0 ; i < General . Configs . Count ; i + + )
{
2014-02-18 14:04:14 +00:00
//mxd. No disabled configs here
if ( ! General . Configs [ i ] . Enabled ) continue ;
2009-04-19 18:07:22 +00:00
// Add config name to list
2014-12-03 09:06:05 +00:00
int index = config . Items . Add ( General . Configs [ i ] ) ;
2009-04-19 18:07:22 +00:00
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
//mxd
2013-03-21 11:23:29 +00:00
if ( newmap & & ! string . IsNullOrEmpty ( General . Settings . LastUsedConfigName ) & & General . Configs [ i ] . Name = = General . Settings . LastUsedConfigName )
{
// Select this item
config . SelectedIndex = index ;
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
}
// Is this configuration currently selected?
2013-03-21 11:23:29 +00:00
else if ( string . Compare ( General . Configs [ i ] . Filename , options . ConfigFile , true ) = = 0 ) // Is this configuration currently selected?
2009-04-19 18:07:22 +00:00
{
// Select this item
config . SelectedIndex = index ;
}
}
2014-02-18 14:04:14 +00:00
//mxd. No dice? Check disabled ones
if ( config . SelectedIndex = = - 1 )
{
for ( int i = 0 ; i < General . Configs . Count ; i + + )
{
//No enabled configs here
if ( General . Configs [ i ] . Enabled ) continue ;
if ( ( newmap & & ! string . IsNullOrEmpty ( General . Settings . LastUsedConfigName ) & & General . Configs [ i ] . Name = = General . Settings . LastUsedConfigName ) | |
string . Compare ( General . Configs [ i ] . Filename , options . ConfigFile , true ) = = 0 )
{
//Add and select this item
config . SelectedIndex = config . Items . Add ( General . Configs [ i ] ) ;
break ;
}
}
}
2013-09-11 09:47:53 +00:00
//mxd. Still better than nothing :)
2014-02-18 14:04:14 +00:00
if ( config . SelectedIndex = = - 1 & & config . Items . Count > 0 ) config . SelectedIndex = 0 ;
2012-07-10 10:20:45 +00:00
2013-03-18 13:52:27 +00:00
//mxd
2014-02-18 14:04:14 +00:00
if ( General . Map ! = null ) datalocations . StartPath = General . Map . FilePathName ;
2013-03-18 13:52:27 +00:00
2009-04-19 18:07:22 +00:00
// Set the level name
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
if ( ! string . IsNullOrEmpty ( options . CurrentName ) ) levelname . Text = options . CurrentName ; //mxd
2009-04-19 18:07:22 +00:00
// Set strict patches loading
strictpatches . Checked = options . StrictPatches ;
// Fill the resources list
datalocations . EditResourceLocationList ( options . Resources ) ;
}
// OK clicked
private void apply_Click ( object sender , EventArgs e )
{
// Configuration selected?
if ( config . SelectedIndex = = - 1 )
{
// Select a configuration!
MessageBox . Show ( this , "Please select a game configuration to use for editing your map." , Application . ProductName , MessageBoxButtons . OK , MessageBoxIcon . Warning ) ;
config . Focus ( ) ;
return ;
}
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
//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 ;
}
2009-04-19 18:07:22 +00:00
// Level name empty?
if ( levelname . Text . Length = = 0 )
{
// Enter a level name!
MessageBox . Show ( this , "Please enter a level name for your map." , Application . ProductName , MessageBoxButtons . OK , MessageBoxIcon . Warning ) ;
2014-12-29 19:38:24 +00:00
levelname . Focus ( ) ;
return ;
}
2014-12-30 13:21:01 +00:00
// Collect information
ConfigurationInfo configinfo = config . SelectedItem as ConfigurationInfo ; //mxd
DataLocationList locations = datalocations . GetResources ( ) ;
2014-12-29 19:38:24 +00:00
//mxd. Level name will fuck things up horribly?
2014-12-30 13:21:01 +00:00
if ( ! configinfo . ValidateMapName ( levelname . Text . ToUpperInvariant ( ) ) )
2014-12-29 19:38:24 +00:00
{
2014-12-29 21:44:25 +00:00
// Enter a different level name!
2014-12-30 13:21:01 +00:00
MessageBox . Show ( this , "Chosen map name conflicts with a lump name defined for current map format.\n" , Application . ProductName , MessageBoxButtons . OK , MessageBoxIcon . Warning ) ;
2009-04-19 18:07:22 +00:00
levelname . Focus ( ) ;
return ;
}
2014-12-16 09:01:52 +00:00
// Resources are valid? (mxd)
if ( ! datalocations . ResourcesAreValid ( ) )
{
MessageBox . Show ( this , "Cannot " + ( newmap ? "create map" : "change map settings" ) + ": at least one resource doesn't exist!" , Application . ProductName , MessageBoxButtons . OK , MessageBoxIcon . Warning ) ;
datalocations . Focus ( ) ;
return ;
}
2009-04-19 18:07:22 +00:00
// When making a new map, check if we should warn the user for missing resources
2013-03-21 11:28:50 +00:00
if ( newmap )
2009-04-19 18:07:22 +00:00
{
2013-03-21 11:28:50 +00:00
General . Settings . LastUsedConfigName = configinfo . Name ; //mxd
if ( ( locations . Count = = 0 ) & & ( configinfo . Resources . Count = = 0 ) & &
MessageBox . Show ( this , "You are about to make a map without selecting any resources. Textures, flats and " +
2009-04-19 18:07:22 +00:00
"sprites may not be shown correctly or may not show up at all. Do you want to continue?" , Application . ProductName ,
MessageBoxButtons . YesNo , MessageBoxIcon . Warning , MessageBoxDefaultButton . Button2 ) = = DialogResult . No )
{
return ;
}
}
// Next checks are only for maps that are already opened
if ( ! newmap )
{
// Now we check if the map name the user has given does already exist in the source WAD file
// We have to warn the user about that, because it would create a level name conflict in the WAD
// Level name changed and the map exists in a source wad?
if ( ( levelname . Text ! = options . CurrentName ) & & ( General . Map ! = null ) & &
2016-02-01 22:04:00 +00:00
( ! string . IsNullOrEmpty ( General . Map . FilePathName ) ) & & File . Exists ( General . Map . FilePathName ) )
2009-04-19 18:07:22 +00:00
{
// Open the source wad file to check for conflicting name
2014-02-18 14:04:14 +00:00
WAD sourcewad = new WAD ( General . Map . FilePathName , true ) ;
bool conflictingname = ( sourcewad . FindLumpIndex ( levelname . Text ) > - 1 ) ;
2009-04-19 18:07:22 +00:00
sourcewad . Dispose ( ) ;
// Names conflict?
if ( conflictingname )
{
// Show warning!
if ( General . ShowWarningMessage ( "The map name \"" + levelname . Text + "\" is already in use by another map or data lump in the source WAD file. Saving your map with this name will cause conflicting data lumps in the WAD file. Do you want to continue?" , MessageBoxButtons . YesNo , MessageBoxDefaultButton . Button2 ) = = DialogResult . No )
{
return ;
}
}
}
2015-07-30 23:48:16 +00:00
//mxd. If the map was never saved and it's name was changed, update filename
if ( ( levelname . Text ! = options . CurrentName ) & & ( General . Map ! = null ) & & ( string . IsNullOrEmpty ( General . Map . FilePathName ) ) )
{
General . Map . FileTitle = levelname . Text + ".wad" ;
}
2009-04-19 18:07:22 +00:00
// When the user changed the configuration to one that has a different read/write interface,
// we have to warn the user that the map may not be compatible.
// Configuration changed?
2014-02-18 14:04:14 +00:00
if ( ( options . ConfigFile ! = "" ) & & ( configinfo . Filename ! = options . ConfigFile ) )
2009-04-19 18:07:22 +00:00
{
// Check if the config uses a different IO interface
2014-02-18 14:04:14 +00:00
if ( configinfo . Configuration . ReadSetting ( "formatinterface" , "" ) ! = General . Map . Config . FormatInterface )
2009-04-19 18:07:22 +00:00
{
// Warn the user about IO interface change
if ( General . ShowWarningMessage ( "The game configuration you selected uses a different file format than your current map. Because your map was not designed for this format it may cause the map to work incorrectly in the game. Do you want to continue?" , MessageBoxButtons . YesNo , MessageBoxDefaultButton . Button2 ) = = DialogResult . No )
{
// Reset to old configuration
for ( int i = 0 ; i < config . Items . Count ; i + + )
{
// Is this configuration the old config?
2014-02-18 14:04:14 +00:00
if ( string . Compare ( ( config . Items [ i ] as ConfigurationInfo ) . Filename , options . ConfigFile , true ) = = 0 )
2009-04-19 18:07:22 +00:00
{
// Select this item
config . SelectedIndex = i ;
}
}
return ;
2013-05-31 13:57:49 +00:00
}
2014-02-18 14:04:14 +00:00
//mxd. Otherwise map data won't be saved if a user decides to save the map right after converting to new map format
General . Map . IsChanged = true ;
2009-04-19 18:07:22 +00:00
}
}
}
// Apply changes
options . ClearResources ( ) ;
2014-02-18 14:04:14 +00:00
options . ConfigFile = ( config . SelectedItem as ConfigurationInfo ) . Filename ; //mxd
2009-04-19 18:07:22 +00:00
options . CurrentName = levelname . Text . Trim ( ) . ToUpper ( ) ;
options . StrictPatches = strictpatches . Checked ;
options . CopyResources ( datalocations . GetResources ( ) ) ;
2014-07-11 10:13:26 +00:00
//mxd. Store script compiler
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
if ( scriptcompiler . Enabled )
2014-07-11 10:13:26 +00:00
{
ScriptConfiguration scriptcfg = scriptcompiler . SelectedItem as ScriptConfiguration ;
foreach ( KeyValuePair < string , ScriptConfiguration > group in General . CompiledScriptConfigs )
{
if ( group . Value = = scriptcfg )
{
options . ScriptCompiler = group . Key ;
break ;
}
}
}
2014-12-16 09:01:52 +00:00
//mxd. Use long texture names?
2015-02-19 13:00:19 +00:00
if ( longtexturenames . Enabled ) options . UseLongTextureNames = longtexturenames . Checked ;
2016-11-24 11:55:11 +00:00
2009-04-19 18:07:22 +00:00
// Hide window
this . DialogResult = DialogResult . OK ;
this . Close ( ) ;
}
// Cancel clicked
private void cancel_Click ( object sender , EventArgs e )
{
// Just hide window
this . DialogResult = DialogResult . Cancel ;
this . Close ( ) ;
}
// Game configuration chosen
private void config_SelectedIndexChanged ( object sender , EventArgs e )
{
// Anything selected?
2014-12-16 09:01:52 +00:00
if ( config . SelectedIndex < 0 ) return ;
// Get the info
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
ConfigurationInfo info = config . SelectedItem as ConfigurationInfo ;
if ( info = = null ) return ; //mxd. Some boilerplate
2009-04-19 18:07:22 +00:00
2014-12-16 09:01:52 +00:00
// No lump name in the name field?
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
if ( newmap | | levelname . Text . Trim ( ) . Length = = 0 )
2014-12-16 09:01:52 +00:00
{
// Get default lump name from configuration
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
levelname . Text = info . DefaultLumpName ;
2014-12-16 09:01:52 +00:00
}
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
examplelabel . Text = info . DefaultLumpName ; //mxd
2014-07-11 10:13:26 +00:00
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
//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 ;
}
2014-07-11 10:13:26 +00:00
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
//mxd. Select proper script compiler
if ( ! string . IsNullOrEmpty ( scriptconfig ) )
2014-12-16 09:01:52 +00:00
{
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
scriptcompiler . Enabled = true ;
scriptcompiler . SelectedItem = General . CompiledScriptConfigs [ scriptconfig ] ;
scriptcompilerlabel . Enabled = true ;
}
else
2014-12-16 09:01:52 +00:00
{
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
scriptcompiler . Enabled = false ;
2014-12-16 09:01:52 +00:00
scriptcompiler . SelectedIndex = - 1 ;
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
scriptcompilerlabel . Enabled = false ;
2009-04-19 18:07:22 +00:00
}
2014-12-16 09:01:52 +00:00
// Show resources
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
datalocations . FixedResourceLocationList ( info . Resources ) ;
2014-12-16 09:01:52 +00:00
// Update long texture names checkbox (mxd)
Game Configurations: added Vanilla Strife, Vanilla Heretic and Vanilla Hexen game configurations.
Added "makedoorceil" game configuration property. Works the same way as "makedoortrack" and "makedoordoor", but for ceilings of door sectors.
Changed, Game configurations: the editor no longer tries to load DECORATE/MODELDEF/VOXELDEF/GLDEFS/REVERBS lumps when "decorategames" setting is not specified / is set to empty string.
Changed, General interface: "Tools -> Reload MODELDEF/VOXELDEF" and "Tools -> Reload GLDEFS" menu items are no longer shown when current game configuration doesn't support DECORATE.
Fixed a crash when pasting linedef/thing properties in Hexen map format.
Fixed, Visual mode: Visual Thing resources were not fully unloaded when resetting D3D device leading to crash when switching to the editor from a DX-using game engine (like ZDoom) running in fullscreen.
Fixed: in some cases, when current game configuration supported multiple script compilers, it was possible to open/create a map or change map options without selecting any script compiler.
Fixed, New Map Options window: default map name was not updated when switching game configurations.
Fixed: copied map element properties were not reset after switching to another map.
Fixed: stored textures for "Make Door" action were not reset after switching to another map.
Fixed, Game Configurations window: currently selected test engine name was not updated when pasting test engines from another configuration.
Fixed, Game Configurations: all "Heretic in Doom map format" configurations were using Doom sector effects list.
Fixed, Game Configurations: all "Strife in Doom map format" configurations were using Doom sector effects list.
2015-10-21 13:35:42 +00:00
longtexturenames . Enabled = info . Configuration . ReadSetting ( "longtexturenames" , false ) ;
2015-02-19 13:00:19 +00:00
longtexturenames . Checked = longtexturenames . Enabled & & options . UseLongTextureNames ;
2009-04-19 18:07:22 +00:00
}
// When keys are pressed in the level name field
private void levelname_KeyPress ( object sender , KeyPressEventArgs e )
{
string allowedchars = Lump . MAP_LUMP_NAME_CHARS + Lump . MAP_LUMP_NAME_CHARS . ToLowerInvariant ( ) + "\b" ;
// Check if key is not allowed
if ( allowedchars . IndexOf ( e . KeyChar ) = = - 1 )
{
// Cancel this
e . Handled = true ;
}
}
// Help
private void MapOptionsForm_HelpRequested ( object sender , HelpEventArgs hlpevent )
{
General . ShowHelp ( "w_mapoptions.html" ) ;
hlpevent . Handled = true ;
}
}
}