2014-10-20 12:16:51 +00:00
|
|
|
|
#region ================== Namespaces
|
|
|
|
|
|
|
|
|
|
using CodeImp.DoomBuilder.Actions;
|
|
|
|
|
using CodeImp.DoomBuilder.Config;
|
2012-04-17 19:13:47 +00:00
|
|
|
|
using CodeImp.DoomBuilder.Windows;
|
|
|
|
|
using CodeImp.DoomBuilder.GZBuilder.Data;
|
|
|
|
|
|
2014-10-20 12:16:51 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
2012-04-17 19:13:47 +00:00
|
|
|
|
namespace CodeImp.DoomBuilder.GZBuilder
|
|
|
|
|
{
|
2013-09-11 09:47:53 +00:00
|
|
|
|
//mxd. should get rid of this class one day...
|
|
|
|
|
public static class GZGeneral
|
|
|
|
|
{
|
2014-10-20 12:16:51 +00:00
|
|
|
|
#region ================== Properties
|
|
|
|
|
|
2013-09-11 09:47:53 +00:00
|
|
|
|
//gzdoom light types
|
2014-10-20 12:16:51 +00:00
|
|
|
|
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};
|
2013-09-11 09:47:53 +00:00
|
|
|
|
public static int[] GZ_LIGHTS { get { return gzLights; } }
|
2014-10-20 12:16:51 +00:00
|
|
|
|
private static readonly int[] gzLightTypes = { 5, 10, 15 }; //these are actually offsets in gz_lights
|
2013-09-11 09:47:53 +00:00
|
|
|
|
public static int[] GZ_LIGHT_TYPES { get { return gzLightTypes; } }
|
2014-10-20 12:16:51 +00:00
|
|
|
|
private static readonly DynamicLightType[] gzAnimatedLightTypes = { DynamicLightType.FLICKER, DynamicLightType.RANDOM, DynamicLightType.PULSE };
|
2013-12-18 09:11:04 +00:00
|
|
|
|
public static DynamicLightType[] GZ_ANIMATED_LIGHT_TYPES { get { return gzAnimatedLightTypes; } }
|
2013-09-11 09:47:53 +00:00
|
|
|
|
|
|
|
|
|
//asc script action specials
|
2014-10-20 12:16:51 +00:00
|
|
|
|
private static readonly int[] acsSpecials = { 80, 81, 82, 83, 84, 85, 226 };
|
2013-09-11 09:47:53 +00:00
|
|
|
|
public static int[] ACS_SPECIALS { get { return acsSpecials; } }
|
|
|
|
|
|
2014-10-20 12:16:51 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region ================== Methods
|
|
|
|
|
|
|
|
|
|
public static void Init()
|
|
|
|
|
{
|
2013-09-11 09:47:53 +00:00
|
|
|
|
//bind actions
|
|
|
|
|
General.Actions.BindMethods(typeof(GZGeneral));
|
|
|
|
|
}
|
2012-04-18 19:34:11 +00:00
|
|
|
|
|
2014-10-20 12:16:51 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region ================== Actions
|
|
|
|
|
|
2013-09-11 09:47:53 +00:00
|
|
|
|
[BeginAction("gztogglemodels")]
|
2014-10-20 12:16:51 +00:00
|
|
|
|
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:
|
2015-06-27 09:10:24 +00:00
|
|
|
|
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:
|
2014-10-20 12:16:51 +00:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-11 09:47:53 +00:00
|
|
|
|
General.MainWindow.RedrawDisplay();
|
|
|
|
|
General.MainWindow.UpdateGZDoomPanel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BeginAction("gztogglelights")]
|
2014-10-20 12:16:51 +00:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-11 09:47:53 +00:00
|
|
|
|
General.MainWindow.RedrawDisplay();
|
|
|
|
|
General.MainWindow.UpdateGZDoomPanel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BeginAction("gztogglefog")]
|
2014-10-20 12:16:51 +00:00
|
|
|
|
private static void ToggleFog()
|
|
|
|
|
{
|
2013-09-11 09:47:53 +00:00
|
|
|
|
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")]
|
2014-10-20 12:16:51 +00:00
|
|
|
|
private static void ToggleFx()
|
|
|
|
|
{
|
2013-09-11 09:47:53 +00:00
|
|
|
|
int on = 0;
|
|
|
|
|
on += General.Settings.GZDrawFog ? 1 : -1;
|
2014-10-20 12:16:51 +00:00
|
|
|
|
on += General.Settings.GZDrawLightsMode != LightRenderMode.NONE ? 1 : -1;
|
|
|
|
|
on += General.Settings.GZDrawModelsMode != ModelRenderMode.NONE ? 1 : -1;
|
2013-09-11 09:47:53 +00:00
|
|
|
|
|
|
|
|
|
bool enable = (on < 0);
|
|
|
|
|
|
|
|
|
|
General.Settings.GZDrawFog = enable;
|
2014-10-20 12:16:51 +00:00
|
|
|
|
General.Settings.GZDrawLightsMode = (enable ? LightRenderMode.ALL : LightRenderMode.NONE);
|
|
|
|
|
General.Settings.GZDrawModelsMode = (enable ? ModelRenderMode.ALL : ModelRenderMode.NONE);
|
2013-09-11 09:47:53 +00:00
|
|
|
|
General.MainWindow.DisplayStatus(StatusType.Action, "Advanced effects are " + (enable ? "ENABLED" : "DISABLED") );
|
|
|
|
|
|
|
|
|
|
General.MainWindow.RedrawDisplay();
|
|
|
|
|
General.MainWindow.UpdateGZDoomPanel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BeginAction("gztoggleeventlines")]
|
2014-10-20 12:16:51 +00:00
|
|
|
|
private static void ToggleEventLines()
|
|
|
|
|
{
|
2013-09-11 09:47:53 +00:00
|
|
|
|
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();
|
|
|
|
|
}
|
2012-09-17 15:41:18 +00:00
|
|
|
|
|
2013-03-18 13:52:27 +00:00
|
|
|
|
[BeginAction("gztogglevisualvertices")]
|
2014-10-20 12:16:51 +00:00
|
|
|
|
private static void ToggleVisualVertices()
|
|
|
|
|
{
|
2013-03-18 13:52:27 +00:00
|
|
|
|
General.Settings.GZShowVisualVertices = !General.Settings.GZShowVisualVertices;
|
|
|
|
|
General.MainWindow.DisplayStatus(StatusType.Action, "Visual vertices are " + (General.Settings.GZShowVisualVertices ? "ENABLED" : "DISABLED"));
|
|
|
|
|
General.MainWindow.RedrawDisplay();
|
2013-04-11 09:27:16 +00:00
|
|
|
|
General.MainWindow.UpdateGZDoomPanel();
|
2013-03-18 13:52:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-09-11 09:47:53 +00:00
|
|
|
|
//main menu actions
|
|
|
|
|
[BeginAction("gzreloadmodeldef")]
|
2014-10-20 12:16:51 +00:00
|
|
|
|
private static void ReloadModeldef()
|
|
|
|
|
{
|
2014-03-03 13:40:29 +00:00
|
|
|
|
if(General.Map != null) General.Map.Data.ReloadModeldef();
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
2012-06-01 10:17:47 +00:00
|
|
|
|
|
2013-09-11 09:47:53 +00:00
|
|
|
|
[BeginAction("gzreloadgldefs")]
|
2014-10-20 12:16:51 +00:00
|
|
|
|
private static void ReloadGldefs()
|
|
|
|
|
{
|
2014-03-03 13:40:29 +00:00
|
|
|
|
if (General.Map != null) General.Map.Data.ReloadGldefs();
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
2012-06-01 10:17:47 +00:00
|
|
|
|
|
2014-10-20 12:16:51 +00:00
|
|
|
|
#endregion
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
2012-07-10 10:20:45 +00:00
|
|
|
|
}
|