diff --git a/Source/Plugins/StairSectorBuilder/BuilderPlug.cs b/Source/Plugins/StairSectorBuilder/BuilderPlug.cs deleted file mode 100644 index b3448be5a805cd18e777162ded773ea0c8dd8604..0000000000000000000000000000000000000000 --- a/Source/Plugins/StairSectorBuilder/BuilderPlug.cs +++ /dev/null @@ -1,184 +0,0 @@ - -#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; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Globalization; -using System.Text; -using System.Windows.Forms; -using System.IO; -using System.Reflection; -using CodeImp.DoomBuilder.Windows; -using CodeImp.DoomBuilder.IO; -using CodeImp.DoomBuilder.Map; -using CodeImp.DoomBuilder.Rendering; -using CodeImp.DoomBuilder.Geometry; -using System.Drawing; -using CodeImp.DoomBuilder.Editing; -using CodeImp.DoomBuilder.Plugins; -using CodeImp.DoomBuilder.Actions; -using CodeImp.DoomBuilder.Types; -using CodeImp.DoomBuilder.Config; -using CodeImp.DoomBuilder.Data; - -#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 - } -} diff --git a/Source/Plugins/StairSectorBuilder/Properties/AssemblyInfo.cs b/Source/Plugins/StairSectorBuilder/Properties/AssemblyInfo.cs deleted file mode 100644 index d110b4e1752da1abb7ce118c861b9431ae8781c2..0000000000000000000000000000000000000000 --- a/Source/Plugins/StairSectorBuilder/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -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")] diff --git a/Source/Plugins/StairSectorBuilder/Properties/Resources.Designer.cs b/Source/Plugins/StairSectorBuilder/Properties/Resources.Designer.cs deleted file mode 100644 index 5f476774894b1af77476eab07faabc5103a1efd3..0000000000000000000000000000000000000000 --- a/Source/Plugins/StairSectorBuilder/Properties/Resources.Designer.cs +++ /dev/null @@ -1,77 +0,0 @@ -//------------------------------------------------------------------------------ -// <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)); - } - } - } -} diff --git a/Source/Plugins/StairSectorBuilder/Properties/Resources.resx b/Source/Plugins/StairSectorBuilder/Properties/Resources.resx deleted file mode 100644 index 409f85257b208c7c75598fdb5de40be9db43e22a..0000000000000000000000000000000000000000 --- a/Source/Plugins/StairSectorBuilder/Properties/Resources.resx +++ /dev/null @@ -1,127 +0,0 @@ -<?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> \ No newline at end of file diff --git a/Source/Plugins/StairSectorBuilder/Resources/Actions.cfg b/Source/Plugins/StairSectorBuilder/Resources/Actions.cfg deleted file mode 100644 index cf26f6e103d3dfb52eac1df349b949080cedbceb..0000000000000000000000000000000000000000 --- a/Source/Plugins/StairSectorBuilder/Resources/Actions.cfg +++ /dev/null @@ -1,42 +0,0 @@ - -// -// 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; -} \ No newline at end of file diff --git a/Source/Plugins/StairSectorBuilder/Resources/StairIcon.png b/Source/Plugins/StairSectorBuilder/Resources/StairIcon.png deleted file mode 100644 index 4db91e94cf70a63540ec1ca8f108c3781f69f6b1..0000000000000000000000000000000000000000 Binary files a/Source/Plugins/StairSectorBuilder/Resources/StairIcon.png and /dev/null differ diff --git a/Source/Plugins/StairSectorBuilder/StairSectorBuilder.csproj b/Source/Plugins/StairSectorBuilder/StairSectorBuilder.csproj deleted file mode 100644 index 7081f258b7d8e6cf15957d89401315d102871b4f..0000000000000000000000000000000000000000 --- a/Source/Plugins/StairSectorBuilder/StairSectorBuilder.csproj +++ /dev/null @@ -1,93 +0,0 @@ -<?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="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> - </EmbeddedResource> - <EmbeddedResource Include="StairSectorBuilderForm.resx"> - <DependentUpon>StairSectorBuilderForm.cs</DependentUpon> - </EmbeddedResource> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="Resources\Actions.cfg" /> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="Resources\StairIcon.png" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\..\Core\Builder.csproj"> - <Project>{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}</Project> - <Name>Builder</Name> - <Private>False</Private> - </ProjectReference> - </ItemGroup> - <ItemGroup> - <None Include="ClassDiagram1.cd" /> - </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> \ No newline at end of file diff --git a/Source/Plugins/StairSectorBuilder/StairSectorBuilder.csproj.user b/Source/Plugins/StairSectorBuilder/StairSectorBuilder.csproj.user deleted file mode 100644 index 7ff3943f7c3512e74da0f9b966cd1dfb5c4e0cef..0000000000000000000000000000000000000000 --- a/Source/Plugins/StairSectorBuilder/StairSectorBuilder.csproj.user +++ /dev/null @@ -1 +0,0 @@ -<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" /> \ No newline at end of file diff --git a/Source/Plugins/StairSectorBuilder/StairSectorBuilderForm.cs b/Source/Plugins/StairSectorBuilder/StairSectorBuilderForm.cs deleted file mode 100644 index 6f2bca33eb8067546b0c0236500d11c92226341e..0000000000000000000000000000000000000000 --- a/Source/Plugins/StairSectorBuilder/StairSectorBuilderForm.cs +++ /dev/null @@ -1,892 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; -using CodeImp.DoomBuilder.Controls; -using CodeImp.DoomBuilder.Editing; -using CodeImp.DoomBuilder.Map; -using CodeImp.DoomBuilder.Data; -using CodeImp.DoomBuilder.IO; -using CodeImp.DoomBuilder.Windows; - - -namespace CodeImp.DoomBuilder.StairSectorBuilderMode -{ - public partial class StairSectorBuilderForm : DelayedForm - { - private bool fullyloaded = false; - private bool loadingprefab = false; - 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.ToString(); - 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 == true) - { - 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 = (int)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 == true) - { - 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(); - } - } -} diff --git a/Source/Plugins/StairSectorBuilder/StairSectorBuilderForm.designer.cs b/Source/Plugins/StairSectorBuilder/StairSectorBuilderForm.designer.cs deleted file mode 100644 index 9a24f16aa47e6eeafe6b70805579ee7edd60337b..0000000000000000000000000000000000000000 --- a/Source/Plugins/StairSectorBuilder/StairSectorBuilderForm.designer.cs +++ /dev/null @@ -1,1151 +0,0 @@ -namespace CodeImp.DoomBuilder.StairSectorBuilderMode -{ - partial class StairSectorBuilderForm - { - /// <summary> - /// Erforderliche Designervariable. - /// </summary> - private System.ComponentModel.IContainer components = null; - - /// <summary> - /// Verwendete Ressourcen bereinigen. - /// </summary> - /// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param> - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Vom Windows Form-Designer generierter Code - - /// <summary> - /// Erforderliche Methode für die Designerunterstützung. - /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. - /// </summary> - private void InitializeComponent() - { - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.numberofsectors = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.label4 = new System.Windows.Forms.Label(); - this.tabcontrol = new System.Windows.Forms.TabControl(); - this.tabPage1 = new System.Windows.Forms.TabPage(); - this.distinctbaseheights = new System.Windows.Forms.CheckBox(); - this.spacing = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.label11 = new System.Windows.Forms.Label(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.singledirection = new System.Windows.Forms.CheckBox(); - this.singlesectors = new System.Windows.Forms.CheckBox(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.sideback = new System.Windows.Forms.RadioButton(); - this.sidefront = new System.Windows.Forms.RadioButton(); - this.sectordepth = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.label1 = new System.Windows.Forms.Label(); - this.tabPage2 = new System.Windows.Forms.TabPage(); - this.autocurveflipping = new System.Windows.Forms.ComboBox(); - this.label12 = new System.Windows.Forms.Label(); - this.autocurveoutervertexmultiplier = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.autocurveinnervertexmultiplier = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.label6 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.tabPage3 = new System.Windows.Forms.TabPage(); - this.splineflipping = new System.Windows.Forms.ComboBox(); - this.label13 = new System.Windows.Forms.Label(); - this.splineoutervertexmultiplier = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.splineinnervertexmultiplier = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.label16 = new System.Windows.Forms.Label(); - this.label17 = new System.Windows.Forms.Label(); - this.numberofcontrolpoints = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.label10 = new System.Windows.Forms.Label(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.floorflattexture = new CodeImp.DoomBuilder.Controls.FlatSelectorControl(); - this.floorflat = new System.Windows.Forms.CheckBox(); - this.ceilingflat = new System.Windows.Forms.CheckBox(); - this.groupBox5 = new System.Windows.Forms.GroupBox(); - this.ceilingflattexture = new CodeImp.DoomBuilder.Controls.FlatSelectorControl(); - this.groupBox6 = new System.Windows.Forms.GroupBox(); - this.label14 = new System.Windows.Forms.Label(); - this.floorbase = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.floorheightmodification = new System.Windows.Forms.CheckBox(); - this.floorlast = new System.Windows.Forms.Label(); - this.floorfirst = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.floorheightmod = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.label = new System.Windows.Forms.Label(); - this.groupBox7 = new System.Windows.Forms.GroupBox(); - this.lowerunpegged = new System.Windows.Forms.CheckBox(); - this.lowertexturetexture = new CodeImp.DoomBuilder.Controls.TextureSelectorControl(); - this.lowertexture = new System.Windows.Forms.CheckBox(); - this.groupBox8 = new System.Windows.Forms.GroupBox(); - this.upperunpegged = new System.Windows.Forms.CheckBox(); - this.uppertexturetexture = new CodeImp.DoomBuilder.Controls.TextureSelectorControl(); - this.uppertexture = new System.Windows.Forms.CheckBox(); - this.ceilinglast = new System.Windows.Forms.Label(); - this.ceilingfirst = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); - this.ceilingheightmod = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.label2 = new System.Windows.Forms.Label(); - this.groupBox9 = new System.Windows.Forms.GroupBox(); - this.label15 = new System.Windows.Forms.Label(); - this.ceilingbase = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.ceilingheightmodification = new System.Windows.Forms.CheckBox(); - this.groupBox11 = new System.Windows.Forms.GroupBox(); - this.prefabload = new System.Windows.Forms.Button(); - this.prefabdelete = new System.Windows.Forms.Button(); - this.prefabsave = new System.Windows.Forms.Button(); - this.prefabname = new System.Windows.Forms.TextBox(); - this.prefabs = new System.Windows.Forms.ListView(); - this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); - this.columnHeader2 = new System.Windows.Forms.ColumnHeader(); - this.groupBox10 = new System.Windows.Forms.GroupBox(); - this.middletexturetexture = new CodeImp.DoomBuilder.Controls.TextureSelectorControl(); - this.middletexture = new System.Windows.Forms.CheckBox(); - this.groupBox1.SuspendLayout(); - this.tabcontrol.SuspendLayout(); - this.tabPage1.SuspendLayout(); - this.groupBox3.SuspendLayout(); - this.groupBox2.SuspendLayout(); - this.tabPage2.SuspendLayout(); - this.tabPage3.SuspendLayout(); - this.groupBox4.SuspendLayout(); - this.groupBox5.SuspendLayout(); - this.groupBox6.SuspendLayout(); - this.groupBox7.SuspendLayout(); - this.groupBox8.SuspendLayout(); - this.groupBox9.SuspendLayout(); - this.groupBox11.SuspendLayout(); - this.groupBox10.SuspendLayout(); - this.SuspendLayout(); - // - // btnOK - // - this.btnOK.Location = new System.Drawing.Point(333, 532); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(112, 27); - this.btnOK.TabIndex = 4; - this.btnOK.Text = "OK"; - this.btnOK.UseVisualStyleBackColor = true; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(448, 532); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(112, 27); - this.btnCancel.TabIndex = 5; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.numberofsectors); - this.groupBox1.Controls.Add(this.label4); - this.groupBox1.Location = new System.Drawing.Point(12, 9); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(220, 50); - this.groupBox1.TabIndex = 9; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "General"; - // - // numberofsectors - // - this.numberofsectors.AllowDecimal = false; - this.numberofsectors.AllowNegative = false; - this.numberofsectors.AllowRelative = false; - this.numberofsectors.ButtonStep = 1; - this.numberofsectors.Location = new System.Drawing.Point(112, 17); - this.numberofsectors.Name = "numberofsectors"; - this.numberofsectors.Size = new System.Drawing.Size(56, 24); - this.numberofsectors.StepValues = null; - this.numberofsectors.TabIndex = 1; - this.numberofsectors.WhenTextChanged += new System.EventHandler(this.numberofsectors_WhenTextChanged); - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(9, 22); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(97, 14); - this.label4.TabIndex = 0; - this.label4.Text = "Number of sectors"; - // - // tabcontrol - // - this.tabcontrol.Controls.Add(this.tabPage1); - this.tabcontrol.Controls.Add(this.tabPage2); - this.tabcontrol.Controls.Add(this.tabPage3); - this.tabcontrol.Location = new System.Drawing.Point(12, 65); - this.tabcontrol.Name = "tabcontrol"; - this.tabcontrol.SelectedIndex = 0; - this.tabcontrol.Size = new System.Drawing.Size(220, 271); - this.tabcontrol.TabIndex = 10; - this.tabcontrol.SelectedIndexChanged += new System.EventHandler(this.tabcontrol_SelectedIndexChanged); - // - // tabPage1 - // - this.tabPage1.Controls.Add(this.distinctbaseheights); - this.tabPage1.Controls.Add(this.spacing); - this.tabPage1.Controls.Add(this.label11); - this.tabPage1.Controls.Add(this.groupBox3); - this.tabPage1.Controls.Add(this.groupBox2); - this.tabPage1.Controls.Add(this.sectordepth); - this.tabPage1.Controls.Add(this.label1); - this.tabPage1.Location = new System.Drawing.Point(4, 23); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(212, 244); - this.tabPage1.TabIndex = 0; - this.tabPage1.Text = "Straight"; - this.tabPage1.UseVisualStyleBackColor = true; - // - // distinctbaseheights - // - this.distinctbaseheights.AutoSize = true; - this.distinctbaseheights.Location = new System.Drawing.Point(10, 70); - this.distinctbaseheights.Name = "distinctbaseheights"; - this.distinctbaseheights.Size = new System.Drawing.Size(126, 18); - this.distinctbaseheights.TabIndex = 6; - this.distinctbaseheights.Text = "Distinct base heights"; - this.distinctbaseheights.UseVisualStyleBackColor = true; - this.distinctbaseheights.CheckedChanged += new System.EventHandler(this.distinctbaseheights_CheckedChanged); - // - // spacing - // - this.spacing.AllowDecimal = false; - this.spacing.AllowNegative = false; - this.spacing.AllowRelative = false; - this.spacing.ButtonStep = 8; - this.spacing.Location = new System.Drawing.Point(81, 33); - this.spacing.Name = "spacing"; - this.spacing.Size = new System.Drawing.Size(56, 24); - this.spacing.StepValues = null; - this.spacing.TabIndex = 5; - this.spacing.WhenTextChanged += new System.EventHandler(this.spacing_WhenTextChanged); - // - // label11 - // - this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(7, 37); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(46, 14); - this.label11.TabIndex = 4; - this.label11.Text = "Spacing"; - // - // groupBox3 - // - this.groupBox3.Controls.Add(this.singledirection); - this.groupBox3.Controls.Add(this.singlesectors); - this.groupBox3.Location = new System.Drawing.Point(82, 94); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(124, 79); - this.groupBox3.TabIndex = 3; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "Appearance"; - // - // singledirection - // - this.singledirection.AutoSize = true; - this.singledirection.Enabled = false; - this.singledirection.Location = new System.Drawing.Point(7, 46); - this.singledirection.Name = "singledirection"; - this.singledirection.Size = new System.Drawing.Size(99, 18); - this.singledirection.TabIndex = 1; - this.singledirection.Text = "Single direction"; - this.singledirection.UseVisualStyleBackColor = true; - this.singledirection.CheckedChanged += new System.EventHandler(this.singledirection_CheckedChanged); - // - // singlesectors - // - this.singlesectors.AutoSize = true; - this.singlesectors.Enabled = false; - this.singlesectors.Location = new System.Drawing.Point(7, 22); - this.singlesectors.Name = "singlesectors"; - this.singlesectors.Size = new System.Drawing.Size(95, 18); - this.singlesectors.TabIndex = 0; - this.singlesectors.Text = "Single sectors"; - this.singlesectors.UseVisualStyleBackColor = true; - this.singlesectors.CheckedChanged += new System.EventHandler(this.singlesectors_CheckedChanged); - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.sideback); - this.groupBox2.Controls.Add(this.sidefront); - this.groupBox2.Location = new System.Drawing.Point(11, 94); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(65, 79); - this.groupBox2.TabIndex = 2; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Side"; - // - // sideback - // - this.sideback.AutoSize = true; - this.sideback.Location = new System.Drawing.Point(7, 46); - this.sideback.Name = "sideback"; - this.sideback.Size = new System.Drawing.Size(49, 18); - this.sideback.TabIndex = 1; - this.sideback.TabStop = true; - this.sideback.Text = "Back"; - this.sideback.UseVisualStyleBackColor = true; - this.sideback.CheckedChanged += new System.EventHandler(this.sideback_CheckedChanged); - // - // sidefront - // - this.sidefront.AutoSize = true; - this.sidefront.Checked = true; - this.sidefront.Location = new System.Drawing.Point(7, 22); - this.sidefront.Name = "sidefront"; - this.sidefront.Size = new System.Drawing.Size(50, 18); - this.sidefront.TabIndex = 0; - this.sidefront.TabStop = true; - this.sidefront.Text = "Front"; - this.sidefront.UseVisualStyleBackColor = true; - this.sidefront.CheckedChanged += new System.EventHandler(this.sidefront_CheckedChanged); - // - // sectordepth - // - this.sectordepth.AllowDecimal = false; - this.sectordepth.AllowNegative = false; - this.sectordepth.AllowRelative = false; - this.sectordepth.ButtonStep = 8; - this.sectordepth.Location = new System.Drawing.Point(81, 3); - this.sectordepth.Name = "sectordepth"; - this.sectordepth.Size = new System.Drawing.Size(56, 24); - this.sectordepth.StepValues = null; - this.sectordepth.TabIndex = 1; - this.sectordepth.WhenTextChanged += new System.EventHandler(this.sectordepth_WhenTextChanged); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(7, 8); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(69, 14); - this.label1.TabIndex = 0; - this.label1.Text = "Sector depth"; - // - // tabPage2 - // - this.tabPage2.Controls.Add(this.autocurveflipping); - this.tabPage2.Controls.Add(this.label12); - this.tabPage2.Controls.Add(this.autocurveoutervertexmultiplier); - this.tabPage2.Controls.Add(this.autocurveinnervertexmultiplier); - this.tabPage2.Controls.Add(this.label6); - this.tabPage2.Controls.Add(this.label5); - this.tabPage2.Location = new System.Drawing.Point(4, 23); - this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(212, 244); - this.tabPage2.TabIndex = 1; - this.tabPage2.Text = "Auto curve"; - this.tabPage2.UseVisualStyleBackColor = true; - // - // autocurveflipping - // - this.autocurveflipping.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.autocurveflipping.FormattingEnabled = true; - this.autocurveflipping.Items.AddRange(new object[] { - "None", - "Source direction", - "Destination direction"}); - this.autocurveflipping.Location = new System.Drawing.Point(55, 9); - this.autocurveflipping.Name = "autocurveflipping"; - this.autocurveflipping.Size = new System.Drawing.Size(151, 22); - this.autocurveflipping.TabIndex = 11; - this.autocurveflipping.SelectedIndexChanged += new System.EventHandler(this.autocurveflipping_SelectedIndexChanged); - // - // label12 - // - this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(6, 12); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(43, 14); - this.label12.TabIndex = 10; - this.label12.Text = "Flipping"; - // - // autocurveoutervertexmultiplier - // - this.autocurveoutervertexmultiplier.AllowDecimal = false; - this.autocurveoutervertexmultiplier.AllowNegative = false; - this.autocurveoutervertexmultiplier.AllowRelative = false; - this.autocurveoutervertexmultiplier.ButtonStep = 1; - this.autocurveoutervertexmultiplier.Location = new System.Drawing.Point(128, 72); - this.autocurveoutervertexmultiplier.Name = "autocurveoutervertexmultiplier"; - this.autocurveoutervertexmultiplier.Size = new System.Drawing.Size(56, 24); - this.autocurveoutervertexmultiplier.StepValues = null; - this.autocurveoutervertexmultiplier.TabIndex = 9; - this.autocurveoutervertexmultiplier.WhenTextChanged += new System.EventHandler(this.autocurveoutervertexmultiplier_WhenTextChanged); - // - // autocurveinnervertexmultiplier - // - this.autocurveinnervertexmultiplier.AllowDecimal = false; - this.autocurveinnervertexmultiplier.AllowNegative = false; - this.autocurveinnervertexmultiplier.AllowRelative = false; - this.autocurveinnervertexmultiplier.ButtonStep = 1; - this.autocurveinnervertexmultiplier.Location = new System.Drawing.Point(128, 45); - this.autocurveinnervertexmultiplier.Name = "autocurveinnervertexmultiplier"; - this.autocurveinnervertexmultiplier.Size = new System.Drawing.Size(56, 24); - this.autocurveinnervertexmultiplier.StepValues = null; - this.autocurveinnervertexmultiplier.TabIndex = 8; - this.autocurveinnervertexmultiplier.WhenTextChanged += new System.EventHandler(this.autocurveinnervertexmultiplier_WhenTextChanged); - // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(6, 77); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(112, 14); - this.label6.TabIndex = 7; - this.label6.Text = "Outer vertex multiplier"; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(6, 50); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(109, 14); - this.label5.TabIndex = 6; - this.label5.Text = "Inner vertex multiplier"; - // - // tabPage3 - // - this.tabPage3.Controls.Add(this.splineflipping); - this.tabPage3.Controls.Add(this.label13); - this.tabPage3.Controls.Add(this.splineoutervertexmultiplier); - this.tabPage3.Controls.Add(this.splineinnervertexmultiplier); - this.tabPage3.Controls.Add(this.label16); - this.tabPage3.Controls.Add(this.label17); - this.tabPage3.Controls.Add(this.numberofcontrolpoints); - this.tabPage3.Controls.Add(this.label10); - this.tabPage3.Location = new System.Drawing.Point(4, 23); - this.tabPage3.Name = "tabPage3"; - this.tabPage3.Padding = new System.Windows.Forms.Padding(3); - this.tabPage3.Size = new System.Drawing.Size(212, 244); - this.tabPage3.TabIndex = 2; - this.tabPage3.Text = "Catmull Rom"; - this.tabPage3.UseVisualStyleBackColor = true; - // - // splineflipping - // - this.splineflipping.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.splineflipping.FormattingEnabled = true; - this.splineflipping.Items.AddRange(new object[] { - "None", - "Source direction", - "Destination direction"}); - this.splineflipping.Location = new System.Drawing.Point(55, 9); - this.splineflipping.Name = "splineflipping"; - this.splineflipping.Size = new System.Drawing.Size(151, 22); - this.splineflipping.TabIndex = 13; - this.splineflipping.SelectedIndexChanged += new System.EventHandler(this.splineflipping_SelectedIndexChanged); - // - // label13 - // - this.label13.AutoSize = true; - this.label13.Location = new System.Drawing.Point(6, 12); - this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(43, 14); - this.label13.TabIndex = 12; - this.label13.Text = "Flipping"; - // - // splineoutervertexmultiplier - // - this.splineoutervertexmultiplier.AllowDecimal = false; - this.splineoutervertexmultiplier.AllowNegative = false; - this.splineoutervertexmultiplier.AllowRelative = false; - this.splineoutervertexmultiplier.ButtonStep = 1; - this.splineoutervertexmultiplier.Location = new System.Drawing.Point(128, 72); - this.splineoutervertexmultiplier.Name = "splineoutervertexmultiplier"; - this.splineoutervertexmultiplier.Size = new System.Drawing.Size(56, 24); - this.splineoutervertexmultiplier.StepValues = null; - this.splineoutervertexmultiplier.TabIndex = 9; - this.splineoutervertexmultiplier.WhenTextChanged += new System.EventHandler(this.splineoutervertexmultiplier_WhenTextChanged); - // - // splineinnervertexmultiplier - // - this.splineinnervertexmultiplier.AllowDecimal = false; - this.splineinnervertexmultiplier.AllowNegative = false; - this.splineinnervertexmultiplier.AllowRelative = false; - this.splineinnervertexmultiplier.ButtonStep = 1; - this.splineinnervertexmultiplier.Location = new System.Drawing.Point(128, 45); - this.splineinnervertexmultiplier.Name = "splineinnervertexmultiplier"; - this.splineinnervertexmultiplier.Size = new System.Drawing.Size(56, 24); - this.splineinnervertexmultiplier.StepValues = null; - this.splineinnervertexmultiplier.TabIndex = 8; - this.splineinnervertexmultiplier.WhenTextChanged += new System.EventHandler(this.splineinnervertexmultiplier_WhenTextChanged); - // - // label16 - // - this.label16.AutoSize = true; - this.label16.Location = new System.Drawing.Point(6, 77); - this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(112, 14); - this.label16.TabIndex = 7; - this.label16.Text = "Outer vertex multiplier"; - // - // label17 - // - this.label17.AutoSize = true; - this.label17.Location = new System.Drawing.Point(6, 50); - this.label17.Name = "label17"; - this.label17.Size = new System.Drawing.Size(109, 14); - this.label17.TabIndex = 6; - this.label17.Text = "Inner vertex multiplier"; - // - // numberofcontrolpoints - // - this.numberofcontrolpoints.AllowDecimal = false; - this.numberofcontrolpoints.AllowNegative = false; - this.numberofcontrolpoints.AllowRelative = false; - this.numberofcontrolpoints.ButtonStep = 1; - this.numberofcontrolpoints.Location = new System.Drawing.Point(128, 99); - this.numberofcontrolpoints.Name = "numberofcontrolpoints"; - this.numberofcontrolpoints.Size = new System.Drawing.Size(56, 24); - this.numberofcontrolpoints.StepValues = null; - this.numberofcontrolpoints.TabIndex = 3; - this.numberofcontrolpoints.WhenTextChanged += new System.EventHandler(this.numberofcontrolpoints_WhenTextChanged); - // - // label10 - // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(6, 104); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(73, 14); - this.label10.TabIndex = 2; - this.label10.Text = "Control points"; - // - // groupBox4 - // - this.groupBox4.Controls.Add(this.floorflattexture); - this.groupBox4.Controls.Add(this.floorflat); - this.groupBox4.Location = new System.Drawing.Point(12, 343); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(105, 183); - this.groupBox4.TabIndex = 11; - this.groupBox4.TabStop = false; - // - // floorflattexture - // - this.floorflattexture.Enabled = false; - this.floorflattexture.Location = new System.Drawing.Point(8, 23); - this.floorflattexture.Name = "floorflattexture"; - this.floorflattexture.Size = new System.Drawing.Size(90, 127); - this.floorflattexture.TabIndex = 1; - this.floorflattexture.TextureName = ""; - // - // floorflat - // - this.floorflat.AutoSize = true; - this.floorflat.Location = new System.Drawing.Point(9, -1); - this.floorflat.Name = "floorflat"; - this.floorflat.Size = new System.Drawing.Size(68, 18); - this.floorflat.TabIndex = 0; - this.floorflat.Text = "Floor flat"; - this.floorflat.UseVisualStyleBackColor = true; - this.floorflat.CheckedChanged += new System.EventHandler(this.floorflat_CheckedChanged); - // - // ceilingflat - // - this.ceilingflat.AutoSize = true; - this.ceilingflat.Location = new System.Drawing.Point(9, -1); - this.ceilingflat.Name = "ceilingflat"; - this.ceilingflat.Size = new System.Drawing.Size(75, 18); - this.ceilingflat.TabIndex = 0; - this.ceilingflat.Text = "Ceiling flat"; - this.ceilingflat.UseVisualStyleBackColor = true; - this.ceilingflat.CheckedChanged += new System.EventHandler(this.ceilingflat_CheckedChanged); - // - // groupBox5 - // - this.groupBox5.Controls.Add(this.ceilingflattexture); - this.groupBox5.Controls.Add(this.ceilingflat); - this.groupBox5.Location = new System.Drawing.Point(123, 343); - this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(105, 183); - this.groupBox5.TabIndex = 12; - this.groupBox5.TabStop = false; - // - // ceilingflattexture - // - this.ceilingflattexture.Enabled = false; - this.ceilingflattexture.Location = new System.Drawing.Point(8, 23); - this.ceilingflattexture.Name = "ceilingflattexture"; - this.ceilingflattexture.Size = new System.Drawing.Size(90, 127); - this.ceilingflattexture.TabIndex = 2; - this.ceilingflattexture.TextureName = ""; - // - // groupBox6 - // - this.groupBox6.Controls.Add(this.label14); - this.groupBox6.Controls.Add(this.floorbase); - this.groupBox6.Controls.Add(this.floorheightmodification); - this.groupBox6.Controls.Add(this.floorlast); - this.groupBox6.Controls.Add(this.floorfirst); - this.groupBox6.Controls.Add(this.label7); - this.groupBox6.Controls.Add(this.label3); - this.groupBox6.Controls.Add(this.floorheightmod); - this.groupBox6.Controls.Add(this.label); - this.groupBox6.Location = new System.Drawing.Point(238, 203); - this.groupBox6.Name = "groupBox6"; - this.groupBox6.Size = new System.Drawing.Size(110, 134); - this.groupBox6.TabIndex = 13; - this.groupBox6.TabStop = false; - this.groupBox6.Text = "c"; - // - // label14 - // - this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(4, 53); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(32, 14); - this.label14.TabIndex = 17; - this.label14.Text = "Base"; - // - // floorbase - // - this.floorbase.AllowDecimal = false; - this.floorbase.AllowNegative = true; - this.floorbase.AllowRelative = false; - this.floorbase.ButtonStep = 8; - this.floorbase.Location = new System.Drawing.Point(45, 48); - this.floorbase.Name = "floorbase"; - this.floorbase.Size = new System.Drawing.Size(56, 24); - this.floorbase.StepValues = null; - this.floorbase.TabIndex = 16; - this.floorbase.WhenTextChanged += new System.EventHandler(this.floorbase_WhenTextChanged); - // - // floorheightmodification - // - this.floorheightmodification.AutoSize = true; - this.floorheightmodification.Checked = true; - this.floorheightmodification.CheckState = System.Windows.Forms.CheckState.Checked; - this.floorheightmodification.Location = new System.Drawing.Point(9, -1); - this.floorheightmodification.Name = "floorheightmodification"; - this.floorheightmodification.Size = new System.Drawing.Size(82, 18); - this.floorheightmodification.TabIndex = 14; - this.floorheightmodification.Text = "Floor height"; - this.floorheightmodification.UseVisualStyleBackColor = true; - this.floorheightmodification.CheckedChanged += new System.EventHandler(this.floorheightmodification_CheckedChanged); - // - // floorlast - // - this.floorlast.AutoSize = true; - this.floorlast.Location = new System.Drawing.Point(41, 108); - this.floorlast.Name = "floorlast"; - this.floorlast.Size = new System.Drawing.Size(46, 14); - this.floorlast.TabIndex = 11; - this.floorlast.Text = "floorlast"; - // - // floorfirst - // - this.floorfirst.AutoSize = true; - this.floorfirst.Location = new System.Drawing.Point(41, 81); - this.floorfirst.Name = "floorfirst"; - this.floorfirst.Size = new System.Drawing.Size(48, 14); - this.floorfirst.TabIndex = 10; - this.floorfirst.Text = "floorfirst"; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(4, 108); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(31, 14); - this.label7.TabIndex = 7; - this.label7.Text = "Last:"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(4, 81); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(31, 14); - this.label3.TabIndex = 6; - this.label3.Text = "First:"; - // - // floorheightmod - // - this.floorheightmod.AllowDecimal = false; - this.floorheightmod.AllowNegative = true; - this.floorheightmod.AllowRelative = false; - this.floorheightmod.ButtonStep = 8; - this.floorheightmod.Location = new System.Drawing.Point(45, 22); - this.floorheightmod.Name = "floorheightmod"; - this.floorheightmod.Size = new System.Drawing.Size(56, 24); - this.floorheightmod.StepValues = null; - this.floorheightmod.TabIndex = 3; - this.floorheightmod.WhenTextChanged += new System.EventHandler(this.floorheightmod_WhenTextChanged); - // - // label - // - this.label.AutoSize = true; - this.label.Location = new System.Drawing.Point(4, 27); - this.label.Name = "label"; - this.label.Size = new System.Drawing.Size(39, 14); - this.label.TabIndex = 2; - this.label.Text = "Modify"; - // - // groupBox7 - // - this.groupBox7.Controls.Add(this.lowerunpegged); - this.groupBox7.Controls.Add(this.lowertexturetexture); - this.groupBox7.Controls.Add(this.lowertexture); - this.groupBox7.Location = new System.Drawing.Point(456, 342); - this.groupBox7.Name = "groupBox7"; - this.groupBox7.Size = new System.Drawing.Size(105, 183); - this.groupBox7.TabIndex = 14; - this.groupBox7.TabStop = false; - // - // lowerunpegged - // - this.lowerunpegged.AutoSize = true; - this.lowerunpegged.Checked = true; - this.lowerunpegged.CheckState = System.Windows.Forms.CheckState.Checked; - this.lowerunpegged.Location = new System.Drawing.Point(9, 156); - this.lowerunpegged.Name = "lowerunpegged"; - this.lowerunpegged.Size = new System.Drawing.Size(75, 18); - this.lowerunpegged.TabIndex = 3; - this.lowerunpegged.Text = "Unpegged"; - this.lowerunpegged.UseVisualStyleBackColor = true; - // - // lowertexturetexture - // - this.lowertexturetexture.Location = new System.Drawing.Point(8, 23); - this.lowertexturetexture.Name = "lowertexturetexture"; - this.lowertexturetexture.Required = false; - this.lowertexturetexture.Size = new System.Drawing.Size(90, 127); - this.lowertexturetexture.TabIndex = 2; - this.lowertexturetexture.TextureName = ""; - // - // lowertexture - // - this.lowertexture.AutoSize = true; - this.lowertexture.Checked = true; - this.lowertexture.CheckState = System.Windows.Forms.CheckState.Checked; - this.lowertexture.Location = new System.Drawing.Point(9, -1); - this.lowertexture.Name = "lowertexture"; - this.lowertexture.Size = new System.Drawing.Size(95, 18); - this.lowertexture.TabIndex = 0; - this.lowertexture.Text = "Lower texture"; - this.lowertexture.UseVisualStyleBackColor = true; - this.lowertexture.CheckedChanged += new System.EventHandler(this.lowertexture_CheckedChanged); - // - // groupBox8 - // - this.groupBox8.Controls.Add(this.upperunpegged); - this.groupBox8.Controls.Add(this.uppertexturetexture); - this.groupBox8.Controls.Add(this.uppertexture); - this.groupBox8.Location = new System.Drawing.Point(234, 343); - this.groupBox8.Name = "groupBox8"; - this.groupBox8.Size = new System.Drawing.Size(105, 183); - this.groupBox8.TabIndex = 13; - this.groupBox8.TabStop = false; - // - // upperunpegged - // - this.upperunpegged.AutoSize = true; - this.upperunpegged.Checked = true; - this.upperunpegged.CheckState = System.Windows.Forms.CheckState.Checked; - this.upperunpegged.Location = new System.Drawing.Point(9, 156); - this.upperunpegged.Name = "upperunpegged"; - this.upperunpegged.Size = new System.Drawing.Size(75, 18); - this.upperunpegged.TabIndex = 4; - this.upperunpegged.Text = "Unpegged"; - this.upperunpegged.UseVisualStyleBackColor = true; - // - // uppertexturetexture - // - this.uppertexturetexture.Location = new System.Drawing.Point(8, 23); - this.uppertexturetexture.Name = "uppertexturetexture"; - this.uppertexturetexture.Required = false; - this.uppertexturetexture.Size = new System.Drawing.Size(90, 127); - this.uppertexturetexture.TabIndex = 1; - this.uppertexturetexture.TextureName = ""; - // - // uppertexture - // - this.uppertexture.AutoSize = true; - this.uppertexture.Checked = true; - this.uppertexture.CheckState = System.Windows.Forms.CheckState.Checked; - this.uppertexture.Location = new System.Drawing.Point(9, -1); - this.uppertexture.Name = "uppertexture"; - this.uppertexture.Size = new System.Drawing.Size(92, 18); - this.uppertexture.TabIndex = 0; - this.uppertexture.Text = "Upper texture"; - this.uppertexture.UseVisualStyleBackColor = true; - this.uppertexture.CheckedChanged += new System.EventHandler(this.uppertexture_CheckedChanged); - // - // ceilinglast - // - this.ceilinglast.AutoSize = true; - this.ceilinglast.Location = new System.Drawing.Point(41, 108); - this.ceilinglast.Name = "ceilinglast"; - this.ceilinglast.Size = new System.Drawing.Size(54, 14); - this.ceilinglast.TabIndex = 24; - this.ceilinglast.Text = "ceilinglast"; - // - // ceilingfirst - // - this.ceilingfirst.AutoSize = true; - this.ceilingfirst.Location = new System.Drawing.Point(41, 81); - this.ceilingfirst.Name = "ceilingfirst"; - this.ceilingfirst.Size = new System.Drawing.Size(56, 14); - this.ceilingfirst.TabIndex = 23; - this.ceilingfirst.Text = "ceilingfirst"; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(4, 108); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(31, 14); - this.label8.TabIndex = 22; - this.label8.Text = "Last:"; - // - // label9 - // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(4, 81); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(31, 14); - this.label9.TabIndex = 21; - this.label9.Text = "First:"; - // - // ceilingheightmod - // - this.ceilingheightmod.AllowDecimal = false; - this.ceilingheightmod.AllowNegative = true; - this.ceilingheightmod.AllowRelative = false; - this.ceilingheightmod.ButtonStep = 8; - this.ceilingheightmod.Location = new System.Drawing.Point(45, 22); - this.ceilingheightmod.Name = "ceilingheightmod"; - this.ceilingheightmod.Size = new System.Drawing.Size(56, 24); - this.ceilingheightmod.StepValues = null; - this.ceilingheightmod.TabIndex = 20; - this.ceilingheightmod.WhenTextChanged += new System.EventHandler(this.ceilingheightmod_WhenTextChanged); - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(4, 27); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(39, 14); - this.label2.TabIndex = 19; - this.label2.Text = "Modify"; - // - // groupBox9 - // - this.groupBox9.Controls.Add(this.label15); - this.groupBox9.Controls.Add(this.ceilingbase); - this.groupBox9.Controls.Add(this.ceilingheightmodification); - this.groupBox9.Controls.Add(this.ceilingheightmod); - this.groupBox9.Controls.Add(this.label2); - this.groupBox9.Controls.Add(this.ceilinglast); - this.groupBox9.Controls.Add(this.label9); - this.groupBox9.Controls.Add(this.ceilingfirst); - this.groupBox9.Controls.Add(this.label8); - this.groupBox9.Location = new System.Drawing.Point(354, 203); - this.groupBox9.Name = "groupBox9"; - this.groupBox9.Size = new System.Drawing.Size(110, 134); - this.groupBox9.TabIndex = 18; - this.groupBox9.TabStop = false; - this.groupBox9.Text = "c"; - // - // label15 - // - this.label15.AutoSize = true; - this.label15.Location = new System.Drawing.Point(4, 53); - this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(32, 14); - this.label15.TabIndex = 27; - this.label15.Text = "Base"; - // - // ceilingbase - // - this.ceilingbase.AllowDecimal = false; - this.ceilingbase.AllowNegative = true; - this.ceilingbase.AllowRelative = false; - this.ceilingbase.ButtonStep = 8; - this.ceilingbase.Location = new System.Drawing.Point(45, 48); - this.ceilingbase.Name = "ceilingbase"; - this.ceilingbase.Size = new System.Drawing.Size(56, 24); - this.ceilingbase.StepValues = null; - this.ceilingbase.TabIndex = 26; - this.ceilingbase.WhenTextChanged += new System.EventHandler(this.ceilingbase_WhenTextChanged); - // - // ceilingheightmodification - // - this.ceilingheightmodification.AutoSize = true; - this.ceilingheightmodification.Checked = true; - this.ceilingheightmodification.CheckState = System.Windows.Forms.CheckState.Checked; - this.ceilingheightmodification.Location = new System.Drawing.Point(9, -1); - this.ceilingheightmodification.Name = "ceilingheightmodification"; - this.ceilingheightmodification.Size = new System.Drawing.Size(89, 18); - this.ceilingheightmodification.TabIndex = 14; - this.ceilingheightmodification.Text = "Ceiling height"; - this.ceilingheightmodification.UseVisualStyleBackColor = true; - this.ceilingheightmodification.CheckedChanged += new System.EventHandler(this.ceilingheightmodification_CheckedChanged); - // - // groupBox11 - // - this.groupBox11.Controls.Add(this.prefabload); - this.groupBox11.Controls.Add(this.prefabdelete); - this.groupBox11.Controls.Add(this.prefabsave); - this.groupBox11.Controls.Add(this.prefabname); - this.groupBox11.Controls.Add(this.prefabs); - this.groupBox11.Location = new System.Drawing.Point(238, 9); - this.groupBox11.Name = "groupBox11"; - this.groupBox11.Size = new System.Drawing.Size(323, 187); - this.groupBox11.TabIndex = 24; - this.groupBox11.TabStop = false; - this.groupBox11.Text = "Prefabs"; - // - // prefabload - // - this.prefabload.Location = new System.Drawing.Point(80, 156); - this.prefabload.Name = "prefabload"; - this.prefabload.Size = new System.Drawing.Size(65, 23); - this.prefabload.TabIndex = 28; - this.prefabload.Text = "Load"; - this.prefabload.UseVisualStyleBackColor = true; - this.prefabload.Click += new System.EventHandler(this.prefabload_Click); - // - // prefabdelete - // - this.prefabdelete.Location = new System.Drawing.Point(151, 156); - this.prefabdelete.Name = "prefabdelete"; - this.prefabdelete.Size = new System.Drawing.Size(65, 23); - this.prefabdelete.TabIndex = 27; - this.prefabdelete.Text = "Delete"; - this.prefabdelete.UseVisualStyleBackColor = true; - this.prefabdelete.Click += new System.EventHandler(this.prefabdelete_Click); - // - // prefabsave - // - this.prefabsave.Location = new System.Drawing.Point(9, 156); - this.prefabsave.Name = "prefabsave"; - this.prefabsave.Size = new System.Drawing.Size(65, 23); - this.prefabsave.TabIndex = 26; - this.prefabsave.Text = "Save"; - this.prefabsave.UseVisualStyleBackColor = true; - this.prefabsave.Click += new System.EventHandler(this.prefabsave_Click); - // - // prefabname - // - this.prefabname.Location = new System.Drawing.Point(10, 19); - this.prefabname.Name = "prefabname"; - this.prefabname.Size = new System.Drawing.Size(306, 20); - this.prefabname.TabIndex = 25; - // - // prefabs - // - this.prefabs.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader1, - this.columnHeader2}); - this.prefabs.FullRowSelect = true; - this.prefabs.Location = new System.Drawing.Point(9, 41); - this.prefabs.MultiSelect = false; - this.prefabs.Name = "prefabs"; - this.prefabs.Size = new System.Drawing.Size(307, 109); - this.prefabs.TabIndex = 24; - this.prefabs.UseCompatibleStateImageBehavior = false; - this.prefabs.View = System.Windows.Forms.View.Details; - // - // columnHeader1 - // - this.columnHeader1.Text = "Name"; - this.columnHeader1.Width = 200; - // - // columnHeader2 - // - this.columnHeader2.Text = "Type"; - this.columnHeader2.Width = 80; - // - // groupBox10 - // - this.groupBox10.Controls.Add(this.middletexturetexture); - this.groupBox10.Controls.Add(this.middletexture); - this.groupBox10.Location = new System.Drawing.Point(345, 343); - this.groupBox10.Name = "groupBox10"; - this.groupBox10.Size = new System.Drawing.Size(105, 183); - this.groupBox10.TabIndex = 25; - this.groupBox10.TabStop = false; - // - // middletexturetexture - // - this.middletexturetexture.Enabled = false; - this.middletexturetexture.Location = new System.Drawing.Point(8, 23); - this.middletexturetexture.Name = "middletexturetexture"; - this.middletexturetexture.Required = false; - this.middletexturetexture.Size = new System.Drawing.Size(90, 127); - this.middletexturetexture.TabIndex = 2; - this.middletexturetexture.TextureName = ""; - // - // middletexture - // - this.middletexture.AutoSize = true; - this.middletexture.Location = new System.Drawing.Point(9, -1); - this.middletexture.Name = "middletexture"; - this.middletexture.Size = new System.Drawing.Size(93, 18); - this.middletexture.TabIndex = 0; - this.middletexture.Text = "Middle texture"; - this.middletexture.UseVisualStyleBackColor = true; - this.middletexture.CheckedChanged += new System.EventHandler(this.middletexture_CheckedChanged); - // - // StairSectorBuilderForm - // - this.AcceptButton = this.btnOK; - this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(573, 570); - this.Controls.Add(this.groupBox10); - this.Controls.Add(this.groupBox11); - this.Controls.Add(this.groupBox9); - this.Controls.Add(this.groupBox7); - this.Controls.Add(this.groupBox8); - this.Controls.Add(this.groupBox6); - this.Controls.Add(this.groupBox5); - this.Controls.Add(this.groupBox4); - this.Controls.Add(this.tabcontrol); - this.Controls.Add(this.groupBox1); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOK); - this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "StairSectorBuilderForm"; - this.Opacity = 0; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Text = "Stair Sector Builder"; - this.Load += new System.EventHandler(this.StairSectorBuilderForm_Load); - this.Shown += new System.EventHandler(this.StairSectorBuilderForm_Shown); - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.StairSectorBuilderForm_FormClosing); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.tabcontrol.ResumeLayout(false); - this.tabPage1.ResumeLayout(false); - this.tabPage1.PerformLayout(); - this.groupBox3.ResumeLayout(false); - this.groupBox3.PerformLayout(); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); - this.tabPage2.ResumeLayout(false); - this.tabPage2.PerformLayout(); - this.tabPage3.ResumeLayout(false); - this.tabPage3.PerformLayout(); - this.groupBox4.ResumeLayout(false); - this.groupBox4.PerformLayout(); - this.groupBox5.ResumeLayout(false); - this.groupBox5.PerformLayout(); - this.groupBox6.ResumeLayout(false); - this.groupBox6.PerformLayout(); - this.groupBox7.ResumeLayout(false); - this.groupBox7.PerformLayout(); - this.groupBox8.ResumeLayout(false); - this.groupBox8.PerformLayout(); - this.groupBox9.ResumeLayout(false); - this.groupBox9.PerformLayout(); - this.groupBox11.ResumeLayout(false); - this.groupBox11.PerformLayout(); - this.groupBox10.ResumeLayout(false); - this.groupBox10.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.GroupBox groupBox1; - private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox numberofsectors; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TabControl tabcontrol; - private System.Windows.Forms.TabPage tabPage1; - private System.Windows.Forms.TabPage tabPage2; - private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox sectordepth; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.RadioButton sideback; - private System.Windows.Forms.RadioButton sidefront; - private System.Windows.Forms.GroupBox groupBox3; - private System.Windows.Forms.CheckBox singledirection; - private System.Windows.Forms.CheckBox singlesectors; - private System.Windows.Forms.GroupBox groupBox4; - private System.Windows.Forms.CheckBox floorflat; - private CodeImp.DoomBuilder.Controls.FlatSelectorControl floorflattexture; - private System.Windows.Forms.GroupBox groupBox5; - private System.Windows.Forms.CheckBox ceilingflat; - private System.Windows.Forms.TabPage tabPage3; - private System.Windows.Forms.GroupBox groupBox6; - private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox floorheightmod; - private System.Windows.Forms.Label label; - private CodeImp.DoomBuilder.Controls.FlatSelectorControl ceilingflattexture; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label floorlast; - private System.Windows.Forms.Label floorfirst; - private System.Windows.Forms.Label label7; - private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox numberofcontrolpoints; - private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox floorheightmodification; - private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox spacing; - private System.Windows.Forms.Label label11; - private System.Windows.Forms.GroupBox groupBox7; - private System.Windows.Forms.CheckBox lowertexture; - private System.Windows.Forms.GroupBox groupBox8; - private System.Windows.Forms.CheckBox uppertexture; - private CodeImp.DoomBuilder.Controls.TextureSelectorControl lowertexturetexture; - private CodeImp.DoomBuilder.Controls.TextureSelectorControl uppertexturetexture; - private System.Windows.Forms.Label ceilinglast; - private System.Windows.Forms.Label ceilingfirst; - private System.Windows.Forms.Label label8; - private System.Windows.Forms.Label label9; - private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox ceilingheightmod; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.GroupBox groupBox9; - private System.Windows.Forms.CheckBox ceilingheightmodification; - private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox floorbase; - private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox ceilingbase; - private System.Windows.Forms.GroupBox groupBox11; - private System.Windows.Forms.Button prefabload; - private System.Windows.Forms.Button prefabdelete; - private System.Windows.Forms.Button prefabsave; - private System.Windows.Forms.TextBox prefabname; - private System.Windows.Forms.ListView prefabs; - private System.Windows.Forms.ColumnHeader columnHeader1; - private System.Windows.Forms.ColumnHeader columnHeader2; - private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox autocurveoutervertexmultiplier; - private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox autocurveinnervertexmultiplier; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.Label label5; - private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox splineoutervertexmultiplier; - private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox splineinnervertexmultiplier; - private System.Windows.Forms.Label label16; - private System.Windows.Forms.Label label17; - private System.Windows.Forms.CheckBox distinctbaseheights; - private System.Windows.Forms.Label label12; - private System.Windows.Forms.ComboBox autocurveflipping; - private System.Windows.Forms.ComboBox splineflipping; - private System.Windows.Forms.Label label13; - private System.Windows.Forms.Label label14; - private System.Windows.Forms.Label label15; - private System.Windows.Forms.CheckBox lowerunpegged; - private System.Windows.Forms.CheckBox upperunpegged; - private System.Windows.Forms.GroupBox groupBox10; - private CodeImp.DoomBuilder.Controls.TextureSelectorControl middletexturetexture; - private System.Windows.Forms.CheckBox middletexture; - } -} \ No newline at end of file diff --git a/Source/Plugins/StairSectorBuilder/StairSectorBuilderForm.resx b/Source/Plugins/StairSectorBuilder/StairSectorBuilderForm.resx deleted file mode 100644 index ff31a6db56e23b5a334f34387830ba5b4bd33eb8..0000000000000000000000000000000000000000 --- a/Source/Plugins/StairSectorBuilder/StairSectorBuilderForm.resx +++ /dev/null @@ -1,120 +0,0 @@ -<?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> \ No newline at end of file diff --git a/Source/Plugins/StairSectorBuilder/StairSectorBuilderMode.cs b/Source/Plugins/StairSectorBuilder/StairSectorBuilderMode.cs deleted file mode 100644 index cc3ce80e6cdf4e67155b7c06121d7cfe5b0a0ef4..0000000000000000000000000000000000000000 --- a/Source/Plugins/StairSectorBuilder/StairSectorBuilderMode.cs +++ /dev/null @@ -1,1671 +0,0 @@ - -#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 System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Globalization; -using System.Text; -using System.Windows.Forms; -using System.IO; -using System.Reflection; -using System.Drawing; -using CodeImp.DoomBuilder.Windows; -using CodeImp.DoomBuilder.IO; -using CodeImp.DoomBuilder.Map; -using CodeImp.DoomBuilder.Rendering; -using CodeImp.DoomBuilder.Geometry; -using CodeImp.DoomBuilder.Editing; -using CodeImp.DoomBuilder.Data; -using CodeImp.DoomBuilder.Actions; -using CodeImp.DoomBuilder.Types; -using CodeImp.DoomBuilder.Config; -using CodeImp.DoomBuilder.Controls; - -#endregion - -namespace CodeImp.DoomBuilder.StairSectorBuilderMode -{ - //[EditMode(DisplayName = "Stair Sector Builder", - // Volatile = true)] - - [EditMode(DisplayName = "Stair Sector Builder Mode", - SwitchAction = "stairsectorbuildermode", // Action name used to switch to this mode - ButtonImage = "StairIcon.png", // Image resource name for the button - ButtonOrder = int.MinValue + 500, // Position of the button (lower is more to the left) - ButtonGroup = "000_editing", - UseByDefault = true, - SafeStartMode = false, - Volatile = true )] - - public sealed class StairSectorBuilderMode : ClassicMode - { - #region ================== Constants - - private const float LINE_THICKNESS = 0.6f; - private const float CONTROLPOINT_SIZE = 10.0f; - private const int INNER_SPLINE = 0; - private const int OUTER_SPLINE = 1; - - #endregion - - #region ================== Variables - - private StairSectorBuilderForm stairsectorbuilderform; - private List<StairInfo> stairsectors; - // private List<Vector2D> controlpoints; - // private List<Vector2D> tangents; - private List<CatmullRomSplineGroup> catmullromsplinegroups; - private int numcontrolpoints; - private ControlpointPointer selectedcontrolpoint; - private bool linesconnected; - private List<ConnectedLinedefs> connectedlinedefs; - private bool baseheightset = false; - private int oldflipping = -1; - private List<List<Vector2D>> exactsplines; - - #endregion - - #region ================== Structures - - private struct CatmullRomSplineData - { - public Line2D line; - public List<Vector2D> controlpoints; - public List<Vector2D> tangents; - } - - private struct CatmullRomSplineGroup - { - public CatmullRomSplineData[] splines; - public Linedef sourcelinedef; - } - - private struct ControlpointPointer - { - public int crsg; - public int crsd; - public int cp; - } - - private struct ConnectedLinedefs - { - public bool closed; - public int sector; - public List<Linedef> linedefs; - public Linedef firstlinedef; - } - - private struct StairInfo - { - public int floorheight; - public int ceilingheight; - public List<List<Vector2D>> sectors; - } - - - #endregion - - #region ================== Properties - - // Just keep the base mode button checked - public override string EditModeButtonName { get { return General.Editing.PreviousStableMode.Name; } } - - #endregion - - #region ================== Constructor / Disposer - - #endregion - - #region ================== Methods - - private void InitializeCatmullRomSplines() - { - List<Linedef> sourceld = new List<Linedef>(General.Map.Map.GetSelectedLinedefs(true)); - Line2D innerline, outerline; - CatmullRomSplineData innerspline, outerspline; - CatmullRomSplineGroup splinegroup; - - numcontrolpoints = stairsectorbuilderform.NumControlPoints; - - if (General.Map.Map.GetSelectedLinedefs(true).Count <= 0) - { - return; - } - - if (catmullromsplinegroups == null) - catmullromsplinegroups = new List<CatmullRomSplineGroup>(); - else - catmullromsplinegroups.Clear(); - - for (int l1 = 0; l1 < sourceld.Count - 1; l1++) - { - int l2 = l1 + 1; - Vector2D s1, s2, e1, e2; - - s1 = stairsectorbuilderform.Flipping == 1 ? sourceld[l1].End.Position : sourceld[l1].Start.Position; - e1 = stairsectorbuilderform.Flipping == 1 ? sourceld[l1].Start.Position : sourceld[l1].End.Position; - s2 = stairsectorbuilderform.Flipping == 2 ? sourceld[l2].End.Position : sourceld[l2].Start.Position; - e2 = stairsectorbuilderform.Flipping == 2 ? sourceld[l2].Start.Position : sourceld[l2].End.Position; - - //innerline = new Line2D(sourceld[l2].Start.Position, sourceld[l1].Start.Position); - //outerline = new Line2D(sourceld[l1].End.Position, sourceld[l2].End.Position); - - innerline = new Line2D(s2, s1); - outerline = new Line2D(e1, e2); - - innerspline = new CatmullRomSplineData(); - innerspline.controlpoints = new List<Vector2D>(); - - innerspline.line = innerline; - innerspline.controlpoints.Add(new Vector2D(innerline.v1)); - - for (int k = 1; k <= numcontrolpoints - 2; k++) - innerspline.controlpoints.Add(new Vector2D(innerline.GetCoordinatesAt(1.0f / (numcontrolpoints - 1) * k))); - - innerspline.controlpoints.Add(new Vector2D(innerline.v2)); - - ComputeTangents(ref innerspline); - - outerspline = new CatmullRomSplineData(); - outerspline.controlpoints = new List<Vector2D>(); - - outerspline.line = outerline; - outerspline.controlpoints.Add(new Vector2D(outerline.v1)); - - for (int k = 1; k <= numcontrolpoints - 2; k++) - outerspline.controlpoints.Add(new Vector2D(outerline.GetCoordinatesAt(1.0f / (numcontrolpoints - 1) * k))); - - outerspline.controlpoints.Add(new Vector2D(outerline.v2)); - - ComputeTangents(ref outerspline); - - splinegroup = new CatmullRomSplineGroup(); - splinegroup.splines = new CatmullRomSplineData[2]; - splinegroup.splines[INNER_SPLINE] = innerspline; - splinegroup.splines[OUTER_SPLINE] = outerspline; - splinegroup.sourcelinedef = sourceld[l1]; - - catmullromsplinegroups.Add(splinegroup); - } - } - - // Modifies the number of control points on the splines - public void ModifyControlpointNumber(int num) - { - if (catmullromsplinegroups == null) return; - - for(int crsg=0; crsg < catmullromsplinegroups.Count;crsg++) { - for (int s = 0; s < 2; s++) - { - List<Vector2D> verts = GenerateCatmullRom(catmullromsplinegroups[crsg].splines[s], num-1); - - catmullromsplinegroups[crsg].splines[s].controlpoints.Clear(); - - foreach (Vector2D v in verts) - { - catmullromsplinegroups[crsg].splines[s].controlpoints.Add(v); - } - - // catmullromsplinegroups[crsg].splines[s].controlpoints.Add(catmullromsplinegroups[crsg].splines[s].line.v1); - - // New tangents of the control points have to be calculated - ComputeTangents(ref catmullromsplinegroups[crsg].splines[s]); - } - } - } - - // Create the sector data depending on the selected tab - public void UpdateVertexData() - { - // Straight stair - if (stairsectorbuilderform.Tabs.SelectedIndex == 0) - { - if (General.Map.Map.SelectedSectorsCount == 0) - { - stairsectors = CreateStraightStairSectorsFromLines(new List<Linedef>(General.Map.Map.GetSelectedLinedefs(true))); - } - else - { - stairsectors = CreateStraightStairSectorsFromSectors(new List<Sector>(General.Map.Map.GetSelectedSectors(true))); - } - } - // Curved stair - else if (stairsectorbuilderform.Tabs.SelectedIndex == 1) - { - stairsectors = CreateCurvedStairSectors(); - } - // Catmull Rom stair - else if (stairsectorbuilderform.Tabs.SelectedIndex == 2) - { - if (oldflipping != stairsectorbuilderform.Flipping) - { - oldflipping = stairsectorbuilderform.Flipping; - InitializeCatmullRomSplines(); - } - - exactsplines = new List<List<Vector2D>>(); - stairsectors = CreateCatmullRomStairSectors(); - } - - if (stairsectors.Count > 0) - { - stairsectorbuilderform.OriginalCeilingBase = stairsectors[0].ceilingheight; - stairsectorbuilderform.OriginalFloorBase = stairsectors[0].floorheight; - } - } - - private bool CheckConnectedLines() - { - //List<Linedef> sourceld = new List<Linedef>(); - - //if (General.Map.Map.GetSelectedLinedefs(true).Count <= 0 && General.Map.Map.SelectedSectorsCount <= 0) - //{ - // return false; - //} - - // connectedlinedefs = new List<ConnectedLinedefs>(); - - //foreach (Linedef ld in General.Map.Map.GetSelectedLinedefs(true)) - //{ - // sourceld.Add(ld); - //} - - // GetConnectedLines(ref sourceld, -1); - - return true; - } - - private void GetConnectedLines(ref List<Linedef> sourceld, int sector) - { - List<Linedef> connectedld = new List<Linedef>(); - Linedef currentld = null; - - connectedlinedefs = new List<ConnectedLinedefs>(); - - while (sourceld.Count > 0) - { - // List is empty - if (connectedld.Count == 0) - { - connectedld.Add(sourceld[0]); - currentld = sourceld[0]; - sourceld.RemoveAt(0); - } - - // Find all connected linedefs starting from the start of the current linedef - while (currentld != null) - { - bool found = false; - - foreach (Linedef ld in sourceld) - { - // if (currentld.Start.Linedefs.Contains(ld)) - if(ld.Start == currentld.Start || ld.End == currentld.Start) - { - // add the connected linedef to the beginning of the list - connectedld.Insert(0, ld); - currentld = ld; - sourceld.Remove(ld); - found = true; - break; - } - } - - if (found == false) currentld = null; - } - - currentld = connectedld[connectedld.Count - 1]; - - // Find all connected linedefs starting from the end of the current linedef - while (currentld != null) - { - bool found = false; - - foreach (Linedef ld in sourceld) - { - // if (currentld.End.Linedefs.Contains(ld)) - if (ld.Start == currentld.End || ld.End == currentld.End) - { - // add the connected linedef to the end of the list - connectedld.Add(ld); - currentld = ld; - sourceld.Remove(ld); - found = true; - break; - } - } - - if (found == false) currentld = null; - } - - ConnectedLinedefs cld = new ConnectedLinedefs(); - cld.linedefs = new List<Linedef>(); - - cld.sector = sector; - - foreach (Linedef ld in connectedld) - { - cld.linedefs.Add(ld); - } - - if (General.Map.Map.SelectedLinedefsCount > 0) - { - foreach (Linedef ld in General.Map.Map.GetSelectedLinedefs(true)) - { - if (cld.linedefs.Contains(ld)) - { - cld.firstlinedef = ld; - break; - } - } - - // if(connectedvertices[0] == cld.firstlinedef.End.Position && connectedvertices[connectedvertices.Count-1] == cld.firstlinedef.Start.Position) { - } - else - { - cld.closed = true; - cld.firstlinedef = cld.linedefs[cld.linedefs.Count-1]; - } - - connectedlinedefs.Add(cld); - connectedld.Clear(); - } - } - - // Computes the tangents of the control points of a Catmull Rom spline - private void ComputeTangents(ref CatmullRomSplineData spline) - { - float f = 2.0f; - int i; - - if (spline.tangents == null) - spline.tangents = new List<Vector2D>(); - else - spline.tangents.Clear(); - - // Special case for the first control point - // spline.tangents.Add(new Vector2D((spline.controlpoints[1] - spline.controlpoints[0]) / f)); - spline.tangents.Add(new Vector2D(spline.controlpoints[1] - spline.controlpoints[0])); - - for (i=1; i < spline.controlpoints.Count - 1; i++) - { - spline.tangents.Add(new Vector2D((spline.controlpoints[i + 1] - spline.controlpoints[i - 1]) / f)); - } - - // Special case for the last control point - //spline.tangents.Add(new Vector2D((spline.controlpoints[i] - spline.controlpoints[i - 1]) / f)); - spline.tangents.Add(new Vector2D(spline.controlpoints[i] - spline.controlpoints[i - 1])); - } - - // Creates sectors for a curved stair - private List<StairInfo> CreateCurvedStairSectors() - { - List<List<Vector2D>> secs = new List<List<Vector2D>>(); - List<Vector2D> newsec; - List<DrawnVertex> dvl = new List<DrawnVertex>(); - List<Vector2D> innervertices, outervertices; - Line2D innerline, outerline; - float innerangle, outerangle; - int innervertexmultiplier = stairsectorbuilderform.InnerVertexMultiplier; - int outervertexmultiplier = stairsectorbuilderform.OuterVertexMultiplier; - bool clockwise; - int numsteps = (int)stairsectorbuilderform.NumberOfSectors; - uint depth = stairsectorbuilderform.SectorDepth; - List<Linedef> sourceld = new List<Linedef>(); - List<StairInfo> stairinfo = new List<StairInfo>(); - StairInfo si = new StairInfo(); - List<List<Vector2D>> sisecs = new List<List<Vector2D>>(); - - secs.Clear(); - - if (General.Map.Map.GetSelectedLinedefs(true).Count <= 0) - { - return null; - } - - // Add all selected linedefs to a source linedef list - foreach (Linedef ld in General.Map.Map.GetSelectedLinedefs(true)) - { - sourceld.Add(ld); - } - - // Go through all source linedefs - for (int l1 = 0; l1 < sourceld.Count - 1; l1++) - { - // A curve will always be made in the order the lines were selected - int l2 = l1 + 1; - Vector2D s1, s2, e1, e2; - float distance = 128; - bool fixedcurve = true; - - s1 = stairsectorbuilderform.Flipping == 1 ? sourceld[l1].End.Position : sourceld[l1].Start.Position; - e1 = stairsectorbuilderform.Flipping == 1 ? sourceld[l1].Start.Position : sourceld[l1].End.Position; - s2 = stairsectorbuilderform.Flipping == 2 ? sourceld[l2].End.Position : sourceld[l2].Start.Position; - e2 = stairsectorbuilderform.Flipping == 2 ? sourceld[l2].Start.Position : sourceld[l2].End.Position; - - if (Vector2D.Distance(s1, s2) < Vector2D.Distance(e1, e2)) - { - clockwise = true; - innerline = new Line2D(s2, s1); - outerline = new Line2D(e1, e2); - } - else // Counter clockwise - { - clockwise = false; - innerline = new Line2D(e1, e2); - outerline = new Line2D(s2, s1); - } - - // Compute the angle of the inner and outer line - if (sourceld[l1].Angle == sourceld[l2].Angle && !(stairsectorbuilderform.Flipping == 1) && !(stairsectorbuilderform.Flipping == 2)) - { - innerangle = 1; - outerangle = 1; - distance = 0; - fixedcurve = false; - } - else - { - if (clockwise) - { - innerangle = outerangle = sourceld[l1].Angle - sourceld[l2].Angle; - if (innerangle < 0.0f) innerangle += Angle2D.PI2; - if (outerangle < 0.0f) outerangle += Angle2D.PI2; - } - else - { - innerangle = outerangle = sourceld[l2].Angle - sourceld[l1].Angle; - if (innerangle < 0.0f) innerangle += Angle2D.PI2; - if (outerangle < 0.0f) outerangle += Angle2D.PI2; - } - - if (stairsectorbuilderform.Flipping != 0) - { - if (sourceld[l1].Angle == sourceld[l2].Angle) - { - if (stairsectorbuilderform.Flipping == 1) - { - innerangle = Math.Abs(innerangle - Angle2D.PI); - outerangle = Math.Abs(outerangle - Angle2D.PI); - } - else if (stairsectorbuilderform.Flipping == 2) - { - innerangle -= Angle2D.PI; - outerangle -= Angle2D.PI; - } - } - else - { - innerangle = Math.Abs(innerangle - Angle2D.PI2); - outerangle = Math.Abs(outerangle - Angle2D.PI2); - } - } - } - - // Generate the vertices on the curve, and add the start and end vertices of the inner line to the list - innervertices = GenerateCurve(innerline, numsteps * innervertexmultiplier - 1, innerangle, false, distance, fixedcurve); - innervertices.Insert(0, innerline.v1); - innervertices.Add(innerline.v2); - - // Generate the vertices on the curve, and add the start and end vertices of the outer line to the list - outervertices = GenerateCurve(outerline, numsteps * outervertexmultiplier - 1, outerangle, true, distance, fixedcurve); - outervertices.Insert(0, outerline.v1); - outervertices.Add(outerline.v2); - - // If the vertices were created in counter-clockwise order turn them into clockwise order - if (!clockwise) - { - List<Vector2D> tmpvertices; - int tmpmultiplier; - - tmpvertices = innervertices; - tmpmultiplier = innervertexmultiplier; - - innervertices = outervertices; - outervertices = tmpvertices; - - innervertexmultiplier = outervertexmultiplier; - outervertexmultiplier = tmpmultiplier; - } - - // Create the sectors from the created vertices - for (int i = 0; i < numsteps; i++) - { - newsec = new List<Vector2D>(); - - // Depending on the outer and innter vertex multipliers more - // vertices from the curve have to be added to the new sector - for (int k = 0; k <= outervertexmultiplier; k++) - { - newsec.Add(outervertices[i * outervertexmultiplier + k]); - } - - // Depending on the outer and innter vertex multipliers more - // vertices from the curve have to be added to the new sector - for (int k = 0; k <= innervertexmultiplier; k++) - { - newsec.Add(innervertices[(numsteps - 1 - i) * innervertexmultiplier + k]); - } - - // Don't forget the add the first vertex again, to actually have - // a whole sector - newsec.Add(outervertices[i * outervertexmultiplier]); - - sisecs.Add(newsec); - } - } - - GetSetTextureAndHeightInfo(sourceld[0], out si); - - si.sectors = sisecs; - - stairinfo.Add(si); - - stairsectorbuilderform.StepMultiplier = sourceld.Count - 1; - - return stairinfo; - } - - private List<Vector2D> GenerateCurve(Line2D line, int vertices, float angle, bool backwards) - { - return GenerateCurve(line, vertices, angle, backwards, 128, true); - } - - // This generates the vertices to split the line with, from start to end - private List<Vector2D> GenerateCurve(Line2D line, int vertices, float angle, bool backwards, float distance, bool fixedcurve) - { - - // Make list - List<Vector2D> points = new List<Vector2D>(vertices); - - //Added by Anders Ã…strand 2008-05-18 - //The formulas used are taken from http://mathworld.wolfram.com/CircularSegment.html - //c and theta are known (length of line and angle parameter). d, R and h are - //calculated from those two - //If the curve is not supposed to be a circular segment it's simply deformed to fit - //the value set for distance. - - //The vertices are generated to be evenly distributed (by angle) along the curve - //and lastly they are rotated and moved to fit with the original line - - //calculate some identities of a circle segment (refer to the graph in the url above) - double c = line.GetLength(); - double theta = angle; - - double d = (c / Math.Tan(theta / 2)) / 2; - double R = d / Math.Cos(theta / 2); - double h = R - d; - - double yDeform = fixedcurve ? 1 : distance / h; - if (backwards) - yDeform = -yDeform; - - double a, x, y; - Vector2D vertex; - - for (int v = 1; v <= vertices; v++) - { - //calculate the angle for this vertex - //the curve starts at PI/2 - theta/2 and is segmented into vertices+1 segments - //this assumes the line is horisontal and on y = 0, the point is rotated and moved later - - a = (Math.PI - theta) / 2 + v * (theta / (vertices + 1)); - - //calculate the coordinates of the point, and distort the y coordinate - //using the deform factor calculated above - x = Math.Cos(a) * R; - y = (Math.Sin(a) * R - d) * yDeform; - - //rotate and transform to fit original line - vertex = new Vector2D((float)x, (float)y).GetRotated(line.GetAngle() + Angle2D.PIHALF); - vertex = vertex.GetTransformed(line.GetCoordinatesAt(0.5f).x, line.GetCoordinatesAt(0.5f).y, 1, 1); - - points.Add(vertex); - } - - - // Done - return points; - } - - - // Creates stair sectors from two Catmull Rom splines - private List<StairInfo> CreateCatmullRomStairSectors() - { - List<List<Vector2D>> secs = new List<List<Vector2D>>(); - List<Vector2D> newsec; - List<Vector2D> innervertices, outervertices; - int innervertexmultiplier = stairsectorbuilderform.InnerVertexMultiplier; - int outervertexmultiplier = stairsectorbuilderform.OuterVertexMultiplier; - int numsteps = (int)stairsectorbuilderform.NumberOfSectors; - List<List<Vector2D>> sisecs = new List<List<Vector2D>>(); - - List<StairInfo> stairinfo = new List<StairInfo>(); - StairInfo si = new StairInfo(); - - secs.Clear(); - - foreach(CatmullRomSplineGroup crsg in catmullromsplinegroups) - { - // Generate the vertices for both the inner and outer spline - innervertices = GenerateCatmullRom(crsg.splines[INNER_SPLINE], numsteps * innervertexmultiplier); - outervertices = GenerateCatmullRom(crsg.splines[OUTER_SPLINE], numsteps * outervertexmultiplier); - - // Create the data to build complete sectors from the splines - for (int i = 0; i < numsteps; i++) - { - newsec = new List<Vector2D>(); - - // Depending on the outer and innter vertex multipliers more - // vertices from the splines have to be added to the new sector - for (int k = 0; k <= outervertexmultiplier; k++) - { - newsec.Add(outervertices[i * outervertexmultiplier + k]); - } - - for (int k = 0; k <= innervertexmultiplier; k++) - { - newsec.Add(innervertices[(numsteps - 1 - i) * innervertexmultiplier + k]); - } - - // Don't forget the add the first vertex again, to actually have - // a whole sector - newsec.Add(outervertices[i * outervertexmultiplier]); - - sisecs.Add(newsec); - } - } - - GetSetTextureAndHeightInfo(catmullromsplinegroups[0].sourcelinedef, out si); - - si.sectors = sisecs; - - stairinfo.Add(si); - - return stairinfo; - } - - private List<StairInfo> CreateStraightStairSectorsFromSectors(List<Sector> selectedsectors) - { - List<StairInfo> stairinfo = new List<StairInfo>(); - - foreach (Sector s in selectedsectors) - { - List<Linedef> linedefs = new List<Linedef>(); - List<Linedef> fliplinedefs = new List<Linedef>(); - - foreach (Sidedef sd in s.Sidedefs) - { - if (sd.Line.Front.Sector.Index != s.Index) - { - fliplinedefs.Add(sd.Line); - sd.Line.FlipVertices(); - sd.Line.FlipSidedefs(); - } - - linedefs.Add(sd.Line); - } - - stairinfo.AddRange(CreateStraightStairSectorsFromLines(linedefs)); - - foreach (Linedef ld in fliplinedefs) - { - ld.FlipSidedefs(); - ld.FlipVertices(); - } - } - - return stairinfo; - } - - private List<StairInfo> CreateStraightStairSectorsFromLines(List<Linedef> selectedlinedefs) - { - List<StairInfo> stairinfo = new List<StairInfo>(); - uint numsteps = stairsectorbuilderform.NumberOfSectors; - uint depth = stairsectorbuilderform.SectorDepth; - int spacing = stairsectorbuilderform.Spacing; - List<Linedef> sourceld = new List<Linedef>(selectedlinedefs); - StairInfo si = new StairInfo(); - - GetConnectedLines(ref selectedlinedefs, -1); - - // Build an independend set of steps from each selected line - if (!stairsectorbuilderform.SingleSectors.Checked) - { - Vector2D direction = new Vector2D(); - Vector2D v1, v2; - - // Go through each selected line - for (int k = 0; k < sourceld.Count; k++) - { - List<List<Vector2D>> sisecs = new List<List<Vector2D>>(); - - // Get the direction to build the stair to. "Flip" the vector depending on the selected build direction modifier - direction = sourceld[k].Line.GetPerpendicular().GetNormal() * (stairsectorbuilderform.SideFront ? -1 : 1); - - for (int i = 0; i < numsteps; i++) - { - List<DrawnVertex> vertices = new List<DrawnVertex>(); - Vector2D v3, v4; - List<Vector2D> newsec = new List<Vector2D>(); - - // Compute the position of the vertices that form the line opposite the source line - v1 = sourceld[k].Start.Position + direction * depth * i; - v2 = sourceld[k].End.Position + direction * depth * i; - v3 = v1 + direction * depth; - v4 = v2 + direction * depth; - - // Apply spacing to each vertex - if (spacing > 0) - { - v1 += (direction * spacing) * i; - v2 += (direction * spacing) * i; - v3 += (direction * spacing) * i; - v4 += (direction * spacing) * i; - - } - - // v1 is added twice so it will actually draw a complete sector - newsec.Add(v1); - newsec.Add(v3); - newsec.Add(v4); - newsec.Add(v2); - newsec.Add(v1); - - sisecs.Add(newsec); - } - - GetSetTextureAndHeightInfo(sourceld[k], out si); - - si.sectors = sisecs; - - stairinfo.Add(si); - } - } - else if(stairsectorbuilderform.SingleSectors.Checked) - { - Vector2D direction = new Vector2D(); - Vector2D globaldirection = new Vector2D(); - bool closed = false; - - foreach (ConnectedLinedefs cld in connectedlinedefs) - { - List<Vector2D> connectedvertices = new List<Vector2D>(); - List<Vector2D> connecteddirections = new List<Vector2D>(); - List<double> connectedlength = new List<double>(); - List<List<Vector2D>> sisecs = new List<List<Vector2D>>(); - - globaldirection = Vector2D.FromAngle(cld.firstlinedef.Angle + Angle2D.DegToRad(stairsectorbuilderform.SideFront ? -90.0f : 90.0f)); - - for(int i=0; i < cld.linedefs.Count; i++) - { - if (cld.sector >= 0) - { - if (cld.linedefs[i].Front.Sector.Index == cld.sector) - { - if (!connectedvertices.Contains(cld.linedefs[i].End.Position)) - connectedvertices.Add(cld.linedefs[i].End.Position); - - if (!connectedvertices.Contains(cld.linedefs[i].Start.Position)) - connectedvertices.Add(cld.linedefs[i].Start.Position); - - } - else - { - if (!connectedvertices.Contains(cld.linedefs[i].Start.Position)) - connectedvertices.Add(cld.linedefs[i].Start.Position); - - if (!connectedvertices.Contains(cld.linedefs[i].End.Position)) - connectedvertices.Add(cld.linedefs[i].End.Position); - } - } - else - { - if (!connectedvertices.Contains(cld.linedefs[i].Start.Position)) - connectedvertices.Add(cld.linedefs[i].Start.Position); - - if (!connectedvertices.Contains(cld.linedefs[i].End.Position)) - connectedvertices.Add(cld.linedefs[i].End.Position); - } - } - - if (cld.sector >= 0) - { - closed = true; - } - else - { - if (connectedvertices[0] == cld.firstlinedef.End.Position && connectedvertices[connectedvertices.Count - 1] == cld.firstlinedef.Start.Position) - closed = true; - } - - for (int i = 0; i < connectedvertices.Count; i++) - { - if (i == 0 && closed == false) - { - connecteddirections.Add(Vector2D.FromAngle(Vector2D.GetAngle(connectedvertices[0], connectedvertices[1]) - Angle2D.DegToRad(stairsectorbuilderform.SideFront ? -90.0f : 90.0f))); - connectedlength.Add(depth); - } - else if (i == connectedvertices.Count - 1 && closed == false) - { - connecteddirections.Add(Vector2D.FromAngle(Vector2D.GetAngle(connectedvertices[i], connectedvertices[i - 1]) + Angle2D.DegToRad(stairsectorbuilderform.SideFront ? -90.0f : 90.0f))); - connectedlength.Add(depth); - } - else - { - Vector2D v1; - Vector2D v2; - - if (closed == true && i == 0) - { - v1 = new Line2D(connectedvertices[1], connectedvertices[0]).GetPerpendicular(); - v2 = new Line2D(connectedvertices[0], connectedvertices[connectedvertices.Count - 1]).GetPerpendicular(); - } - else if(closed == true && i == connectedvertices.Count - 1) - { - v1 = new Line2D(connectedvertices[0], connectedvertices[i]).GetPerpendicular(); - v2 = new Line2D(connectedvertices[i], connectedvertices[i - 1]).GetPerpendicular(); - } - else - { - v1 = new Line2D(connectedvertices[i + 1], connectedvertices[i]).GetPerpendicular(); - v2 = new Line2D(connectedvertices[i], connectedvertices[i - 1]).GetPerpendicular(); - } - - double a = (v1.GetNormal() + v2.GetNormal()).GetAngle(); - double b = a - v1.GetNormal().GetAngle(); - - double opl = Math.Tan(b) * (double)depth; - double distance = Math.Sqrt(depth * depth + opl * opl); - Vector2D v3 = Vector2D.FromAngle((float)a); - - connecteddirections.Add(Vector2D.FromAngle(v3.GetAngle() + Angle2D.DegToRad(stairsectorbuilderform.SideFront ? 0.0f : 180.0f))); - connectedlength.Add(distance); - } - } - - for (int i = 0; i < numsteps; i++) - { - List<Vector2D> newsec = new List<Vector2D>(); - float length; - - if (closed == false) - { - for (int k = 0; k < connectedvertices.Count; k++) - { - if (!stairsectorbuilderform.SingleDirection.Checked) - { - direction = connecteddirections[k]; - length = (float)connectedlength[k]; - } - else - { - direction = globaldirection; - length = depth; - } - - newsec.Add(connectedvertices[k] + direction * length * i + (direction * spacing) * i); - } - } - - for (int k = connectedvertices.Count - 1; k >= 0; k--) - { - if (!stairsectorbuilderform.SingleDirection.Checked) - { - direction = connecteddirections[k]; - length = (float)connectedlength[k]; - } - else - { - direction = globaldirection; - length = depth; - } - - newsec.Add(connectedvertices[k] + direction * length * (i + 1) + (direction * spacing) * i); - } - - if(closed == false) - newsec.Add(connectedvertices[0] + direction * depth * i + (direction * spacing) * i); - else - newsec.Add(newsec[0]); - - // If the steps are drawn on the back side the vertices are in counter-clockwise - // order, so reverse their order - if (!stairsectorbuilderform.SideFront) newsec.Reverse(); - - sisecs.Add(newsec); - } - - GetSetTextureAndHeightInfo(cld.firstlinedef, out si); - - si.sectors = sisecs; - - stairinfo.Add(si); - } - } - - stairsectorbuilderform.StepMultiplier = 1; - - return stairinfo; - } - - // Generats the Catmull Rom spline from the given control points and their tangents. - // Returns a list of Vector2D. - // The line between two control points is a "section". There is always one section - // less than there are control points. - // A "hop" is the distance between two to-be-created vertices. The distance is not - // in map units, but a relative indication where on the line between two control - // points the vertex will be. - // First it is calculated in which section the vertex will be in, then the relative - // position on the line between the control points of this section is calculated. - // This value will be from 0.0 to 0.99999... - // A workaround has to be done for the last vertex, which will inevitably be exactly - // on the last control point, thus computing the wrong section and relative position - private List<Vector2D> GenerateCatmullRom(CatmullRomSplineData crsd, int numverts) - { - List<Vector2D> vertices = new List<Vector2D>(); - int sections = crsd.controlpoints.Count - 1; - double hop = (double)sections / numverts; - float distance = 0.0f; - float unithop = 0; - List<float> cpdistance = new List<float>(); - - // Compute the length of the whole spline and the length of the parts on the - // spline between the control points - for (int i = 0; i < crsd.controlpoints.Count-1; i++) - { - int h = (int)Vector2D.Distance(crsd.controlpoints[i], crsd.controlpoints[i + 1]); - float dist = 0; - List<Vector2D> dc = new List<Vector2D>(); - - Vector2D p0 = crsd.controlpoints[i]; - Vector2D p1 = crsd.controlpoints[i + 1]; - Vector2D t0 = crsd.tangents[i]; - Vector2D t1 = crsd.tangents[i + 1]; - - for (int k = 0; k <= h; k++) - { - dc.Add(Tools.HermiteSpline(p0, t0, p1, t1, (float)(((float)k/(float)h)))); - } - - for (int k = 0; k < h; k++) - { - dist += Vector2D.Distance(dc[k], dc[k + 1]); - } - - distance += dist; - - cpdistance.Add(dist); - - exactsplines.Add(dc); - } - - unithop = distance / numverts; - - for (int i = 0; i <= numverts; i++) - { - int s = 0; - float u; - float distancefromstart = i * unithop; - float max = 0.0f; - - // Find out what section the vertex is in - while (max < distancefromstart) - { - max += cpdistance[s]; - if (max < distancefromstart) s++; - - // Work around for rounding errors - if (s > cpdistance.Count-1) - { - s = cpdistance.Count - 1; - max = distancefromstart; - } - } - - // Compute the u component with special cases for the first - // and last vertex - if (distancefromstart == 0) - u = 0.0f; - else if (distancefromstart == distance) - u = 1.0f; - else - u = 1.0f - ((max - distancefromstart) / cpdistance[s]); - - Vector2D p0 = crsd.controlpoints[s]; - Vector2D p1 = crsd.controlpoints[s + 1]; - Vector2D t0 = crsd.tangents[s]; - Vector2D t1 = crsd.tangents[s + 1]; - vertices.Add(Tools.HermiteSpline(p0, t0, p1, t1, u)); - } - - // OLD CODE - //for (int x = 0; x <= numverts; x++) - //{ - // // Compute the section the vertex will be in - // int s = (int)(x * hop); - // double u; - - // // Workaround for the last vertex - // if ((x * hop) - s < 0.00001f && s == sections) - // { - // u = 1.0f; - // s--; - // } - // else - // { - // //u = (summe - x * unithop) / Vector2D.Distance(crsd.controlpoints[cs], crsd.controlpoints[cs+1]); - // u = (x * hop) - s; - // } - - // if (u > 1.0f) u = 1.0f; - - // Vector2D p0 = crsd.controlpoints[s]; - // Vector2D p1 = crsd.controlpoints[s + 1]; - // Vector2D t0 = crsd.tangents[s]; - // Vector2D t1 = crsd.tangents[s + 1]; - // vertices.Add(Tools.HermiteSpline(p0, t0, p1, t1, (float)u)); - //} - - return vertices; - } - - // Turns a position into a DrawnVertex and returns it - private DrawnVertex SectorVertex(float x, float y) - { - DrawnVertex v = new DrawnVertex(); - - v.stitch = true; - v.stitchline = true; - v.pos = new Vector2D((float)Math.Round(x, General.Map.FormatInterface.VertexDecimals), (float)Math.Round(y, General.Map.FormatInterface.VertexDecimals)); - - return v; - } - - private DrawnVertex SectorVertex(Vector2D v) - { - return SectorVertex(v.x, v.y); - } - - // Remember info for floor and ceiling height. The info is retrieved - // from either front or back of the source line, depending in what - // direction the it should build - // Also set the upper/lower textures to use if they aren't already - private void GetSetTextureAndHeightInfo(Linedef ld, out StairInfo siout) - { - StairInfo si = new StairInfo(); - Sidedef primary; - Sidedef secondary; - - GetSetBaseHeights(ld); - - if (stairsectorbuilderform.SideFront) - { - if (ld.Front == null) - { - primary = ld.Back; - secondary = ld.Front; - } - else - { - primary = ld.Front; - secondary = ld.Back; - } - } - else - { - if (ld.Back == null) - { - primary = ld.Front; - secondary = ld.Back; - } - else - { - primary = ld.Back; - secondary = ld.Front; - } - } - - si.ceilingheight = primary.Sector.CeilHeight; - si.floorheight = primary.Sector.FloorHeight; - - if (stairsectorbuilderform.UpperTextureTexture == "") - stairsectorbuilderform.UpperTextureTexture = (secondary == null) ? primary.MiddleTexture : primary.HighTexture; - - if (stairsectorbuilderform.LowerTextureTexture == "") - stairsectorbuilderform.LowerTextureTexture = (secondary == null) ? primary.MiddleTexture : primary.LowTexture; - - siout = si; - } - - private void GetSetBaseHeights(Linedef ld) - { - if (baseheightset) return; - - baseheightset = true; - - if (stairsectorbuilderform.SideFront) - { - if (ld.Back == null) - { - stairsectorbuilderform.CeilingBase = ld.Front.Sector.CeilHeight; - stairsectorbuilderform.FloorBase = ld.Front.Sector.FloorHeight; - } - else - { - stairsectorbuilderform.CeilingBase = ld.Back.Sector.CeilHeight; - stairsectorbuilderform.FloorBase = ld.Back.Sector.FloorHeight; - } - } - else - { - stairsectorbuilderform.CeilingBase = ld.Front.Sector.CeilHeight; - stairsectorbuilderform.FloorBase = ld.Front.Sector.FloorHeight; - } - } - - #endregion - - #region ================== Events - - public override void OnHelp() - { - General.ShowHelp("e_curvelinedefs.html"); - } - - // Cancelled - public override void OnCancel() - { - // Cancel base class - base.OnCancel(); - - // stairsectorbuilderform.Close(); - - // Return to base mode - General.Editing.ChangeMode(General.Editing.PreviousStableMode.Name); - } - - // Mode engages - public override void OnEngage() - { - base.OnEngage(); - - // If no lines are selected nothing can be done, so exit this mode immediately - if (General.Map.Map.SelectedLinedefsCount == 0 && General.Map.Map.SelectedSectorsCount == 0) - { - General.Interface.DisplayStatus(StatusType.Warning, "No lines or sectors selected."); - General.Editing.ChangeMode(General.Editing.PreviousStableMode.Name); - return; - } - - renderer.SetPresentation(Presentation.Standard); - - linesconnected = CheckConnectedLines(); - - LoadPrefabs(); - - // stairsectorbuilderform = BuilderPlug.Me.StairSectorBuilderForm; - - stairsectorbuilderform = new StairSectorBuilderForm(); - - InitializeCatmullRomSplines(); - - selectedcontrolpoint.cp = -1; - selectedcontrolpoint.crsd = -1; - selectedcontrolpoint.crsg = -1; - - stairsectorbuilderform.SingleSectors.Enabled = linesconnected ? true : false; - stairsectorbuilderform.DistinctBaseHeights.Checked = General.Map.Map.SelectedLinedefsCount == 1 ? false : true; - - - // Show toolbox window - // stairsectorbuilderform.Show(); - stairsectorbuilderform.Show((Form)General.Interface); - } - - // Disenagaging - public override void OnDisengage() - { - base.OnDisengage(); - - SavePrefabs(); - - // Sort of work around so that the DB2 window won't lose focus - General.Interface.Focus(); - - if(stairsectorbuilderform != null) - stairsectorbuilderform.Hide(); - } - - // This applies the curves and returns to the base mode - public override void OnAccept() - { - string uppertexture = stairsectorbuilderform.UpperTextureTexture; - string lowertexture = stairsectorbuilderform.LowerTextureTexture; - string middletexture = stairsectorbuilderform.MiddleTextureTexture; - string olddefaulttexture = "-"; - List<Vertex> newvertices = new List<Vertex>(); - List<Linedef> newlinedefs = new List<Linedef>(); - List<Sector> allnewsectors = new List<Sector>(); - - if (stairsectors == null) return; - - // Create undo - General.Map.UndoRedo.CreateUndo("Build stair sectors"); - - // Get the default settings and remember the default texture - General.Settings.FindDefaultDrawSettings(); - - if (stairsectorbuilderform.MiddleTexture) - { - olddefaulttexture = General.Settings.DefaultTexture; - General.Settings.DefaultTexture = "-"; - } - - // This creates the geometry. Uses exactly the same data used - // for the preview - try - { - foreach (StairInfo si in stairsectors) - { - int stepcounter = 1; - - foreach (List<Vector2D> lv in si.sectors) - { - List<Sector> oldsectors = new List<Sector>(General.Map.Map.Sectors); - List<Sector> newsectors = new List<Sector>(); - List<DrawnVertex> vertices = new List<DrawnVertex>(); - - for (int i = 0; i < lv.Count; i++) - { - vertices.Add(SectorVertex(lv[i])); - } - - // Draw the new sector - if (!Tools.DrawLines(vertices)) throw new Exception("Failed drawing lines"); - - // Update newly created sector(s) with the given textures and heights - foreach (Sector s in General.Map.Map.Sectors) - { - if (!oldsectors.Contains(s)) - { - allnewsectors.Add(s); - - // Apply floor heights if necessary - if (stairsectorbuilderform.FloorHeight) - { - // Should each stair use individual base height or the global one? - if (stairsectorbuilderform.DistinctBaseHeights.Checked && stairsectorbuilderform.StairType == 0) - s.FloorHeight = si.floorheight + stairsectorbuilderform.FloorHeightModification * stepcounter; - else - s.FloorHeight = stairsectorbuilderform.FloorBase + stairsectorbuilderform.FloorHeightModification * stepcounter; - } - - // Apply ceiling heights if necessary - if (stairsectorbuilderform.CeilingHeight) - { - // Should each stair use individual base height or the global one? - if (stairsectorbuilderform.DistinctBaseHeights.Checked && stairsectorbuilderform.StairType == 0) - s.CeilHeight = si.ceilingheight + stairsectorbuilderform.CeilingHeightModification * stepcounter; - else - s.CeilHeight = stairsectorbuilderform.CeilingBase + stairsectorbuilderform.CeilingHeightModification * stepcounter; - } - - // Apply floor and ceiling textures if necessary - if (stairsectorbuilderform.FloorFlat) - s.SetFloorTexture(stairsectorbuilderform.FloorFlatTexture); - - if (stairsectorbuilderform.CeilingFlat) - s.SetCeilTexture(stairsectorbuilderform.CeilingFlatTexture); - - // Fix missing textures - foreach (Sidedef sd in s.Sidedefs) - { - if (!newlinedefs.Contains(sd.Line)) newlinedefs.Add(sd.Line); - - if (stairsectorbuilderform.UpperTexture) - { - if (sd.Line.Back != null && sd.Line.Back.HighRequired()) sd.Line.Back.SetTextureHigh(uppertexture); - if (sd.Line.Front != null && sd.Line.Front.HighRequired()) sd.Line.Front.SetTextureHigh(uppertexture); - if (stairsectorbuilderform.UpperUnpegged) sd.Line.SetFlag(General.Map.Config.UpperUnpeggedFlag, true); - } - - if (stairsectorbuilderform.LowerTexture) - { - if (sd.Line.Front != null && sd.Line.Front.LowRequired()) sd.Line.Front.SetTextureLow(lowertexture); - if (sd.Line.Back != null && sd.Line.Back.LowRequired()) sd.Line.Back.SetTextureLow(lowertexture); - if (stairsectorbuilderform.LowerUnpegged) sd.Line.SetFlag(General.Map.Config.LowerUnpeggedFlag, true); - } - - if (stairsectorbuilderform.MiddleTexture) - { - if (sd.Line.Front != null && sd.Line.Front.MiddleRequired()) sd.Line.Front.SetTextureMid(middletexture); - if (sd.Line.Back != null && sd.Line.Back.MiddleRequired()) sd.Line.Back.SetTextureMid(middletexture); - } - } - } - } - - stepcounter++; - } - } - - if (stairsectorbuilderform.MiddleTexture) - General.Settings.DefaultTexture = olddefaulttexture; - - // Snap to map format accuracy - General.Map.Map.SnapAllToAccuracy(); - - // Clean the map up. Merge all vertices that share the same position and - // remove looped linedefs - foreach (Sector s in allnewsectors) - { - if (s.Sidedefs == null) continue; - - foreach (Sidedef sd in s.Sidedefs) - { - if (!newvertices.Contains(sd.Line.Start)) newvertices.Add(sd.Line.Start); - if (!newvertices.Contains(sd.Line.End)) newvertices.Add(sd.Line.End); - } - } - - General.Map.Map.BeginAddRemove(); - MapSet.JoinVertices(newvertices, newvertices, false, MapSet.STITCH_DISTANCE); - General.Map.Map.EndAddRemove(); - - MapSet.RemoveLoopedLinedefs(newlinedefs); - - // Update textures - General.Map.Data.UpdateUsedTextures(); - - // Update caches - General.Map.Map.Update(); - General.Map.IsChanged = true; - } - catch (Exception e) - { - General.Interface.DisplayStatus(StatusType.Warning, e.ToString()); - General.Map.UndoRedo.WithdrawUndo(); - } - - // Return to base mode - General.Editing.ChangeMode(General.Editing.PreviousStableMode.Name); - } - - // Redrawing display - public override void OnRedrawDisplay() - { - if (!stairsectorbuilderform.FullyLoaded) return; - - base.OnRedrawDisplay(); - - renderer.RedrawSurface(); - - // Render lines - if (renderer.StartPlotter(true)) - { - renderer.PlotLinedefSet(General.Map.Map.Linedefs); - renderer.PlotVerticesSet(General.Map.Map.Vertices); - renderer.Finish(); - } - - // Render things - if (renderer.StartThings(true)) - { - renderer.RenderThingSet(General.Map.Map.Things, 1.0f); - renderer.Finish(); - } - - // Render overlay - if (renderer.StartOverlay(true)) - { - if (stairsectorbuilderform.Tabs.SelectedIndex == 2 && numcontrolpoints != stairsectorbuilderform.NumControlPoints) - { - ModifyControlpointNumber(stairsectorbuilderform.NumControlPoints); - numcontrolpoints = stairsectorbuilderform.NumControlPoints; - } - - // Create sector info based on the settings... - UpdateVertexData(); - - // Render the control points if the Catmull Rom spline tab is selected - if (stairsectorbuilderform.Tabs.SelectedIndex == 2) - { - foreach (List<Vector2D> lv in exactsplines) - { - for (int i = 0; i < lv.Count - 1; i++) - { - renderer.RenderLine(lv[i], lv[i + 1], LINE_THICKNESS, new PixelColor(255, 128, 128, 128), true); - } - } - - foreach(CatmullRomSplineGroup crsg in catmullromsplinegroups) - { - CatmullRomSplineData[] crsd = new CatmullRomSplineData[2] { crsg.splines[INNER_SPLINE], crsg.splines[OUTER_SPLINE] }; - - foreach(CatmullRomSplineData c in crsd) - { - for (int i = 0; i < c.controlpoints.Count; i++) - { - RectangleF rect = new RectangleF(c.controlpoints[i].x - CONTROLPOINT_SIZE / 2, c.controlpoints[i].y - CONTROLPOINT_SIZE / 2, 10.0f, 10.0f); - - if(i == 0) renderer.RenderRectangle(rect, 2, new PixelColor(128, 255, 0, 0), true); - else if (i == c.controlpoints.Count -1) renderer.RenderRectangle(rect, 2, new PixelColor(128, 0, 255, 0), true); - else renderer.RenderRectangle(rect, 2, General.Colors.Indication, true); - //renderer.RenderLine(c.controlpoints[i], c.controlpoints[i] + c.tangents[i], LINE_THICKNESS, new PixelColor(255, 128, 128, 128), true); - } - } - } - } - - // ... and draw the preview - foreach (StairInfo si in stairsectors) - { - foreach (List<Vector2D> lv in si.sectors) - { - for (int i = 0; i < lv.Count - 1; i++) - { - renderer.RenderLine(lv[i], lv[i + 1], LINE_THICKNESS, General.Colors.Highlight, true); - - RectangleF rect = new RectangleF(lv[i].x - CONTROLPOINT_SIZE / 2, lv[i].y - CONTROLPOINT_SIZE / 2, 10.0f, 10.0f); - renderer.RenderRectangle(rect, 2, new PixelColor(128, 255, 0, 0), true); - } - } - } - - renderer.Finish(); - } - - renderer.Present(); - } - - protected override void OnSelectBegin() - { - base.OnSelectBegin(); - - if (stairsectorbuilderform.Tabs.SelectedIndex != 2) return; - - // Go through all Catmull Rom Spline Groups - for (int crsg = 0; crsg < catmullromsplinegroups.Count; crsg++) - { - // Check inner and outer splines - for (int crsd = 0; crsd < 2; crsd++) - { - // Check all control points except the first and last, they belong to the linedefs - // and may not be moved - for (int cp = 1; cp < catmullromsplinegroups[crsg].splines[crsd].controlpoints.Count-1; cp++) - { - Vector2D p = catmullromsplinegroups[crsg].splines[crsd].controlpoints[cp]; - - // If the mouse is inside a control point, set the info about that control point - // in the selectedcontrolpoint struct - if (mousemappos.x >= p.x - CONTROLPOINT_SIZE / 2 && mousemappos.x <= p.x + CONTROLPOINT_SIZE / 2 && mousemappos.y >= p.y - CONTROLPOINT_SIZE / 2 && mousemappos.y <= p.y + CONTROLPOINT_SIZE / 2) - { - selectedcontrolpoint.cp = cp; - selectedcontrolpoint.crsd = crsd; - selectedcontrolpoint.crsg = crsg; - } - } - } - } - } - - // When selected button is released - protected override void OnSelectEnd() - { - base.OnSelectEnd(); - - // No control point is selected - selectedcontrolpoint.cp = -1; - selectedcontrolpoint.crsd = -1; - selectedcontrolpoint.crsg = -1; - - // Redraw - General.Map.Map.Update(); - General.Interface.RedrawDisplay(); - } - - // Mouse moves - public override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - - // If a control point is selected move it around - if (selectedcontrolpoint.cp != -1) - { - if(General.Interface.ShiftState ^ General.Interface.SnapToGrid) - { - catmullromsplinegroups[selectedcontrolpoint.crsg].splines[selectedcontrolpoint.crsd].controlpoints[selectedcontrolpoint.cp] = new Vector2D(General.Map.Grid.SnappedToGrid(mousemappos).x, General.Map.Grid.SnappedToGrid(mousemappos).y); - } - else - { - catmullromsplinegroups[selectedcontrolpoint.crsg].splines[selectedcontrolpoint.crsd].controlpoints[selectedcontrolpoint.cp] = new Vector2D(mousemappos.x, mousemappos.y); - } - - // New tangents of the control points have to be calculated - ComputeTangents(ref catmullromsplinegroups[selectedcontrolpoint.crsg].splines[selectedcontrolpoint.crsd]); - - General.Interface.RedrawDisplay(); - } - } - - public static void SavePrefabs() - { - ListDictionary prefabdata = new ListDictionary(); - int counter = 1; - - foreach(BuilderPlug.Prefab p in BuilderPlug.Me.Prefabs) - { - ListDictionary data = new ListDictionary(); - data.Add("name", p.name); - data.Add("numberofsectors", p.numberofsectors); - data.Add("outervertexmultiplier", p.outervertexmultiplier); - data.Add("innervertexmultiplier", p.innervertexmultiplier); - data.Add("stairtype", p.stairtype); - data.Add("sectordepth", p.sectordepth); - data.Add("spacing", p.spacing); - data.Add("frontside", p.frontside); - data.Add("singlesectors", p.singlesectors); - data.Add("singledirection", p.singledirection); - data.Add("distinctbaseheights", p.distinctbaseheights); - data.Add("flipping", p.flipping); - data.Add("numberofcontrolpoints", p.numberofcontrolpoints); - data.Add("applyfloormod", p.applyfloormod); - data.Add("floormod", p.floormod); - //data.Add("floorbase", p.floorbase); - data.Add("applyceilingmod", p.applyceilingmod); - data.Add("ceilingmod", p.ceilingmod); - //data.Add("ceilingbase", p.ceilingbase); - data.Add("applyfloortexture", p.applyfloortexture); - data.Add("floortexture", p.floortexture); - data.Add("applyceilingtexture", p.applyceilingtexture); - data.Add("ceilingtexture", p.ceilingtexture); - data.Add("applyuppertexture", p.applyuppertexture); - data.Add("uppertexture", p.uppertexture); - data.Add("upperunpegged", p.upperunpegged); - data.Add("applymiddletexture", p.applymiddletexture); - data.Add("middletexture", p.middletexture); - data.Add("applylowertexture", p.applylowertexture); - data.Add("lowertexture", p.lowertexture); - data.Add("lowerunpegged", p.lowerunpegged); - - prefabdata.Add("prefab" + counter.ToString(), data); - - counter++; - } - - General.Map.Options.WritePluginSetting("prefabs", prefabdata); - } - - private void LoadPrefabs() - { - ListDictionary prefabdata = new ListDictionary(); - - // load the light info from the .dbs - prefabdata = (ListDictionary)General.Map.Options.ReadPluginSetting("prefabs", new ListDictionary()); - - BuilderPlug.Me.Prefabs.Clear(); - - foreach (DictionaryEntry prefabentry in prefabdata) - { - BuilderPlug.Prefab p = new BuilderPlug.Prefab(); - - foreach (DictionaryEntry entry in (ListDictionary)prefabentry.Value) - { - if ((string)entry.Key == "name") p.name = (string)entry.Value; - if ((string)entry.Key == "numberofsectors") p.numberofsectors = (int)entry.Value; - if ((string)entry.Key == "outervertexmultiplier") p.outervertexmultiplier = (int)entry.Value; - if ((string)entry.Key == "innervertexmultiplier") p.innervertexmultiplier = (int)entry.Value; - if ((string)entry.Key == "stairtype") p.stairtype = (int)entry.Value; - if ((string)entry.Key == "sectordepth") p.sectordepth = (int)entry.Value; - if ((string)entry.Key == "spacing") p.spacing = (int)entry.Value; - if ((string)entry.Key == "frontside") p.frontside = (bool)entry.Value; - if ((string)entry.Key == "singlesectors") p.singlesectors = (bool)entry.Value; - if ((string)entry.Key == "singledirection") p.singledirection = (bool)entry.Value; - if ((string)entry.Key == "distinctbaseheights") p.distinctbaseheights = (bool)entry.Value; - if ((string)entry.Key == "flipping") p.flipping = (int)entry.Value; - if ((string)entry.Key == "numberofcontrolpoints") p.numberofcontrolpoints = (int)entry.Value; - if ((string)entry.Key == "applyfloormod") p.applyfloormod = (bool)entry.Value; - if ((string)entry.Key == "floormod") p.floormod = (int)entry.Value; - //if ((string)entry.Key == "floorbase") p.floorbase = (int)entry.Value; - if ((string)entry.Key == "applyceilingmod") p.applyceilingmod = (bool)entry.Value; - if ((string)entry.Key == "ceilingmod") p.ceilingmod = (int)entry.Value; - //if ((string)entry.Key == "ceilingbase") p.ceilingbase = (int)entry.Value; - if ((string)entry.Key == "applyfloortexture") p.applyfloortexture = (bool)entry.Value; - if ((string)entry.Key == "floortexture") p.floortexture = (string)entry.Value; - if ((string)entry.Key == "applyceilingtexture") p.applyceilingtexture = (bool)entry.Value; - if ((string)entry.Key == "ceilingtexture") p.ceilingtexture = (string)entry.Value; - if ((string)entry.Key == "applyuppertexture") p.applyuppertexture = (bool)entry.Value; - if ((string)entry.Key == "upperunpegged") p.upperunpegged = (bool)entry.Value; - if ((string)entry.Key == "uppertexture") p.uppertexture = (string)entry.Value; - if ((string)entry.Key == "applymiddletexture") p.applymiddletexture = (bool)entry.Value; - if ((string)entry.Key == "middletexture") p.middletexture = (string)entry.Value; - if ((string)entry.Key == "applylowertexture") p.applylowertexture = (bool)entry.Value; - if ((string)entry.Key == "lowertexture") p.lowertexture = (string)entry.Value; - if ((string)entry.Key == "lowerunpegged") p.lowerunpegged = (bool)entry.Value; - } - - BuilderPlug.Me.Prefabs.Add(p); - } - } - - #endregion - } -}