UltimateZoneBuilder/Source/Core/GZBuilder/GZGeneral.cs
MaxED 13c3155db5 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

159 lines
No EOL
5.7 KiB
C#

#region ================== Namespaces
using CodeImp.DoomBuilder.Actions;
using CodeImp.DoomBuilder.Config;
using CodeImp.DoomBuilder.Windows;
using CodeImp.DoomBuilder.GZBuilder.Data;
#endregion
namespace CodeImp.DoomBuilder.GZBuilder
{
//mxd. should get rid of this class one day...
public static class GZGeneral
{
#region ================== Properties
//gzdoom light types
private static readonly int[] gzLights = { /* normal lights */ 9800, 9801, 9802, 9803, 9804, /* additive lights */ 9810, 9811, 9812, 9813, 9814, /* negative lights */ 9820, 9821, 9822, 9823, 9824, /* vavoom lights */ 1502, 1503};
public static int[] GZ_LIGHTS { get { return gzLights; } }
private static readonly int[] gzLightTypes = { 5, 10, 15 }; //these are actually offsets in gz_lights
public static int[] GZ_LIGHT_TYPES { get { return gzLightTypes; } }
private static readonly DynamicLightType[] gzAnimatedLightTypes = { DynamicLightType.FLICKER, DynamicLightType.RANDOM, DynamicLightType.PULSE };
public static DynamicLightType[] GZ_ANIMATED_LIGHT_TYPES { get { return gzAnimatedLightTypes; } }
//asc script action specials
private static readonly int[] acsSpecials = { 80, 81, 82, 83, 84, 85, 226 };
public static int[] ACS_SPECIALS { get { return acsSpecials; } }
#endregion
#region ================== Methods
public static void Init()
{
//bind actions
General.Actions.BindMethods(typeof(GZGeneral));
}
#endregion
#region ================== Actions
[BeginAction("gztogglemodels")]
private static void ToggleModelsRenderingMode()
{
switch(General.Settings.GZDrawModelsMode)
{
case ModelRenderMode.NONE:
General.Settings.GZDrawModelsMode = ModelRenderMode.SELECTION;
General.MainWindow.DisplayStatus(StatusType.Action, "Models rendering mode: SELECTION ONLY");
break;
case ModelRenderMode.SELECTION:
General.Settings.GZDrawModelsMode = ModelRenderMode.ACTIVE_THINGS_FILTER;
General.MainWindow.DisplayStatus(StatusType.Action, "Models rendering mode: ACTIVE THINGS FILTER ONLY");
break;
case ModelRenderMode.ACTIVE_THINGS_FILTER:
General.Settings.GZDrawModelsMode = ModelRenderMode.ALL;
General.MainWindow.DisplayStatus(StatusType.Action, "Models rendering mode: ALL");
break;
case ModelRenderMode.ALL:
General.Settings.GZDrawModelsMode = ModelRenderMode.NONE;
General.MainWindow.DisplayStatus(StatusType.Action, "Models rendering mode: NONE");
break;
}
General.MainWindow.RedrawDisplay();
General.MainWindow.UpdateGZDoomPanel();
}
[BeginAction("gztogglelights")]
private static void ToggleLightsRenderingMode()
{
switch(General.Settings.GZDrawLightsMode)
{
case LightRenderMode.NONE:
General.Settings.GZDrawLightsMode = LightRenderMode.ALL;
General.MainWindow.DisplayStatus(StatusType.Action, "Dynamic lights rendering mode: ALL");
break;
case LightRenderMode.ALL:
General.Settings.GZDrawLightsMode = LightRenderMode.ALL_ANIMATED;
General.MainWindow.DisplayStatus(StatusType.Action, "Models rendering mode: ANIMATED");
break;
case LightRenderMode.ALL_ANIMATED:
General.Settings.GZDrawLightsMode = LightRenderMode.NONE;
General.MainWindow.DisplayStatus(StatusType.Action, "Models rendering mode: NONE");
break;
}
General.MainWindow.RedrawDisplay();
General.MainWindow.UpdateGZDoomPanel();
}
[BeginAction("gztogglefog")]
private static void ToggleFog()
{
General.Settings.GZDrawFog = !General.Settings.GZDrawFog;
General.MainWindow.DisplayStatus(StatusType.Action, "Fog rendering is " + (General.Settings.GZDrawFog ? "ENABLED" : "DISABLED"));
General.MainWindow.RedrawDisplay();
General.MainWindow.UpdateGZDoomPanel();
}
[BeginAction("gztogglefx")]
private static void ToggleFx()
{
int on = 0;
on += General.Settings.GZDrawFog ? 1 : -1;
on += General.Settings.GZDrawLightsMode != LightRenderMode.NONE ? 1 : -1;
on += General.Settings.GZDrawModelsMode != ModelRenderMode.NONE ? 1 : -1;
bool enable = (on < 0);
General.Settings.GZDrawFog = enable;
General.Settings.GZDrawLightsMode = (enable ? LightRenderMode.ALL : LightRenderMode.NONE);
General.Settings.GZDrawModelsMode = (enable ? ModelRenderMode.ALL : ModelRenderMode.NONE);
General.MainWindow.DisplayStatus(StatusType.Action, "Advanced effects are " + (enable ? "ENABLED" : "DISABLED") );
General.MainWindow.RedrawDisplay();
General.MainWindow.UpdateGZDoomPanel();
}
[BeginAction("gztoggleeventlines")]
private static void ToggleEventLines()
{
General.Settings.GZShowEventLines = !General.Settings.GZShowEventLines;
General.MainWindow.DisplayStatus(StatusType.Action, "Event lines are " + (General.Settings.GZShowEventLines ? "ENABLED" : "DISABLED"));
General.MainWindow.RedrawDisplay();
General.MainWindow.UpdateGZDoomPanel();
}
[BeginAction("gztogglevisualvertices")]
private static void ToggleVisualVertices()
{
General.Settings.GZShowVisualVertices = !General.Settings.GZShowVisualVertices;
General.MainWindow.DisplayStatus(StatusType.Action, "Visual vertices are " + (General.Settings.GZShowVisualVertices ? "ENABLED" : "DISABLED"));
General.MainWindow.RedrawDisplay();
General.MainWindow.UpdateGZDoomPanel();
}
//main menu actions
[BeginAction("gzreloadmodeldef")]
private static void ReloadModeldef()
{
if(General.Map != null) General.Map.Data.ReloadModeldef();
}
[BeginAction("gzreloadgldefs")]
private static void ReloadGldefs()
{
if (General.Map != null) General.Map.Data.ReloadGldefs();
}
#endregion
}
}