2014-04-21 09:30:00 +00:00
#region = = = = = = = = = = = = = = = = = = Copyright ( c ) 2007 Pascal vd Heiden
/ *
* Copyright ( c ) 2007 Pascal vd Heiden , www . codeimp . com
* This program is released under GNU General Public License
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* /
#endregion
#region = = = = = = = = = = = = = = = = = = Namespaces
using System ;
using System.Collections.Generic ;
using System.Drawing ;
using System.Windows.Forms ;
using CodeImp.DoomBuilder.Config ;
2016-04-27 09:13:07 +00:00
using CodeImp.DoomBuilder.Controls ;
2014-04-21 09:30:00 +00:00
using CodeImp.DoomBuilder.Geometry ;
2015-07-27 09:02:28 +00:00
using CodeImp.DoomBuilder.Map ;
2014-04-21 09:30:00 +00:00
using CodeImp.DoomBuilder.Types ;
#endregion
namespace CodeImp.DoomBuilder.Windows
{
/// <summary>
/// Dialog window that allows viewing and editing of Thing properties.
/// </summary>
internal partial class ThingEditFormUDMF : DelayedForm
{
#region = = = = = = = = = = = = = = = = = = Events
public event EventHandler OnValuesChanged ; //mxd
#endregion
#region = = = = = = = = = = = = = = = = = = Variables
private ICollection < Thing > things ;
private ThingTypeInfo thinginfo ;
private bool preventchanges ;
2015-01-26 08:53:05 +00:00
private bool preventmapchange ; //mxd
private bool undocreated ; //mxd
2015-04-15 12:49:28 +00:00
private static bool useabsoluteheight ; //mxd
2015-01-26 08:53:05 +00:00
private List < ThingProperties > thingprops ; //mxd
2014-12-04 10:06:44 +00:00
private readonly string [ ] renderstyles ; //mxd
2016-07-15 14:07:30 +00:00
private Dictionary < string , string > flagsrename ; //mxd
2014-04-21 09:30:00 +00:00
//mxd. Window setup stuff
private static Point location = Point . Empty ;
2015-04-15 07:41:18 +00:00
private static int activetab ;
2014-04-21 09:30:00 +00:00
2015-06-14 19:29:44 +00:00
//mxd. Persistent settings
private static bool linkscale ;
2014-04-21 09:30:00 +00:00
private struct ThingProperties //mxd
{
2014-09-03 14:07:08 +00:00
//public readonly int Type;
2014-04-21 09:30:00 +00:00
public readonly int AngleDoom ;
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
public readonly int Pitch ;
public readonly int Roll ;
public readonly float ScaleX ;
public readonly float ScaleY ;
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
public readonly float Alpha ;
2014-04-21 09:30:00 +00:00
public readonly float X ;
public readonly float Y ;
public readonly float Z ;
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
public readonly Dictionary < string , bool > Flags ;
2014-04-21 09:30:00 +00:00
2014-05-02 11:37:37 +00:00
public ThingProperties ( Thing t )
{
2014-04-21 09:30:00 +00:00
X = t . Position . x ;
Y = t . Position . y ;
Z = t . Position . z ;
2014-09-03 14:07:08 +00:00
//Type = t.Type;
2014-04-21 09:30:00 +00:00
AngleDoom = t . AngleDoom ;
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
Pitch = t . Pitch ;
Roll = t . Roll ;
ScaleX = t . ScaleX ;
ScaleY = t . ScaleY ;
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
Alpha = UniFields . GetFloat ( t . Fields , "alpha" , 1.0f ) ;
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
Flags = t . GetFlags ( ) ;
2014-04-21 09:30:00 +00:00
}
}
#endregion
#region = = = = = = = = = = = = = = = = = = Constructor
// Constructor
2014-05-02 11:37:37 +00:00
public ThingEditFormUDMF ( )
{
2014-04-21 09:30:00 +00:00
// Initialize
InitializeComponent ( ) ;
//mxd. Widow setup
2014-12-03 23:15:26 +00:00
if ( location ! = Point . Empty )
{
2014-04-21 09:30:00 +00:00
this . StartPosition = FormStartPosition . Manual ;
this . Location = location ;
2015-04-15 07:41:18 +00:00
if ( General . Settings . StoreSelectedEditTab & & activetab > 0 ) tabs . SelectTab ( activetab ) ;
2014-04-21 09:30:00 +00:00
}
// Fill flags list
foreach ( KeyValuePair < string , string > tf in General . Map . Config . ThingFlags )
flags . Add ( tf . Value , tf . Key ) ;
2014-12-04 10:06:44 +00:00
flags . Enabled = ( General . Map . Config . ThingFlags . Count > 0 ) ;
2014-05-05 14:24:57 +00:00
2014-04-21 09:30:00 +00:00
// Fill actions list
action . GeneralizedCategories = General . Map . Config . GenActionCategories ;
action . AddInfo ( General . Map . Config . SortedLinedefActions . ToArray ( ) ) ;
2014-12-04 10:06:44 +00:00
// Setup renderstyles
renderstyles = new string [ General . Map . Config . ThingRenderStyles . Count ] ;
General . Map . Config . ThingRenderStyles . Keys . CopyTo ( renderstyles , 0 ) ;
2014-04-21 09:30:00 +00:00
2014-12-04 10:06:44 +00:00
// Fill renderstyles
foreach ( KeyValuePair < string , string > lf in General . Map . Config . ThingRenderStyles )
renderStyle . Items . Add ( lf . Value ) ;
renderStyle . Enabled = ( General . Map . Config . ThingRenderStyles . Count > 0 ) ;
labelrenderstyle . Enabled = ( General . Map . Config . ThingRenderStyles . Count > 0 ) ;
// Initialize custom fields editor
fieldslist . Setup ( "thing" ) ;
// Fill universal fields list
fieldslist . ListFixedFields ( General . Map . Config . ThingFields ) ;
2014-04-21 09:30:00 +00:00
2016-02-07 23:04:20 +00:00
//mxd. Show fixed fields?
hidefixedfields . Checked = ! General . Settings . ReadSetting ( "customfieldsshowfixed" , true ) ;
2014-04-21 09:30:00 +00:00
// Thing height?
posZ . Visible = General . Map . FormatInterface . HasThingHeight ;
zlabel . Visible = General . Map . FormatInterface . HasThingHeight ;
cbAbsoluteHeight . Visible = General . Map . FormatInterface . HasThingHeight ; //mxd
//mxd. Decimals allowed?
2014-12-03 23:15:26 +00:00
if ( General . Map . FormatInterface . VertexDecimals > 0 )
{
2014-04-21 09:30:00 +00:00
posX . AllowDecimal = true ;
posY . AllowDecimal = true ;
posZ . AllowDecimal = true ;
}
2016-06-15 22:02:51 +00:00
//mxd. Use doom angle clamping?
anglecontrol . DoomAngleClamping = General . Map . Config . DoomThingRotationAngles ;
2015-06-14 19:29:44 +00:00
// Value linking
scale . LinkValues = linkscale ;
2014-04-21 09:30:00 +00:00
// Setup types list
thingtype . Setup ( ) ;
}
2015-05-23 21:01:44 +00:00
#endregion
#region = = = = = = = = = = = = = = = = = = Methods
2014-04-21 09:30:00 +00:00
// This sets up the form to edit the given things
2014-05-02 11:37:37 +00:00
public void Setup ( ICollection < Thing > things )
{
2014-04-21 09:30:00 +00:00
preventchanges = true ;
// Keep this list
this . things = things ;
if ( things . Count > 1 ) this . Text = "Edit Things (" + things . Count + ")" ;
hint . Visible = things . Count > 1 ; //mxd
hintlabel . Visible = things . Count > 1 ; //mxd
2014-10-29 11:35:27 +00:00
thingtype . UseMultiSelection = things . Count > 1 ; //mxd
2014-04-21 09:30:00 +00:00
////////////////////////////////////////////////////////////////////////
// Set all options to the first thing properties
////////////////////////////////////////////////////////////////////////
Thing ft = General . GetByIndex ( things , 0 ) ;
// Set type
thingtype . SelectType ( ft . Type ) ;
// Flags
2015-12-28 15:01:53 +00:00
foreach ( CheckBox c in flags . Checkboxes )
2014-12-03 23:15:26 +00:00
{
2015-12-28 15:01:53 +00:00
if ( ft . Flags . ContainsKey ( c . Tag . ToString ( ) ) ) c . Checked = ft . Flags [ c . Tag . ToString ( ) ] ;
2014-04-21 09:30:00 +00:00
}
// Coordination
angle . Text = ft . AngleDoom . ToString ( ) ;
2015-04-15 12:49:28 +00:00
cbAbsoluteHeight . Checked = useabsoluteheight ; //mxd
2014-04-21 09:30:00 +00:00
//mxd
2014-09-03 14:07:08 +00:00
ft . DetermineSector ( ) ;
2015-04-15 12:49:28 +00:00
float floorheight = ( ft . Sector ! = null ? Sector . GetFloorPlane ( ft . Sector ) . GetZ ( ft . Position ) : 0 ) ;
2014-09-03 14:07:08 +00:00
posX . Text = ( ft . Position . x ) . ToString ( ) ;
posY . Text = ( ft . Position . y ) . ToString ( ) ;
2015-04-15 12:49:28 +00:00
posZ . Text = ( useabsoluteheight ? ( ( float ) Math . Round ( ft . Position . z + floorheight , General . Map . FormatInterface . VertexDecimals ) ) . ToString ( ) : ( ft . Position . z ) . ToString ( ) ) ;
2014-04-21 09:30:00 +00:00
posX . ButtonStep = General . Map . Grid . GridSize ;
posY . ButtonStep = General . Map . Grid . GridSize ;
posZ . ButtonStep = General . Map . Grid . GridSize ;
2016-02-08 21:51:03 +00:00
//mxd. User vars. Should be done before adding regular fields
ThingTypeInfo fti = General . Map . Data . GetThingInfoEx ( ft . Type ) ;
if ( fti ! = null & & fti . Actor ! = null & & fti . Actor . UserVars . Count > 0 )
fieldslist . SetUserVars ( fti . Actor . UserVars , ft . Fields , true ) ;
2016-07-15 14:07:30 +00:00
thinginfo = fti ; //mxd
2016-02-08 21:51:03 +00:00
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
// Custom fields
2014-12-04 10:06:44 +00:00
fieldslist . SetValues ( ft . Fields , true ) ;
2015-11-29 18:50:35 +00:00
commenteditor . SetValues ( ft . Fields , true ) ;
2014-12-04 10:06:44 +00:00
conversationID . Text = ft . Fields . GetValue ( "conversation" , 0 ) . ToString ( ) ;
2015-11-29 18:50:35 +00:00
floatbobphase . Text = ft . Fields . GetValue ( "floatbobphase" , - 1 ) . ToString ( ) ;
2014-12-04 10:06:44 +00:00
gravity . Text = ft . Fields . GetValue ( "gravity" , 1.0f ) . ToString ( ) ;
score . Text = ft . Fields . GetValue ( "score" , 0 ) . ToString ( ) ;
health . Text = ft . Fields . GetValue ( "health" , 1 ) . ToString ( ) ;
alpha . Text = ft . Fields . GetValue ( "alpha" , 1.0f ) . ToString ( ) ;
2016-03-23 21:26:26 +00:00
color . SetValueFrom ( ft . Fields , true ) ;
2014-12-04 10:06:44 +00:00
scale . SetValues ( ft . ScaleX , ft . ScaleY , true ) ;
pitch . Text = ft . Pitch . ToString ( ) ;
roll . Text = ft . Roll . ToString ( ) ;
renderStyle . SelectedIndex = Array . IndexOf ( renderstyles , ft . Fields . GetValue ( "renderstyle" , "normal" ) ) ;
2014-04-21 09:30:00 +00:00
// Action/tags
action . Value = ft . Action ;
tagSelector . Setup ( UniversalType . ThingTag ) ;
tagSelector . SetTag ( ft . Tag ) ;
2015-07-27 09:02:28 +00:00
//mxd. Args
argscontrol . SetValue ( ft , true ) ;
2014-04-21 09:30:00 +00:00
////////////////////////////////////////////////////////////////////////
// Now go for all lines and change the options when a setting is different
////////////////////////////////////////////////////////////////////////
2015-01-26 08:53:05 +00:00
thingprops = new List < ThingProperties > ( ) ;
2014-04-21 09:30:00 +00:00
// Go for all things
2014-12-03 23:15:26 +00:00
foreach ( Thing t in things )
{
2014-09-03 14:07:08 +00:00
//mxd. Update sector info
t . DetermineSector ( ) ;
2014-04-21 09:30:00 +00:00
// Type does not match?
ThingTypeInfo info = thingtype . GetSelectedInfo ( ) ; //mxd
2016-07-15 14:07:30 +00:00
if ( info ! = null & & info . Index ! = t . Type )
{
thingtype . ClearSelectedType ( ) ;
thinginfo = null ; //mxd
}
2014-04-21 09:30:00 +00:00
// Flags
2014-12-03 23:15:26 +00:00
foreach ( CheckBox c in flags . Checkboxes )
{
2014-08-05 08:22:49 +00:00
if ( c . CheckState = = CheckState . Indeterminate ) continue ; //mxd
if ( t . IsFlagSet ( c . Tag . ToString ( ) ) ! = c . Checked )
{
c . ThreeState = true ;
c . CheckState = CheckState . Indeterminate ;
2014-04-21 09:30:00 +00:00
}
}
// Coordination
if ( t . AngleDoom . ToString ( ) ! = angle . Text ) angle . Text = "" ;
2014-09-03 14:07:08 +00:00
//mxd. Position
if ( ( t . Position . x ) . ToString ( ) ! = posX . Text ) posX . Text = "" ;
if ( ( t . Position . y ) . ToString ( ) ! = posY . Text ) posY . Text = "" ;
2015-04-15 12:49:28 +00:00
if ( useabsoluteheight & & t . Sector ! = null )
2014-12-03 23:15:26 +00:00
{
2015-04-15 12:49:28 +00:00
if ( ( ( float ) Math . Round ( Sector . GetFloorPlane ( t . Sector ) . GetZ ( t . Position ) + t . Position . z , General . Map . FormatInterface . VertexDecimals ) ) . ToString ( ) ! = posZ . Text )
posZ . Text = "" ;
2014-12-03 23:15:26 +00:00
}
else if ( ( t . Position . z ) . ToString ( ) ! = posZ . Text )
{
2014-04-21 09:30:00 +00:00
posZ . Text = "" ;
}
// Action/tags
if ( t . Action ! = action . Value ) action . Empty = true ;
if ( t . Tag ! = ft . Tag ) tagSelector . ClearTag ( ) ; //mxd
2015-07-27 09:02:28 +00:00
//mxd. Arguments
argscontrol . SetValue ( t , false ) ;
2014-04-21 09:30:00 +00:00
2016-02-08 21:51:03 +00:00
//mxd. User vars. Should be done before adding regular fields
ThingTypeInfo ti = General . Map . Data . GetThingInfoEx ( t . Type ) ;
if ( ti ! = null & & ti . Actor ! = null & & ti . Actor . UserVars . Count > 0 )
fieldslist . SetUserVars ( ti . Actor . UserVars , t . Fields , false ) ;
2014-04-21 09:30:00 +00:00
//mxd. Custom fields
2014-12-04 10:06:44 +00:00
fieldslist . SetValues ( t . Fields , false ) ;
2015-07-14 23:34:31 +00:00
commenteditor . SetValues ( t . Fields , false ) ; //mxd. Comments
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
if ( t . Fields . GetValue ( "conversation" , 0 ) . ToString ( ) ! = conversationID . Text ) conversationID . Text = "" ;
2015-11-29 18:50:35 +00:00
if ( t . Fields . GetValue ( "floatbobphase" , - 1 ) . ToString ( ) ! = floatbobphase . Text ) floatbobphase . Text = "" ;
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
if ( t . Fields . GetValue ( "gravity" , 1.0f ) . ToString ( ) ! = gravity . Text ) gravity . Text = "" ;
if ( t . Fields . GetValue ( "score" , 0 ) . ToString ( ) ! = score . Text ) score . Text = "" ;
if ( t . Fields . GetValue ( "health" , 1 ) . ToString ( ) ! = health . Text ) health . Text = "" ;
if ( t . Fields . GetValue ( "alpha" , 1.0f ) . ToString ( ) ! = alpha . Text ) alpha . Text = "" ;
2014-04-21 09:30:00 +00:00
2014-12-04 10:06:44 +00:00
scale . SetValues ( t . ScaleX , t . ScaleY , false ) ;
2016-03-23 21:26:26 +00:00
color . SetValueFrom ( t . Fields , false ) ;
2014-04-21 09:30:00 +00:00
2015-12-28 15:01:53 +00:00
if ( t . Pitch . ToString ( ) ! = pitch . Text ) pitch . Text = "" ;
if ( t . Roll . ToString ( ) ! = roll . Text ) roll . Text = "" ;
2014-04-21 09:30:00 +00:00
2014-12-04 10:06:44 +00:00
//Render style
if ( renderStyle . SelectedIndex > - 1 & & renderStyle . SelectedIndex ! = Array . IndexOf ( renderstyles , t . Fields . GetValue ( "renderstyle" , "normal" ) ) )
renderStyle . SelectedIndex = - 1 ;
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
2014-04-21 09:30:00 +00:00
//mxd. Store initial properties
2015-01-26 08:53:05 +00:00
thingprops . Add ( new ThingProperties ( t ) ) ;
2014-04-21 09:30:00 +00:00
}
preventchanges = false ;
2014-11-03 13:02:59 +00:00
//mxd. Trigger updates manually...
2015-01-26 08:53:05 +00:00
preventmapchange = true ;
2014-05-02 11:37:37 +00:00
angle_WhenTextChanged ( angle , EventArgs . Empty ) ;
pitch_WhenTextChanged ( pitch , EventArgs . Empty ) ;
roll_WhenTextChanged ( roll , EventArgs . Empty ) ;
2014-11-03 13:02:59 +00:00
flags_OnValueChanged ( flags , EventArgs . Empty ) ;
2015-01-26 08:53:05 +00:00
preventmapchange = false ;
2014-05-02 11:37:37 +00:00
2015-07-27 09:02:28 +00:00
argscontrol . UpdateScriptControls ( ) ; //mxd
2014-12-05 14:33:31 +00:00
actionhelp . UpdateAction ( action . GetValue ( ) ) ; //mxd
2015-01-05 14:56:44 +00:00
labelScale . Enabled = scale . NonDefaultValue ; //mxd
2015-07-14 23:34:31 +00:00
commenteditor . FinishSetup ( ) ; //mxd
2016-07-15 14:07:30 +00:00
UpdateFlagNames ( ) ; //mxd
2014-04-21 09:30:00 +00:00
}
2015-01-26 08:53:05 +00:00
//mxd
private void MakeUndo ( )
{
if ( undocreated ) return ;
undocreated = true ;
//mxd. Make undo
General . Map . UndoRedo . CreateUndo ( "Edit " + ( things . Count > 1 ? things . Count + " things" : "thing" ) ) ;
foreach ( Thing t in things ) t . Fields . BeforeFieldsChange ( ) ;
}
2016-07-15 14:07:30 +00:00
//mxd
private void UpdateFlagNames ( )
{
Dictionary < string , string > newflagsrename = ( thinginfo ! = null ? thinginfo . FlagsRename : null ) ;
// Update flag names?
if ( flagsrename ! = null | | newflagsrename ! = null )
{
flags . SuspendLayout ( ) ;
// Restore default flags?
if ( flagsrename ! = null )
{
foreach ( CheckBox cb in flags . Checkboxes )
{
string flag = cb . Tag . ToString ( ) ;
if ( flagsrename . ContainsKey ( flag ) )
{
cb . Text = General . Map . Config . ThingFlags [ flag ] ;
cb . ForeColor = SystemColors . WindowText ;
}
}
}
// Apply new renaming?
if ( newflagsrename ! = null )
{
foreach ( CheckBox cb in flags . Checkboxes )
{
string flag = cb . Tag . ToString ( ) ;
if ( newflagsrename . ContainsKey ( flag ) )
{
cb . Text = newflagsrename [ flag ] ;
cb . ForeColor = SystemColors . HotTrack ;
}
}
}
flags . ResumeLayout ( ) ;
}
// Store current flag names
flagsrename = newflagsrename ;
}
2014-04-21 09:30:00 +00:00
#endregion
#region = = = = = = = = = = = = = = = = = = Events
//mxd
2014-05-02 11:37:37 +00:00
private void thingtype_OnTypeDoubleClicked ( )
{
2014-04-21 09:30:00 +00:00
apply_Click ( this , EventArgs . Empty ) ;
}
// Action changes
2014-05-02 11:37:37 +00:00
private void action_ValueChanges ( object sender , EventArgs e )
{
2014-04-21 09:30:00 +00:00
int showaction = 0 ;
// Only when line type is known, otherwise use the thing arguments
if ( General . Map . Config . LinedefActions . ContainsKey ( action . Value ) ) showaction = action . Value ;
2015-07-27 09:02:28 +00:00
//mxd. Change the argument descriptions
argscontrol . UpdateAction ( showaction , preventchanges , ( action . Empty ? null : thinginfo ) ) ;
2014-04-21 09:30:00 +00:00
2014-12-05 21:34:16 +00:00
if ( ! preventchanges )
2014-12-03 23:15:26 +00:00
{
2015-01-26 08:53:05 +00:00
MakeUndo ( ) ; //mxd
2014-04-21 09:30:00 +00:00
2014-12-05 21:34:16 +00:00
//mxd. Update what must be updated
2015-07-27 09:02:28 +00:00
argscontrol . UpdateScriptControls ( ) ;
2014-12-05 21:34:16 +00:00
actionhelp . UpdateAction ( showaction ) ;
2014-12-05 14:33:31 +00:00
}
2014-04-21 09:30:00 +00:00
}
// Browse Action clicked
2014-05-02 11:37:37 +00:00
private void browseaction_Click ( object sender , EventArgs e )
{
2014-04-21 09:30:00 +00:00
action . Value = ActionBrowserForm . BrowseAction ( this , action . Value ) ;
}
// Angle text changes
2014-05-02 11:37:37 +00:00
private void angle_WhenTextChanged ( object sender , EventArgs e )
{
2015-12-28 15:01:53 +00:00
if ( preventchanges ) return ;
2014-05-02 11:37:37 +00:00
preventchanges = true ;
2016-04-27 09:13:07 +00:00
anglecontrol . Angle = angle . GetResult ( AngleControlEx . NO_ANGLE ) ;
2014-05-02 11:37:37 +00:00
preventchanges = false ;
2015-01-26 08:53:05 +00:00
if ( ! preventmapchange ) ApplyAngleChange ( ) ; //mxd
2014-04-21 09:30:00 +00:00
}
//mxd. Angle control clicked
2014-12-24 18:32:24 +00:00
private void anglecontrol_AngleChanged ( object sender , EventArgs e )
2014-05-02 11:37:37 +00:00
{
if ( preventchanges ) return ;
2014-04-21 09:30:00 +00:00
angle . Text = anglecontrol . Angle . ToString ( ) ;
2015-01-26 08:53:05 +00:00
if ( ! preventmapchange ) ApplyAngleChange ( ) ;
2014-04-21 09:30:00 +00:00
}
2014-05-02 11:37:37 +00:00
private void pitch_WhenTextChanged ( object sender , EventArgs e )
{
if ( preventchanges ) return ;
2016-04-27 09:13:07 +00:00
int p = pitch . GetResult ( AngleControlEx . NO_ANGLE ) ;
2014-05-02 11:37:37 +00:00
preventchanges = true ;
2016-04-27 09:13:07 +00:00
pitchControl . Angle = ( p = = AngleControlEx . NO_ANGLE ? p : p + 90 ) ;
2014-05-02 11:37:37 +00:00
preventchanges = false ;
2015-01-26 08:53:05 +00:00
if ( ! preventmapchange ) ApplyPitchChange ( ) ;
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
}
2014-12-24 18:32:24 +00:00
private void pitchControl_AngleChanged ( object sender , EventArgs e )
2014-05-02 11:37:37 +00:00
{
if ( preventchanges ) return ;
pitch . Text = ( General . ClampAngle ( pitchControl . Angle - 90 ) ) . ToString ( ) ;
2015-01-26 08:53:05 +00:00
if ( ! preventmapchange ) ApplyPitchChange ( ) ;
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
}
2014-05-02 11:37:37 +00:00
private void roll_WhenTextChanged ( object sender , EventArgs e )
{
if ( preventchanges ) return ;
2016-04-27 09:13:07 +00:00
int r = roll . GetResult ( AngleControlEx . NO_ANGLE ) ;
2014-05-02 11:37:37 +00:00
preventchanges = true ;
2016-04-27 09:13:07 +00:00
rollControl . Angle = ( r = = AngleControlEx . NO_ANGLE ? r : r + 90 ) ;
2014-05-02 11:37:37 +00:00
preventchanges = false ;
2015-01-26 08:53:05 +00:00
if ( ! preventmapchange ) ApplyRollChange ( ) ;
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
}
2014-12-24 18:32:24 +00:00
private void rollControl_AngleChanged ( object sender , EventArgs e )
2014-05-02 11:37:37 +00:00
{
if ( preventchanges ) return ;
roll . Text = ( General . ClampAngle ( rollControl . Angle - 90 ) ) . ToString ( ) ;
2015-01-26 08:53:05 +00:00
if ( ! preventmapchange ) ApplyRollChange ( ) ;
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
}
2014-04-21 09:30:00 +00:00
// Apply clicked
2014-05-02 11:37:37 +00:00
private void apply_Click ( object sender , EventArgs e )
{
2015-12-28 15:01:53 +00:00
//mxd. Make Undo
MakeUndo ( ) ;
2015-01-26 08:53:05 +00:00
2014-04-21 09:30:00 +00:00
List < string > defaultflags = new List < string > ( ) ;
// Verify the tag
if ( General . Map . FormatInterface . HasThingTag ) //mxd
{
tagSelector . ValidateTag ( ) ; //mxd
2014-12-03 23:15:26 +00:00
if ( ( ( tagSelector . GetTag ( 0 ) < General . Map . FormatInterface . MinTag ) | | ( tagSelector . GetTag ( 0 ) > General . Map . FormatInterface . MaxTag ) ) )
{
2014-04-21 09:30:00 +00:00
General . ShowWarningMessage ( "Thing tag must be between " + General . Map . FormatInterface . MinTag + " and " + General . Map . FormatInterface . MaxTag + "." , MessageBoxButtons . OK ) ;
return ;
}
}
// Verify the type
2016-02-29 08:10:11 +00:00
if ( ! string . IsNullOrEmpty ( thingtype . TypeStringValue ) & & ( ( thingtype . GetResult ( 0 ) < General . Map . FormatInterface . MinThingType ) | | ( thingtype . GetResult ( 0 ) > General . Map . FormatInterface . MaxThingType ) ) )
2014-12-03 23:15:26 +00:00
{
2014-04-21 09:30:00 +00:00
General . ShowWarningMessage ( "Thing type must be between " + General . Map . FormatInterface . MinThingType + " and " + General . Map . FormatInterface . MaxThingType + "." , MessageBoxButtons . OK ) ;
return ;
}
// Verify the action
2014-12-03 23:15:26 +00:00
if ( General . Map . FormatInterface . HasThingAction & & ( ( action . Value < General . Map . FormatInterface . MinAction ) | | ( action . Value > General . Map . FormatInterface . MaxAction ) ) )
{
2014-04-21 09:30:00 +00:00
General . ShowWarningMessage ( "Thing action must be between " + General . Map . FormatInterface . MinAction + " and " + General . Map . FormatInterface . MaxAction + "." , MessageBoxButtons . OK ) ;
return ;
}
// Go for all the things
2014-08-05 11:03:55 +00:00
int tagoffset = 0 ; //mxd
2014-12-03 23:15:26 +00:00
foreach ( Thing t in things )
{
2014-04-21 09:30:00 +00:00
// Coordination
2015-02-27 10:55:18 +00:00
//mxd. Randomize rotations?
2016-06-15 22:02:51 +00:00
if ( cbrandomangle . Checked )
{
int newangle = General . Random ( 0 , 359 ) ;
if ( General . Map . Config . DoomThingRotationAngles ) newangle = newangle / 45 * 45 ;
t . Rotate ( newangle ) ;
}
2015-02-27 10:55:18 +00:00
if ( cbrandompitch . Checked ) t . SetPitch ( General . Random ( 0 , 359 ) ) ;
if ( cbrandomroll . Checked ) t . SetRoll ( General . Random ( 0 , 359 ) ) ;
2014-04-21 09:30:00 +00:00
//mxd. Check position
float px = General . Clamp ( t . Position . x , General . Map . Config . LeftBoundary , General . Map . Config . RightBoundary ) ;
float py = General . Clamp ( t . Position . y , General . Map . Config . BottomBoundary , General . Map . Config . TopBoundary ) ;
if ( t . Position . x ! = px | | t . Position . y ! = py ) t . Move ( new Vector2D ( px , py ) ) ;
// Action/tags
2014-08-11 08:35:39 +00:00
t . Tag = General . Clamp ( tagSelector . GetSmartTag ( t . Tag , tagoffset + + ) , General . Map . FormatInterface . MinTag , General . Map . FormatInterface . MaxTag ) ; //mxd
2015-07-27 09:02:28 +00:00
if ( ! action . Empty ) t . Action = action . Value ;
2014-04-21 09:30:00 +00:00
2015-07-27 09:02:28 +00:00
//mxd. Apply args
argscontrol . Apply ( t ) ;
2014-04-21 09:30:00 +00:00
//mxd. Custom fields
2014-12-04 10:06:44 +00:00
fieldslist . Apply ( t . Fields ) ;
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
if ( ! string . IsNullOrEmpty ( conversationID . Text ) )
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
UniFields . SetInteger ( t . Fields , "conversation" , conversationID . GetResult ( t . Fields . GetValue ( "conversation" , 0 ) ) , 0 ) ;
2015-11-29 18:50:35 +00:00
if ( ! string . IsNullOrEmpty ( floatbobphase . Text ) )
UniFields . SetInteger ( t . Fields , "floatbobphase" , General . Clamp ( floatbobphase . GetResult ( t . Fields . GetValue ( "floatbobphase" , - 1 ) ) , - 1 , 63 ) , - 1 ) ;
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
if ( ! string . IsNullOrEmpty ( gravity . Text ) )
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
UniFields . SetFloat ( t . Fields , "gravity" , gravity . GetResultFloat ( t . Fields . GetValue ( "gravity" , 1.0f ) ) , 1.0f ) ;
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
if ( ! string . IsNullOrEmpty ( health . Text ) )
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
UniFields . SetInteger ( t . Fields , "health" , health . GetResult ( t . Fields . GetValue ( "health" , 1 ) ) , 1 ) ;
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
if ( ! string . IsNullOrEmpty ( score . Text ) )
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
UniFields . SetInteger ( t . Fields , "score" , score . GetResult ( t . Fields . GetValue ( "score" , 0 ) ) , 0 ) ;
2014-12-04 10:06:44 +00:00
2016-02-08 21:51:03 +00:00
//mxd. User vars. Should be called after fieldslist.Apply()
ThingTypeInfo ti = General . Map . Data . GetThingInfoEx ( t . Type ) ;
if ( ti ! = null & & ti . Actor ! = null & & ti . Actor . UserVars . Count > 0 )
fieldslist . ApplyUserVars ( ti . Actor . UserVars , t . Fields ) ;
2014-12-04 10:06:44 +00:00
color . ApplyTo ( t . Fields , t . Fields . GetValue ( "fillcolor" , 0 ) ) ;
2014-04-21 09:30:00 +00:00
2015-07-14 23:34:31 +00:00
//mxd. Comments
commenteditor . Apply ( t . Fields ) ;
2014-04-21 09:30:00 +00:00
// Update settings
t . UpdateConfiguration ( ) ;
}
// Set as defaults
2015-12-28 15:01:53 +00:00
foreach ( CheckBox c in flags . Checkboxes )
2014-12-03 23:15:26 +00:00
{
2015-12-28 15:01:53 +00:00
if ( c . CheckState = = CheckState . Checked ) defaultflags . Add ( c . Tag . ToString ( ) ) ;
2014-04-21 09:30:00 +00:00
}
General . Settings . DefaultThingType = thingtype . GetResult ( General . Settings . DefaultThingType ) ;
General . Settings . DefaultThingAngle = Angle2D . DegToRad ( ( float ) angle . GetResult ( ( int ) Angle2D . RadToDeg ( General . Settings . DefaultThingAngle ) - 90 ) + 90 ) ;
General . Settings . SetDefaultThingFlags ( defaultflags ) ;
2015-06-14 19:29:44 +00:00
// Store value linking
linkscale = scale . LinkValues ;
2014-04-21 09:30:00 +00:00
// Done
General . Map . IsChanged = true ;
if ( OnValuesChanged ! = null ) OnValuesChanged ( this , EventArgs . Empty ) ; //mxd
this . DialogResult = DialogResult . OK ;
this . Close ( ) ;
}
// Cancel clicked
2014-05-02 11:37:37 +00:00
private void cancel_Click ( object sender , EventArgs e )
{
2015-01-26 08:53:05 +00:00
//mxd. Perform undo?
if ( undocreated ) General . Map . UndoRedo . WithdrawUndo ( ) ;
2014-04-21 09:30:00 +00:00
// Be gone
this . DialogResult = DialogResult . Cancel ;
this . Close ( ) ;
}
//mxd
2014-05-02 11:37:37 +00:00
private void cbAbsoluteHeight_CheckedChanged ( object sender , EventArgs e )
{
2014-09-03 14:07:08 +00:00
if ( preventchanges ) return ;
2015-04-15 12:49:28 +00:00
MakeUndo ( ) ;
2015-01-26 08:53:05 +00:00
2015-04-15 12:49:28 +00:00
useabsoluteheight = cbAbsoluteHeight . Checked ;
2014-09-03 14:07:08 +00:00
preventchanges = true ;
//update label text
Thing ft = General . GetByIndex ( things , 0 ) ;
float z = ft . Position . z ;
2015-04-15 12:49:28 +00:00
if ( useabsoluteheight & & ft . Sector ! = null ) z + = Sector . GetFloorPlane ( ft . Sector ) . GetZ ( ft . Position ) ;
posZ . Text = ( ( float ) Math . Round ( z , General . Map . FormatInterface . VertexDecimals ) ) . ToString ( ) ;
2014-09-03 14:07:08 +00:00
2014-12-03 23:15:26 +00:00
foreach ( Thing t in things )
{
2014-09-03 14:07:08 +00:00
z = t . Position . z ;
2015-04-15 12:49:28 +00:00
if ( useabsoluteheight & & t . Sector ! = null ) z + = Sector . GetFloorPlane ( t . Sector ) . GetZ ( t . Position ) ;
string ztext = ( ( float ) Math . Round ( z , General . Map . FormatInterface . VertexDecimals ) ) . ToString ( ) ;
if ( posZ . Text ! = ztext )
2014-12-03 23:15:26 +00:00
{
2014-09-03 14:07:08 +00:00
posZ . Text = "" ;
break ;
}
}
preventchanges = false ;
2014-04-21 09:30:00 +00:00
}
//mxd
2014-05-02 11:37:37 +00:00
private void tabcustom_MouseEnter ( object sender , EventArgs e )
{
2014-04-21 09:30:00 +00:00
fieldslist . Focus ( ) ;
}
Fixed, Visual mode, Auto-align actions: incorrect texture was used when clamping texture offsets of 3D floor sides.
Fixed, Numeric textbox: incorrect character was treated as decimal separator character was used when using certain Windows regional settings.
Changed, Edit Things window: when applicable, the "Filter" textbox is now focused when opening the window.
Changed, Sector Effects browser window: when applicable, the "Filter" textbox is now focused when opening the window.
Changed, Edit Things window: when the "Filter" textbox is focused, pressing the "Down" key will now switch focus to the Things list.
Changed, Sector Effects Browser window: when the "Filter" textbox is focused, pressing the "Down" key will now switch focus to the Effects list.
Changed, Linedef Action Browser window: when the "Filter" textbox is focused, pressing the "Down" key will now switch focus to the Actions list.
Configurations, Doom map format thing flags: changed "Multiplayer" flag name to "Multiplayer only".
2015-09-23 11:04:12 +00:00
//mxd
private void ThingEditFormUDMF_Shown ( object sender , EventArgs e )
{
if ( activetab = = 0 )
{
thingtype . Focus ( ) ;
thingtype . FocusTextbox ( ) ;
}
}
2014-04-21 09:30:00 +00:00
//mxd
2014-12-03 23:15:26 +00:00
private void ThingEditForm_FormClosing ( object sender , FormClosingEventArgs e )
{
2014-04-21 09:30:00 +00:00
location = this . Location ;
2015-04-15 07:41:18 +00:00
activetab = tabs . SelectedIndex ;
2016-02-07 23:04:20 +00:00
General . Settings . WriteSetting ( "customfieldsshowfixed" , ! hidefixedfields . Checked ) ;
2014-04-21 09:30:00 +00:00
}
// Help
2014-05-02 11:37:37 +00:00
private void ThingEditForm_HelpRequested ( object sender , HelpEventArgs hlpevent )
{
2015-06-01 21:46:28 +00:00
General . ShowHelp ( "w_thingedit.html" ) ;
2014-04-21 09:30:00 +00:00
hlpevent . Handled = true ;
}
#endregion
#region = = = = = = = = = = = = = = = = = = mxd . Realtime events
2014-05-02 11:37:37 +00:00
private void posX_WhenTextChanged ( object sender , EventArgs e )
{
2014-04-21 09:30:00 +00:00
if ( preventchanges ) return ;
2015-01-26 08:53:05 +00:00
MakeUndo ( ) ; //mxd
2014-04-21 09:30:00 +00:00
int i = 0 ;
2014-09-03 14:07:08 +00:00
// Update values
foreach ( Thing t in things )
2015-01-26 08:53:05 +00:00
t . Move ( new Vector2D ( posX . GetResultFloat ( thingprops [ i + + ] . X ) , t . Position . y ) ) ;
2014-04-21 09:30:00 +00:00
General . Map . IsChanged = true ;
if ( OnValuesChanged ! = null ) OnValuesChanged ( this , EventArgs . Empty ) ;
}
2014-05-02 11:37:37 +00:00
private void posY_WhenTextChanged ( object sender , EventArgs e )
{
2014-04-21 09:30:00 +00:00
if ( preventchanges ) return ;
2015-01-26 08:53:05 +00:00
MakeUndo ( ) ; //mxd
2014-04-21 09:30:00 +00:00
int i = 0 ;
2014-09-03 14:07:08 +00:00
// Update values
foreach ( Thing t in things )
2015-01-26 08:53:05 +00:00
t . Move ( new Vector2D ( t . Position . x , posY . GetResultFloat ( thingprops [ i + + ] . Y ) ) ) ;
2014-04-21 09:30:00 +00:00
General . Map . IsChanged = true ;
if ( OnValuesChanged ! = null ) OnValuesChanged ( this , EventArgs . Empty ) ;
}
2014-05-02 11:37:37 +00:00
private void posZ_WhenTextChanged ( object sender , EventArgs e )
{
2014-04-21 09:30:00 +00:00
if ( preventchanges ) return ;
2015-01-26 08:53:05 +00:00
MakeUndo ( ) ; //mxd
2014-09-03 14:07:08 +00:00
int i = 0 ;
2014-04-21 09:30:00 +00:00
2014-12-03 23:15:26 +00:00
if ( string . IsNullOrEmpty ( posZ . Text ) )
{
2014-09-03 14:07:08 +00:00
// Restore values
2014-04-21 09:30:00 +00:00
foreach ( Thing t in things )
2015-01-26 08:53:05 +00:00
t . Move ( new Vector3D ( t . Position . x , t . Position . y , thingprops [ i + + ] . Z ) ) ;
2014-12-03 23:15:26 +00:00
}
else
{
2014-09-03 14:07:08 +00:00
// Update values
2014-12-03 23:15:26 +00:00
foreach ( Thing t in things )
{
2015-01-26 08:53:05 +00:00
float z = posZ . GetResultFloat ( thingprops [ i + + ] . Z ) ;
2015-04-15 12:49:28 +00:00
if ( useabsoluteheight & & ! posZ . CheckIsRelative ( ) & & t . Sector ! = null )
z - = ( float ) Math . Round ( Sector . GetFloorPlane ( t . Sector ) . GetZ ( t . Position . x , t . Position . y ) , General . Map . FormatInterface . VertexDecimals ) ;
2014-04-21 09:30:00 +00:00
t . Move ( new Vector3D ( t . Position . x , t . Position . y , z ) ) ;
}
}
General . Map . IsChanged = true ;
if ( OnValuesChanged ! = null ) OnValuesChanged ( this , EventArgs . Empty ) ;
}
2014-05-02 11:37:37 +00:00
private void scale_OnValuesChanged ( object sender , EventArgs e )
{
2015-01-26 08:53:05 +00:00
if ( preventchanges ) return ;
MakeUndo ( ) ; //mxd
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
int i = 0 ;
2015-12-28 15:01:53 +00:00
foreach ( Thing t in things )
2014-12-03 23:15:26 +00:00
{
2015-01-26 08:53:05 +00:00
float sx = scale . GetValue1 ( thingprops [ i ] . ScaleX ) ;
float sy = scale . GetValue2 ( thingprops [ i ] . ScaleY ) ;
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
t . SetScale ( ( sx = = 0 ? 1.0f : sx ) , ( sy = = 0 ? 1.0f : sy ) ) ;
i + + ;
}
General . Map . IsChanged = true ;
2015-01-05 14:56:44 +00:00
labelScale . Enabled = scale . NonDefaultValue ;
2015-12-28 15:01:53 +00:00
if ( OnValuesChanged ! = null ) OnValuesChanged ( this , EventArgs . Empty ) ;
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
}
2014-04-21 09:30:00 +00:00
// Selected type changes
2014-05-02 11:37:37 +00:00
private void thingtype_OnTypeChanged ( ThingTypeInfo value )
{
2014-04-21 09:30:00 +00:00
thinginfo = value ;
// Update arguments
action_ValueChanges ( this , EventArgs . Empty ) ;
//mxd. Update things
2016-02-29 08:10:11 +00:00
if ( preventchanges | |
( ! string . IsNullOrEmpty ( thingtype . TypeStringValue ) & &
thingtype . GetResult ( 0 ) < General . Map . FormatInterface . MinThingType
| | thingtype . GetResult ( 0 ) > General . Map . FormatInterface . MaxThingType ) )
2014-04-21 09:30:00 +00:00
return ;
2015-01-26 08:53:05 +00:00
MakeUndo ( ) ; //mxd
2014-12-03 23:15:26 +00:00
foreach ( Thing t in things )
{
2014-04-21 09:30:00 +00:00
//Set type
t . Type = thingtype . GetResult ( t . Type ) ;
// Update settings
t . UpdateConfiguration ( ) ;
}
2016-07-15 14:07:30 +00:00
UpdateFlagNames ( ) ; //mxd
2014-04-21 09:30:00 +00:00
General . Map . IsChanged = true ;
if ( OnValuesChanged ! = null ) OnValuesChanged ( this , EventArgs . Empty ) ;
}
//mxd
2015-01-26 08:53:05 +00:00
private void ApplyAngleChange ( )
2014-05-02 11:37:37 +00:00
{
2014-04-21 09:30:00 +00:00
if ( preventchanges ) return ;
2015-01-26 08:53:05 +00:00
MakeUndo ( ) ; //mxd
2014-04-21 09:30:00 +00:00
int i = 0 ;
//restore values
2014-12-03 23:15:26 +00:00
if ( string . IsNullOrEmpty ( angle . Text ) )
{
2015-01-26 08:53:05 +00:00
foreach ( Thing t in things ) t . Rotate ( thingprops [ i + + ] . AngleDoom ) ;
2014-12-03 23:15:26 +00:00
}
else //update values
{
2014-04-21 09:30:00 +00:00
foreach ( Thing t in things )
2015-01-26 08:53:05 +00:00
t . Rotate ( angle . GetResult ( thingprops [ i + + ] . AngleDoom ) ) ;
2014-04-21 09:30:00 +00:00
}
General . Map . IsChanged = true ;
if ( OnValuesChanged ! = null ) OnValuesChanged ( this , EventArgs . Empty ) ;
}
2015-01-26 08:53:05 +00:00
private void ApplyPitchChange ( )
2014-05-02 11:37:37 +00:00
{
2015-01-26 08:53:05 +00:00
if ( preventchanges ) return ;
MakeUndo ( ) ; //mxd
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
int i = 0 ;
//restore values
2015-12-28 15:01:53 +00:00
if ( string . IsNullOrEmpty ( pitch . Text ) )
2014-12-03 23:15:26 +00:00
{
2015-12-28 15:01:53 +00:00
foreach ( Thing t in things ) t . SetPitch ( thingprops [ i + + ] . Pitch ) ;
2014-12-03 23:15:26 +00:00
}
else //update values
{
2015-12-28 15:01:53 +00:00
foreach ( Thing t in things )
2015-01-26 08:53:05 +00:00
t . SetPitch ( pitch . GetResult ( thingprops [ i + + ] . Pitch ) ) ;
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
}
General . Map . IsChanged = true ;
2015-01-26 08:53:05 +00:00
if ( OnValuesChanged ! = null ) OnValuesChanged ( this , EventArgs . Empty ) ;
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
}
2014-12-03 23:15:26 +00:00
//mxd
2015-01-26 08:53:05 +00:00
private void ApplyRollChange ( )
2014-05-02 11:37:37 +00:00
{
2015-01-26 08:53:05 +00:00
if ( preventchanges ) return ;
MakeUndo ( ) ; //mxd
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
int i = 0 ;
//restore values
2015-12-28 15:01:53 +00:00
if ( string . IsNullOrEmpty ( roll . Text ) )
2014-12-03 23:15:26 +00:00
{
2015-12-28 15:01:53 +00:00
foreach ( Thing t in things ) t . SetRoll ( thingprops [ i + + ] . Roll ) ;
2014-12-03 23:15:26 +00:00
}
else //update values
{
2015-12-28 15:01:53 +00:00
foreach ( Thing t in things )
2015-01-26 08:53:05 +00:00
t . SetRoll ( roll . GetResult ( thingprops [ i + + ] . Roll ) ) ;
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
}
General . Map . IsChanged = true ;
2015-12-28 15:01:53 +00:00
if ( OnValuesChanged ! = null ) OnValuesChanged ( this , EventArgs . Empty ) ;
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score.
Visual mode, UDMF: UDMF scale is now applied when rendering sprites.
Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info.
Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly.
Classic modes: display was not updated after loading a sprite.
Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
2014-04-30 10:01:22 +00:00
}
2014-09-29 20:49:41 +00:00
private void flags_OnValueChanged ( object sender , EventArgs e )
{
if ( preventchanges ) return ;
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
MakeUndo ( ) ; //mxd
int i = 0 ;
2014-09-29 20:49:41 +00:00
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
// Apply flags
foreach ( Thing t in things )
{
// Apply all flags
foreach ( CheckBox c in flags . Checkboxes )
{
if ( c . CheckState = = CheckState . Checked )
t . SetFlag ( c . Tag . ToString ( ) , true ) ;
else if ( c . CheckState = = CheckState . Unchecked )
t . SetFlag ( c . Tag . ToString ( ) , false ) ;
else if ( thingprops [ i ] . Flags . ContainsKey ( c . Tag . ToString ( ) ) )
t . SetFlag ( c . Tag . ToString ( ) , thingprops [ i ] . Flags [ c . Tag . ToString ( ) ] ) ;
else //things created in the editor have empty Flags by default
t . SetFlag ( c . Tag . ToString ( ) , false ) ;
}
i + + ;
}
// Dispatch event
General . Map . IsChanged = true ;
if ( OnValuesChanged ! = null ) OnValuesChanged ( this , EventArgs . Empty ) ;
2015-12-28 15:01:53 +00:00
// Gather enabled flags
HashSet < string > activeflags = new HashSet < string > ( ) ;
foreach ( CheckBox cb in flags . Checkboxes )
{
if ( cb . CheckState ! = CheckState . Unchecked ) activeflags . Add ( cb . Tag . ToString ( ) ) ;
}
// Check em
List < string > warnings = ThingFlagsCompare . CheckFlags ( activeflags ) ;
if ( warnings . Count > 0 )
2014-09-29 20:49:41 +00:00
{
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
// Got missing flags
2015-12-28 15:01:53 +00:00
tooltip . SetToolTip ( missingflags , string . Join ( Environment . NewLine , warnings . ToArray ( ) ) ) ;
2014-11-03 13:02:59 +00:00
missingflags . Visible = true ;
settingsgroup . ForeColor = Color . DarkRed ;
return ;
2014-09-29 20:49:41 +00:00
}
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
// Everything is OK
2014-09-29 20:49:41 +00:00
missingflags . Visible = false ;
settingsgroup . ForeColor = SystemColors . ControlText ;
}
2015-02-27 10:55:18 +00:00
private void cbrandomangle_CheckedChanged ( object sender , EventArgs e )
{
angle . Enabled = ! cbrandomangle . Checked ;
groupangle . Enabled = ! cbrandomangle . Checked ;
}
private void cbrandompitch_CheckedChanged ( object sender , EventArgs e )
{
pitch . Enabled = ! cbrandompitch . Checked ;
grouppitch . Enabled = ! cbrandompitch . Checked ;
}
private void cbrandomroll_CheckedChanged ( object sender , EventArgs e )
{
roll . Enabled = ! cbrandomroll . Checked ;
grouproll . Enabled = ! cbrandomroll . Checked ;
}
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
private void renderStyle_SelectedIndexChanged ( object sender , EventArgs e )
{
if ( preventchanges ) return ;
MakeUndo ( ) ; //mxd
//update values
foreach ( Thing t in things )
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
UniFields . SetString ( t . Fields , "renderstyle" , renderstyles [ renderStyle . SelectedIndex ] , "normal" ) ;
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
General . Map . IsChanged = true ;
if ( OnValuesChanged ! = null ) OnValuesChanged ( this , EventArgs . Empty ) ;
}
private void alpha_WhenTextChanged ( object sender , EventArgs e )
{
if ( preventchanges ) return ;
MakeUndo ( ) ; //mxd
int i = 0 ;
//restore values
if ( string . IsNullOrEmpty ( alpha . Text ) )
{
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
foreach ( Thing t in things ) UniFields . SetFloat ( t . Fields , "alpha" , thingprops [ i + + ] . Alpha , 1.0f ) ;
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
}
else //update values
{
foreach ( Thing t in things )
{
float value = General . Clamp ( alpha . GetResultFloat ( t . Fields . GetValue ( "alpha" , 1.0f ) ) , 0f , 1.0f ) ;
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
UniFields . SetFloat ( t . Fields , "alpha" , value , 1.0f ) ;
Added, Visual mode, DECORATE: "Alpha" and "DefaultAlpha" properties are now supported.
Added, Visual mode, DECORATE: "RenderStyle" property is now partially supported.
Added, Visual mode, DECORATE: +BRIGHT flag is now supported.
Added, Visual mode, UDMF: "Alpha" thing property is now supported.
Added, Visual mode, UDMF: "RenderStyle" thing property is now partially supported.
Added, Visual mode, Hexen map format and UDMF: "Translucent" and "Invisible" thing flags are now supported.
Added, Game Configurations: added "alpha" and "renderstyle" Thing and Thing Category properties.
Fixed, Visual mode: blockmap was not updated when moving things using "Move Thing Left/Right/Forward/Backward" and "Move Thing to Cursor Location" actions.
DECORATE parser: added a warning when unable to find actor's parent class.
Internal: current map format can now be checked using "General.Map.UDMF", "General.Map.HEXEN" and "General.Map.DOOM" properties.
Updated documentation ("Game Configuration - Things Settings" page).
2015-09-28 14:57:48 +00:00
}
}
General . Map . IsChanged = true ;
if ( OnValuesChanged ! = null ) OnValuesChanged ( this , EventArgs . Empty ) ;
}
2016-02-07 23:04:20 +00:00
private void hidefixedfields_CheckedChanged ( object sender , EventArgs e )
{
fieldslist . ShowFixedFields = ! hidefixedfields . Checked ;
}
2014-04-21 09:30:00 +00:00
#endregion
}
}