mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-24 04:41:10 +00:00
697069e27b
Texture Browser Form: don't save current texture group when the form was canceled. Keyboard Shortcut Reference export: generated html will now be saved to program configuration folder if working folder is write-protected. Internal: added SupportedMapFormats property to EditModeAttribute. A mode with this property specified will be available only in specified map formats. Interface: Ceiling Align Mode and Floor Align Mode are now enabled by default. Interface: Ceiling Align Mode and Floor Align Mode are now only available in UDMF map format. Interface: Visplane Explorer Mode is now available only in Doom map format.
107 lines
2.8 KiB
C#
107 lines
2.8 KiB
C#
|
|
#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 CodeImp.DoomBuilder.Data;
|
|
using CodeImp.DoomBuilder.Map;
|
|
using CodeImp.DoomBuilder.Rendering;
|
|
using CodeImp.DoomBuilder.Editing;
|
|
|
|
#endregion
|
|
|
|
namespace CodeImp.DoomBuilder.BuilderModes
|
|
{
|
|
[EditMode(DisplayName = "Floor Align Mode",
|
|
SwitchAction = "flooralignmode",
|
|
ButtonImage = "FloorAlign.png",
|
|
ButtonOrder = int.MinValue + 310,
|
|
ButtonGroup = "000_editing",
|
|
UseByDefault = true, //mxd
|
|
SupportedMapFormats = new[] { "UniversalMapSetIO" }, //mxd
|
|
Volatile = true)]
|
|
|
|
public class FloorAlignMode : FlatAlignMode
|
|
{
|
|
#region ================== Constants
|
|
|
|
#endregion
|
|
|
|
#region ================== Variables
|
|
|
|
private ViewMode prevviewmode;
|
|
|
|
#endregion
|
|
|
|
#region ================== Properties
|
|
|
|
public override string XScaleName { get { return "xscalefloor"; } }
|
|
public override string YScaleName { get { return "yscalefloor"; } }
|
|
public override string XOffsetName { get { return "xpanningfloor"; } }
|
|
public override string YOffsetName { get { return "ypanningfloor"; } }
|
|
public override string RotationName { get { return "rotationfloor"; } }
|
|
public override string UndoDescription { get { return "Floor Alignment"; } }
|
|
|
|
#endregion
|
|
|
|
#region ================== Constructor / Disposer
|
|
|
|
// Constructor
|
|
public FloorAlignMode()
|
|
{
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ================== Methods
|
|
|
|
// Get the texture data to align
|
|
protected override ImageData GetTexture(Sector editsector)
|
|
{
|
|
return General.Map.Data.GetFlatImage(editsector.LongFloorTexture);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ================== Events
|
|
|
|
// Mode engages
|
|
public override void OnEngage()
|
|
{
|
|
prevviewmode = General.Map.Renderer2D.ViewMode;
|
|
|
|
base.OnEngage();
|
|
|
|
General.Actions.InvokeAction("builder_viewmodefloors");
|
|
}
|
|
|
|
// Mode disengages
|
|
public override void OnDisengage()
|
|
{
|
|
switch(prevviewmode)
|
|
{
|
|
case ViewMode.Normal: General.Actions.InvokeAction("builder_viewmodenormal"); break;
|
|
case ViewMode.FloorTextures: General.Actions.InvokeAction("builder_viewmodefloors"); break;
|
|
case ViewMode.CeilingTextures: General.Actions.InvokeAction("builder_viewmodeceilings"); break;
|
|
case ViewMode.Brightness: General.Actions.InvokeAction("builder_viewmodebrightness"); break;
|
|
}
|
|
|
|
base.OnDisengage();
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|