mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 14:31:50 +00:00
Added source for Tag Range plugin
This commit is contained in:
parent
7ad72cd817
commit
08e6f30d0f
17 changed files with 1280 additions and 11 deletions
BIN
Resources/Icons/tag_blue.png
Normal file
BIN
Resources/Icons/tag_blue.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 586 B |
|
@ -2,7 +2,7 @@
|
|||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
|
@ -235,6 +235,7 @@
|
|||
<EmbeddedResource Include="Resources\HeightsMode.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ClassicModes\TriangulatorMode.cs" />
|
||||
<Compile Include="ErrorChecks\CheckMissingTextures.cs" />
|
||||
<Compile Include="ErrorChecks\CheckUnknownFlats.cs" />
|
||||
<Compile Include="ErrorChecks\CheckUnknownTextures.cs" />
|
||||
|
|
|
@ -178,9 +178,6 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
|||
|
||||
// Set new highlight
|
||||
highlighted = s;
|
||||
|
||||
// Get label positions
|
||||
if(s != null) labelpos = Tools.FindLabelPositions(s);
|
||||
|
||||
// Render highlighted item
|
||||
if((highlighted != null) && !highlighted.IsDisposed)
|
||||
|
@ -434,7 +431,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
|||
renderer.Present();
|
||||
}
|
||||
|
||||
Thread.Sleep(10);
|
||||
//Thread.Sleep(10);
|
||||
|
||||
// Start with a clear display
|
||||
if(renderer.StartPlotter(true))
|
||||
|
@ -452,7 +449,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
|||
}
|
||||
|
||||
// Wait a bit
|
||||
Thread.Sleep(40);
|
||||
//Thread.Sleep(40);
|
||||
Application.DoEvents();
|
||||
}
|
||||
|
||||
|
@ -506,7 +503,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
|||
{
|
||||
EarClipVertex prev, first;
|
||||
|
||||
for(int a = 0; a < 8; a++)
|
||||
for(int a = 0; a < 2; a++)
|
||||
{
|
||||
// Start with a clear display
|
||||
if(renderer.StartPlotter(true))
|
||||
|
@ -543,7 +540,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
|||
renderer.Finish();
|
||||
renderer.Present();
|
||||
}
|
||||
Thread.Sleep(60);
|
||||
Thread.Sleep(10);
|
||||
Application.DoEvents();
|
||||
|
||||
// Start with a clear display
|
||||
|
@ -573,7 +570,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
|||
renderer.Finish();
|
||||
renderer.Present();
|
||||
}
|
||||
Thread.Sleep(40);
|
||||
//Thread.Sleep(10);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ thingsmode
|
|||
allowscroll = true;
|
||||
}
|
||||
|
||||
/*
|
||||
///*
|
||||
triangulatormode
|
||||
{
|
||||
title = "Triangulator Mode";
|
||||
|
@ -87,7 +87,7 @@ triangulatormode
|
|||
allowmouse = true;
|
||||
allowscroll = true;
|
||||
}
|
||||
*/
|
||||
//*/
|
||||
|
||||
drawlinesmode
|
||||
{
|
||||
|
|
105
Source/Plugins/TagRange/BuilderPlug.cs
Normal file
105
Source/Plugins/TagRange/BuilderPlug.cs
Normal file
|
@ -0,0 +1,105 @@
|
|||
|
||||
#region ================== Copyright (c) 2010 Pascal vd Heiden
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010 Pascal vd Heiden
|
||||
* 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.Controls;
|
||||
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.TagRange
|
||||
{
|
||||
public class BuilderPlug : Plug
|
||||
{
|
||||
// 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;
|
||||
|
||||
// Tools form
|
||||
private ToolsForm toolsform;
|
||||
|
||||
// Static property to access the BuilderPlug
|
||||
public static BuilderPlug Me { get { return me; } }
|
||||
|
||||
// This event is called when the plugin is initialized
|
||||
public override void OnInitialize()
|
||||
{
|
||||
base.OnInitialize();
|
||||
|
||||
// Keep a static reference
|
||||
me = this;
|
||||
|
||||
// Load form
|
||||
toolsform = new ToolsForm();
|
||||
|
||||
General.Actions.BindMethods(this);
|
||||
}
|
||||
|
||||
// This is called when the plugin is terminated
|
||||
public override void Dispose()
|
||||
{
|
||||
base.Dispose();
|
||||
|
||||
General.Actions.UnbindMethods(this);
|
||||
|
||||
// Dispose form
|
||||
if(toolsform != null)
|
||||
toolsform.Dispose();
|
||||
toolsform = null;
|
||||
}
|
||||
|
||||
// This updates the button on the toolbar
|
||||
public override void OnEditEngage(EditMode oldmode, EditMode newmode)
|
||||
{
|
||||
base.OnEditEngage(oldmode, newmode);
|
||||
toolsform.UpdateButton();
|
||||
}
|
||||
|
||||
[BeginAction("rangetagselectedsectors")]
|
||||
private void RangeTagSelectedSectors()
|
||||
{
|
||||
TagRangeForm f = new TagRangeForm();
|
||||
f.Setup();
|
||||
if(f.SelectionCount > 0)
|
||||
f.ShowDialog(Form.ActiveForm);
|
||||
else
|
||||
General.Interface.MessageBeep(MessageBeepType.Default);
|
||||
f.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
35
Source/Plugins/TagRange/Properties/AssemblyInfo.cs
Normal file
35
Source/Plugins/TagRange/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("TagRange")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Doom Builder")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2010")]
|
||||
[assembly: AssemblyTrademark("CodeImp")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("8b9957c1-629e-45b7-8228-115225999d62")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
70
Source/Plugins/TagRange/Properties/Resources.Designer.cs
generated
Normal file
70
Source/Plugins/TagRange/Properties/Resources.Designer.cs
generated
Normal file
|
@ -0,0 +1,70 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.4206
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace CodeImp.DoomBuilder.TagRange.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[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>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </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.TagRange.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </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 System.Drawing.Bitmap tag_blue {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("tag_blue", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
124
Source/Plugins/TagRange/Properties/Resources.resx
Normal file
124
Source/Plugins/TagRange/Properties/Resources.resx
Normal file
|
@ -0,0 +1,124 @@
|
|||
<?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="tag_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\tag_blue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
10
Source/Plugins/TagRange/Resources/Actions.cfg
Normal file
10
Source/Plugins/TagRange/Resources/Actions.cfg
Normal file
|
@ -0,0 +1,10 @@
|
|||
|
||||
rangetagselectedsectors
|
||||
{
|
||||
title = "Tag Range Sectors";
|
||||
category = "sectors";
|
||||
description = "Allows giving a range of tags to a selection of sectors.";
|
||||
allowkeys = true;
|
||||
allowmouse = true;
|
||||
allowscroll = true;
|
||||
}
|
BIN
Source/Plugins/TagRange/Resources/tag_blue.png
Normal file
BIN
Source/Plugins/TagRange/Resources/tag_blue.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 586 B |
92
Source/Plugins/TagRange/TagRange.csproj
Normal file
92
Source/Plugins/TagRange/TagRange.csproj
Normal file
|
@ -0,0 +1,92 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CodeImp.DoomBuilder.TagRange</RootNamespace>
|
||||
<AssemblyName>TagRange</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>..\..\..\Build\Plugins\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<OutputPath>..\..\..\Build\Plugins\</OutputPath>
|
||||
<DefineConstants>
|
||||
</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Design" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<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="TagRangeForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TagRangeForm.Designer.cs">
|
||||
<DependentUpon>TagRangeForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ToolsForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ToolsForm.Designer.cs">
|
||||
<DependentUpon>ToolsForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\tag_blue.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\Actions.cfg" />
|
||||
<EmbeddedResource Include="TagRangeForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>TagRangeForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ToolsForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>ToolsForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Core\Builder.csproj">
|
||||
<Project>{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}</Project>
|
||||
<Name>Builder</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\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>
|
206
Source/Plugins/TagRange/TagRangeForm.Designer.cs
generated
Normal file
206
Source/Plugins/TagRange/TagRangeForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,206 @@
|
|||
namespace CodeImp.DoomBuilder.TagRange
|
||||
{
|
||||
partial class TagRangeForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if(disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.rangestart = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.itemcountlabel = new System.Windows.Forms.Label();
|
||||
this.doubletagwarning = new System.Windows.Forms.Label();
|
||||
this.skipdoubletags = new System.Windows.Forms.CheckBox();
|
||||
this.okbutton = new System.Windows.Forms.Button();
|
||||
this.cancelbutton = new System.Windows.Forms.Button();
|
||||
this.outoftagswarning = new System.Windows.Forms.Label();
|
||||
this.endtaglabel = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// rangestart
|
||||
//
|
||||
this.rangestart.AllowDecimal = false;
|
||||
this.rangestart.AllowNegative = false;
|
||||
this.rangestart.AllowRelative = false;
|
||||
this.rangestart.ButtonStep = 1;
|
||||
this.rangestart.Location = new System.Drawing.Point(110, 56);
|
||||
this.rangestart.Name = "rangestart";
|
||||
this.rangestart.Size = new System.Drawing.Size(96, 24);
|
||||
this.rangestart.StepValues = null;
|
||||
this.rangestart.TabIndex = 0;
|
||||
this.rangestart.WhenTextChanged += new System.EventHandler(this.rangestart_WhenTextChanged);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(44, 61);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(54, 14);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Start Tag:";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(30, 27);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(68, 14);
|
||||
this.label2.TabIndex = 2;
|
||||
this.label2.Text = "Items to Tag:";
|
||||
//
|
||||
// itemcountlabel
|
||||
//
|
||||
this.itemcountlabel.AutoSize = true;
|
||||
this.itemcountlabel.Location = new System.Drawing.Point(110, 27);
|
||||
this.itemcountlabel.Name = "itemcountlabel";
|
||||
this.itemcountlabel.Size = new System.Drawing.Size(13, 14);
|
||||
this.itemcountlabel.TabIndex = 3;
|
||||
this.itemcountlabel.Text = "0";
|
||||
//
|
||||
// doubletagwarning
|
||||
//
|
||||
this.doubletagwarning.BackColor = System.Drawing.SystemColors.Info;
|
||||
this.doubletagwarning.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.doubletagwarning.Location = new System.Drawing.Point(12, 130);
|
||||
this.doubletagwarning.Name = "doubletagwarning";
|
||||
this.doubletagwarning.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.doubletagwarning.Size = new System.Drawing.Size(273, 50);
|
||||
this.doubletagwarning.TabIndex = 4;
|
||||
this.doubletagwarning.Text = "Warning: The tag range contains already used tags.";
|
||||
this.doubletagwarning.Visible = false;
|
||||
//
|
||||
// skipdoubletags
|
||||
//
|
||||
this.skipdoubletags.AutoSize = true;
|
||||
this.skipdoubletags.BackColor = System.Drawing.SystemColors.Info;
|
||||
this.skipdoubletags.Location = new System.Drawing.Point(63, 154);
|
||||
this.skipdoubletags.Name = "skipdoubletags";
|
||||
this.skipdoubletags.Size = new System.Drawing.Size(161, 18);
|
||||
this.skipdoubletags.TabIndex = 5;
|
||||
this.skipdoubletags.Text = "Skip over already used tags";
|
||||
this.skipdoubletags.UseVisualStyleBackColor = false;
|
||||
this.skipdoubletags.Visible = false;
|
||||
this.skipdoubletags.CheckedChanged += new System.EventHandler(this.skipdoubletags_CheckedChanged);
|
||||
//
|
||||
// okbutton
|
||||
//
|
||||
this.okbutton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.okbutton.Location = new System.Drawing.Point(41, 197);
|
||||
this.okbutton.Name = "okbutton";
|
||||
this.okbutton.Size = new System.Drawing.Size(99, 26);
|
||||
this.okbutton.TabIndex = 6;
|
||||
this.okbutton.Text = "OK";
|
||||
this.okbutton.UseVisualStyleBackColor = true;
|
||||
this.okbutton.Click += new System.EventHandler(this.okbutton_Click);
|
||||
//
|
||||
// cancelbutton
|
||||
//
|
||||
this.cancelbutton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.cancelbutton.Location = new System.Drawing.Point(158, 197);
|
||||
this.cancelbutton.Name = "cancelbutton";
|
||||
this.cancelbutton.Size = new System.Drawing.Size(99, 26);
|
||||
this.cancelbutton.TabIndex = 7;
|
||||
this.cancelbutton.Text = "Cancel";
|
||||
this.cancelbutton.UseVisualStyleBackColor = true;
|
||||
this.cancelbutton.Click += new System.EventHandler(this.cancelbutton_Click);
|
||||
//
|
||||
// outoftagswarning
|
||||
//
|
||||
this.outoftagswarning.BackColor = System.Drawing.SystemColors.Info;
|
||||
this.outoftagswarning.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.outoftagswarning.Location = new System.Drawing.Point(12, 130);
|
||||
this.outoftagswarning.Name = "outoftagswarning";
|
||||
this.outoftagswarning.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.outoftagswarning.Size = new System.Drawing.Size(273, 50);
|
||||
this.outoftagswarning.TabIndex = 8;
|
||||
this.outoftagswarning.Text = "The range exceeds the maximum allowed tags and cannot be created.";
|
||||
this.outoftagswarning.Visible = false;
|
||||
//
|
||||
// endtaglabel
|
||||
//
|
||||
this.endtaglabel.AutoSize = true;
|
||||
this.endtaglabel.Location = new System.Drawing.Point(110, 95);
|
||||
this.endtaglabel.Name = "endtaglabel";
|
||||
this.endtaglabel.Size = new System.Drawing.Size(13, 14);
|
||||
this.endtaglabel.TabIndex = 10;
|
||||
this.endtaglabel.Text = "0";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(49, 95);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(49, 14);
|
||||
this.label4.TabIndex = 9;
|
||||
this.label4.Text = "End Tag:";
|
||||
//
|
||||
// TagRangeForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.ClientSize = new System.Drawing.Size(298, 231);
|
||||
this.Controls.Add(this.endtaglabel);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.cancelbutton);
|
||||
this.Controls.Add(this.okbutton);
|
||||
this.Controls.Add(this.skipdoubletags);
|
||||
this.Controls.Add(this.doubletagwarning);
|
||||
this.Controls.Add(this.itemcountlabel);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.rangestart);
|
||||
this.Controls.Add(this.outoftagswarning);
|
||||
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.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "TagRangeForm";
|
||||
this.Opacity = 0;
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Tag Selected Range";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox rangestart;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label itemcountlabel;
|
||||
private System.Windows.Forms.Label doubletagwarning;
|
||||
private System.Windows.Forms.CheckBox skipdoubletags;
|
||||
private System.Windows.Forms.Button okbutton;
|
||||
private System.Windows.Forms.Button cancelbutton;
|
||||
private System.Windows.Forms.Label outoftagswarning;
|
||||
private System.Windows.Forms.Label endtaglabel;
|
||||
private System.Windows.Forms.Label label4;
|
||||
}
|
||||
}
|
196
Source/Plugins/TagRange/TagRangeForm.cs
Normal file
196
Source/Plugins/TagRange/TagRangeForm.cs
Normal file
|
@ -0,0 +1,196 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Controls;
|
||||
|
||||
namespace CodeImp.DoomBuilder.TagRange
|
||||
{
|
||||
public partial class TagRangeForm : DelayedForm
|
||||
{
|
||||
private UniversalType selectiontype;
|
||||
private int selectioncount;
|
||||
Dictionary<int, bool> usedtags;
|
||||
|
||||
public int SelectionCount { get { return selectioncount; } }
|
||||
|
||||
// Constructor
|
||||
public TagRangeForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
// This sets up the form
|
||||
public void Setup()
|
||||
{
|
||||
General.Map.Map.ClearAllMarks(false);
|
||||
|
||||
string modename = General.Editing.Mode.GetType().Name;
|
||||
if(modename == "SectorsMode")
|
||||
{
|
||||
selectiontype = UniversalType.SectorTag;
|
||||
ICollection<Sector> list = General.Map.Map.GetSelectedSectors(true);
|
||||
selectioncount = list.Count;
|
||||
}
|
||||
else if(modename == "LinedefsMode")
|
||||
{
|
||||
selectiontype = UniversalType.LinedefTag;
|
||||
ICollection<Linedef> list = General.Map.Map.GetSelectedLinedefs(true);
|
||||
selectioncount = list.Count;
|
||||
}
|
||||
else if(modename == "ThingsMode")
|
||||
{
|
||||
selectiontype = UniversalType.ThingTag;
|
||||
ICollection<Thing> list = General.Map.Map.GetSelectedThings(true);
|
||||
selectioncount = list.Count;
|
||||
}
|
||||
|
||||
// Show number of selected items
|
||||
itemcountlabel.Text = selectioncount.ToString();
|
||||
|
||||
// Find out which tags are used
|
||||
usedtags = new Dictionary<int, bool>();
|
||||
General.Map.Map.ForAllTags(TagHandler, false, usedtags);
|
||||
|
||||
// Find the first unused tag to use as range start
|
||||
int starttag = General.Map.Map.GetNewTag();
|
||||
rangestart.Text = starttag.ToString();
|
||||
}
|
||||
|
||||
// Handler for finding a new tag
|
||||
private void TagHandler(MapElement element, bool actionargument, UniversalType type, ref int value, Dictionary<int, bool> usedtags)
|
||||
{
|
||||
usedtags[value] = true;
|
||||
}
|
||||
|
||||
// This creates a range
|
||||
private List<int> CreateRange(int starttag, bool skipusedtags, out bool tagsused, out bool outoftags)
|
||||
{
|
||||
List<int> newtags = new List<int>(selectioncount);
|
||||
outoftags = false;
|
||||
tagsused = false;
|
||||
|
||||
// Go for the number of tags we need
|
||||
for(int i = 0; i < selectioncount; i++)
|
||||
{
|
||||
if(starttag > General.Map.FormatInterface.MaxTag)
|
||||
{
|
||||
outoftags = true;
|
||||
return newtags;
|
||||
}
|
||||
|
||||
if(skipusedtags)
|
||||
{
|
||||
// Find next unused tag
|
||||
while(usedtags.ContainsKey(starttag))
|
||||
{
|
||||
if(starttag == General.Map.FormatInterface.MaxTag)
|
||||
{
|
||||
outoftags = true;
|
||||
return newtags;
|
||||
}
|
||||
|
||||
starttag++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tagsused |= usedtags.ContainsKey(starttag);
|
||||
}
|
||||
|
||||
newtags.Add(starttag);
|
||||
|
||||
if(starttag < General.Map.FormatInterface.MaxTag)
|
||||
starttag++;
|
||||
}
|
||||
|
||||
return newtags;
|
||||
}
|
||||
|
||||
// This updates the calculated range
|
||||
private void UpdateChanges()
|
||||
{
|
||||
bool outoftags, tagsused;
|
||||
int starttag = rangestart.GetResult(0);
|
||||
|
||||
List<int> tags = CreateRange(starttag, false, out tagsused, out outoftags);
|
||||
|
||||
outoftagswarning.Visible = outoftags;
|
||||
doubletagwarning.Visible = tagsused && !outoftags;
|
||||
skipdoubletags.Visible = tagsused && !outoftags;
|
||||
|
||||
tags = CreateRange(starttag, skipdoubletags.Checked, out tagsused, out outoftags);
|
||||
|
||||
if(tags.Count > 0)
|
||||
endtaglabel.Text = tags[tags.Count - 1].ToString();
|
||||
}
|
||||
|
||||
// Range start changes
|
||||
private void rangestart_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateChanges();
|
||||
}
|
||||
|
||||
// OK clicked
|
||||
private void okbutton_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool outoftags, tagsused;
|
||||
int starttag = rangestart.GetResult(0);
|
||||
|
||||
List<int> tags = CreateRange(starttag, skipdoubletags.Checked, out tagsused, out outoftags);
|
||||
|
||||
if(outoftags)
|
||||
{
|
||||
General.ShowWarningMessage("The range exceeds the maximum allowed tags and cannot be created.", MessageBoxButtons.OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Apply tags!
|
||||
if(selectiontype == UniversalType.SectorTag)
|
||||
{
|
||||
General.Map.UndoRedo.CreateUndo("Set " + selectioncount + " sector tags");
|
||||
ICollection<Sector> list = General.Map.Map.GetSelectedSectors(true);
|
||||
int index = 0;
|
||||
foreach(Sector s in list)
|
||||
s.Tag = tags[index++];
|
||||
}
|
||||
else if(selectiontype == UniversalType.LinedefTag)
|
||||
{
|
||||
General.Map.UndoRedo.CreateUndo("Set " + selectioncount + " linedef tags");
|
||||
ICollection<Linedef> list = General.Map.Map.GetSelectedLinedefs(true);
|
||||
int index = 0;
|
||||
foreach(Linedef l in list)
|
||||
l.Tag = tags[index++];
|
||||
}
|
||||
else if(selectiontype == UniversalType.ThingTag)
|
||||
{
|
||||
General.Map.UndoRedo.CreateUndo("Set " + selectioncount + " thing tags");
|
||||
ICollection<Thing> list = General.Map.Map.GetSelectedThings(true);
|
||||
int index = 0;
|
||||
foreach(Thing t in list)
|
||||
t.Tag = tags[index++];
|
||||
}
|
||||
}
|
||||
|
||||
this.Close();
|
||||
}
|
||||
|
||||
// Cancel clicked
|
||||
private void cancelbutton_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
// Skip over used tags changed
|
||||
private void skipdoubletags_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
156
Source/Plugins/TagRange/TagRangeForm.resx
Normal file
156
Source/Plugins/TagRange/TagRangeForm.resx
Normal file
|
@ -0,0 +1,156 @@
|
|||
<?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>
|
||||
<metadata name="rangestart.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label2.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="itemcountlabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="doubletagwarning.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="skipdoubletags.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="okbutton.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="cancelbutton.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="outoftagswarning.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="endtaglabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label4.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
99
Source/Plugins/TagRange/ToolsForm.Designer.cs
generated
Normal file
99
Source/Plugins/TagRange/ToolsForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,99 @@
|
|||
namespace CodeImp.DoomBuilder.TagRange
|
||||
{
|
||||
partial class ToolsForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if(disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.toolstrip = new System.Windows.Forms.ToolStrip();
|
||||
this.tagrangebutton = new System.Windows.Forms.ToolStripButton();
|
||||
this.seperator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.seperator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.toolstrip.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// toolstrip
|
||||
//
|
||||
this.toolstrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.seperator1,
|
||||
this.tagrangebutton,
|
||||
this.seperator2});
|
||||
this.toolstrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.toolstrip.Name = "toolstrip";
|
||||
this.toolstrip.Size = new System.Drawing.Size(330, 25);
|
||||
this.toolstrip.TabIndex = 0;
|
||||
this.toolstrip.Text = "toolStrip1";
|
||||
//
|
||||
// tagrangebutton
|
||||
//
|
||||
this.tagrangebutton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.tagrangebutton.Image = global::CodeImp.DoomBuilder.TagRange.Properties.Resources.tag_blue;
|
||||
this.tagrangebutton.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.tagrangebutton.Name = "tagrangebutton";
|
||||
this.tagrangebutton.Size = new System.Drawing.Size(23, 22);
|
||||
this.tagrangebutton.Tag = "rangetagselectedsectors";
|
||||
this.tagrangebutton.Text = "Tag Range";
|
||||
this.tagrangebutton.Click += new System.EventHandler(this.InvokeTaggedAction);
|
||||
//
|
||||
// seperator2
|
||||
//
|
||||
this.seperator2.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.seperator2.Name = "seperator2";
|
||||
this.seperator2.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
// seperator1
|
||||
//
|
||||
this.seperator1.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.seperator1.Name = "seperator1";
|
||||
this.seperator1.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
// ToolsForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.ClientSize = new System.Drawing.Size(330, 230);
|
||||
this.Controls.Add(this.toolstrip);
|
||||
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.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ToolsForm";
|
||||
this.Text = "Tag Range";
|
||||
this.toolstrip.ResumeLayout(false);
|
||||
this.toolstrip.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ToolStrip toolstrip;
|
||||
private System.Windows.Forms.ToolStripButton tagrangebutton;
|
||||
private System.Windows.Forms.ToolStripSeparator seperator2;
|
||||
private System.Windows.Forms.ToolStripSeparator seperator1;
|
||||
}
|
||||
}
|
55
Source/Plugins/TagRange/ToolsForm.cs
Normal file
55
Source/Plugins/TagRange/ToolsForm.cs
Normal file
|
@ -0,0 +1,55 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.IO;
|
||||
|
||||
namespace CodeImp.DoomBuilder.TagRange
|
||||
{
|
||||
public partial class ToolsForm : Form
|
||||
{
|
||||
bool buttonontoolbar;
|
||||
|
||||
// Constructor
|
||||
public ToolsForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
buttonontoolbar = false;
|
||||
}
|
||||
|
||||
// This invokes an action from control event
|
||||
private void InvokeTaggedAction(object sender, EventArgs e)
|
||||
{
|
||||
General.Interface.InvokeTaggedAction(sender, e);
|
||||
}
|
||||
|
||||
// This adds or removes the button from the DB toolbar
|
||||
public void UpdateButton()
|
||||
{
|
||||
if(buttonontoolbar)
|
||||
{
|
||||
General.Interface.RemoveButton(seperator1);
|
||||
General.Interface.RemoveButton(tagrangebutton);
|
||||
General.Interface.RemoveButton(seperator2);
|
||||
buttonontoolbar = false;
|
||||
}
|
||||
|
||||
if(General.Editing.Mode == null)
|
||||
return;
|
||||
|
||||
string modename = General.Editing.Mode.GetType().Name;
|
||||
IMapSetIO mapset = General.Map.FormatInterface;
|
||||
if((modename == "SectorsMode") ||
|
||||
((modename == "LinedefsMode") && mapset.HasLinedefTag) ||
|
||||
((modename == "ThingsMode") && mapset.HasThingTag))
|
||||
{
|
||||
General.Interface.AddButton(seperator1);
|
||||
General.Interface.AddButton(tagrangebutton);
|
||||
General.Interface.AddButton(seperator2);
|
||||
buttonontoolbar = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
123
Source/Plugins/TagRange/ToolsForm.resx
Normal file
123
Source/Plugins/TagRange/ToolsForm.resx
Normal file
|
@ -0,0 +1,123 @@
|
|||
<?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>
|
||||
<metadata name="toolstrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
Loading…
Reference in a new issue