mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +00:00
Added Stair Sector Builder plugin by Boris Iwanski.
Removed a bunch of unused build configurations from Builder.sln.
This commit is contained in:
parent
bb68e1fe43
commit
0e23e64ab4
13 changed files with 4370 additions and 88 deletions
94
Builder.sln
94
Builder.sln
|
@ -21,140 +21,58 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisplaneExplorer", "Source\
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoundPropagation", "Source\Plugins\SoundPropagationMode\SoundPropagation.csproj", "{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StairSectorBuilder", "Source\Plugins\StairSectorBuilder\StairSectorBuilder.csproj", "{3F365121-906B-409D-BB1E-37E0A78056C2}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug|Win32.ActiveCfg = Debug|x86
|
||||
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug|x86.Build.0 = Debug|x86
|
||||
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release|Win32.ActiveCfg = Release|x86
|
||||
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release|x86.ActiveCfg = Release|x86
|
||||
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release|x86.Build.0 = Release|x86
|
||||
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug|Win32.ActiveCfg = Debug|x86
|
||||
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug|x86.Build.0 = Debug|x86
|
||||
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release|Win32.ActiveCfg = Release|x86
|
||||
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release|x86.ActiveCfg = Release|x86
|
||||
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release|x86.Build.0 = Release|x86
|
||||
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug|Win32.ActiveCfg = Debug|x86
|
||||
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug|x86.Build.0 = Debug|x86
|
||||
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release|Win32.ActiveCfg = Release|x86
|
||||
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release|x86.ActiveCfg = Release|x86
|
||||
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release|x86.Build.0 = Release|x86
|
||||
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|Win32.ActiveCfg = Debug|x86
|
||||
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|x86.Build.0 = Debug|x86
|
||||
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|Win32.ActiveCfg = Release|x86
|
||||
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|x86.ActiveCfg = Release|x86
|
||||
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|x86.Build.0 = Release|x86
|
||||
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug|Win32.ActiveCfg = Debug|x86
|
||||
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug|x86.Build.0 = Debug|x86
|
||||
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release|Win32.ActiveCfg = Release|x86
|
||||
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release|x86.ActiveCfg = Release|x86
|
||||
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release|x86.Build.0 = Release|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|Win32.ActiveCfg = Debug|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|x86.Build.0 = Debug|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|Win32.ActiveCfg = Release|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|x86.ActiveCfg = Release|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|x86.Build.0 = Release|x86
|
||||
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug|Win32.ActiveCfg = Debug|x86
|
||||
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug|x86.Build.0 = Debug|x86
|
||||
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release|Win32.ActiveCfg = Release|x86
|
||||
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release|x86.ActiveCfg = Release|x86
|
||||
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release|x86.Build.0 = Release|x86
|
||||
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug|Win32.ActiveCfg = Debug|x86
|
||||
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug|x86.Build.0 = Debug|x86
|
||||
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release|Win32.ActiveCfg = Release|x86
|
||||
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release|x86.ActiveCfg = Release|x86
|
||||
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release|x86.Build.0 = Release|x86
|
||||
{CF670175-7099-4090-A330-EE25C7230139}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{CF670175-7099-4090-A330-EE25C7230139}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{CF670175-7099-4090-A330-EE25C7230139}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{CF670175-7099-4090-A330-EE25C7230139}.Debug|Win32.ActiveCfg = Debug|x86
|
||||
{CF670175-7099-4090-A330-EE25C7230139}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{CF670175-7099-4090-A330-EE25C7230139}.Debug|x86.Build.0 = Debug|x86
|
||||
{CF670175-7099-4090-A330-EE25C7230139}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{CF670175-7099-4090-A330-EE25C7230139}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{CF670175-7099-4090-A330-EE25C7230139}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{CF670175-7099-4090-A330-EE25C7230139}.Release|Win32.ActiveCfg = Release|x86
|
||||
{CF670175-7099-4090-A330-EE25C7230139}.Release|x86.ActiveCfg = Release|x86
|
||||
{CF670175-7099-4090-A330-EE25C7230139}.Release|x86.Build.0 = Release|x86
|
||||
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug|Win32.ActiveCfg = Debug|x86
|
||||
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug|x86.Build.0 = Debug|x86
|
||||
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release|Win32.ActiveCfg = Release|x86
|
||||
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release|x86.ActiveCfg = Release|x86
|
||||
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release|x86.Build.0 = Release|x86
|
||||
{3F365121-906B-409D-BB1E-37E0A78056C2}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{3F365121-906B-409D-BB1E-37E0A78056C2}.Debug|x86.Build.0 = Debug|x86
|
||||
{3F365121-906B-409D-BB1E-37E0A78056C2}.Release|x86.ActiveCfg = Release|x86
|
||||
{3F365121-906B-409D-BB1E-37E0A78056C2}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
167
Source/Plugins/StairSectorBuilder/BuilderPlug.cs
Normal file
167
Source/Plugins/StairSectorBuilder/BuilderPlug.cs
Normal file
|
@ -0,0 +1,167 @@
|
|||
|
||||
#region ================== Copyright (c) 2009 Boris Iwanski
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009 Boris Iwanski
|
||||
* 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 System.Collections.Generic;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Plugins;
|
||||
using CodeImp.DoomBuilder.Actions;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace CodeImp.DoomBuilder.StairSectorBuilderMode
|
||||
{
|
||||
//
|
||||
// MANDATORY: The plug!
|
||||
// This is an important class to the Doom Builder core. Every plugin must
|
||||
// have exactly 1 class that inherits from Plug. When the plugin is loaded,
|
||||
// this class is instantiated and used to receive events from the core.
|
||||
// Make sure the class is public, because only public classes can be seen
|
||||
// by the core.
|
||||
//
|
||||
|
||||
public class BuilderPlug : Plug
|
||||
{
|
||||
public struct Prefab
|
||||
{
|
||||
public string name;
|
||||
|
||||
// General
|
||||
public int numberofsectors;
|
||||
public int innervertexmultiplier;
|
||||
public int outervertexmultiplier;
|
||||
public int stairtype;
|
||||
|
||||
// Straight stairs
|
||||
public int sectordepth;
|
||||
public int spacing;
|
||||
public bool frontside;
|
||||
public bool singlesectors;
|
||||
public bool singledirection;
|
||||
public bool distinctbaseheights;
|
||||
|
||||
// Auto curve
|
||||
public int flipping;
|
||||
|
||||
// Catmull Rom spline
|
||||
public int numberofcontrolpoints;
|
||||
|
||||
// Height info
|
||||
public bool applyfloormod;
|
||||
public int floormod;
|
||||
public int floorbase;
|
||||
public bool applyceilingmod;
|
||||
public int ceilingmod;
|
||||
public int ceilingbase;
|
||||
|
||||
// Textures
|
||||
public bool applyfloortexture;
|
||||
public string floortexture;
|
||||
public bool applyceilingtexture;
|
||||
public string ceilingtexture;
|
||||
|
||||
public bool applyuppertexture;
|
||||
public string uppertexture;
|
||||
public bool upperunpegged;
|
||||
public bool applymiddletexture;
|
||||
public string middletexture;
|
||||
public bool applylowertexture;
|
||||
public string lowertexture;
|
||||
public bool lowerunpegged;
|
||||
}
|
||||
|
||||
// Static instance. We can't use a real static class, because BuilderPlug must
|
||||
// be instantiated by the core, so we keep a static reference. (this technique
|
||||
// should be familiar to object-oriented programmers)
|
||||
private static BuilderPlug me;
|
||||
|
||||
// Static property to access the BuilderPlug
|
||||
public static BuilderPlug Me { get { return me; } }
|
||||
|
||||
private List<Prefab> prefabs;
|
||||
|
||||
public List<Prefab> Prefabs { get { return prefabs; } }
|
||||
|
||||
// This plugin relies on some functionality that wasn't there in older versions
|
||||
public override int MinimumRevision { get { return 1310; } }
|
||||
|
||||
// This event is called when the plugin is initialized
|
||||
public override void OnInitialize()
|
||||
{
|
||||
base.OnInitialize();
|
||||
|
||||
// This binds the methods in this class that have the BeginAction
|
||||
// and EndAction attributes with their actions. Without this, the
|
||||
// attributes are useless. Note that in classes derived from EditMode
|
||||
// this is not needed, because they are bound automatically when the
|
||||
// editing mode is engaged.
|
||||
General.Actions.BindMethods(this);
|
||||
|
||||
prefabs = new List<Prefab>();
|
||||
|
||||
// TODO: Add DB2 version check so that old DB2 versions won't crash
|
||||
// General.ErrorLogger.Add(ErrorType.Error, "zomg!");
|
||||
|
||||
// Keep a static reference
|
||||
me = this;
|
||||
}
|
||||
|
||||
// This is called when the plugin is terminated
|
||||
public override void Dispose()
|
||||
{
|
||||
base.Dispose();
|
||||
|
||||
// This must be called to remove bound methods for actions.
|
||||
General.Actions.UnbindMethods(this);
|
||||
}
|
||||
|
||||
#region ================== Actions
|
||||
|
||||
[BeginAction("selectsectorsoutline")]
|
||||
public void SelectSectorsOutline()
|
||||
{
|
||||
// Must have sectors selected. Having sectors selected implies
|
||||
// that there are also linedefs selected
|
||||
if (General.Map.Map.SelectedSectorsCount == 0) return;
|
||||
|
||||
// Get the list of selected sectors since it'll be empty after
|
||||
// switching to linedefs mode
|
||||
List<Sector> sectors = new List<Sector>(General.Map.Map.GetSelectedSectors(true));
|
||||
|
||||
General.Editing.ChangeMode("LinedefsMode");
|
||||
|
||||
// Go through all selected linedefs and unselect/unmark all which
|
||||
// have a selected sector on both sides
|
||||
foreach (Linedef ld in General.Map.Map.GetSelectedLinedefs(true))
|
||||
{
|
||||
if (sectors.Contains(ld.Front.Sector) && ld.Back != null && sectors.Contains(ld.Back.Sector))
|
||||
{
|
||||
ld.Selected = false;
|
||||
ld.Marked = false;
|
||||
}
|
||||
}
|
||||
|
||||
General.Interface.RedrawDisplay();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Methods
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
35
Source/Plugins/StairSectorBuilder/Properties/AssemblyInfo.cs
Normal file
35
Source/Plugins/StairSectorBuilder/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Управление общими сведениями о сборке осуществляется с помощью
|
||||
// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
|
||||
// связанные со сборкой.
|
||||
[assembly: AssemblyTitle("StairSectorBuilder")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("StairSectorBuilder")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Параметр ComVisible со значением FALSE делает типы в сборке невидимыми
|
||||
// для COM-компонентов. Если требуется обратиться к типу в этой сборке через
|
||||
// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
|
||||
[assembly: Guid("a3340ba1-665f-4414-8cbb-a0271aa32137")]
|
||||
|
||||
// Сведения о версии сборки состоят из следующих четырех значений:
|
||||
//
|
||||
// Основной номер версии
|
||||
// Дополнительный номер версии
|
||||
// Номер построения
|
||||
// Редакция
|
||||
//
|
||||
// Можно задать все значения или принять номер построения и номер редакции по умолчанию,
|
||||
// используя "*", как показано ниже:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
77
Source/Plugins/StairSectorBuilder/Properties/Resources.Designer.cs
generated
Normal file
77
Source/Plugins/StairSectorBuilder/Properties/Resources.Designer.cs
generated
Normal file
|
@ -0,0 +1,77 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Этот код создан программой.
|
||||
// Исполняемая версия:2.0.50727.4927
|
||||
//
|
||||
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||
// повторной генерации кода.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace CodeImp.DoomBuilder.StairSectorBuilder.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
|
||||
/// </summary>
|
||||
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
|
||||
// с помощью такого средства, как ResGen или Visual Studio.
|
||||
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
|
||||
// с параметром /str или перестройте свой проект VS.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CodeImp.DoomBuilder.StairSectorBuilder.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
|
||||
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
internal static byte[] Actions {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Actions", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
internal static System.Drawing.Bitmap StairIcon {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("StairIcon", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
127
Source/Plugins/StairSectorBuilder/Properties/Resources.resx
Normal file
127
Source/Plugins/StairSectorBuilder/Properties/Resources.resx
Normal file
|
@ -0,0 +1,127 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="Actions" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Actions.cfg;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="StairIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\StairIcon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
42
Source/Plugins/StairSectorBuilder/Resources/Actions.cfg
Normal file
42
Source/Plugins/StairSectorBuilder/Resources/Actions.cfg
Normal file
|
@ -0,0 +1,42 @@
|
|||
|
||||
//
|
||||
// This file defines which actions there are, what description they have and
|
||||
// some behaviour options. The Doom Builder core will bind to these actions
|
||||
// with delegates (function pointers) where you use the BeginAction and
|
||||
// EndAction attributes. This file must be named Actions.cfg and must be
|
||||
// included in the plugin project as "Embedded Resource".
|
||||
//
|
||||
|
||||
//
|
||||
// Options:
|
||||
//
|
||||
// allowkeys: Allows the user to bind standard keys to this action.
|
||||
// allowmouse: Allows the user to bind mouse buttons to this action.
|
||||
// allowscroll: Allows the user to bind the scrollwheel to this action.
|
||||
// disregardshift: This action will trigger regardless if Shift or Control is used.
|
||||
// repeat: BeginAction will be called for automatic key repetition.
|
||||
// default: Default key is only used when the action is loaded for the first
|
||||
// time and the default key is not used by any other action.
|
||||
//
|
||||
// allowkeys and allowmouse are true by default, the others are false by default.
|
||||
//
|
||||
|
||||
stairsectorbuildermode
|
||||
{
|
||||
title = "Stair Sector Builder Mode";
|
||||
category = "modes";
|
||||
description = "Switches to the stair sector builder mode.";
|
||||
allowkeys = true;
|
||||
allowmouse = true;
|
||||
allowscroll = true;
|
||||
}
|
||||
|
||||
selectsectorsoutline
|
||||
{
|
||||
title = "Select Sectors Outline";
|
||||
category = "sectors";
|
||||
description = "Selects the outline of all marked sectors, deselecting lines that are shared.";
|
||||
allowkeys = true;
|
||||
allowmouse = true;
|
||||
allowscroll = true;
|
||||
}
|
BIN
Source/Plugins/StairSectorBuilder/Resources/StairIcon.png
Normal file
BIN
Source/Plugins/StairSectorBuilder/Resources/StairIcon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
90
Source/Plugins/StairSectorBuilder/StairSectorBuilder.csproj
Normal file
90
Source/Plugins/StairSectorBuilder/StairSectorBuilder.csproj
Normal file
|
@ -0,0 +1,90 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{3F365121-906B-409D-BB1E-37E0A78056C2}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CodeImp.DoomBuilder.StairSectorBuilder</RootNamespace>
|
||||
<AssemblyName>StairSectorBuilder</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\Build\Plugins\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\..\Build\Plugins\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Builder, Version=1.14.0.2201, Culture=neutral, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\Build\Builder.exe</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BuilderPlug.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="StairSectorBuilderForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="StairSectorBuilderForm.designer.cs">
|
||||
<DependentUpon>StairSectorBuilderForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="StairSectorBuilderMode.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="StairSectorBuilderForm.resx">
|
||||
<DependentUpon>StairSectorBuilderForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\Actions.cfg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\StairIcon.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -0,0 +1 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
|
881
Source/Plugins/StairSectorBuilder/StairSectorBuilderForm.cs
Normal file
881
Source/Plugins/StairSectorBuilder/StairSectorBuilderForm.cs
Normal file
|
@ -0,0 +1,881 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
|
||||
namespace CodeImp.DoomBuilder.StairSectorBuilderMode
|
||||
{
|
||||
public partial class StairSectorBuilderForm : DelayedForm
|
||||
{
|
||||
private bool fullyloaded;
|
||||
private bool loadingprefab;
|
||||
private int stepmultiplier = 1;
|
||||
private int originalfloorbase;
|
||||
private int originalceilingbase;
|
||||
|
||||
|
||||
#region ================== Properties
|
||||
|
||||
public int OriginalFloorBase
|
||||
{
|
||||
set { originalfloorbase = value; }
|
||||
get { return originalfloorbase; }
|
||||
}
|
||||
|
||||
public int OriginalCeilingBase
|
||||
{
|
||||
set { originalceilingbase = value; }
|
||||
get { return originalceilingbase; }
|
||||
}
|
||||
|
||||
public int StepMultiplier
|
||||
{
|
||||
set { stepmultiplier = value; }
|
||||
}
|
||||
|
||||
public int StairType
|
||||
{
|
||||
get { return tabcontrol.SelectedIndex; }
|
||||
}
|
||||
|
||||
public uint NumberOfSectors
|
||||
{
|
||||
// get { return (uint)System.Convert.ToUInt32(numberofsectors.Text); }
|
||||
get { return (uint)numberofsectors.GetResult(1); }
|
||||
set { numberofsectors.Text = value.ToString(); }
|
||||
}
|
||||
|
||||
public uint SectorDepth
|
||||
{
|
||||
// get { return (uint)System.Convert.ToUInt32(sectordepth.Text); }
|
||||
get { return (uint)sectordepth.GetResult(32); }
|
||||
set { sectordepth.Text = value.ToString(); }
|
||||
}
|
||||
|
||||
public int Spacing
|
||||
{
|
||||
get { return spacing.GetResult(0); }
|
||||
set { spacing.Text = value.ToString(); }
|
||||
}
|
||||
|
||||
public int InnerVertexMultiplier
|
||||
{
|
||||
get { return autocurveinnervertexmultiplier.GetResult(1); }
|
||||
set { autocurveinnervertexmultiplier.Text = value.ToString(); }
|
||||
}
|
||||
|
||||
public int OuterVertexMultiplier
|
||||
{
|
||||
get { return autocurveoutervertexmultiplier.GetResult(1); }
|
||||
set { autocurveoutervertexmultiplier.Text = value.ToString(); }
|
||||
}
|
||||
|
||||
public bool SideFront
|
||||
{
|
||||
get { return sidefront.Checked; }
|
||||
set { sidefront.Checked = value; }
|
||||
}
|
||||
|
||||
public CheckBox DistinctBaseHeights
|
||||
{
|
||||
get { return distinctbaseheights; }
|
||||
set { distinctbaseheights = value; }
|
||||
}
|
||||
|
||||
public CheckBox SingleSectors
|
||||
{
|
||||
get { return singlesectors; }
|
||||
set { singlesectors = value; }
|
||||
}
|
||||
|
||||
public CheckBox SingleDirection
|
||||
{
|
||||
get { return singledirection; }
|
||||
set { singledirection = value; }
|
||||
}
|
||||
|
||||
public TabControl Tabs
|
||||
{
|
||||
get { return tabcontrol; }
|
||||
}
|
||||
|
||||
public int NumControlPoints
|
||||
{
|
||||
get { return numberofcontrolpoints.GetResult(1) + 2; }
|
||||
set { numberofcontrolpoints.Text = value.ToString(); }
|
||||
}
|
||||
|
||||
public bool FloorHeight
|
||||
{
|
||||
get { return floorheightmodification.Checked; }
|
||||
set { floorheightmodification.Checked = value; }
|
||||
}
|
||||
|
||||
public bool CeilingHeight
|
||||
{
|
||||
get { return ceilingheightmodification.Checked; }
|
||||
set { ceilingheightmodification.Checked = value; }
|
||||
}
|
||||
|
||||
|
||||
public int FloorHeightModification
|
||||
{
|
||||
get { return floorheightmod.GetResult(0); }
|
||||
set { floorheightmod.Text = value.ToString(); }
|
||||
}
|
||||
|
||||
public int CeilingHeightModification
|
||||
{
|
||||
get { return ceilingheightmod.GetResult(0); }
|
||||
set { ceilingheightmod.Text = value.ToString(); }
|
||||
}
|
||||
|
||||
public bool FloorFlat
|
||||
{
|
||||
get { return floorflat.Checked; }
|
||||
set { floorflat.Checked = value; }
|
||||
}
|
||||
|
||||
public string FloorFlatTexture
|
||||
{
|
||||
get { return floorflattexture.TextureName; }
|
||||
set { floorflattexture.TextureName = value; }
|
||||
}
|
||||
|
||||
public bool CeilingFlat
|
||||
{
|
||||
get { return ceilingflat.Checked; }
|
||||
set { ceilingflat.Checked = value; }
|
||||
}
|
||||
|
||||
public string CeilingFlatTexture
|
||||
{
|
||||
get { return ceilingflattexture.TextureName; }
|
||||
set { ceilingflattexture.TextureName = value; }
|
||||
}
|
||||
|
||||
public bool UpperTexture
|
||||
{
|
||||
get { return uppertexture.Checked; }
|
||||
set { uppertexture.Checked = value; }
|
||||
}
|
||||
|
||||
public bool MiddleTexture
|
||||
{
|
||||
get { return middletexture.Checked; }
|
||||
set { middletexture.Checked = value; }
|
||||
}
|
||||
|
||||
public bool LowerTexture
|
||||
{
|
||||
get { return lowertexture.Checked; }
|
||||
set { lowertexture.Checked = value; }
|
||||
}
|
||||
|
||||
public string UpperTextureTexture
|
||||
{
|
||||
get { return uppertexturetexture.TextureName; }
|
||||
set { uppertexturetexture.TextureName = value; }
|
||||
}
|
||||
|
||||
public string MiddleTextureTexture
|
||||
{
|
||||
get { return middletexturetexture.TextureName; }
|
||||
set { middletexturetexture.TextureName = value; }
|
||||
}
|
||||
|
||||
public string LowerTextureTexture
|
||||
{
|
||||
get { return lowertexturetexture.TextureName; }
|
||||
set { lowertexturetexture.TextureName = value; }
|
||||
}
|
||||
|
||||
public int FloorBase
|
||||
{
|
||||
set { floorbase.Text = value.ToString(); }
|
||||
get { return floorbase.GetResult(0); }
|
||||
}
|
||||
|
||||
public int CeilingBase
|
||||
{
|
||||
set { ceilingbase.Text = value.ToString(); }
|
||||
get { return ceilingbase.GetResult(0); }
|
||||
}
|
||||
|
||||
public bool FullyLoaded
|
||||
{
|
||||
get { return fullyloaded; }
|
||||
}
|
||||
|
||||
public int Flipping
|
||||
{
|
||||
get { return autocurveflipping.SelectedIndex; }
|
||||
set { autocurveflipping.SelectedIndex = value; }
|
||||
}
|
||||
|
||||
public bool UpperUnpegged
|
||||
{
|
||||
get { return upperunpegged.Checked; }
|
||||
set { upperunpegged.Checked = value; }
|
||||
}
|
||||
|
||||
public bool LowerUnpegged
|
||||
{
|
||||
get { return lowerunpegged.Checked; }
|
||||
set { lowerunpegged.Checked = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public StairSectorBuilderForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
foreach (BuilderPlug.Prefab p in BuilderPlug.Me.Prefabs)
|
||||
{
|
||||
ListViewItem lvi = new ListViewItem();
|
||||
ListViewItem.ListViewSubItem lvisi = new ListViewItem.ListViewSubItem();
|
||||
|
||||
lvi.Text = p.name;
|
||||
lvisi.Text = tabcontrol.TabPages[p.stairtype].Text;
|
||||
|
||||
lvi.SubItems.Add(lvisi);
|
||||
prefabs.Items.Add(lvi);
|
||||
}
|
||||
}
|
||||
|
||||
// This shows the window
|
||||
public void Show(Form owner)
|
||||
{
|
||||
// Position at left-top of owner
|
||||
this.Location = new Point(owner.Location.X + 20, owner.Location.Y + 90);
|
||||
|
||||
// Set the default name for the prefab
|
||||
for (int i = 1; i < int.MaxValue; i++)
|
||||
{
|
||||
string defname = "Prefab #" + i;
|
||||
bool validname = true;
|
||||
|
||||
foreach (BuilderPlug.Prefab p in BuilderPlug.Me.Prefabs)
|
||||
{
|
||||
if (p.name == defname)
|
||||
{
|
||||
validname = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (validname)
|
||||
{
|
||||
prefabname.Text = defname;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Show window
|
||||
base.Show(owner);
|
||||
}
|
||||
|
||||
private void ComputeHeights()
|
||||
{
|
||||
if (!fullyloaded) return;
|
||||
|
||||
if (floorbase.Enabled == false)
|
||||
{
|
||||
floorfirst.Text = "--";
|
||||
floorlast.Text = "--";
|
||||
}
|
||||
else
|
||||
{
|
||||
floorfirst.Text = (Int32.Parse(floorbase.Text) + Int32.Parse(floorheightmod.Text)).ToString();
|
||||
floorlast.Text = (Int32.Parse(floorbase.Text) + Int32.Parse(floorheightmod.Text) * (Int32.Parse(numberofsectors.Text) * stepmultiplier)).ToString();
|
||||
}
|
||||
|
||||
if (ceilingbase.Enabled == false)
|
||||
{
|
||||
ceilingfirst.Text = "--";
|
||||
ceilinglast.Text = "--";
|
||||
}
|
||||
else
|
||||
{
|
||||
ceilingfirst.Text = (Int32.Parse(ceilingbase.Text) + Int32.Parse(ceilingheightmod.Text)).ToString();
|
||||
ceilinglast.Text = (Int32.Parse(ceilingbase.Text) + Int32.Parse(ceilingheightmod.Text) * (Int32.Parse(numberofsectors.Text) * stepmultiplier)).ToString();
|
||||
}
|
||||
}
|
||||
|
||||
// Wrap redrawing display so that it will not get called multiple
|
||||
// times while loading a prefab
|
||||
private void DoRedrawDisplay()
|
||||
{
|
||||
if (loadingprefab == false) General.Interface.RedrawDisplay();
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
SavePrefab("[Previous]", true, 0);
|
||||
|
||||
General.Editing.AcceptMode();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
General.Editing.CancelMode();
|
||||
}
|
||||
|
||||
private void tbSectorDepth_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void rdbFront_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void rdbBack_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void tabcontrol_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (General.Map.Map.GetSelectedLinedefs(true).Count == 1)
|
||||
{
|
||||
tabcontrol.SelectedTab = tabPage1;
|
||||
}
|
||||
|
||||
if (tabcontrol.SelectedTab != tabPage1)
|
||||
{
|
||||
floorbase.Enabled = true;
|
||||
ceilingbase.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (distinctbaseheights.Checked)
|
||||
{
|
||||
floorbase.Enabled = false;
|
||||
ceilingbase.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
floorbase.Enabled = true;
|
||||
ceilingbase.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
DoRedrawDisplay();
|
||||
ComputeHeights();
|
||||
}
|
||||
|
||||
/*private void tbAutoNumSectors_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
DoRedrawDisplay();
|
||||
}*/
|
||||
|
||||
private void numberofsectors_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (numberofsectors.Text == "" || numberofsectors.GetResult(1) == 0) numberofsectors.Text = "1";
|
||||
ComputeHeights();
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void sectordepth_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (sectordepth.GetResult(32) == 0) sectordepth.Text = "1";
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void StairSectorBuilderForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
sectordepth.Text = "32";
|
||||
spacing.Text = "0";
|
||||
numberofsectors.Text = "1";
|
||||
autocurveinnervertexmultiplier.Text = "1";
|
||||
autocurveoutervertexmultiplier.Text = "1";
|
||||
splineinnervertexmultiplier.Text = "1";
|
||||
splineoutervertexmultiplier.Text = "1";
|
||||
numberofcontrolpoints.Text = "1";
|
||||
floorheightmod.Text = "0";
|
||||
ceilingheightmod.Text = "0";
|
||||
floorbase.Text = "0";
|
||||
ceilingbase.Text = "0";
|
||||
autocurveflipping.SelectedIndex = 0;
|
||||
MiddleTextureTexture = "-";
|
||||
|
||||
fullyloaded = true;
|
||||
|
||||
ComputeHeights();
|
||||
}
|
||||
|
||||
private void autocurveinnervertexmultiplier_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (autocurveinnervertexmultiplier.GetResult(1) == 0) autocurveinnervertexmultiplier.Text = "1";
|
||||
|
||||
if(splineinnervertexmultiplier.Text != autocurveinnervertexmultiplier.Text)
|
||||
splineinnervertexmultiplier.Text = autocurveinnervertexmultiplier.Text;
|
||||
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void autocurveoutervertexmultiplier_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (autocurveoutervertexmultiplier.GetResult(1) == 0) autocurveoutervertexmultiplier.Text = "1";
|
||||
|
||||
if(splineoutervertexmultiplier.Text != autocurveoutervertexmultiplier.Text)
|
||||
splineoutervertexmultiplier.Text = autocurveoutervertexmultiplier.Text;
|
||||
|
||||
DoRedrawDisplay();
|
||||
|
||||
}
|
||||
|
||||
private void splineinnervertexmultiplier_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (splineinnervertexmultiplier.GetResult(1) == 0) splineinnervertexmultiplier.Text = "1";
|
||||
|
||||
if(autocurveinnervertexmultiplier.Text != splineinnervertexmultiplier.Text)
|
||||
autocurveinnervertexmultiplier.Text = splineinnervertexmultiplier.Text;
|
||||
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void splineoutervertexmultiplier_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (splineoutervertexmultiplier.GetResult(1) == 0) splineoutervertexmultiplier.Text = "1";
|
||||
|
||||
if(splineoutervertexmultiplier.Text != autocurveoutervertexmultiplier.Text)
|
||||
autocurveoutervertexmultiplier.Text = splineoutervertexmultiplier.Text;
|
||||
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void onecontrolpoint_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void StairSectorBuilderForm_Shown(object sender, EventArgs e)
|
||||
{
|
||||
if (General.Map.Map.GetSelectedLinedefs(true).Count == 1 || General.Map.Map.SelectedSectorsCount > 0)
|
||||
{
|
||||
tabcontrol.TabPages.Remove(tabPage2);
|
||||
tabcontrol.TabPages.Remove(tabPage3);
|
||||
}
|
||||
|
||||
if (General.Map.Map.SelectedSectorsCount > 0)
|
||||
{
|
||||
singledirection.Checked = false;
|
||||
singledirection.Enabled = false;
|
||||
|
||||
singlesectors.Checked = true;
|
||||
singlesectors.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void singlesectors_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (singlesectors.Checked)
|
||||
singledirection.Enabled = true;
|
||||
else
|
||||
singledirection.Enabled = false;
|
||||
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void numberofcontrolpoints_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (numberofcontrolpoints.GetResult(1) == 0) numberofcontrolpoints.Text = "1";
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void sidefront_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void sideback_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void singledirection_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void floorheightmod_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (floorheightmod.GetResult(0) == 0) floorheightmod.Text = "0";
|
||||
ComputeHeights();
|
||||
}
|
||||
|
||||
private void ceilingheightmod_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (ceilingheightmod.GetResult(0) == 0) ceilingheightmod.Text = "0";
|
||||
ComputeHeights();
|
||||
}
|
||||
|
||||
private void floorflat_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (floorflat.Checked)
|
||||
floorflattexture.Enabled = true;
|
||||
else
|
||||
floorflattexture.Enabled = false;
|
||||
}
|
||||
|
||||
private void ceilingflat_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (ceilingflat.Checked)
|
||||
ceilingflattexture.Enabled = true;
|
||||
else
|
||||
ceilingflattexture.Enabled = false;
|
||||
}
|
||||
|
||||
private void spacing_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (spacing.GetResult(0) == 0) spacing.Text = "0";
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void uppertexture_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (uppertexture.Checked)
|
||||
{
|
||||
uppertexturetexture.Enabled = true;
|
||||
upperunpegged.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
uppertexturetexture.Enabled = false;
|
||||
upperunpegged.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void middletexture_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (middletexture.Checked)
|
||||
middletexturetexture.Enabled = true;
|
||||
else
|
||||
middletexturetexture.Enabled = false;
|
||||
}
|
||||
|
||||
private void lowertexture_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (lowertexture.Checked)
|
||||
{
|
||||
lowertexturetexture.Enabled = true;
|
||||
lowerunpegged.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
lowertexturetexture.Enabled = false;
|
||||
lowerunpegged.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void firstisback_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void StairSectorBuilderForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
// User closing the window?
|
||||
if (e.CloseReason == CloseReason.UserClosing)
|
||||
{
|
||||
// Just cancel
|
||||
General.Editing.CancelMode();
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void lastisback_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void acflipping1_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void acflipping2_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void acflipping3_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void floorbase_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (floorbase.GetResult(0) == 0) floorbase.Text = "0";
|
||||
ComputeHeights();
|
||||
}
|
||||
|
||||
private void ceilingbase_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (ceilingbase.GetResult(0) == 0) ceilingbase.Text = "0";
|
||||
ComputeHeights();
|
||||
}
|
||||
|
||||
private void prefabsave_Click(object sender, EventArgs e)
|
||||
{
|
||||
string name = prefabname.Text.Trim();
|
||||
|
||||
if (name == "[Previous]")
|
||||
MessageBox.Show(Owner, "The prefab name \"[Previous]\" is reserved and can not be overwritten.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
else
|
||||
SavePrefab(prefabname.Text.Trim(), false, -1);
|
||||
}
|
||||
|
||||
private void SavePrefab(string name, bool forceoverwrite, int position)
|
||||
{
|
||||
int overwrite = -1;
|
||||
|
||||
// Prefab name may not be empty
|
||||
if (name == "")
|
||||
{
|
||||
MessageBox.Show(this.Owner, "Please enter a name for the prefab", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if there's already a prefab with the given name
|
||||
for (int i = 0; i < BuilderPlug.Me.Prefabs.Count; i++)
|
||||
{
|
||||
BuilderPlug.Prefab p = BuilderPlug.Me.Prefabs[i];
|
||||
|
||||
if (p.name == name)
|
||||
{
|
||||
if (forceoverwrite == false && MessageBox.Show(this.Owner, "A prefab with that name already exists. Overwrite?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
||||
return;
|
||||
else
|
||||
overwrite = i;
|
||||
}
|
||||
}
|
||||
|
||||
ListViewItem lvi = new ListViewItem();
|
||||
ListViewItem.ListViewSubItem lvisi = new ListViewItem.ListViewSubItem();
|
||||
|
||||
lvi.Text = name;
|
||||
lvisi.Text = tabcontrol.TabPages[tabcontrol.SelectedIndex].Text;
|
||||
|
||||
lvi.SubItems.Add(lvisi);
|
||||
|
||||
BuilderPlug.Prefab pf = new BuilderPlug.Prefab();
|
||||
|
||||
pf.name = name;
|
||||
|
||||
pf.numberofsectors = (int)NumberOfSectors;
|
||||
pf.outervertexmultiplier = OuterVertexMultiplier;
|
||||
pf.innervertexmultiplier = InnerVertexMultiplier;
|
||||
|
||||
pf.stairtype = tabcontrol.SelectedIndex;
|
||||
|
||||
// Straight stairs
|
||||
pf.sectordepth = (int)SectorDepth;
|
||||
pf.spacing = Spacing;
|
||||
pf.frontside = SideFront;
|
||||
pf.singlesectors = SingleSectors.Checked;
|
||||
pf.singledirection = SingleDirection.Checked;
|
||||
pf.distinctbaseheights = DistinctBaseHeights.Checked;
|
||||
|
||||
// Auto curve
|
||||
pf.flipping = Flipping;
|
||||
|
||||
// Catmull Rom spline
|
||||
pf.numberofcontrolpoints = NumControlPoints - 2;
|
||||
|
||||
// Height info
|
||||
pf.applyfloormod = FloorHeight;
|
||||
pf.floormod = FloorHeightModification;
|
||||
//pf.floorbase = FloorBase;
|
||||
pf.applyceilingmod = CeilingHeight;
|
||||
pf.ceilingmod = CeilingHeightModification;
|
||||
//pf.ceilingbase = CeilingBase;
|
||||
|
||||
// Textures
|
||||
pf.applyfloortexture = FloorFlat;
|
||||
pf.floortexture = FloorFlatTexture;
|
||||
|
||||
pf.applyceilingtexture = CeilingFlat;
|
||||
pf.ceilingtexture = CeilingFlatTexture;
|
||||
|
||||
pf.applyuppertexture = UpperTexture;
|
||||
pf.uppertexture = UpperTextureTexture;
|
||||
pf.upperunpegged = UpperUnpegged;
|
||||
|
||||
pf.applymiddletexture = MiddleTexture;
|
||||
pf.middletexture = MiddleTextureTexture;
|
||||
|
||||
pf.applylowertexture = LowerTexture;
|
||||
pf.lowertexture = LowerTextureTexture;
|
||||
pf.lowerunpegged = LowerUnpegged;
|
||||
|
||||
if (overwrite == -1)
|
||||
{
|
||||
if (position == -1)
|
||||
{
|
||||
BuilderPlug.Me.Prefabs.Add(pf);
|
||||
prefabs.Items.Add(lvi);
|
||||
}
|
||||
else
|
||||
{
|
||||
BuilderPlug.Me.Prefabs.Insert(position, pf);
|
||||
prefabs.Items.Insert(position, lvi);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BuilderPlug.Me.Prefabs.RemoveAt(overwrite);
|
||||
BuilderPlug.Me.Prefabs.Insert(overwrite, pf);
|
||||
|
||||
prefabs.Items.RemoveAt(overwrite);
|
||||
prefabs.Items.Insert(overwrite, lvi);
|
||||
}
|
||||
}
|
||||
|
||||
private void prefabload_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (prefabs.SelectedIndices.Count == 0) return;
|
||||
|
||||
loadingprefab = true;
|
||||
|
||||
BuilderPlug.Prefab p = BuilderPlug.Me.Prefabs[prefabs.SelectedIndices[0]];
|
||||
|
||||
prefabname.Text = p.name;
|
||||
|
||||
NumberOfSectors = (uint)p.numberofsectors;
|
||||
OuterVertexMultiplier = p.outervertexmultiplier;
|
||||
InnerVertexMultiplier = p.innervertexmultiplier;
|
||||
|
||||
tabcontrol.SelectedIndex = p.stairtype;
|
||||
|
||||
// Straight stairs
|
||||
SectorDepth = (uint)p.sectordepth;
|
||||
Spacing = p.spacing;
|
||||
SideFront = p.frontside;
|
||||
SingleSectors.Checked = p.singlesectors;
|
||||
SingleDirection.Checked = p.singledirection;
|
||||
DistinctBaseHeights.Checked = p.distinctbaseheights;
|
||||
|
||||
// Auto curve TODO
|
||||
Flipping = p.flipping;
|
||||
|
||||
// Catmull Rom spline
|
||||
NumControlPoints = p.numberofcontrolpoints;
|
||||
|
||||
// Height info
|
||||
FloorHeight = p.applyfloormod;
|
||||
FloorHeightModification = p.floormod;
|
||||
//FloorBase = p.floorbase;
|
||||
CeilingHeight = p.applyceilingmod;
|
||||
CeilingHeightModification = p.ceilingmod;
|
||||
//CeilingBase = p.ceilingbase;
|
||||
|
||||
// Textures
|
||||
FloorFlat = p.applyfloortexture;
|
||||
FloorFlatTexture = p.floortexture;
|
||||
CeilingFlat = p.applyceilingtexture;
|
||||
CeilingFlatTexture = p.ceilingtexture;
|
||||
|
||||
UpperTexture = p.applyuppertexture;
|
||||
UpperTextureTexture = p.uppertexture;
|
||||
UpperUnpegged = p.upperunpegged;
|
||||
|
||||
MiddleTexture = p.applymiddletexture;
|
||||
MiddleTextureTexture = p.middletexture;
|
||||
|
||||
LowerTexture = p.applylowertexture;
|
||||
LowerTextureTexture = p.lowertexture;
|
||||
LowerUnpegged = p.lowerunpegged;
|
||||
|
||||
loadingprefab = false;
|
||||
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void prefabdelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (prefabs.SelectedIndices.Count == 0) return;
|
||||
|
||||
BuilderPlug.Me.Prefabs.RemoveAt(prefabs.SelectedIndices[0]);
|
||||
prefabs.Items.RemoveAt(prefabs.SelectedIndices[0]);
|
||||
}
|
||||
|
||||
private void distinctbaseheights_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (distinctbaseheights.Checked)
|
||||
{
|
||||
floorbase.Enabled = false;
|
||||
ceilingbase.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(floorheightmodification.Checked) floorbase.Enabled = true;
|
||||
if(ceilingheightmodification.Checked) ceilingbase.Enabled = true;
|
||||
}
|
||||
|
||||
ComputeHeights();
|
||||
}
|
||||
|
||||
private void autocurveflipping_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (autocurveflipping.SelectedIndex != splineflipping.SelectedIndex)
|
||||
splineflipping.SelectedIndex = autocurveflipping.SelectedIndex;
|
||||
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void splineflipping_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (splineflipping.SelectedIndex != autocurveflipping.SelectedIndex)
|
||||
autocurveflipping.SelectedIndex = splineflipping.SelectedIndex;
|
||||
|
||||
DoRedrawDisplay();
|
||||
}
|
||||
|
||||
private void floorheightmodification_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (floorheightmodification.Checked)
|
||||
{
|
||||
floorheightmod.Enabled = true;
|
||||
|
||||
if (StairType != 0 || distinctbaseheights.Checked == false) floorbase.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
floorheightmod.Enabled = false;
|
||||
|
||||
if (StairType != 0 || distinctbaseheights.Checked == false) floorbase.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void ceilingheightmodification_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (ceilingheightmodification.Checked)
|
||||
{
|
||||
ceilingheightmod.Enabled = true;
|
||||
|
||||
if (StairType != 0 || distinctbaseheights.Checked == false) ceilingbase.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ceilingheightmod.Enabled = false;
|
||||
|
||||
if (StairType != 0 || distinctbaseheights.Checked == false) ceilingbase.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void floorbasegetter_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
floorbase.Text = originalfloorbase.ToString();
|
||||
}
|
||||
|
||||
private void ceilingbasegetter_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
ceilingbase.Text = originalceilingbase.ToString();
|
||||
}
|
||||
}
|
||||
}
|
1168
Source/Plugins/StairSectorBuilder/StairSectorBuilderForm.designer.cs
generated
Normal file
1168
Source/Plugins/StairSectorBuilder/StairSectorBuilderForm.designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
120
Source/Plugins/StairSectorBuilder/StairSectorBuilderForm.resx
Normal file
120
Source/Plugins/StairSectorBuilder/StairSectorBuilderForm.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
1656
Source/Plugins/StairSectorBuilder/StairSectorBuilderMode.cs
Normal file
1656
Source/Plugins/StairSectorBuilder/StairSectorBuilderMode.cs
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue