2014-02-21 14:42:12 +00:00
|
|
|
|
using CodeImp.DoomBuilder.Actions;
|
2012-04-17 19:13:47 +00:00
|
|
|
|
using CodeImp.DoomBuilder.Windows;
|
|
|
|
|
using CodeImp.DoomBuilder.GZBuilder.Data;
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
{
|
|
|
|
|
//gzdoom light types
|
|
|
|
|
private static 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 int[] gzLightTypes = { 5, 10, 15 }; //these are actually offsets in gz_lights
|
|
|
|
|
public static int[] GZ_LIGHT_TYPES { get { return gzLightTypes; } }
|
2013-12-18 09:11:04 +00:00
|
|
|
|
private static DynamicLightType[] gzAnimatedLightTypes = { DynamicLightType.FLICKER, DynamicLightType.RANDOM, DynamicLightType.PULSE };
|
|
|
|
|
public static DynamicLightType[] GZ_ANIMATED_LIGHT_TYPES { get { return gzAnimatedLightTypes; } }
|
2013-09-11 09:47:53 +00:00
|
|
|
|
|
|
|
|
|
//asc script action specials
|
|
|
|
|
private static int[] acsSpecials = { 80, 81, 82, 83, 84, 85, 226 };
|
|
|
|
|
public static int[] ACS_SPECIALS { get { return acsSpecials; } }
|
|
|
|
|
|
|
|
|
|
public static void Init() {
|
|
|
|
|
//bind actions
|
|
|
|
|
General.Actions.BindMethods(typeof(GZGeneral));
|
|
|
|
|
General.MainWindow.UpdateGZDoomPanel();
|
|
|
|
|
}
|
2012-04-18 19:34:11 +00:00
|
|
|
|
|
2012-04-17 19:13:47 +00:00
|
|
|
|
//actions
|
2013-09-11 09:47:53 +00:00
|
|
|
|
[BeginAction("gztogglemodels")]
|
|
|
|
|
private static void toggleModels() {
|
|
|
|
|
General.Settings.GZDrawModels = !General.Settings.GZDrawModels;
|
|
|
|
|
General.MainWindow.DisplayStatus(StatusType.Action, "Models rendering is " + (General.Settings.GZDrawModels ? "ENABLED" : "DISABLED"));
|
|
|
|
|
General.MainWindow.RedrawDisplay();
|
|
|
|
|
General.MainWindow.UpdateGZDoomPanel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BeginAction("gztogglelights")]
|
|
|
|
|
private static void toggleLights() {
|
|
|
|
|
General.Settings.GZDrawLights = !General.Settings.GZDrawLights;
|
|
|
|
|
General.MainWindow.DisplayStatus(StatusType.Action, "Dynamic lights rendering is " + (General.Settings.GZDrawLights ? "ENABLED" : "DISABLED"));
|
|
|
|
|
General.MainWindow.RedrawDisplay();
|
|
|
|
|
General.MainWindow.UpdateGZDoomPanel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BeginAction("gztogglelightsanimation")]
|
|
|
|
|
private static void toggleLightsAnimation() {
|
|
|
|
|
General.Settings.GZAnimateLights = !General.Settings.GZAnimateLights;
|
|
|
|
|
General.MainWindow.DisplayStatus(StatusType.Action, "Dynamic lights animation is " + (General.Settings.GZAnimateLights ? "ENABLED" : "DISABLED"));
|
|
|
|
|
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("gzdrawselectedmodelsonly")]
|
|
|
|
|
private static void toggleDrawSelectedModelsOnly() {
|
|
|
|
|
General.Settings.GZDrawSelectedModelsOnly = !General.Settings.GZDrawSelectedModelsOnly;
|
|
|
|
|
General.MainWindow.DisplayStatus(StatusType.Action, "Rendering " + (General.Settings.GZDrawSelectedModelsOnly ? "only selected" : "all") + " models.");
|
2012-09-17 21:57:08 +00:00
|
|
|
|
General.MainWindow.RedrawDisplay();
|
2013-04-11 09:27:16 +00:00
|
|
|
|
General.MainWindow.UpdateGZDoomPanel();
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BeginAction("gztogglefx")]
|
|
|
|
|
private static void toggleFx() {
|
|
|
|
|
int on = 0;
|
|
|
|
|
on += General.Settings.GZDrawFog ? 1 : -1;
|
|
|
|
|
on += General.Settings.GZDrawLights ? 1 : -1;
|
|
|
|
|
on += General.Settings.GZDrawModels ? 1 : -1;
|
|
|
|
|
|
|
|
|
|
bool enable = (on < 0);
|
|
|
|
|
|
|
|
|
|
General.Settings.GZDrawFog = enable;
|
|
|
|
|
General.Settings.GZDrawLights = enable;
|
|
|
|
|
General.Settings.GZDrawModels = enable;
|
|
|
|
|
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();
|
|
|
|
|
}
|
2012-09-17 15:41:18 +00:00
|
|
|
|
|
2013-03-18 13:52:27 +00:00
|
|
|
|
[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();
|
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")]
|
|
|
|
|
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")]
|
|
|
|
|
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
|
|
|
|
|
2013-09-11 09:47:53 +00:00
|
|
|
|
[BeginAction("gzreloadmapinfo")]
|
|
|
|
|
private static void reloadMapInfo() {
|
2014-03-03 13:40:29 +00:00
|
|
|
|
if (General.Map != null) General.Map.Data.ReloadMapInfo();
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-07-10 10:20:45 +00:00
|
|
|
|
}
|