2012-06-26 08:54:25 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
using CodeImp.DoomBuilder.Config;
|
|
|
|
|
using CodeImp.DoomBuilder.Map;
|
|
|
|
|
using CodeImp.DoomBuilder.VisualModes;
|
|
|
|
|
using CodeImp.DoomBuilder.Windows;
|
|
|
|
|
using CodeImp.DoomBuilder.Geometry;
|
|
|
|
|
using CodeImp.DoomBuilder.Types;
|
2012-07-10 14:14:53 +00:00
|
|
|
|
using System.Globalization;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.UDMFControls
|
|
|
|
|
{
|
2012-07-12 22:34:12 +00:00
|
|
|
|
public sealed partial class UDMFControlsForm : DelayedForm {
|
2012-06-28 20:27:48 +00:00
|
|
|
|
private List<SurfaceProperties> floors;
|
|
|
|
|
private List<SurfaceProperties> ceilings;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
2012-06-28 20:27:48 +00:00
|
|
|
|
private List<SurfaceProperties> wallsTop;
|
|
|
|
|
private List<SurfaceProperties> wallsMid;
|
|
|
|
|
private List<SurfaceProperties> wallsBottom;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
2012-06-28 20:27:48 +00:00
|
|
|
|
private List<List<SurfaceProperties>> walls;
|
|
|
|
|
private List<List<SurfaceProperties>> ceilingsAndFloors;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
2012-06-28 20:27:48 +00:00
|
|
|
|
private List<SurfaceProperties> updateList; //list of sectors to update
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
|
|
|
|
private CheckBox[] wallFlags;
|
|
|
|
|
private CheckBox[] sectorFlags;
|
|
|
|
|
|
|
|
|
|
private List<string> renderStyles;
|
|
|
|
|
|
2012-08-20 01:08:18 +00:00
|
|
|
|
private static bool relativeMode = false;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
|
|
|
|
public UDMFControlsForm() {
|
|
|
|
|
//capture keys
|
|
|
|
|
KeyPreview = true;
|
|
|
|
|
|
|
|
|
|
//initialize form
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
//create collections
|
2012-06-28 20:27:48 +00:00
|
|
|
|
floors = new List<SurfaceProperties>();
|
|
|
|
|
ceilings = new List<SurfaceProperties>();
|
|
|
|
|
wallsTop = new List<SurfaceProperties>();
|
|
|
|
|
wallsMid = new List<SurfaceProperties>();
|
|
|
|
|
wallsBottom = new List<SurfaceProperties>();
|
|
|
|
|
|
|
|
|
|
walls = new List<List<SurfaceProperties>>() { wallsTop, wallsMid, wallsBottom };
|
|
|
|
|
ceilingsAndFloors = new List<List<SurfaceProperties>>() { ceilings, floors };
|
|
|
|
|
|
|
|
|
|
updateList = new List<SurfaceProperties>();
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
2012-11-05 12:31:24 +00:00
|
|
|
|
wallFlags = new CheckBox[] { cbnodecals, cbnofakecontrast, cbclipmidtex, cbsmoothlighting, cblightfog };
|
2012-07-05 00:03:40 +00:00
|
|
|
|
sectorFlags = new CheckBox[] { cbsilent, cbnofallingdamage, cbdropactors, cbnorespawn, cbhidden };
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
|
|
|
|
renderStyles = new List<string>() { "translucent", "add" };
|
|
|
|
|
|
|
|
|
|
KeyDown += new KeyEventHandler(UDMFControlsForm_KeyDown);
|
|
|
|
|
KeyUp += new KeyEventHandler(UDMFControlsForm_KeyUp);
|
|
|
|
|
|
|
|
|
|
cbRelativeMode.Checked = relativeMode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//we should be in Visual mode and should have some surfaces selected at this point
|
2012-06-28 20:27:48 +00:00
|
|
|
|
public void Setup(List<VisualGeometry> surfaces) {
|
2012-06-26 08:54:25 +00:00
|
|
|
|
//create undo
|
|
|
|
|
string rest = surfaces.Count + " surface" + (surfaces.Count > 1 ? "s" : "");
|
|
|
|
|
General.Map.UndoRedo.CreateUndo("Edit texture properties of " + rest);
|
|
|
|
|
|
|
|
|
|
//get default values
|
|
|
|
|
List<UniversalFieldInfo> defaultSidedefFields = General.Map.Config.SidedefFields;
|
|
|
|
|
List<UniversalFieldInfo> defaultLinedefFields = General.Map.Config.LinedefFields;
|
|
|
|
|
List<UniversalFieldInfo> defaultSectorFields = General.Map.Config.SectorFields;
|
|
|
|
|
|
2012-06-28 20:27:48 +00:00
|
|
|
|
SurfaceProperties firstWall = null;
|
|
|
|
|
SurfaceProperties firstFloor = null; //or ceiling!
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
2012-06-28 20:27:48 +00:00
|
|
|
|
List<int> wall3DIndeces = new List<int>();
|
|
|
|
|
SurfaceProperties sp;
|
|
|
|
|
int walls3dCount = 0;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
|
|
|
|
//sort things
|
|
|
|
|
foreach (VisualGeometry vg in surfaces) {
|
2012-06-28 20:27:48 +00:00
|
|
|
|
sp = new SurfaceProperties(vg);
|
|
|
|
|
updateList.Add(sp);
|
|
|
|
|
|
2012-06-26 08:54:25 +00:00
|
|
|
|
switch (vg.GeometryType) {
|
|
|
|
|
case VisualGeometryType.CEILING:
|
2012-06-28 20:27:48 +00:00
|
|
|
|
if (firstFloor == null) firstFloor = sp;
|
|
|
|
|
ceilings.Add(sp);
|
|
|
|
|
setDefaultUniversalProperties(sp.Sector.Fields, defaultSectorFields);
|
2012-06-26 08:54:25 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case VisualGeometryType.FLOOR:
|
2012-06-28 20:27:48 +00:00
|
|
|
|
if (firstFloor == null) firstFloor = sp;
|
|
|
|
|
floors.Add(sp);
|
|
|
|
|
setDefaultUniversalProperties(sp.Sector.Fields, defaultSectorFields);
|
2012-06-26 08:54:25 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case VisualGeometryType.WALL_BOTTOM:
|
2012-06-28 20:27:48 +00:00
|
|
|
|
if (firstWall == null) firstWall = sp;
|
|
|
|
|
wallsBottom.Add(sp);
|
|
|
|
|
setDefaultUniversalProperties(sp.Sidedef.Fields, defaultSidedefFields);
|
|
|
|
|
setDefaultUniversalProperties(sp.Linedef.Fields, defaultLinedefFields);
|
2012-06-26 08:54:25 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2012-07-05 00:03:40 +00:00
|
|
|
|
case VisualGeometryType.WALL_MIDDLE_3D:
|
2012-06-28 20:27:48 +00:00
|
|
|
|
walls3dCount++;
|
|
|
|
|
wall3DIndeces.Add(vg.Sector.Sector.FixedIndex);
|
|
|
|
|
goto case VisualGeometryType.WALL_MIDDLE;
|
|
|
|
|
|
2012-06-26 08:54:25 +00:00
|
|
|
|
case VisualGeometryType.WALL_MIDDLE:
|
2012-06-28 20:27:48 +00:00
|
|
|
|
if (firstWall == null) firstWall = sp;
|
|
|
|
|
wallsMid.Add(sp);
|
|
|
|
|
setDefaultUniversalProperties(sp.Sidedef.Fields, defaultSidedefFields);
|
|
|
|
|
setDefaultUniversalProperties(sp.Linedef.Fields, defaultLinedefFields);
|
2012-07-05 00:03:40 +00:00
|
|
|
|
|
|
|
|
|
if (sp.HasControlLinedef)
|
|
|
|
|
setDefaultUniversalProperties(sp.ControlSidedef.Fields, defaultSidedefFields);
|
2012-06-26 08:54:25 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case VisualGeometryType.WALL_UPPER:
|
2012-06-28 20:27:48 +00:00
|
|
|
|
if (firstWall == null) firstWall = sp;
|
|
|
|
|
wallsTop.Add(sp);
|
|
|
|
|
setDefaultUniversalProperties(sp.Sidedef.Fields, defaultSidedefFields);
|
|
|
|
|
setDefaultUniversalProperties(sp.Linedef.Fields, defaultLinedefFields);
|
2012-06-26 08:54:25 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default: //dbg
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//set sliders limits
|
|
|
|
|
sliderDesaturation.SetLimits(0f, 1f, false);
|
|
|
|
|
sliderAlpha.SetLimits(0f, 1f, false);
|
2012-07-28 20:36:28 +00:00
|
|
|
|
float scaleRange = BuilderPlug.Me.ScaleReange;
|
|
|
|
|
scaleControl.SetLimits(-scaleRange, scaleRange);
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
|
|
|
|
cbRenderStyle.Items.AddRange(new object[] { "Translucent", "Add" });
|
|
|
|
|
cbRenderStyle.SelectedIndex = 0;
|
|
|
|
|
|
|
|
|
|
//set initial values to controls
|
|
|
|
|
if (firstFloor != null) {
|
|
|
|
|
//get values
|
2012-06-28 20:27:48 +00:00
|
|
|
|
float scaleX = (float)firstFloor.Sector.Fields[KeyNames.GetScaleX(firstFloor.GeometryType)].Value;
|
|
|
|
|
float scaleY = (float)firstFloor.Sector.Fields[KeyNames.GetScaleY(firstFloor.GeometryType)].Value;
|
|
|
|
|
float translateX = (float)firstFloor.Sector.Fields[KeyNames.GetTranslationX(firstFloor.GeometryType)].Value;
|
|
|
|
|
float translateY = (float)firstFloor.Sector.Fields[KeyNames.GetTranslationY(firstFloor.GeometryType)].Value;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
|
|
|
|
//set shared and sector flags
|
2012-06-28 20:27:48 +00:00
|
|
|
|
cblightabsolute.Checked = (bool)firstFloor.Sector.Fields[KeyNames.GetLightAbsolute(firstFloor.GeometryType)].Value;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
|
|
|
|
foreach(CheckBox cb in sectorFlags)
|
2012-06-28 20:27:48 +00:00
|
|
|
|
cb.Checked = (bool)firstFloor.Sector.Fields[(string)cb.Tag].Value;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
|
|
|
|
//set values to controls
|
|
|
|
|
scaleControl.Value = new Vector2D(scaleX, scaleY);
|
|
|
|
|
positionControl1.Value = new Vector2D(translateX, translateY);
|
2012-06-28 20:27:48 +00:00
|
|
|
|
angleControl1.Value = (int)((float)firstFloor.Sector.Fields[KeyNames.GetRotation(firstFloor.GeometryType)].Value);
|
2012-08-20 01:08:18 +00:00
|
|
|
|
sliderBrightness.SetLimits(cblightabsolute.Checked ? 0 : -255, 255);
|
|
|
|
|
sliderBrightness.Value = (int)firstFloor.Sector.Fields[KeyNames.GetLight(firstFloor.GeometryType)].Value;
|
2012-06-28 20:27:48 +00:00
|
|
|
|
nudGravity.Value = (decimal)((float)firstFloor.Sector.Fields[(string)nudGravity.Tag].Value);
|
|
|
|
|
sliderDesaturation.Value = (float)firstFloor.Sector.Fields[(string)sliderDesaturation.Tag].Value;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
|
|
|
|
} else {//disable floor/ceiling related controls
|
|
|
|
|
gbRotation.Enabled = false;
|
|
|
|
|
gbFlagsFloor.Enabled = false;
|
|
|
|
|
nudGravity.Enabled = false;
|
|
|
|
|
labelGravity.Enabled = false;
|
|
|
|
|
gbDesaturation.Enabled = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (firstWall != null) {
|
|
|
|
|
if(firstFloor == null){ //get shared values from wall
|
|
|
|
|
//get values
|
2012-07-05 00:03:40 +00:00
|
|
|
|
float scaleX = (float)firstWall.ControlSidedef.Fields[KeyNames.GetScaleX(firstWall.GeometryType)].Value;
|
|
|
|
|
float scaleY = (float)firstWall.ControlSidedef.Fields[KeyNames.GetScaleY(firstWall.GeometryType)].Value;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
float translateX = (float)firstWall.Sidedef.Fields[KeyNames.GetTranslationX(firstWall.GeometryType)].Value;
|
|
|
|
|
float translateY = (float)firstWall.Sidedef.Fields[KeyNames.GetTranslationY(firstWall.GeometryType)].Value;
|
|
|
|
|
|
|
|
|
|
//set values to controls
|
|
|
|
|
scaleControl.Value = new Vector2D(scaleX, scaleY);
|
|
|
|
|
positionControl1.Value = new Vector2D(translateX, translateY);
|
|
|
|
|
cblightabsolute.Checked = (bool)firstWall.Sidedef.Fields[KeyNames.GetLightAbsolute(firstWall.GeometryType)].Value;
|
2012-08-20 01:08:18 +00:00
|
|
|
|
sliderBrightness.SetLimits(cblightabsolute.Checked ? 0 : -255, 255);
|
|
|
|
|
sliderBrightness.Value = (int)firstWall.Sidedef.Fields[KeyNames.GetLight(firstWall.GeometryType)].Value;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
|
|
|
|
//set linedef values
|
2012-06-28 20:27:48 +00:00
|
|
|
|
sliderAlpha.Value = (float)firstWall.Linedef.Fields[(string)sliderAlpha.Tag].Value;
|
|
|
|
|
string renderStyle = (string)firstWall.Linedef.Fields[(string)cbRenderStyle.Tag].Value;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
cbRenderStyle.SelectedIndex = renderStyles.IndexOf(renderStyle);
|
2012-06-28 20:27:48 +00:00
|
|
|
|
|
|
|
|
|
//if we got only 3d-walls selected, disable controls, which don't affect those
|
|
|
|
|
if (walls3dCount == wallsMid.Count && wallsTop.Count == 0 && wallsBottom.Count == 0) {
|
|
|
|
|
gbAlpha.Enabled = false;
|
|
|
|
|
bgBrightness.Enabled = false;
|
|
|
|
|
}
|
2012-06-26 08:54:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//set wall flags
|
|
|
|
|
foreach(CheckBox cb in wallFlags)
|
|
|
|
|
cb.Checked = (bool)firstWall.Sidedef.Fields[(string)cb.Tag].Value;
|
|
|
|
|
|
|
|
|
|
} else { //disable wall-related controls
|
|
|
|
|
gbFlagsWall.Enabled = false;
|
|
|
|
|
gbAlpha.Enabled = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Text = "Editing " + rest;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setDefaultUniversalProperties(UniFields fields, List<UniversalFieldInfo> defaultFields) {
|
|
|
|
|
foreach (UniversalFieldInfo info in defaultFields) {
|
|
|
|
|
if (!fields.ContainsKey(info.Name))
|
2012-07-10 14:14:53 +00:00
|
|
|
|
fields.Add(info.Name, new UniValue(info.Type, (UniversalType)info.Type == UniversalType.Integer ? (object)Convert.ToInt32(info.Default, CultureInfo.InvariantCulture) : info.Default));
|
2012-06-26 08:54:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void removeDefaultUniversalProperties(UniFields fields, List<UniversalFieldInfo> defaultFields) {
|
|
|
|
|
foreach (UniversalFieldInfo info in defaultFields) {
|
2012-07-10 14:14:53 +00:00
|
|
|
|
if (fields.ContainsKey(info.Name) && fields[info.Name].Value.Equals((UniversalType)info.Type == UniversalType.Integer ? (object)Convert.ToInt32(info.Default, CultureInfo.InvariantCulture) : info.Default))
|
2012-06-26 08:54:25 +00:00
|
|
|
|
fields.Remove(info.Name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void removeDefaultValues() {
|
|
|
|
|
//remove default values...
|
|
|
|
|
List<UniversalFieldInfo> defaultSidedefFields = General.Map.Config.SidedefFields;
|
|
|
|
|
List<UniversalFieldInfo> defaultLinedefFields = General.Map.Config.LinedefFields;
|
|
|
|
|
List<UniversalFieldInfo> defaultSectorFields = General.Map.Config.SectorFields;
|
|
|
|
|
|
|
|
|
|
//...from floors/ceilings...
|
2012-06-28 20:27:48 +00:00
|
|
|
|
foreach (List<SurfaceProperties> list in ceilingsAndFloors) {
|
|
|
|
|
foreach (SurfaceProperties floor in list)
|
|
|
|
|
removeDefaultUniversalProperties(floor.Sector.Fields, defaultSectorFields);
|
2012-06-26 08:54:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//...and walls
|
2012-06-28 20:27:48 +00:00
|
|
|
|
foreach (List<SurfaceProperties> list in walls) {
|
|
|
|
|
foreach (SurfaceProperties wall in list) {
|
2012-06-26 08:54:25 +00:00
|
|
|
|
removeDefaultUniversalProperties(wall.Sidedef.Fields, defaultSidedefFields);
|
2012-06-28 20:27:48 +00:00
|
|
|
|
removeDefaultUniversalProperties(wall.Linedef.Fields, defaultLinedefFields);
|
2012-07-05 00:03:40 +00:00
|
|
|
|
|
|
|
|
|
if(wall.HasControlLinedef)
|
|
|
|
|
removeDefaultUniversalProperties(wall.ControlSidedef.Fields, defaultSidedefFields);
|
2012-06-26 08:54:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//update view
|
|
|
|
|
private void update() {
|
2012-06-28 20:27:48 +00:00
|
|
|
|
foreach (SurfaceProperties sp in updateList)
|
|
|
|
|
sp.Update();
|
2012-06-26 08:54:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//shared props
|
|
|
|
|
private void setSharedProperty(string propName, object value) {
|
|
|
|
|
setSidedefProperty(propName, value);
|
|
|
|
|
setSectorProperty(propName, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setSharedPairedProperty(string propName, Vector2D value) {
|
|
|
|
|
setPairedSectorProperty(propName, value);
|
|
|
|
|
setPairedSidedefProperty(propName, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//linedef props
|
|
|
|
|
private void setLinedefProperty(string propName, object value) {
|
2012-06-28 20:27:48 +00:00
|
|
|
|
foreach (List<SurfaceProperties> list in walls) {
|
|
|
|
|
foreach (SurfaceProperties vg in list)
|
|
|
|
|
vg.Linedef.Fields[propName].Value = value;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//sidedef props
|
|
|
|
|
private void setSidedefProperty(string propName, object value) {
|
|
|
|
|
//special cases
|
2012-07-05 00:03:40 +00:00
|
|
|
|
if (propName == "scale") {
|
|
|
|
|
General.Fail("use SetSidedefScale instead!");
|
|
|
|
|
return;
|
|
|
|
|
}else if(propName == "offset"){
|
2012-06-26 08:54:25 +00:00
|
|
|
|
setPairedSidedefProperty(propName, (Vector2D)value);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//apply value
|
2012-10-09 15:17:52 +00:00
|
|
|
|
foreach (List<SurfaceProperties> list in walls) {
|
|
|
|
|
foreach (SurfaceProperties vg in list) {
|
|
|
|
|
if ((propName == "light" || propName == "lightabsolute") && vg.GeometryType == VisualGeometryType.WALL_MIDDLE_3D) //just... skip it for now
|
|
|
|
|
continue;
|
|
|
|
|
vg.Sidedef.Fields[propName].Value = value;
|
2012-07-05 00:03:40 +00:00
|
|
|
|
}
|
2012-10-09 15:17:52 +00:00
|
|
|
|
}
|
2012-06-26 08:54:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setPairedSidedefProperty(string propName, Vector2D value) {
|
2012-07-05 00:03:40 +00:00
|
|
|
|
if (propName == "scale") General.Fail("use SetScale instead!"); //dbg
|
|
|
|
|
if (propName != "offset") return;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
|
|
|
|
string upperNameX = "x_top";
|
|
|
|
|
string upperNameY = "y_top";
|
|
|
|
|
string middleNameX = "x_mid";
|
|
|
|
|
string middleNameY = "y_mid";
|
|
|
|
|
string lowerNameX = "x_bottom";
|
|
|
|
|
string lowerNameY = "y_bottom";
|
|
|
|
|
|
|
|
|
|
string[] props = new string[] { upperNameX, upperNameY, middleNameX, middleNameY, lowerNameX, lowerNameY };
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < props.Length; i++ )
|
|
|
|
|
props[i] = propName + props[i];
|
|
|
|
|
|
|
|
|
|
int index = 0;
|
2012-06-28 20:27:48 +00:00
|
|
|
|
|
2012-06-26 08:54:25 +00:00
|
|
|
|
//apply values
|
|
|
|
|
if (relativeMode) {
|
|
|
|
|
float val;
|
2012-06-28 20:27:48 +00:00
|
|
|
|
foreach (List<SurfaceProperties> list in walls) { //top -> middle -> bottom
|
|
|
|
|
foreach (SurfaceProperties vg in list) {
|
2012-06-26 08:54:25 +00:00
|
|
|
|
val = (float)vg.Sidedef.Fields[props[index]].Value + value.x;
|
|
|
|
|
vg.Sidedef.Fields[props[index]].Value = val;
|
|
|
|
|
|
2012-07-05 00:03:40 +00:00
|
|
|
|
val = (float)vg.Sidedef.Fields[props[index + 1]].Value + value.y;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
vg.Sidedef.Fields[props[index + 1]].Value = val;
|
|
|
|
|
}
|
|
|
|
|
index += 2;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2012-06-28 20:27:48 +00:00
|
|
|
|
foreach (List<SurfaceProperties> list in walls) { //top -> middle -> bottom
|
|
|
|
|
foreach (SurfaceProperties vg in list) {
|
2012-06-26 08:54:25 +00:00
|
|
|
|
vg.Sidedef.Fields[props[index]].Value = value.x;
|
|
|
|
|
vg.Sidedef.Fields[props[index + 1]].Value = value.y;
|
|
|
|
|
}
|
|
|
|
|
index += 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//floor/ceiling props
|
|
|
|
|
private void setSectorProperty(string propName, object value) {
|
|
|
|
|
//special cases
|
|
|
|
|
if (propName == "scale" || propName == "offset") {
|
|
|
|
|
setPairedSectorProperty(propName, (Vector2D)value);
|
|
|
|
|
return;
|
|
|
|
|
} else if (propName == "light" || propName == "lightabsolute" || propName == "rotation") {
|
|
|
|
|
string propFloor;
|
|
|
|
|
string propCeiling;
|
|
|
|
|
|
|
|
|
|
if (propName == "light") {
|
|
|
|
|
propFloor = "lightfloor";
|
|
|
|
|
propCeiling = "lightceiling";
|
|
|
|
|
} else if (propName == "lightabsolute") {
|
|
|
|
|
propFloor = "lightfloorabsolute";
|
|
|
|
|
propCeiling = "lightceilingabsolute";
|
|
|
|
|
} else {
|
|
|
|
|
propFloor = "rotationfloor";
|
|
|
|
|
propCeiling = "rotationceiling";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (propName == "rotation" && relativeMode) {
|
|
|
|
|
float val;
|
|
|
|
|
|
2012-06-28 20:27:48 +00:00
|
|
|
|
foreach (SurfaceProperties vg in floors) {
|
|
|
|
|
val = (float)vg.Sector.Fields[propFloor].Value + (float)value;
|
|
|
|
|
vg.Sector.Fields[propFloor].Value = (object)val;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-28 20:27:48 +00:00
|
|
|
|
foreach (SurfaceProperties vg in ceilings) {
|
|
|
|
|
val = (float)vg.Sector.Fields[propCeiling].Value + (float)value;
|
|
|
|
|
vg.Sector.Fields[propCeiling].Value = (object)val;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
}
|
|
|
|
|
} else {
|
2012-06-28 20:27:48 +00:00
|
|
|
|
foreach (SurfaceProperties vg in floors)
|
|
|
|
|
vg.Sector.Fields[propFloor].Value = value;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
2012-06-28 20:27:48 +00:00
|
|
|
|
foreach (SurfaceProperties vg in ceilings)
|
|
|
|
|
vg.Sector.Fields[propCeiling].Value = value;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
2012-06-28 20:27:48 +00:00
|
|
|
|
//apply values
|
|
|
|
|
foreach (List<SurfaceProperties> list in ceilingsAndFloors) {
|
|
|
|
|
foreach (SurfaceProperties vg in list)
|
|
|
|
|
vg.Sector.Fields[propName].Value = value;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setPairedSectorProperty(string propName, Vector2D value) {
|
|
|
|
|
if (propName != "scale" && propName != "offset")
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
string ceilingNameX, ceilingNameY, floorNameX, floorNameY;
|
|
|
|
|
string[] props;
|
|
|
|
|
|
|
|
|
|
if (propName == "scale") {
|
|
|
|
|
ceilingNameX = "xscaleceiling";
|
|
|
|
|
ceilingNameY = "yscaleceiling";
|
|
|
|
|
floorNameX = "xscalefloor";
|
|
|
|
|
floorNameY = "yscalefloor";
|
|
|
|
|
} else {
|
|
|
|
|
ceilingNameX = "xpanningceiling";
|
|
|
|
|
ceilingNameY = "ypanningceiling";
|
|
|
|
|
floorNameX = "xpanningfloor";
|
|
|
|
|
floorNameY = "ypanningfloor";
|
|
|
|
|
}
|
|
|
|
|
props = new string[] { ceilingNameX, ceilingNameY, floorNameX, floorNameY };
|
|
|
|
|
int index = 0;
|
|
|
|
|
|
2012-06-28 20:27:48 +00:00
|
|
|
|
//apply values
|
2012-06-26 08:54:25 +00:00
|
|
|
|
if (relativeMode) {
|
|
|
|
|
float val;
|
2012-06-28 20:27:48 +00:00
|
|
|
|
foreach (List<SurfaceProperties> list in ceilingsAndFloors) { //ceilings -> floors
|
|
|
|
|
foreach (SurfaceProperties vg in list) {
|
|
|
|
|
val = (float)vg.Sector.Fields[props[index]].Value + value.x;
|
|
|
|
|
vg.Sector.Fields[props[index]].Value = (object)val;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
2012-06-28 20:27:48 +00:00
|
|
|
|
val = (float)vg.Sector.Fields[props[index + 1]].Value + value.y;
|
|
|
|
|
vg.Sector.Fields[props[index + 1]].Value = (object)val;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
}
|
|
|
|
|
index += 2;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2012-06-28 20:27:48 +00:00
|
|
|
|
foreach (List<SurfaceProperties> list in ceilingsAndFloors) { //ceilings -> floors
|
|
|
|
|
foreach (SurfaceProperties vg in list) {
|
|
|
|
|
vg.Sector.Fields[props[index]].Value = value.x;
|
|
|
|
|
vg.Sector.Fields[props[index + 1]].Value = value.y;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
}
|
|
|
|
|
index += 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-07-05 00:03:40 +00:00
|
|
|
|
|
|
|
|
|
private void setSidedefScale(Vector2D value) {
|
|
|
|
|
string[] props = new string[] { "scalex_top", "scaley_top", "scalex_mid", "scaley_mid", "scalex_bottom", "scaley_bottom" };
|
|
|
|
|
List<int> controlSectors = new List<int>();
|
|
|
|
|
int index = 0;
|
|
|
|
|
|
|
|
|
|
//apply values
|
|
|
|
|
if (relativeMode) {
|
|
|
|
|
float val;
|
|
|
|
|
foreach (List<SurfaceProperties> list in walls) { //top -> middle -> bottom
|
|
|
|
|
foreach (SurfaceProperties vg in list) {
|
|
|
|
|
if (vg.HasControlLinedef) {
|
|
|
|
|
if (controlSectors.Contains(vg.ControlSidedef.Sector.FixedIndex))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
val = (float)vg.ControlSidedef.Fields[props[index]].Value + value.x;
|
|
|
|
|
vg.ControlSidedef.Fields[props[index]].Value = val;
|
|
|
|
|
|
|
|
|
|
val = (float)vg.ControlSidedef.Fields[props[index + 1]].Value + value.y;
|
|
|
|
|
vg.ControlSidedef.Fields[props[index + 1]].Value = val;
|
|
|
|
|
|
|
|
|
|
controlSectors.Add(vg.ControlSidedef.Sector.FixedIndex);
|
|
|
|
|
} else {
|
|
|
|
|
val = (float)vg.Sidedef.Fields[props[index]].Value + value.x;
|
|
|
|
|
vg.Sidedef.Fields[props[index]].Value = val;
|
|
|
|
|
|
|
|
|
|
val = (float)vg.Sidedef.Fields[props[index + 1]].Value + value.y;
|
|
|
|
|
vg.Sidedef.Fields[props[index + 1]].Value = val;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
index += 2;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
foreach (List<SurfaceProperties> list in walls) { //top -> middle -> bottom
|
|
|
|
|
foreach (SurfaceProperties vg in list) {
|
|
|
|
|
if (vg.HasControlLinedef) {
|
|
|
|
|
if (controlSectors.Contains(vg.ControlSidedef.Sector.FixedIndex))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
vg.ControlSidedef.Fields[props[index]].Value = value.x;
|
|
|
|
|
vg.ControlSidedef.Fields[props[index + 1]].Value = value.y;
|
|
|
|
|
|
|
|
|
|
controlSectors.Add(vg.ControlSidedef.Sector.FixedIndex);
|
|
|
|
|
} else {
|
|
|
|
|
vg.Sidedef.Fields[props[index]].Value = value.x;
|
|
|
|
|
vg.Sidedef.Fields[props[index + 1]].Value = value.y;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
index += 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-06-26 08:54:25 +00:00
|
|
|
|
|
|
|
|
|
//EVENTS
|
|
|
|
|
private void btnOK_Click(object sender, EventArgs e) {
|
|
|
|
|
//apply flags and settings, which are not updated in real time
|
|
|
|
|
//gravity
|
|
|
|
|
setSectorProperty((string)nudGravity.Tag, (object)((float)nudGravity.Value));
|
|
|
|
|
//desaturation
|
|
|
|
|
setSectorProperty((string)sliderDesaturation.Tag, (object)sliderDesaturation.Value);
|
|
|
|
|
|
|
|
|
|
//wall flags
|
|
|
|
|
foreach (CheckBox cb in wallFlags)
|
|
|
|
|
setSidedefProperty((string)cb.Tag, (object)cb.Checked);
|
|
|
|
|
|
|
|
|
|
//sector flags
|
|
|
|
|
foreach (CheckBox cb in sectorFlags)
|
|
|
|
|
setSectorProperty((string)cb.Tag, (object)cb.Checked);
|
|
|
|
|
|
|
|
|
|
//update sectors
|
2012-06-28 20:27:48 +00:00
|
|
|
|
foreach (SurfaceProperties vs in updateList) {
|
|
|
|
|
if (vs.Sector != null) {
|
|
|
|
|
vs.Sector.UpdateNeeded = true;
|
|
|
|
|
vs.Sector.UpdateCache();
|
|
|
|
|
}
|
2012-06-26 08:54:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
removeDefaultValues();
|
2012-11-13 21:11:53 +00:00
|
|
|
|
this.DialogResult = DialogResult.OK;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnCancel_Click(object sender, EventArgs e) {
|
2013-03-18 13:52:27 +00:00
|
|
|
|
this.DialogResult = DialogResult.Cancel;
|
2012-06-26 08:54:25 +00:00
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-13 21:11:53 +00:00
|
|
|
|
//so proper actions are executed when user closes the window using "x" button
|
|
|
|
|
private void UDMFControlsForm_FormClosing(object sender, FormClosingEventArgs e) {
|
|
|
|
|
if(this.DialogResult == DialogResult.Cancel) {
|
|
|
|
|
//restore initial values
|
2013-03-18 13:52:27 +00:00
|
|
|
|
General.Map.UndoRedo.WithdrawUndo();
|
2012-11-13 21:11:53 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-26 08:54:25 +00:00
|
|
|
|
//KEYBOARD EVENTS
|
|
|
|
|
private void UDMFControlsForm_KeyDown(object sender, KeyEventArgs e) {
|
|
|
|
|
if (e.Shift) {
|
|
|
|
|
angleControl1.SnapAngle = e.Shift;
|
|
|
|
|
e.Handled = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void UDMFControlsForm_KeyUp(object sender, KeyEventArgs e) {
|
|
|
|
|
if (e.Shift) {
|
|
|
|
|
angleControl1.SnapAngle = !e.Shift;
|
|
|
|
|
e.Handled = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//INTERACTIVE CONTROLS
|
|
|
|
|
//position
|
|
|
|
|
private void positionControl1_OnValueChanged(object sender, EventArgs e) {
|
|
|
|
|
setSharedPairedProperty((string)positionControl1.Tag, relativeMode ? positionControl1.Delta : positionControl1.Value);
|
|
|
|
|
update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//rotation
|
|
|
|
|
private void angleControl1_OnAngleChanged(object sender, EventArgs e) {
|
|
|
|
|
setSectorProperty((string)angleControl1.Tag, relativeMode ? (float)angleControl1.Delta : (float)angleControl1.Value);
|
|
|
|
|
update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//scale
|
|
|
|
|
private void scaleControl_OnValueChanged(object sender, EventArgs e) {
|
2012-07-05 00:03:40 +00:00
|
|
|
|
setPairedSectorProperty((string)scaleControl.Tag, relativeMode ? scaleControl.Delta : scaleControl.Value);
|
|
|
|
|
setSidedefScale(relativeMode ? scaleControl.Delta : scaleControl.Value);
|
2012-06-26 08:54:25 +00:00
|
|
|
|
update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//brightness
|
|
|
|
|
private void sliderBrightness_OnValueChanged(object sender, EventArgs e) {
|
|
|
|
|
setSharedProperty((string)sliderBrightness.Tag, (object)sliderBrightness.Value);
|
|
|
|
|
update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//alpha
|
|
|
|
|
private void sliderAlpha_OnValueChanged(object sender, EventArgs e) {
|
|
|
|
|
setLinedefProperty((string)sliderAlpha.Tag, sliderAlpha.Value);
|
|
|
|
|
update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void cbRenderStyle_SelectedIndexChanged(object sender, EventArgs e) {
|
|
|
|
|
string val = cbRenderStyle.Text.ToLowerInvariant();
|
|
|
|
|
setLinedefProperty((string)cbRenderStyle.Tag, val);
|
|
|
|
|
update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//flags
|
|
|
|
|
private void cbwrapmidtex_CheckedChanged(object sender, EventArgs e) {
|
|
|
|
|
setSidedefProperty((string)cbwrapmidtex.Tag, (object)cbwrapmidtex.Checked);
|
|
|
|
|
update();
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-05 12:31:24 +00:00
|
|
|
|
private void cblightfog_CheckedChanged(object sender, EventArgs e) {
|
|
|
|
|
setSidedefProperty((string)cblightfog.Tag, (object)cblightfog.Checked);
|
|
|
|
|
update();
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-26 08:54:25 +00:00
|
|
|
|
private void cblightabsolute_CheckedChanged(object sender, EventArgs e) {
|
|
|
|
|
if(cblightabsolute.Checked)
|
|
|
|
|
sliderBrightness.SetLimits(0, 255);
|
|
|
|
|
else
|
|
|
|
|
sliderBrightness.SetLimits(-255, 255);
|
|
|
|
|
|
|
|
|
|
setSharedProperty((string)cblightabsolute.Tag, (object)cblightabsolute.Checked);
|
|
|
|
|
update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void cbRelativeMode_CheckedChanged(object sender, EventArgs e) {
|
|
|
|
|
relativeMode = cbRelativeMode.Checked;
|
|
|
|
|
}
|
2012-06-28 20:27:48 +00:00
|
|
|
|
|
|
|
|
|
private void UDMFControlsForm_HelpRequested(object sender, HelpEventArgs hlpevent) {
|
|
|
|
|
General.ShowHelp("gz_plug_udmfcontrols.html");
|
|
|
|
|
hlpevent.Handled = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-07-05 00:03:40 +00:00
|
|
|
|
internal sealed class SurfaceProperties {
|
2012-06-28 20:27:48 +00:00
|
|
|
|
private Sector sector;
|
|
|
|
|
public Sector Sector { get { return sector; } }
|
|
|
|
|
|
2012-07-05 00:03:40 +00:00
|
|
|
|
private Sidedef controlSidedef;
|
|
|
|
|
public Sidedef ControlSidedef { get { return controlSidedef; } }
|
|
|
|
|
|
2012-06-28 20:27:48 +00:00
|
|
|
|
private Sidedef sidedef;
|
|
|
|
|
public Sidedef Sidedef { get { return sidedef; } }
|
|
|
|
|
|
|
|
|
|
private Linedef linedef;
|
|
|
|
|
public Linedef Linedef { get { return linedef; } }
|
|
|
|
|
|
|
|
|
|
public VisualGeometryType GeometryType { get { return vg.GeometryType; } }
|
|
|
|
|
private VisualGeometry vg;
|
2012-07-05 00:03:40 +00:00
|
|
|
|
|
|
|
|
|
private bool hasControlLinedef;
|
|
|
|
|
public bool HasControlLinedef { get { return hasControlLinedef; } }
|
2012-06-28 20:27:48 +00:00
|
|
|
|
|
|
|
|
|
public SurfaceProperties(VisualGeometry visualGeometry) {
|
|
|
|
|
vg = visualGeometry;
|
|
|
|
|
if (vg.GeometryType == VisualGeometryType.CEILING || vg.GeometryType == VisualGeometryType.FLOOR) {
|
|
|
|
|
sector = vg.GetControlSector();
|
|
|
|
|
sector.Fields.BeforeFieldsChange();
|
2012-08-20 01:08:18 +00:00
|
|
|
|
} else if(vg.GeometryType == VisualGeometryType.WALL_MIDDLE_3D) {
|
|
|
|
|
linedef = vg.GetControlLinedef();
|
|
|
|
|
|
|
|
|
|
controlSidedef = linedef.Front;
|
|
|
|
|
sidedef = vg.Sidedef;
|
|
|
|
|
|
|
|
|
|
hasControlLinedef = (controlSidedef.Sector.FixedIndex != sidedef.Sector.FixedIndex);
|
|
|
|
|
|
|
|
|
|
linedef.Fields.BeforeFieldsChange();
|
|
|
|
|
controlSidedef.Fields.BeforeFieldsChange();
|
|
|
|
|
sidedef.Fields.BeforeFieldsChange();
|
|
|
|
|
} else {
|
|
|
|
|
hasControlLinedef = false;
|
|
|
|
|
sidedef = vg.Sidedef;
|
|
|
|
|
controlSidedef = sidedef;
|
|
|
|
|
linedef = sidedef.Line;
|
|
|
|
|
linedef.Fields.BeforeFieldsChange();
|
|
|
|
|
sidedef.Fields.BeforeFieldsChange();
|
|
|
|
|
}
|
2012-06-28 20:27:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Update() {
|
|
|
|
|
vg.Sector.UpdateSectorData();
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-26 08:54:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-07-05 00:03:40 +00:00
|
|
|
|
internal sealed class KeyNames {
|
2012-06-26 08:54:25 +00:00
|
|
|
|
//SCALE
|
|
|
|
|
public static string GetScaleX(VisualGeometryType type) {
|
|
|
|
|
return getScale(type).Replace("$", "x");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string GetScaleY(VisualGeometryType type) {
|
|
|
|
|
return getScale(type).Replace("$", "y");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static string getScale(VisualGeometryType type) {
|
|
|
|
|
switch(type){
|
|
|
|
|
case VisualGeometryType.CEILING:
|
|
|
|
|
return "$scaleceiling";
|
|
|
|
|
|
|
|
|
|
case VisualGeometryType.FLOOR:
|
|
|
|
|
return "$scalefloor";
|
|
|
|
|
|
|
|
|
|
case VisualGeometryType.WALL_UPPER:
|
|
|
|
|
return "scale$_top";
|
|
|
|
|
|
2012-06-28 20:27:48 +00:00
|
|
|
|
case VisualGeometryType.WALL_MIDDLE_3D:
|
2012-06-26 08:54:25 +00:00
|
|
|
|
case VisualGeometryType.WALL_MIDDLE:
|
|
|
|
|
return "scale$_mid";
|
|
|
|
|
|
|
|
|
|
case VisualGeometryType.WALL_BOTTOM:
|
|
|
|
|
return "scale$_bottom";
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//TRANSLATION
|
|
|
|
|
public static string GetTranslationX(VisualGeometryType type) {
|
|
|
|
|
return getTranslation(type).Replace("$", "x");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string GetTranslationY(VisualGeometryType type) {
|
|
|
|
|
return getTranslation(type).Replace("$", "y");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static string getTranslation(VisualGeometryType type) {
|
|
|
|
|
switch (type) {
|
|
|
|
|
case VisualGeometryType.CEILING:
|
|
|
|
|
return "$panningceiling";
|
|
|
|
|
|
|
|
|
|
case VisualGeometryType.FLOOR:
|
|
|
|
|
return "$panningfloor";
|
|
|
|
|
|
|
|
|
|
case VisualGeometryType.WALL_UPPER:
|
|
|
|
|
return "offset$_top";
|
|
|
|
|
|
2012-06-28 20:27:48 +00:00
|
|
|
|
case VisualGeometryType.WALL_MIDDLE_3D:
|
2012-06-26 08:54:25 +00:00
|
|
|
|
case VisualGeometryType.WALL_MIDDLE:
|
|
|
|
|
return "offset$_mid";
|
|
|
|
|
|
|
|
|
|
case VisualGeometryType.WALL_BOTTOM:
|
|
|
|
|
return "offset$_bottom";
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//ROTATION
|
|
|
|
|
public static string GetRotation(VisualGeometryType type) {
|
|
|
|
|
switch (type) {
|
|
|
|
|
case VisualGeometryType.FLOOR:
|
|
|
|
|
return "rotationfloor";
|
|
|
|
|
|
|
|
|
|
case VisualGeometryType.CEILING:
|
|
|
|
|
return "rotationceiling";
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//LIGHT
|
|
|
|
|
public static string GetLight(VisualGeometryType type) {
|
|
|
|
|
switch (type) {
|
|
|
|
|
case VisualGeometryType.FLOOR:
|
|
|
|
|
return "lightfloor";
|
|
|
|
|
|
|
|
|
|
case VisualGeometryType.CEILING:
|
|
|
|
|
return "lightceiling";
|
|
|
|
|
|
|
|
|
|
case VisualGeometryType.WALL_BOTTOM:
|
|
|
|
|
case VisualGeometryType.WALL_MIDDLE:
|
2012-06-28 20:27:48 +00:00
|
|
|
|
case VisualGeometryType.WALL_MIDDLE_3D:
|
2012-06-26 08:54:25 +00:00
|
|
|
|
case VisualGeometryType.WALL_UPPER:
|
|
|
|
|
return "light";
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string GetLightAbsolute(VisualGeometryType type) {
|
|
|
|
|
switch (type) {
|
|
|
|
|
case VisualGeometryType.FLOOR:
|
|
|
|
|
return "lightfloorabsolute";
|
|
|
|
|
|
|
|
|
|
case VisualGeometryType.CEILING:
|
|
|
|
|
return "lightceilingabsolute";
|
|
|
|
|
|
|
|
|
|
case VisualGeometryType.WALL_BOTTOM:
|
|
|
|
|
case VisualGeometryType.WALL_MIDDLE:
|
2012-06-28 20:27:48 +00:00
|
|
|
|
case VisualGeometryType.WALL_MIDDLE_3D:
|
2012-06-26 08:54:25 +00:00
|
|
|
|
case VisualGeometryType.WALL_UPPER:
|
|
|
|
|
return "lightabsolute";
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|