mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 14:31:50 +00:00
Added "Go To Coordinates" action (available in "View" menu and via Ctrl-Shift-G shortcut). It will center the view on given coordinates in classic modes and place camera at given coordinates in visual mode.
This commit is contained in:
parent
2787034d1d
commit
8229cb8b71
16 changed files with 427 additions and 45 deletions
|
@ -812,6 +812,12 @@
|
|||
<Compile Include="Types\ThingClassHandler.cs" />
|
||||
<Compile Include="Types\ThingTypeHandler.cs" />
|
||||
<Compile Include="VisualModes\VisualVertex.cs" />
|
||||
<Compile Include="Windows\CenterOnCoordinatesForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Windows\CenterOnCoordinatesForm.Designer.cs">
|
||||
<DependentUpon>CenterOnCoordinatesForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\ChangeMapForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
@ -1059,6 +1065,9 @@
|
|||
<SubType>Designer</SubType>
|
||||
<DependentUpon>BitFlagsForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Windows\CenterOnCoordinatesForm.resx">
|
||||
<DependentUpon>CenterOnCoordinatesForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Windows\ChangeMapForm.resx">
|
||||
<DependentUpon>ChangeMapForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
|
|
@ -360,9 +360,9 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
area.Inflate(area.Width * padding, area.Height * padding);
|
||||
|
||||
// Calculate scale to view map at
|
||||
scalew = (float)General.Map.Graphics.RenderTarget.ClientSize.Width / area.Width;
|
||||
scaleh = (float)General.Map.Graphics.RenderTarget.ClientSize.Height / area.Height;
|
||||
if(scalew < scaleh) scale = scalew; else scale = scaleh;
|
||||
scalew = General.Map.Graphics.RenderTarget.ClientSize.Width / area.Width;
|
||||
scaleh = General.Map.Graphics.RenderTarget.ClientSize.Height / area.Height;
|
||||
scale = scalew < scaleh ? scalew : scaleh;
|
||||
|
||||
// Change the view to see the whole map
|
||||
renderer2d.ScaleView(scale);
|
||||
|
@ -850,6 +850,18 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
SetViewMode(ViewMode.CeilingTextures);
|
||||
}
|
||||
|
||||
//mxd
|
||||
[BeginAction("centeroncoordinates", BaseAction = true)]
|
||||
protected virtual void CenterOnCoordinates() {
|
||||
//show form...
|
||||
CenterOnCoordinatesForm form = new CenterOnCoordinatesForm();
|
||||
if (form.ShowDialog() == DialogResult.OK) {
|
||||
//center view
|
||||
renderer2d.PositionView(form.Coordinates.x, form.Coordinates.y);
|
||||
General.Interface.RedrawDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
|
|
@ -1022,6 +1022,17 @@ toggleinfopanel
|
|||
allowscroll = false;
|
||||
}
|
||||
|
||||
centeroncoordinates
|
||||
{
|
||||
title = "Go To Coordinates";
|
||||
category = "view";
|
||||
description = "Centers the view on given map coordinates.";
|
||||
allowkeys = true;
|
||||
allowmouse = false;
|
||||
allowscroll = false;
|
||||
default = 196679; //Ctrl-Shift-G
|
||||
}
|
||||
|
||||
showerrors
|
||||
{
|
||||
title = "Show Errors and Warnings";
|
||||
|
|
|
@ -114,7 +114,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
modething.DetermineSector();
|
||||
float z = modething.Position.z;
|
||||
if(modething.Sector != null)
|
||||
z = modething.Position.z + (float)modething.Sector.FloorHeight;
|
||||
z = modething.Position.z + modething.Sector.FloorHeight;
|
||||
|
||||
// Position camera here
|
||||
Vector3D wantedposition = new Vector3D(modething.Position.x, modething.Position.y, z + THING_Z_OFFSET);
|
||||
|
@ -130,10 +130,8 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// This applies the camera position and angle to the 3D Camera Thing
|
||||
|
@ -158,10 +156,8 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
modething.Rotate(anglexy - Angle2D.PI);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//mxd
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
|
@ -1108,6 +1109,23 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
|
||||
#region ================== Actions
|
||||
|
||||
//mxd
|
||||
[BeginAction("centeroncoordinates", BaseAction = true)]
|
||||
protected virtual void CenterOnCoordinates() {
|
||||
//show form...
|
||||
CenterOnCoordinatesForm form = new CenterOnCoordinatesForm();
|
||||
if(form.ShowDialog() == DialogResult.OK) {
|
||||
Sector s = General.Map.Map.GetSectorByCoordinates(form.Coordinates);
|
||||
|
||||
if (s == null) {
|
||||
General.Map.VisualCamera.Position = form.Coordinates;
|
||||
} else {
|
||||
General.Map.VisualCamera.Position = new Vector3D(form.Coordinates.x, form.Coordinates.y, s.FloorHeight + 54);
|
||||
}
|
||||
General.Map.VisualCamera.Sector = s;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
134
Source/Core/Windows/CenterOnCoordinatesForm.Designer.cs
generated
Normal file
134
Source/Core/Windows/CenterOnCoordinatesForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,134 @@
|
|||
namespace CodeImp.DoomBuilder.Windows
|
||||
{
|
||||
partial class CenterOnCoordinatesForm
|
||||
{
|
||||
/// <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.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.accept = new System.Windows.Forms.Button();
|
||||
this.cancel = new System.Windows.Forms.Button();
|
||||
this.gotoy = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
|
||||
this.gotox = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 17);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(17, 14);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "X:";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(12, 47);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(17, 14);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "Y:";
|
||||
//
|
||||
// accept
|
||||
//
|
||||
this.accept.Location = new System.Drawing.Point(109, 12);
|
||||
this.accept.Name = "accept";
|
||||
this.accept.Size = new System.Drawing.Size(65, 24);
|
||||
this.accept.TabIndex = 2;
|
||||
this.accept.Text = "OK";
|
||||
this.accept.UseVisualStyleBackColor = true;
|
||||
this.accept.Click += new System.EventHandler(this.accept_Click);
|
||||
//
|
||||
// cancel
|
||||
//
|
||||
this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancel.Location = new System.Drawing.Point(109, 42);
|
||||
this.cancel.Name = "cancel";
|
||||
this.cancel.Size = new System.Drawing.Size(65, 24);
|
||||
this.cancel.TabIndex = 3;
|
||||
this.cancel.Text = "Cancel";
|
||||
this.cancel.UseVisualStyleBackColor = true;
|
||||
this.cancel.Click += new System.EventHandler(this.cancel_Click);
|
||||
//
|
||||
// gotoy
|
||||
//
|
||||
this.gotoy.AllowDecimal = false;
|
||||
this.gotoy.AllowNegative = true;
|
||||
this.gotoy.AllowRelative = false;
|
||||
this.gotoy.ButtonStep = 1;
|
||||
this.gotoy.ButtonStepFloat = 1F;
|
||||
this.gotoy.Location = new System.Drawing.Point(32, 42);
|
||||
this.gotoy.Name = "gotoy";
|
||||
this.gotoy.Size = new System.Drawing.Size(71, 24);
|
||||
this.gotoy.StepValues = null;
|
||||
this.gotoy.TabIndex = 1;
|
||||
//
|
||||
// gotox
|
||||
//
|
||||
this.gotox.AllowDecimal = false;
|
||||
this.gotox.AllowNegative = true;
|
||||
this.gotox.AllowRelative = false;
|
||||
this.gotox.ButtonStep = 1;
|
||||
this.gotox.ButtonStepFloat = 1F;
|
||||
this.gotox.Location = new System.Drawing.Point(32, 12);
|
||||
this.gotox.Name = "gotox";
|
||||
this.gotox.Size = new System.Drawing.Size(71, 24);
|
||||
this.gotox.StepValues = null;
|
||||
this.gotox.TabIndex = 0;
|
||||
//
|
||||
// CenterOnCoordinatesForm
|
||||
//
|
||||
this.AcceptButton = this.accept;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.CancelButton = this.cancel;
|
||||
this.ClientSize = new System.Drawing.Size(184, 74);
|
||||
this.Controls.Add(this.cancel);
|
||||
this.Controls.Add(this.accept);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.gotoy);
|
||||
this.Controls.Add(this.gotox);
|
||||
this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "CenterOnCoordinatesForm";
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Go To Coordinates:";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox gotox;
|
||||
private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox gotoy;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button accept;
|
||||
private System.Windows.Forms.Button cancel;
|
||||
}
|
||||
}
|
31
Source/Core/Windows/CenterOnCoordinatesForm.cs
Normal file
31
Source/Core/Windows/CenterOnCoordinatesForm.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
|
||||
namespace CodeImp.DoomBuilder.Windows
|
||||
{
|
||||
public partial class CenterOnCoordinatesForm : Form
|
||||
{
|
||||
private static Vector2D coordinates;
|
||||
public Vector2D Coordinates { get { return coordinates; } }
|
||||
|
||||
public CenterOnCoordinatesForm() {
|
||||
InitializeComponent();
|
||||
gotox.Text = coordinates.x.ToString();
|
||||
gotoy.Text = coordinates.y.ToString();
|
||||
}
|
||||
|
||||
private void accept_Click(object sender, EventArgs e) {
|
||||
coordinates.x = (float)Math.Round(General.Clamp(gotox.GetResult((int)coordinates.x), General.Map.FormatInterface.MinCoordinate, General.Map.FormatInterface.MaxCoordinate));
|
||||
coordinates.y = (float)Math.Round(General.Clamp(gotoy.GetResult((int)coordinates.y), General.Map.FormatInterface.MinCoordinate, General.Map.FormatInterface.MaxCoordinate));
|
||||
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void cancel_Click(object sender, EventArgs e) {
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
120
Source/Core/Windows/CenterOnCoordinatesForm.resx
Normal file
120
Source/Core/Windows/CenterOnCoordinatesForm.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
47
Source/Core/Windows/MainForm.Designer.cs
generated
47
Source/Core/Windows/MainForm.Designer.cs
generated
|
@ -190,6 +190,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.seperatorviews = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.buttonsnaptogrid = new System.Windows.Forms.ToolStripButton();
|
||||
this.buttonautomerge = new System.Windows.Forms.ToolStripButton();
|
||||
this.buttonautoclearsidetextures = new System.Windows.Forms.ToolStripButton();
|
||||
this.seperatorgeometry = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.buttontogglefx = new System.Windows.Forms.ToolStripButton();
|
||||
this.buttontoggledynlight = new System.Windows.Forms.ToolStripButton();
|
||||
|
@ -248,7 +249,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.dockersspace = new System.Windows.Forms.Panel();
|
||||
this.dockerspanel = new CodeImp.DoomBuilder.Controls.DockersControl();
|
||||
this.dockerscollapser = new System.Windows.Forms.Timer(this.components);
|
||||
this.buttonautoclearsidetextures = new System.Windows.Forms.ToolStripButton();
|
||||
this.menugotocoords = new System.Windows.Forms.ToolStripMenuItem();
|
||||
toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
|
||||
toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator();
|
||||
|
@ -960,6 +961,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.itemviewceilings,
|
||||
this.seperatorviewviews,
|
||||
this.menuzoom,
|
||||
this.menugotocoords,
|
||||
this.itemfittoscreen,
|
||||
this.itemtoggleinfo,
|
||||
this.seperatorviewzoom,
|
||||
|
@ -1041,7 +1043,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// item2zoom200
|
||||
//
|
||||
this.item2zoom200.Name = "item2zoom200";
|
||||
this.item2zoom200.Size = new System.Drawing.Size(102, 22);
|
||||
this.item2zoom200.Size = new System.Drawing.Size(152, 22);
|
||||
this.item2zoom200.Tag = "200";
|
||||
this.item2zoom200.Text = "200%";
|
||||
this.item2zoom200.Click += new System.EventHandler(this.itemzoomto_Click);
|
||||
|
@ -1049,7 +1051,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// item2zoom100
|
||||
//
|
||||
this.item2zoom100.Name = "item2zoom100";
|
||||
this.item2zoom100.Size = new System.Drawing.Size(102, 22);
|
||||
this.item2zoom100.Size = new System.Drawing.Size(152, 22);
|
||||
this.item2zoom100.Tag = "100";
|
||||
this.item2zoom100.Text = "100%";
|
||||
this.item2zoom100.Click += new System.EventHandler(this.itemzoomto_Click);
|
||||
|
@ -1057,7 +1059,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// item2zoom50
|
||||
//
|
||||
this.item2zoom50.Name = "item2zoom50";
|
||||
this.item2zoom50.Size = new System.Drawing.Size(102, 22);
|
||||
this.item2zoom50.Size = new System.Drawing.Size(152, 22);
|
||||
this.item2zoom50.Tag = "50";
|
||||
this.item2zoom50.Text = "50%";
|
||||
this.item2zoom50.Click += new System.EventHandler(this.itemzoomto_Click);
|
||||
|
@ -1065,7 +1067,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// item2zoom25
|
||||
//
|
||||
this.item2zoom25.Name = "item2zoom25";
|
||||
this.item2zoom25.Size = new System.Drawing.Size(102, 22);
|
||||
this.item2zoom25.Size = new System.Drawing.Size(152, 22);
|
||||
this.item2zoom25.Tag = "25";
|
||||
this.item2zoom25.Text = "25%";
|
||||
this.item2zoom25.Click += new System.EventHandler(this.itemzoomto_Click);
|
||||
|
@ -1073,7 +1075,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// item2zoom10
|
||||
//
|
||||
this.item2zoom10.Name = "item2zoom10";
|
||||
this.item2zoom10.Size = new System.Drawing.Size(102, 22);
|
||||
this.item2zoom10.Size = new System.Drawing.Size(152, 22);
|
||||
this.item2zoom10.Tag = "10";
|
||||
this.item2zoom10.Text = "10%";
|
||||
this.item2zoom10.Click += new System.EventHandler(this.itemzoomto_Click);
|
||||
|
@ -1081,7 +1083,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// item2zoom5
|
||||
//
|
||||
this.item2zoom5.Name = "item2zoom5";
|
||||
this.item2zoom5.Size = new System.Drawing.Size(102, 22);
|
||||
this.item2zoom5.Size = new System.Drawing.Size(152, 22);
|
||||
this.item2zoom5.Tag = "5";
|
||||
this.item2zoom5.Text = "5%";
|
||||
this.item2zoom5.Click += new System.EventHandler(this.itemzoomto_Click);
|
||||
|
@ -1709,6 +1711,19 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.buttonautomerge.Text = "Merge Geometry";
|
||||
this.buttonautomerge.Click += new System.EventHandler(this.InvokeTaggedAction);
|
||||
//
|
||||
// buttonautoclearsidetextures
|
||||
//
|
||||
this.buttonautoclearsidetextures.Checked = true;
|
||||
this.buttonautoclearsidetextures.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.buttonautoclearsidetextures.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.buttonautoclearsidetextures.Image = global::CodeImp.DoomBuilder.Properties.Resources.ClearTextures;
|
||||
this.buttonautoclearsidetextures.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.buttonautoclearsidetextures.Name = "buttonautoclearsidetextures";
|
||||
this.buttonautoclearsidetextures.Size = new System.Drawing.Size(23, 22);
|
||||
this.buttonautoclearsidetextures.Tag = "builder_toggleautoclearsidetextures";
|
||||
this.buttonautoclearsidetextures.Text = "Auto Clear Sidedef Textures";
|
||||
this.buttonautoclearsidetextures.Click += new System.EventHandler(this.InvokeTaggedAction);
|
||||
//
|
||||
// seperatorgeometry
|
||||
//
|
||||
this.seperatorgeometry.Name = "seperatorgeometry";
|
||||
|
@ -2310,18 +2325,13 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.dockerscollapser.Interval = 200;
|
||||
this.dockerscollapser.Tick += new System.EventHandler(this.dockerscollapser_Tick);
|
||||
//
|
||||
// buttonautoclearsidetextures
|
||||
// menugotocoords
|
||||
//
|
||||
this.buttonautoclearsidetextures.Checked = true;
|
||||
this.buttonautoclearsidetextures.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.buttonautoclearsidetextures.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.buttonautoclearsidetextures.Image = global::CodeImp.DoomBuilder.Properties.Resources.ClearTextures;
|
||||
this.buttonautoclearsidetextures.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.buttonautoclearsidetextures.Name = "buttonautoclearsidetextures";
|
||||
this.buttonautoclearsidetextures.Size = new System.Drawing.Size(23, 22);
|
||||
this.buttonautoclearsidetextures.Tag = "builder_toggleautoclearsidetextures";
|
||||
this.buttonautoclearsidetextures.Text = "Auto Clear Sidedef Textures";
|
||||
this.buttonautoclearsidetextures.Click += new System.EventHandler(this.InvokeTaggedAction);
|
||||
this.menugotocoords.Name = "menugotocoords";
|
||||
this.menugotocoords.Size = new System.Drawing.Size(209, 22);
|
||||
this.menugotocoords.Tag = "builder_centeroncoordinates";
|
||||
this.menugotocoords.Text = "Go To Coordinates...";
|
||||
this.menugotocoords.Click += new System.EventHandler(this.InvokeTaggedAction);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
|
@ -2579,5 +2589,6 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
private System.Windows.Forms.Label modename;
|
||||
private System.Windows.Forms.ToolStripMenuItem itemautoclearsidetextures;
|
||||
private System.Windows.Forms.ToolStripButton buttonautoclearsidetextures;
|
||||
private System.Windows.Forms.ToolStripMenuItem menugotocoords;
|
||||
}
|
||||
}
|
|
@ -2470,6 +2470,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
itemscripteditor.Enabled = (General.Map != null);
|
||||
itemfittoscreen.Enabled = (General.Map != null);
|
||||
menuzoom.Enabled = (General.Map != null);
|
||||
menugotocoords.Enabled = (General.Map != null); //mxd
|
||||
itemtoggleinfo.Checked = IsInfoPanelExpanded;
|
||||
|
||||
// View mode items
|
||||
|
|
|
@ -154,18 +154,18 @@
|
|||
<data name="buttontogglemodels.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABcSURBVDhPY2AYBUMoBNyzl/8HORdGk+x0kMb8wvImGE19
|
||||
A0AmI2OYDchiOF2A7jxkPsggZI1YvYDPAJBmWOCR7AKYRpg3YAZgjQmYTeg0zAsgcWQ5GJvk2KC6BgDp
|
||||
BYcfucB8fQAAAABJRU5ErkJggg==
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABaSURBVDhPYxgFQwm4Zy//j0yTDEAa8wvLm2A0VJh4QNAA
|
||||
kAQyhgqjiOM0AF0SmQbJY5MDa4QBbBrRFWMTgwNCGmEYJgfCYI3IAKYBnQYBEBuGkflgyQEGDAwA6QWH
|
||||
HxoHRHkAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="buttonselectedmodelsonly.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAClSURBVDhPY2CgJnjdLnGRFIxiN0wjMQ7CUAsSAGmE0fgM
|
||||
wVD7rkP6KykYZjjcMpBmDEEcTsCqllgD5igq/gepBdEo3iXFgKf1kr9ABuQXljeR7AWQRrwGgBQgY1gw
|
||||
IIvhNADmLGw0yCCQk/G6AJ8BIM0gQwgasLzG/wW6QTCNMG/AvACLCbA3QbEAClGYTeg0zAsgcZABMLUw
|
||||
dWADSMHE5BWS1AAACnwkE01c7eYAAAAASUVORK5CYII=
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACWSURBVDhPY6AqeN0ucZEUDNUGAVgFcQAMtTAOMQZgqH3X
|
||||
If2VFAzWBAQoBoAZQEDIBRQZMEdR8T9ILYgG8cky4Gm95C8QnV9Y3kR9A0ASyBgsCQTIYjgNgAlio0Fq
|
||||
YGyyDADRIHUgNl4Dltf4v8ClEYZhBoAwWDMIgAwAmQbTgE6DAIgNwiADYGrh8iADSMFgTdQDDAwACnwk
|
||||
E7rnlAUAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="statusbar.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
|
|
|
@ -97,10 +97,10 @@ namespace CodeImp.DoomBuilder.BuilderModes.ClassicModes {
|
|||
|
||||
//show form
|
||||
form = new BridgeModeForm();
|
||||
form.OnCancelClick += new EventHandler(form_OnCancelClick);
|
||||
form.OnOkClick += new EventHandler(form_OnOkClick);
|
||||
form.OnFlipClick += new EventHandler(form_OnFlipClick);
|
||||
form.OnSubdivisionChanged += new EventHandler(form_OnSubdivisionChanged);
|
||||
form.OnCancelClick += form_OnCancelClick;
|
||||
form.OnOkClick += form_OnOkClick;
|
||||
form.OnFlipClick += form_OnFlipClick;
|
||||
form.OnSubdivisionChanged += form_OnSubdivisionChanged;
|
||||
form.Show(Form.ActiveForm);
|
||||
General.Interface.FocusDisplay();
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
using System;
|
||||
#region ================== Namespaces
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
@ -9,6 +11,8 @@ using CodeImp.DoomBuilder.Map;
|
|||
using CodeImp.DoomBuilder.Rendering;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace CodeImp.DoomBuilder.BuilderModes
|
||||
{
|
||||
[EditMode(DisplayName = "Draw Curve Mode",
|
||||
|
@ -19,12 +23,18 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
public class DrawCurveMode : DrawGeometryMode
|
||||
{
|
||||
#region ================== Variables
|
||||
|
||||
private HintLabel hintLabel;
|
||||
private Curve curve;
|
||||
private static int segmentLength = 32;
|
||||
private int minSegmentLength = 16;
|
||||
private int maxSegmentLength = 4096; //just some arbitrary number
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor/Disposer
|
||||
|
||||
public DrawCurveMode() {
|
||||
hintLabel = new HintLabel();
|
||||
}
|
||||
|
@ -36,6 +46,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
base.Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Methods
|
||||
|
||||
protected override void Update() {
|
||||
PixelColor stitchcolor = General.Colors.Highlight;
|
||||
PixelColor losecolor = General.Colors.Selection;
|
||||
|
@ -45,8 +59,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
snaptonearest = General.Interface.CtrlState ^ General.Interface.AutoMerge;
|
||||
|
||||
DrawnVertex curp = GetCurrentPosition();
|
||||
float vsize = ((float)renderer.VertexSize + 1.0f) / renderer.Scale;
|
||||
float vsizeborder = ((float)renderer.VertexSize + 3.0f) / renderer.Scale;
|
||||
float vsize = (renderer.VertexSize + 1.0f) / renderer.Scale;
|
||||
|
||||
// The last label's end must go to the mouse cursor
|
||||
if(labels.Count > 0)
|
||||
|
@ -121,6 +134,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
renderer.Present();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Events
|
||||
|
||||
public override void OnAccept() {
|
||||
Cursor.Current = Cursors.AppStarting;
|
||||
|
||||
|
@ -217,7 +234,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
General.Editing.ChangeMode(General.Editing.PreviousStableMode.Name);
|
||||
}
|
||||
|
||||
//ACTIONS
|
||||
public override void OnHelp() {
|
||||
General.ShowHelp("/gzdb/features/classic_modes/mode_drawcurve.html");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Actions
|
||||
|
||||
[BeginAction("increasesubdivlevel")]
|
||||
protected virtual void increaseSubdivLevel() {
|
||||
if(segmentLength < maxSegmentLength) {
|
||||
|
@ -241,5 +265,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
Update();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,6 +118,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
Update();
|
||||
}
|
||||
|
||||
public override void OnHelp() {
|
||||
General.ShowHelp("/gzdb/features/classic_modes/mode_drawellipse.html");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Actions
|
||||
|
|
|
@ -139,6 +139,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
General.Editing.ChangeMode(General.Editing.PreviousStableMode.Name);
|
||||
}
|
||||
|
||||
public override void OnHelp() {
|
||||
General.ShowHelp("/gzdb/features/classic_modes/mode_drawgrid.html");
|
||||
}
|
||||
|
||||
private void OptionsPanelOnValueChanged(object sender, EventArgs eventArgs) {
|
||||
triangulate = panel.Triangulate;
|
||||
horizontalSlices = panel.HorizontalSlices + 1;
|
||||
|
|
|
@ -352,6 +352,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
General.Editing.ChangeMode(General.Editing.PreviousStableMode.Name);
|
||||
}
|
||||
|
||||
public override void OnHelp() {
|
||||
General.ShowHelp("/gzdb/features/classic_modes/mode_drawrect.html");
|
||||
}
|
||||
|
||||
private void OptionsPanelOnValueChanged(object sender, EventArgs eventArgs) {
|
||||
bevelWidth = panel.BevelWidth;
|
||||
subdivisions = panel.Subdivisions;
|
||||
|
|
Loading…
Reference in a new issue