Info panels: thing and sector flags are now displayed.

Visual mode: changed "Move Texture Left/Right/Up/Down by 8" actions to "Move Texture Left/Right/Up/Down by cur. grid size"
Visual mode: holding Ctrl-Shift while dragging texture with the mouse will snap texture offsets to current grid size.
Classic modes: interiors of highlighted sectors are now highlighted when the action target of currently highlighted map element is sector.
Unhandeled exceptions infos are now written to the event log.
This commit is contained in:
MaxED 2013-12-05 09:24:55 +00:00
parent 44bf0b9588
commit ca03109006
22 changed files with 655 additions and 536 deletions

View file

@ -72,6 +72,8 @@ namespace CodeImp.DoomBuilder.Controls
this.floortex = new System.Windows.Forms.Panel();
this.labelFloorTextureSize = new System.Windows.Forms.Label();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.flagsPanel = new System.Windows.Forms.GroupBox();
this.flags = new System.Windows.Forms.ListView();
label13 = new System.Windows.Forms.Label();
label5 = new System.Windows.Forms.Label();
label4 = new System.Windows.Forms.Label();
@ -86,6 +88,7 @@ namespace CodeImp.DoomBuilder.Controls
this.floorInfo.SuspendLayout();
this.floortex.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.flagsPanel.SuspendLayout();
this.SuspendLayout();
//
// label13
@ -378,7 +381,7 @@ namespace CodeImp.DoomBuilder.Controls
this.ceilingInfo.Controls.Add(this.ceilingAngleLabel);
this.ceilingInfo.Controls.Add(this.ceilingScaleLabel);
this.ceilingInfo.Controls.Add(this.ceilingAngle);
this.ceilingInfo.Location = new System.Drawing.Point(82, 15);
this.ceilingInfo.Location = new System.Drawing.Point(80, 15);
this.ceilingInfo.Name = "ceilingInfo";
this.ceilingInfo.Size = new System.Drawing.Size(118, 80);
this.ceilingInfo.TabIndex = 2;
@ -439,7 +442,7 @@ namespace CodeImp.DoomBuilder.Controls
this.floorInfo.Controls.Add(this.floorAngleLabel);
this.floorInfo.Controls.Add(this.floorScaleLabel);
this.floorInfo.Controls.Add(this.floorAngle);
this.floorInfo.Location = new System.Drawing.Point(82, 15);
this.floorInfo.Location = new System.Drawing.Point(80, 15);
this.floorInfo.Name = "floorInfo";
this.floorInfo.Size = new System.Drawing.Size(118, 80);
this.floorInfo.TabIndex = 30;
@ -514,13 +517,40 @@ namespace CodeImp.DoomBuilder.Controls
this.flowLayoutPanel1.Controls.Add(this.sectorinfo);
this.flowLayoutPanel1.Controls.Add(this.floorpanel);
this.flowLayoutPanel1.Controls.Add(this.ceilingpanel);
this.flowLayoutPanel1.Controls.Add(this.flagsPanel);
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(642, 100);
this.flowLayoutPanel1.Size = new System.Drawing.Size(1090, 100);
this.flowLayoutPanel1.TabIndex = 5;
this.flowLayoutPanel1.WrapContents = false;
//
// flagsPanel
//
this.flagsPanel.Controls.Add(this.flags);
this.flagsPanel.Location = new System.Drawing.Point(629, 0);
this.flagsPanel.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
this.flagsPanel.Name = "flagsPanel";
this.flagsPanel.Size = new System.Drawing.Size(455, 100);
this.flagsPanel.TabIndex = 7;
this.flagsPanel.TabStop = false;
this.flagsPanel.Text = " Flags";
//
// flags
//
this.flags.BackColor = System.Drawing.SystemColors.Control;
this.flags.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.flags.CheckBoxes = true;
this.flags.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.flags.Location = new System.Drawing.Point(6, 18);
this.flags.Name = "flags";
this.flags.Scrollable = false;
this.flags.ShowGroups = false;
this.flags.Size = new System.Drawing.Size(443, 100);
this.flags.TabIndex = 0;
this.flags.UseCompatibleStateImageBehavior = false;
this.flags.View = System.Windows.Forms.View.List;
//
// SectorInfoPanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
@ -530,7 +560,7 @@ namespace CodeImp.DoomBuilder.Controls
this.MaximumSize = new System.Drawing.Size(10000, 100);
this.MinimumSize = new System.Drawing.Size(100, 100);
this.Name = "SectorInfoPanel";
this.Size = new System.Drawing.Size(642, 100);
this.Size = new System.Drawing.Size(1090, 100);
this.sectorinfo.ResumeLayout(false);
this.sectorinfo.PerformLayout();
this.ceilingpanel.ResumeLayout(false);
@ -542,6 +572,7 @@ namespace CodeImp.DoomBuilder.Controls
this.floortex.ResumeLayout(false);
this.floortex.PerformLayout();
this.flowLayoutPanel1.ResumeLayout(false);
this.flagsPanel.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -586,5 +617,7 @@ namespace CodeImp.DoomBuilder.Controls
private System.Windows.Forms.Panel panelLightColor;
private System.Windows.Forms.Label labelFade;
private System.Windows.Forms.Label labelLight;
private System.Windows.Forms.GroupBox flagsPanel;
private System.Windows.Forms.ListView flags;
}
}

View file

@ -21,6 +21,7 @@ using System.Windows.Forms;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Data;
using CodeImp.DoomBuilder.Rendering;
using System.Collections.Generic;
#endregion
@ -86,153 +87,176 @@ namespace CodeImp.DoomBuilder.Controls
//mxd
bool showExtededFloorInfo = false;
bool showExtededCeilingInfo = false;
if(General.Map.UDMF && s.Fields != null) {
//sector colors
labelLight.Visible = true;
labelFade.Visible = true;
panelLightColor.Visible = true;
panelFadeColor.Visible = true;
if(General.Map.UDMF) {
if(s.Fields != null) {
//sector colors
labelLight.Visible = true;
labelFade.Visible = true;
panelLightColor.Visible = true;
panelFadeColor.Visible = true;
if(s.Fields.ContainsKey("lightcolor")) {
panelLightColor.BackColor = PixelColor.FromInt(s.Fields.GetValue("lightcolor", 0xFFFFFF)).WithAlpha(255).ToColor();
labelLight.Enabled = true;
} else {
panelLightColor.BackColor = System.Drawing.SystemColors.Control;
labelLight.Enabled = false;
if(s.Fields.ContainsKey("lightcolor")) {
panelLightColor.BackColor = PixelColor.FromInt(s.Fields.GetValue("lightcolor", 0xFFFFFF)).WithAlpha(255).ToColor();
labelLight.Enabled = true;
} else {
panelLightColor.BackColor = System.Drawing.SystemColors.Control;
labelLight.Enabled = false;
}
if(s.Fields.ContainsKey("fadecolor")) {
panelFadeColor.BackColor = PixelColor.FromInt(s.Fields.GetValue("fadecolor", 0)).WithAlpha(255).ToColor();
labelFade.Enabled = true;
} else {
panelFadeColor.BackColor = System.Drawing.SystemColors.Control;
labelFade.Enabled = false;
}
//light
if(s.Fields.ContainsKey("lightceiling") || s.Fields.ContainsKey("lightceilingabsolute")) {
showExtededCeilingInfo = true;
ceilingLight.Enabled = true;
ceilingLightLabel.Enabled = true;
int cl = s.Fields.GetValue("lightceiling", 0);
if(s.Fields.GetValue("lightceilingabsolute", false))
ceilingLight.Text = cl + " (abs.)";
else
ceilingLight.Text = cl + " (" + Math.Min(255, Math.Max(0, (cl + s.Brightness))) + ")";
} else {
ceilingLight.Text = "--";
ceilingLight.Enabled = false;
ceilingLightLabel.Enabled = false;
}
if(s.Fields.ContainsKey("lightfloor") || s.Fields.ContainsKey("lightfloorabsolute")) {
showExtededFloorInfo = true;
floorLight.Enabled = true;
floorLightLabel.Enabled = true;
int fl = s.Fields.GetValue("lightfloor", 0);
if(s.Fields.GetValue("lightfloorabsolute", false))
floorLight.Text = fl + " (abs.)";
else
floorLight.Text = fl + " (" + Math.Min(255, Math.Max(0, (fl + s.Brightness))) + ")";
} else {
floorLight.Text = "--";
floorLight.Enabled = false;
floorLightLabel.Enabled = false;
}
//ceiling offsets
float panX = s.Fields.GetValue("xpanningceiling", 0f);
float panY = s.Fields.GetValue("ypanningceiling", 0f);
if(panX != 0 || panY != 0) {
showExtededCeilingInfo = true;
ceilingOffset.Enabled = true;
ceilingOffsetLabel.Enabled = true;
ceilingOffset.Text = String.Format("{0:0.##}", panX) + ", " + String.Format("{0:0.##}", panY);
} else {
ceilingOffset.Text = "--, --";
ceilingOffset.Enabled = false;
ceilingOffsetLabel.Enabled = false;
}
//floor offsets
panX = s.Fields.GetValue("xpanningfloor", 0f);
panY = s.Fields.GetValue("ypanningfloor", 0f);
if(panX != 0 || panY != 0) {
showExtededFloorInfo = true;
floorOffset.Enabled = true;
floorOffsetLabel.Enabled = true;
floorOffset.Text = String.Format("{0:0.##}", panX) + ", " + String.Format("{0:0.##}", panY);
} else {
floorOffset.Text = "--, --";
floorOffset.Enabled = false;
floorOffsetLabel.Enabled = false;
}
//ceiling scale
float scaleX = s.Fields.GetValue("xscaleceiling", 1.0f);//1.0f;
float scaleY = s.Fields.GetValue("yscaleceiling", 1.0f);
if(scaleX != 1.0f || scaleY != 1.0f) {
showExtededCeilingInfo = true;
ceilingScale.Enabled = true;
ceilingScaleLabel.Enabled = true;
ceilingScale.Text = String.Format("{0:0.##}", scaleX) + ", " + String.Format("{0:0.##}", scaleY);
} else {
ceilingScale.Text = "--, --";
ceilingScale.Enabled = false;
ceilingScaleLabel.Enabled = false;
}
//floor scale
scaleX = s.Fields.GetValue("xscalefloor", 1.0f);
scaleY = s.Fields.GetValue("yscalefloor", 1.0f);
if(scaleX != 1.0f || scaleY != 1.0f) {
showExtededFloorInfo = true;
floorScale.Enabled = true;
floorScaleLabel.Enabled = true;
floorScale.Text = String.Format("{0:0.##}", scaleX) + ", " + String.Format("{0:0.##}", scaleY);
} else {
floorScale.Text = "--, --";
floorScale.Enabled = false;
floorScaleLabel.Enabled = false;
}
//rotation
if(s.Fields.ContainsKey("rotationceiling")) {
showExtededCeilingInfo = true;
ceilingAngle.Enabled = true;
ceilingAngleLabel.Enabled = true;
ceilingAngle.Text = s.Fields["rotationceiling"].Value.ToString() + "\u00B0";
} else {
ceilingAngle.Text = "-";
ceilingAngle.Enabled = false;
ceilingAngleLabel.Enabled = false;
}
if(s.Fields.ContainsKey("rotationfloor")) {
showExtededFloorInfo = true;
floorAngle.Enabled = true;
floorAngleLabel.Enabled = true;
floorAngle.Text = s.Fields["rotationfloor"].Value.ToString() + "\u00B0";
} else {
floorAngle.Text = "-";
floorAngle.Enabled = false;
floorAngleLabel.Enabled = false;
}
}
if(s.Fields.ContainsKey("fadecolor")) {
panelFadeColor.BackColor = PixelColor.FromInt(s.Fields.GetValue("fadecolor", 0)).WithAlpha(255).ToColor();
labelFade.Enabled = true;
} else {
panelFadeColor.BackColor = System.Drawing.SystemColors.Control;
labelFade.Enabled = false;
}
//light
if(s.Fields.ContainsKey("lightceiling") || s.Fields.ContainsKey("lightceilingabsolute")) {
showExtededCeilingInfo = true;
ceilingLight.Enabled = true;
ceilingLightLabel.Enabled = true;
int cl = s.Fields.GetValue("lightceiling", 0);
if(s.Fields.GetValue("lightceilingabsolute", false))
ceilingLight.Text = cl + " (abs.)";
else
ceilingLight.Text = cl + " (" + Math.Min(255, Math.Max(0, (cl + s.Brightness))) + ")";
} else {
ceilingLight.Text = "--";
ceilingLight.Enabled = false;
ceilingLightLabel.Enabled = false;
//Flags
flags.Items.Clear();
foreach(KeyValuePair<string, bool> group in s.Flags) {
if(group.Value) {
ListViewItem item = new ListViewItem(General.Map.Config.SectorFlags[group.Key]);
item.Checked = true;
flags.Items.Add(item);
}
}
if(s.Fields.ContainsKey("lightfloor") || s.Fields.ContainsKey("lightfloorabsolute")) {
showExtededFloorInfo = true;
floorLight.Enabled = true;
floorLightLabel.Enabled = true;
int fl = s.Fields.GetValue("lightfloor", 0);
if(s.Fields.GetValue("lightfloorabsolute", false))
floorLight.Text = fl + " (abs.)";
else
floorLight.Text = fl + " (" + Math.Min(255, Math.Max(0, (fl + s.Brightness))) + ")";
} else {
floorLight.Text = "--";
floorLight.Enabled = false;
floorLightLabel.Enabled = false;
//mxd. Flags panel visibility and size
flagsPanel.Visible = (flags.Items.Count > 0);
if(flags.Items.Count > 0) {
int itemWidth = flags.Items[0].GetBounds(ItemBoundsPortion.Entire).Width;
if(itemWidth == 0) itemWidth = 96;
flags.Width = itemWidth * (int)Math.Ceiling(flags.Items.Count / 5.0f);
flagsPanel.Width = flags.Width + flags.Left * 2;
}
//ceiling offsets
float panX = s.Fields.GetValue("xpanningceiling", 0f);
float panY = s.Fields.GetValue("ypanningceiling", 0f);
if(panX != 0 || panY != 0) {
showExtededCeilingInfo = true;
ceilingOffset.Enabled = true;
ceilingOffsetLabel.Enabled = true;
ceilingOffset.Text = String.Format("{0:0.##}", panX) + ", " + String.Format("{0:0.##}", panY);
} else {
ceilingOffset.Text = "--, --";
ceilingOffset.Enabled = false;
ceilingOffsetLabel.Enabled = false;
}
//floor offsets
panX = s.Fields.GetValue("xpanningfloor", 0f);
panY = s.Fields.GetValue("ypanningfloor", 0f);
if(panX != 0 || panY != 0) {
showExtededFloorInfo = true;
floorOffset.Enabled = true;
floorOffsetLabel.Enabled = true;
floorOffset.Text = String.Format("{0:0.##}", panX) + ", " + String.Format("{0:0.##}", panY);
} else {
floorOffset.Text = "--, --";
floorOffset.Enabled = false;
floorOffsetLabel.Enabled = false;
}
//ceiling scale
float scaleX = s.Fields.GetValue("xscaleceiling", 1.0f);//1.0f;
float scaleY = s.Fields.GetValue("yscaleceiling", 1.0f);
if(scaleX != 1.0f || scaleY != 1.0f) {
showExtededCeilingInfo = true;
ceilingScale.Enabled = true;
ceilingScaleLabel.Enabled = true;
ceilingScale.Text = String.Format("{0:0.##}", scaleX) + ", " + String.Format("{0:0.##}", scaleY);
} else {
ceilingScale.Text = "--, --";
ceilingScale.Enabled = false;
ceilingScaleLabel.Enabled = false;
}
//floor scale
scaleX = s.Fields.GetValue("xscalefloor", 1.0f);
scaleY = s.Fields.GetValue("yscalefloor", 1.0f);
if(scaleX != 1.0f || scaleY != 1.0f) {
showExtededFloorInfo = true;
floorScale.Enabled = true;
floorScaleLabel.Enabled = true;
floorScale.Text = String.Format("{0:0.##}", scaleX) + ", " + String.Format("{0:0.##}", scaleY);
} else {
floorScale.Text = "--, --";
floorScale.Enabled = false;
floorScaleLabel.Enabled = false;
}
//rotation
if(s.Fields.ContainsKey("rotationceiling")) {
showExtededCeilingInfo = true;
ceilingAngle.Enabled = true;
ceilingAngleLabel.Enabled = true;
ceilingAngle.Text = s.Fields["rotationceiling"].Value.ToString() + "\u00B0";
} else {
ceilingAngle.Text = "-";
ceilingAngle.Enabled = false;
ceilingAngleLabel.Enabled = false;
}
if(s.Fields.ContainsKey("rotationfloor")) {
showExtededFloorInfo = true;
floorAngle.Enabled = true;
floorAngleLabel.Enabled = true;
floorAngle.Text = s.Fields["rotationfloor"].Value.ToString() + "\u00B0";
} else {
floorAngle.Text = "-";
floorAngle.Enabled = false;
floorAngleLabel.Enabled = false;
}
} else {
panelFadeColor.Visible = false;
panelLightColor.Visible = false;
labelFade.Visible = false;
labelLight.Visible = false;
flagsPanel.Visible = false;
}
//panels size

View file

@ -1,138 +1,138 @@
<?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.
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.
-->
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: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>
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
<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>
<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>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="label13.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
<value>False</value>
</metadata>
<metadata name="label5.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
<value>False</value>
</metadata>
<metadata name="label4.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
<value>False</value>
</metadata>
<metadata name="label3.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
<value>False</value>
</metadata>
<metadata name="label2.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
<value>False</value>
</metadata>
<metadata name="label1.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
<value>False</value>
</metadata>
</root>

View file

@ -52,6 +52,8 @@ namespace CodeImp.DoomBuilder.Controls
this.spritepanel = new System.Windows.Forms.GroupBox();
this.spritename = new System.Windows.Forms.Label();
this.spritetex = new System.Windows.Forms.Panel();
this.flagsPanel = new System.Windows.Forms.GroupBox();
this.flags = new System.Windows.Forms.ListView();
label5 = new System.Windows.Forms.Label();
label4 = new System.Windows.Forms.Label();
label3 = new System.Windows.Forms.Label();
@ -59,6 +61,7 @@ namespace CodeImp.DoomBuilder.Controls
label1 = new System.Windows.Forms.Label();
this.infopanel.SuspendLayout();
this.spritepanel.SuspendLayout();
this.flagsPanel.SuspendLayout();
this.SuspendLayout();
//
// label5
@ -75,7 +78,7 @@ namespace CodeImp.DoomBuilder.Controls
label4.AutoSize = true;
label4.Location = new System.Drawing.Point(30, 77);
label4.Name = "label4";
label4.Size = new System.Drawing.Size(28, 14);
label4.Size = new System.Drawing.Size(27, 14);
label4.TabIndex = 4;
label4.Text = "Tag:";
//
@ -102,7 +105,7 @@ namespace CodeImp.DoomBuilder.Controls
label1.AutoSize = true;
label1.Location = new System.Drawing.Point(24, 19);
label1.Name = "label1";
label1.Size = new System.Drawing.Size(34, 14);
label1.Size = new System.Drawing.Size(33, 14);
label1.TabIndex = 0;
label1.Text = "Type:";
//
@ -310,20 +313,47 @@ namespace CodeImp.DoomBuilder.Controls
this.spritetex.Size = new System.Drawing.Size(68, 60);
this.spritetex.TabIndex = 0;
//
// flagsPanel
//
this.flagsPanel.Controls.Add(this.flags);
this.flagsPanel.Location = new System.Drawing.Point(592, 0);
this.flagsPanel.Name = "flagsPanel";
this.flagsPanel.Size = new System.Drawing.Size(568, 100);
this.flagsPanel.TabIndex = 6;
this.flagsPanel.TabStop = false;
this.flagsPanel.Text = " Flags";
//
// flags
//
this.flags.BackColor = System.Drawing.SystemColors.Control;
this.flags.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.flags.CheckBoxes = true;
this.flags.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.flags.Location = new System.Drawing.Point(6, 18);
this.flags.Name = "flags";
this.flags.Scrollable = false;
this.flags.ShowGroups = false;
this.flags.Size = new System.Drawing.Size(556, 100);
this.flags.TabIndex = 0;
this.flags.UseCompatibleStateImageBehavior = false;
this.flags.View = System.Windows.Forms.View.List;
//
// ThingInfoPanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.flagsPanel);
this.Controls.Add(this.spritepanel);
this.Controls.Add(this.infopanel);
this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.MaximumSize = new System.Drawing.Size(10000, 100);
this.MinimumSize = new System.Drawing.Size(100, 100);
this.Name = "ThingInfoPanel";
this.Size = new System.Drawing.Size(650, 100);
this.Size = new System.Drawing.Size(1190, 100);
this.infopanel.ResumeLayout(false);
this.infopanel.PerformLayout();
this.spritepanel.ResumeLayout(false);
this.flagsPanel.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -349,6 +379,8 @@ namespace CodeImp.DoomBuilder.Controls
private System.Windows.Forms.Label arg2;
private System.Windows.Forms.Label arg1;
private System.Windows.Forms.GroupBox infopanel;
private System.Windows.Forms.GroupBox flagsPanel;
private System.Windows.Forms.ListView flags;
}
}

View file

@ -23,6 +23,7 @@ using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Config;
using CodeImp.DoomBuilder.Types;
using CodeImp.DoomBuilder.GZBuilder; //mxd
using System.Collections.Generic;
#endregion
@ -86,6 +87,7 @@ namespace CodeImp.DoomBuilder.Controls
// Move panel
spritepanel.Left = infopanel.Left + infopanel.Width + infopanel.Margin.Right + spritepanel.Margin.Left;
flagsPanel.Left = spritepanel.Left + spritepanel.Width + spritepanel.Margin.Right + flagsPanel.Margin.Left; //mxd
// Lookup thing info
ti = General.Map.Data.GetThingInfo(t.Type);
@ -200,6 +202,25 @@ namespace CodeImp.DoomBuilder.Controls
th.SetValue(t.Args[4]);
arg5.Text = th.GetStringValue();
//mxd. Flags
flags.Items.Clear();
foreach(KeyValuePair<string, bool> group in t.Flags){
if(group.Value) {
ListViewItem item = new ListViewItem(General.Map.Config.ThingFlags[group.Key]);
item.Checked = true;
flags.Items.Add(item);
}
}
//mxd. Flags panel visibility and size
flagsPanel.Visible = (flags.Items.Count > 0);
if(flags.Items.Count > 0) {
int itemWidth = flags.Items[0].GetBounds(ItemBoundsPortion.Entire).Width;
if(itemWidth == 0) itemWidth = 96;
flags.Width = itemWidth * (int)Math.Ceiling(flags.Items.Count / 5.0f);
flagsPanel.Width = flags.Width + flags.Left * 2;
}
// Show the whole thing
this.Show();
this.Update();

View file

@ -1,210 +1,207 @@
<?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.
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.
-->
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: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>
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
<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>
<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>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="label5.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="label5.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
<value>False</value>
</metadata>
<metadata name="label4.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="label4.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
<value>False</value>
</metadata>
<metadata name="label3.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="label3.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
<value>False</value>
</metadata>
<metadata name="label2.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="label2.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
<value>False</value>
</metadata>
<metadata name="label1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="label1.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
<value>False</value>
</metadata>
<metadata name="infopanel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="arg5.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="arglbl5.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="arglbl4.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="arg4.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="arglbl3.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="arglbl2.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="arg3.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="arglbl1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="arg2.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="arg1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="angle.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="tag.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="position.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="action.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="type.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="spritepanel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="spritename.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
<metadata name="spritetex.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>
<value>True</value>
</metadata>
</root>

View file

@ -99,6 +99,9 @@ namespace CodeImp.DoomBuilder.GZBuilder.Windows
}
private string getExceptionDescription(Exception ex) {
//add to error logger
General.ErrorLogger.Add(ErrorType.Error, "**** " + ex.Source + ": " + ex.Message + " ****");
string message = "********EXCEPTION DETAILS********"
+ Environment.NewLine + ex.Source + ": " + ex.Message + Environment.NewLine + ex.StackTrace;

View file

@ -584,7 +584,7 @@ namespace CodeImp.DoomBuilder
// Remove the previous log file and start logging
if(File.Exists(logfile)) File.Delete(logfile);
//mxd
General.WriteLogLine("GZDoom Builder " + GZBuilder.GZGeneral.Version + GZBuilder.GZGeneral.Revision + " startup");
General.WriteLogLine("GZDoom Builder " + GZBuilder.GZGeneral.Version + GZBuilder.GZGeneral.Revision + "startup");
//General.WriteLogLine("Doom Builder " + thisversion.Major + "." + thisversion.Minor + " startup");
General.WriteLogLine("Application path: " + apppath);
General.WriteLogLine("Temporary path: " + temppath);

View file

@ -2216,7 +2216,7 @@ namespace CodeImp.DoomBuilder.Windows
this.thinginfo.MaximumSize = new System.Drawing.Size(10000, 100);
this.thinginfo.MinimumSize = new System.Drawing.Size(100, 100);
this.thinginfo.Name = "thinginfo";
this.thinginfo.Size = new System.Drawing.Size(639, 100);
this.thinginfo.Size = new System.Drawing.Size(1190, 100);
this.thinginfo.TabIndex = 3;
this.thinginfo.Visible = false;
//
@ -2227,7 +2227,7 @@ namespace CodeImp.DoomBuilder.Windows
this.sectorinfo.MaximumSize = new System.Drawing.Size(10000, 100);
this.sectorinfo.MinimumSize = new System.Drawing.Size(100, 100);
this.sectorinfo.Name = "sectorinfo";
this.sectorinfo.Size = new System.Drawing.Size(642, 100);
this.sectorinfo.Size = new System.Drawing.Size(1090, 100);
this.sectorinfo.TabIndex = 2;
this.sectorinfo.Visible = false;
//

View file

@ -643,7 +643,7 @@ namespace CodeImp.DoomBuilder.Windows
} else { //update values
// Apply position
foreach(Thing t in things) {
float z = (float)posZ.GetResult((int)t.Position.z);
float z = posZ.GetResult((int)t.Position.z);
if(useAbsoluteHeight && t.Sector != null)
z -= t.Sector.FloorHeight;
t.Move(new Vector3D(t.Position.x, t.Position.y, z));

View file

@ -17,7 +17,6 @@
#region ================== Namespaces
using System;
using System.Collections;
using System.Collections.Generic;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Map;
@ -324,39 +323,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
}
//mxd. This updates OffsetX of unstable lines
private void updateTextureOffsetX() {
int c = 0;
foreach(Linedef l in unstablelines) {
if(l.Length > 0 && l.Length != unstableLinesInitialLengths[c]/* && l.Angle == unstableLinesInitialAngles[c]*/) {
if (l.Front != null && ((l.Front.MiddleRequired() || l.Front.MiddleTexture.Length > 1) || l.Front.HighRequired() || l.Front.LowRequired()) && selectedverts.Contains(l.Start)) {
l.Front.OffsetX += (int)Math.Round(unstableLinesInitialLengths[c] - l.Length);
clampTextureOffsetX(l.Front);
} else if (l.Back != null && ((l.Back.MiddleRequired() || l.Back.MiddleTexture.Length > 1) || l.Back.HighRequired() || l.Back.LowRequired()) && selectedverts.Contains(l.End)) {
l.Back.OffsetX += (int)Math.Round(unstableLinesInitialLengths[c] - l.Length);
clampTextureOffsetX(l.Back);
}
}
c++;
}
}
//mxd
private void clampTextureOffsetX(Sidedef target) {
ImageData texture = null;
if (target.MiddleTexture.Length > 1 && General.Map.Data.GetFlatExists(target.MiddleTexture)) {
texture = General.Map.Data.GetFlatImage(target.MiddleTexture);
} else if (target.HighRequired() && target.HighTexture.Length > 1 && General.Map.Data.GetFlatExists(target.HighTexture)) {
texture = General.Map.Data.GetFlatImage(target.HighTexture);
} else if (target.LowTexture.Length > 1 && General.Map.Data.GetFlatExists(target.LowTexture)) {
texture = General.Map.Data.GetFlatImage(target.LowTexture);
}
if (texture != null && texture.IsImageLoaded)
target.OffsetX %= texture.Width;
}
// Cancelled
public override void OnCancel()
{
@ -489,10 +455,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Update cached values
General.Map.Map.Update();
//mxd
if(BuilderPlug.Me.AutoAlignTextureOffsetsOnDrag)
updateTextureOffsetX();
// Done
Cursor.Current = Cursors.Default;
General.Map.IsChanged = true;
@ -533,7 +495,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Redraw
UpdateRedraw();
renderer.Present();
//General.Interface.RedrawDisplay();
}
}

View file

@ -458,7 +458,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
renderer.Present();
}
}
else if(!selecting) //mxd. We don't want to draw while multiselecting
else if(!selecting && BuilderPlug.Me.AutoDrawOnEdit) //mxd. We don't want to draw while multiselecting
{
// Start drawing mode
DrawGeometryMode drawmode = new DrawGeometryMode();

View file

@ -155,15 +155,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartOverlay(true))
{
//mxd. Render highlighted sector
if (BuilderPlug.Me.UseHighlight) {
if (highlighted != null) {
int highlightedColor = General.Colors.Highlight.WithAlpha(64).ToInt();
FlatVertex[] verts = new FlatVertex[highlighted.FlatVertices.Length];
highlighted.FlatVertices.CopyTo(verts, 0);
for (int i = 0; i < verts.Length; i++)
verts[i].c = highlightedColor;
renderer.RenderGeometry(verts, null, true);
}
if(BuilderPlug.Me.UseHighlight && highlighted != null) {
int highlightedColor = General.Colors.Highlight.WithAlpha(64).ToInt();
FlatVertex[] verts = new FlatVertex[highlighted.FlatVertices.Length];
highlighted.FlatVertices.CopyTo(verts, 0);
for(int i = 0; i < verts.Length; i++)
verts[i].c = highlightedColor;
renderer.RenderGeometry(verts, null, true);
}
// Go for all selected sectors
@ -719,7 +717,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
renderer.Present();
}
}
else if(!selecting) //mxd. We don't want to draw while multiselecting
else if(!selecting && BuilderPlug.Me.AutoDrawOnEdit) //mxd. We don't want to draw while multiselecting
{
// Start drawing mode
DrawGeometryMode drawmode = new DrawGeometryMode();

View file

@ -365,30 +365,23 @@ namespace CodeImp.DoomBuilder.BuilderModes
renderer.Present();
}
}
else
else if(mouseinside && !selecting && BuilderPlug.Me.AutoDrawOnEdit) //mxd. We don't want to insert a thing when multiselecting
{
// Mouse in window?
if(mouseinside && !selecting) //mxd. We don't want to insert a thing when multiselecting
{
// Edit pressed in this mode
editpressed = true;
thinginserted = true;
// Insert a new item and select it for dragging
General.Map.UndoRedo.CreateUndo("Insert thing");
Thing t = InsertThing(mousemappos);
// Edit pressed in this mode
editpressed = true;
thinginserted = true;
if (t == null)
{
General.Map.UndoRedo.WithdrawUndo();
}
else
{
General.Map.Map.ClearSelectedThings();
t.Selected = true;
Highlight(t);
General.Interface.RedrawDisplay();
}
// Insert a new item and select it for dragging
General.Map.UndoRedo.CreateUndo("Insert thing");
Thing t = InsertThing(mousemappos);
if(t == null) {
General.Map.UndoRedo.WithdrawUndo();
} else {
General.Map.Map.ClearSelectedThings();
t.Selected = true;
Highlight(t);
General.Interface.RedrawDisplay();
}
}

View file

@ -376,7 +376,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Redraw display
General.Interface.RedrawDisplay();
}
else
else if(BuilderPlug.Me.AutoDrawOnEdit)
{
// Start drawing mode
DrawGeometryMode drawmode = new DrawGeometryMode();

View file

@ -114,8 +114,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
private bool usehighlight;
private bool autodragonpaste;
private bool autoAlignTextureOffsetsOnCreate;//mxd
private bool autoAlignTextureOffsetsOnDrag;//mxd
private bool dontMoveGeometryOutsideMapBoundary;//mxd
private bool autoDrawOnEdit; //mxd
private bool marqueSelectTouching; //mxd. Select elements partially/fully inside of marque selection?
private bool syncSelection; //mxd. Sync selection between Visual and Classic modes.
private bool objExportTextures; //mxd
@ -176,8 +176,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
}
public bool AutoDragOnPaste { get { return autodragonpaste; } set { autodragonpaste = value; } }
public bool AutoDrawOnEdit { get { return autoDrawOnEdit; } set { autoDrawOnEdit = value; } } //mxd
public bool AutoAlignTextureOffsetsOnCreate { get { return autoAlignTextureOffsetsOnCreate; } set { autoAlignTextureOffsetsOnCreate = value; } } //mxd
public bool AutoAlignTextureOffsetsOnDrag { get { return autoAlignTextureOffsetsOnDrag; } set { autoAlignTextureOffsetsOnDrag = value; } } //mxd
public bool DontMoveGeometryOutsideMapBoundary { get { return dontMoveGeometryOutsideMapBoundary; } set { DontMoveGeometryOutsideMapBoundary = value; } } //mxd
public bool MarqueSelectTouching { get { return marqueSelectTouching; } set { marqueSelectTouching = value; } } //mxd
public bool SyncSelection { get { return syncSelection; } set { syncSelection = value; } } //mxd
@ -333,8 +333,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
highlightthingsrange = General.Settings.ReadPluginSetting("highlightthingsrange", 10);
splitlinedefsrange = General.Settings.ReadPluginSetting("splitlinedefsrange", 10);
autodragonpaste = General.Settings.ReadPluginSetting("autodragonpaste", false);
autoDrawOnEdit = General.Settings.ReadPluginSetting("autodrawonedit", true); //mxd
autoAlignTextureOffsetsOnCreate = General.Settings.ReadPluginSetting("autoaligntextureoffsetsoncreate", false); //mxd
autoAlignTextureOffsetsOnDrag = General.Settings.ReadPluginSetting("autoaligntextureoffsetsondrag", true); //mxd
dontMoveGeometryOutsideMapBoundary = General.Settings.ReadPluginSetting("dontmovegeometryoutsidemapboundary", false); //mxd
syncSelection = General.Settings.ReadPluginSetting("syncselection", false); //mxd
objExportTextures = General.Settings.ReadPluginSetting("objexporttextures", false); //mxd
@ -343,7 +343,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
lockSectorTextureOffsetsWhileDragging = General.Settings.ReadPluginSetting("locktextureoffsets", false); //mxd
}
//mxd
//mxd. Save settings, which can be changed via UI
private void saveSettings() {
General.Settings.WritePluginSetting("locktextureoffsets", lockSectorTextureOffsetsWhileDragging);
General.Settings.WritePluginSetting("viewselectionnumbers", viewselectionnumbers);
@ -771,6 +771,19 @@ namespace CodeImp.DoomBuilder.BuilderModes
foreach(Line3D l in lines)
renderer.RenderArrow(l, l.LineType == Line3DType.ACTIVATOR ? General.Colors.Selection : General.Colors.InfoLine);
}
}
else if(asso.type == UniversalType.SectorTag) //mxd. Render sector highlight
{
foreach(Sector s in General.Map.Map.Sectors) {
if(s.Tag == asso.tag) {
int highlightedColor = General.Colors.Highlight.WithAlpha(128).ToInt();
FlatVertex[] verts = new FlatVertex[s.FlatVertices.Length];
s.FlatVertices.CopyTo(verts, 0);
for(int i = 0; i < verts.Length; i++)
verts[i].c = highlightedColor;
renderer.RenderGeometry(verts, null, true);
}
}
}
}

View file

@ -40,9 +40,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.defaultbrightness = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
this.label11 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.autodrawonedit = new System.Windows.Forms.CheckBox();
this.syncSelection = new System.Windows.Forms.CheckBox();
this.dontMoveGeometryOutsideBounds = new System.Windows.Forms.CheckBox();
this.autoalignDraggedSidedefsOffsetX = new System.Windows.Forms.CheckBox();
this.autoaligntexturesoncreate = new System.Windows.Forms.CheckBox();
this.autodragonpaste = new System.Windows.Forms.CheckBox();
this.visualmodeclearselection = new System.Windows.Forms.CheckBox();
@ -207,9 +207,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
//
// groupBox3
//
this.groupBox3.Controls.Add(this.autodrawonedit);
this.groupBox3.Controls.Add(this.syncSelection);
this.groupBox3.Controls.Add(this.dontMoveGeometryOutsideBounds);
this.groupBox3.Controls.Add(this.autoalignDraggedSidedefsOffsetX);
this.groupBox3.Controls.Add(this.autoaligntexturesoncreate);
this.groupBox3.Controls.Add(this.autodragonpaste);
this.groupBox3.Controls.Add(this.visualmodeclearselection);
@ -224,10 +224,20 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.groupBox3.TabStop = false;
this.groupBox3.Text = " Options ";
//
// autodrawonedit
//
this.autodrawonedit.AutoSize = true;
this.autodrawonedit.Location = new System.Drawing.Point(13, 24);
this.autodrawonedit.Name = "autodrawonedit";
this.autodrawonedit.Size = new System.Drawing.Size(360, 18);
this.autodrawonedit.TabIndex = 11;
this.autodrawonedit.Text = "Start drawing when Edit pressed over empty space in Classic modes";
this.autodrawonedit.UseVisualStyleBackColor = true;
//
// syncSelection
//
this.syncSelection.AutoSize = true;
this.syncSelection.Location = new System.Drawing.Point(13, 250);
this.syncSelection.Location = new System.Drawing.Point(13, 249);
this.syncSelection.Name = "syncSelection";
this.syncSelection.Size = new System.Drawing.Size(306, 18);
this.syncSelection.TabIndex = 10;
@ -237,27 +247,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
// dontMoveGeometryOutsideBounds
//
this.dontMoveGeometryOutsideBounds.AutoSize = true;
this.dontMoveGeometryOutsideBounds.Location = new System.Drawing.Point(13, 225);
this.dontMoveGeometryOutsideBounds.Location = new System.Drawing.Point(13, 224);
this.dontMoveGeometryOutsideBounds.Name = "dontMoveGeometryOutsideBounds";
this.dontMoveGeometryOutsideBounds.Size = new System.Drawing.Size(332, 18);
this.dontMoveGeometryOutsideBounds.TabIndex = 9;
this.dontMoveGeometryOutsideBounds.Text = "Don\'t move selection if any part of it is outside of map boundary";
this.dontMoveGeometryOutsideBounds.UseVisualStyleBackColor = true;
//
// autoalignDraggedSidedefsOffsetX
//
this.autoalignDraggedSidedefsOffsetX.AutoSize = true;
this.autoalignDraggedSidedefsOffsetX.Location = new System.Drawing.Point(13, 200);
this.autoalignDraggedSidedefsOffsetX.Name = "autoalignDraggedSidedefsOffsetX";
this.autoalignDraggedSidedefsOffsetX.Size = new System.Drawing.Size(286, 18);
this.autoalignDraggedSidedefsOffsetX.TabIndex = 8;
this.autoalignDraggedSidedefsOffsetX.Text = "Try to align horizontal tex. offset of dragged geometry";
this.autoalignDraggedSidedefsOffsetX.UseVisualStyleBackColor = true;
//
// autoaligntexturesoncreate
//
this.autoaligntexturesoncreate.AutoSize = true;
this.autoaligntexturesoncreate.Location = new System.Drawing.Point(13, 175);
this.autoaligntexturesoncreate.Location = new System.Drawing.Point(13, 199);
this.autoaligntexturesoncreate.Name = "autoaligntexturesoncreate";
this.autoaligntexturesoncreate.Size = new System.Drawing.Size(245, 18);
this.autoaligntexturesoncreate.TabIndex = 7;
@ -267,7 +267,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// autodragonpaste
//
this.autodragonpaste.AutoSize = true;
this.autodragonpaste.Location = new System.Drawing.Point(13, 150);
this.autodragonpaste.Location = new System.Drawing.Point(13, 174);
this.autodragonpaste.Name = "autodragonpaste";
this.autodragonpaste.Size = new System.Drawing.Size(205, 18);
this.autodragonpaste.TabIndex = 6;
@ -277,7 +277,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// visualmodeclearselection
//
this.visualmodeclearselection.AutoSize = true;
this.visualmodeclearselection.Location = new System.Drawing.Point(13, 125);
this.visualmodeclearselection.Location = new System.Drawing.Point(13, 149);
this.visualmodeclearselection.Name = "visualmodeclearselection";
this.visualmodeclearselection.Size = new System.Drawing.Size(220, 18);
this.visualmodeclearselection.TabIndex = 5;
@ -287,7 +287,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// autoclearselection
//
this.autoclearselection.AutoSize = true;
this.autoclearselection.Location = new System.Drawing.Point(13, 100);
this.autoclearselection.Location = new System.Drawing.Point(13, 124);
this.autoclearselection.Name = "autoclearselection";
this.autoclearselection.Size = new System.Drawing.Size(231, 18);
this.autoclearselection.TabIndex = 4;
@ -297,7 +297,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// editnewthing
//
this.editnewthing.AutoSize = true;
this.editnewthing.Location = new System.Drawing.Point(13, 25);
this.editnewthing.Location = new System.Drawing.Point(13, 49);
this.editnewthing.Name = "editnewthing";
this.editnewthing.Size = new System.Drawing.Size(256, 18);
this.editnewthing.TabIndex = 1;
@ -307,7 +307,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// editnewsector
//
this.editnewsector.AutoSize = true;
this.editnewsector.Location = new System.Drawing.Point(13, 50);
this.editnewsector.Location = new System.Drawing.Point(13, 74);
this.editnewsector.Name = "editnewsector";
this.editnewsector.Size = new System.Drawing.Size(271, 18);
this.editnewsector.TabIndex = 2;
@ -317,7 +317,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// additiveselect
//
this.additiveselect.AutoSize = true;
this.additiveselect.Location = new System.Drawing.Point(13, 75);
this.additiveselect.Location = new System.Drawing.Point(13, 99);
this.additiveselect.Name = "additiveselect";
this.additiveselect.Size = new System.Drawing.Size(211, 18);
this.additiveselect.TabIndex = 3;
@ -589,7 +589,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
private System.Windows.Forms.ComboBox splitbehavior;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.CheckBox autoaligntexturesoncreate;
private System.Windows.Forms.CheckBox autoalignDraggedSidedefsOffsetX;
private System.Windows.Forms.CheckBox dontMoveGeometryOutsideBounds;
private System.Windows.Forms.CheckBox syncSelection;
private System.Windows.Forms.GroupBox groupBox4;
@ -601,5 +600,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.CheckBox autodrawonedit;
}
}

View file

@ -54,9 +54,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
visualmodeclearselection.Checked = BuilderPlug.Me.VisualModeClearSelection;
autodragonpaste.Checked = BuilderPlug.Me.AutoDragOnPaste;
autoaligntexturesoncreate.Checked = BuilderPlug.Me.AutoAlignTextureOffsetsOnCreate; //mxd
autoalignDraggedSidedefsOffsetX.Checked = BuilderPlug.Me.AutoAlignTextureOffsetsOnDrag; //mxd
dontMoveGeometryOutsideBounds.Checked = BuilderPlug.Me.DontMoveGeometryOutsideMapBoundary; //mxd
syncSelection.Checked = BuilderPlug.Me.SyncSelection; //mxd
autodrawonedit.Checked = BuilderPlug.Me.AutoDrawOnEdit;
defaultbrightness.Text = General.Settings.DefaultBrightness.ToString(); //mxd
defaultceilheight.Text = General.Settings.DefaultCeilingHeight.ToString();//mxd
defaultfloorheight.Text = General.Settings.DefaultFloorHeight.ToString(); //mxd
@ -82,8 +82,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Settings.WritePluginSetting("autoclearselection", autoclearselection.Checked);
General.Settings.WritePluginSetting("visualmodeclearselection", visualmodeclearselection.Checked);
General.Settings.WritePluginSetting("autodragonpaste", autodragonpaste.Checked);
General.Settings.WritePluginSetting("autodrawonedit", autodrawonedit.Checked); //mxd
General.Settings.WritePluginSetting("autoaligntextureoffsetsoncreate", autoaligntexturesoncreate.Checked);//mxd
General.Settings.WritePluginSetting("autoaligntextureoffsetsondrag", autoalignDraggedSidedefsOffsetX.Checked);//mxd
General.Settings.WritePluginSetting("dontmovegeometryoutsidemapboundary", dontMoveGeometryOutsideBounds.Checked);//mxd
General.Settings.WritePluginSetting("syncselection", syncSelection.Checked);//mxd

View file

@ -642,9 +642,9 @@ movetexturedown
movetextureleft8
{
title = "Move Texture Left by 8";
title = "Move Texture Left by cur. grid size";
category = "visual";
description = "Moves the offset of the targeted or selected textures to the left by 8 pixels.";
description = "Moves the offset of the targeted or selected textures to the left by current grid size.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
@ -654,9 +654,9 @@ movetextureleft8
movetextureright8
{
title = "Move Texture Right by 8";
title = "Move Texture Right by cur. grid size";
category = "visual";
description = "Moves the offset of the targeted or selected textures to the right by 8 pixels.";
description = "Moves the offset of the targeted or selected textures to the right by current grid size.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
@ -666,9 +666,9 @@ movetextureright8
movetextureup8
{
title = "Move Texture Up by 8";
title = "Move Texture Up by cur. grid size";
category = "visual";
description = "Moves the offset of the targeted or selected textures up by 8 pixels.";
description = "Moves the offset of the targeted or selected textures up by current grid size.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
@ -678,9 +678,9 @@ movetextureup8
movetexturedown8
{
title = "Move Texture Down by 8";
title = "Move Texture Down by cur. grid size";
category = "visual";
description = "Moves the offset of the targeted or selected textures down by 8 pixels.";
description = "Moves the offset of the targeted or selected textures down by current grid size.";
allowkeys = true;
allowmouse = true;
allowscroll = true;

View file

@ -148,26 +148,47 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
//mxd. Modify offsets based on surface and camera angles
if (General.Map.UDMF) {
float angle = 0;
float angle = 0;
if(GeometryType == VisualGeometryType.CEILING)
angle = Angle2D.DegToRad(level.sector.Fields.GetValue("rotationceiling", 0f));
else
angle = Angle2D.DegToRad(level.sector.Fields.GetValue("rotationfloor", 0f));
if(GeometryType == VisualGeometryType.CEILING)
angle = Angle2D.DegToRad(level.sector.Fields.GetValue("rotationceiling", 0f));
else
angle = Angle2D.DegToRad(level.sector.Fields.GetValue("rotationfloor", 0f));
Vector2D v = new Vector2D(offsetx, offsety).GetRotated(angle);
Vector2D v = new Vector2D(offsetx, offsety).GetRotated(angle);
offsetx = (int)Math.Round(v.x);
offsety = (int)Math.Round(v.y);
}
offsetx = (int)Math.Round(v.x);
offsety = (int)Math.Round(v.y);
// Apply offsets
int newoffsetx = startoffsetx - (int)Math.Round(offsetx);
int newoffsety = startoffsety + (int)Math.Round(offsety);
mode.ApplyFlatOffsetChange(prevoffsetx - newoffsetx, prevoffsety - newoffsety);
prevoffsetx = newoffsetx;
prevoffsety = newoffsety;
if(General.Interface.CtrlState && General.Interface.ShiftState) { //mxd. Clamp to grid size?
int newoffsetx = startoffsetx - (int)Math.Round(offsetx);
int newoffsety = startoffsety + (int)Math.Round(offsety);
int dx = prevoffsetx - newoffsetx;
int dy = prevoffsety - newoffsety;
if(Math.Abs(dx) >= General.Map.Grid.GridSize) {
dx = General.Map.Grid.GridSize * Math.Sign(dx);
prevoffsetx = newoffsetx;
} else {
dx = 0;
}
if(Math.Abs(dy) >= General.Map.Grid.GridSize) {
dy = General.Map.Grid.GridSize * Math.Sign(dy);
prevoffsety = newoffsety;
} else {
dy = 0;
}
if(dx != 0 || dy != 0) mode.ApplyFlatOffsetChange(dx, dy);
} else {
int newoffsetx = startoffsetx - (int)Math.Round(offsetx);
int newoffsety = startoffsety + (int)Math.Round(offsety);
mode.ApplyFlatOffsetChange(prevoffsetx - newoffsetx, prevoffsety - newoffsety);
prevoffsetx = newoffsetx;
prevoffsety = newoffsety;
}
mode.ShowTargetInfo();
}
@ -423,6 +444,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Moving the mouse
public virtual void OnMouseMove(MouseEventArgs e)
{
if(!General.Map.UDMF) return; //mxd. Cannot change texture offsets in other map formats...
// Dragging UV?
if(uvdragging)
{
@ -438,16 +461,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
float deltaz = General.Map.VisualCamera.AngleZ - dragstartanglez;
if((Math.Abs(deltaxy) + Math.Abs(deltaz)) > DRAG_ANGLE_TOLERANCE)
{
if(General.Map.UDMF) { //mxd
mode.PreAction(UndoGroup.TextureOffsetChange);
mode.CreateUndo("Change texture offsets");
mode.PreAction(UndoGroup.TextureOffsetChange);
mode.CreateUndo("Change texture offsets");
// Start drag now
uvdragging = true;
mode.Renderer.ShowSelection = false;
mode.Renderer.ShowHighlight = false;
UpdateDragUV();
}
// Start drag now
uvdragging = true;
mode.Renderer.ShowSelection = false;
mode.Renderer.ShowHighlight = false;
UpdateDragUV();
}
}
}

View file

@ -1096,11 +1096,34 @@ namespace CodeImp.DoomBuilder.BuilderModes
if((Math.Sign(dragdeltaz.x) < 0) || (Math.Sign(dragdeltaz.y) < 0) || (Math.Sign(dragdeltaz.z) < 0)) offsety = -offsety;
// Apply offsets
int newoffsetx = (General.Interface.CtrlState && !General.Interface.ShiftState ? startoffsetx : startoffsetx - (int)Math.Round(offsetx)); //mxd
int newoffsety = (!General.Interface.CtrlState && General.Interface.ShiftState ? startoffsety : startoffsety + (int)Math.Round(offsety)); //mxd
mode.ApplyTextureOffsetChange(prevoffsetx - newoffsetx, prevoffsety - newoffsety);
prevoffsetx = newoffsetx;
prevoffsety = newoffsety;
if(General.Interface.CtrlState && General.Interface.ShiftState) { //mxd. Clamp to grid size?
int newoffsetx = startoffsetx - (int)Math.Round(offsetx);
int newoffsety = startoffsety + (int)Math.Round(offsety);
int dx = prevoffsetx - newoffsetx;
int dy = prevoffsety - newoffsety;
if(Math.Abs(dx) >= General.Map.Grid.GridSize) {
dx = General.Map.Grid.GridSize * Math.Sign(dx);
prevoffsetx = newoffsetx;
} else {
dx = 0;
}
if(Math.Abs(dy) >= General.Map.Grid.GridSize) {
dy = General.Map.Grid.GridSize * Math.Sign(dy);
prevoffsety = newoffsety;
} else {
dy = 0;
}
if(dx != 0 || dy != 0) mode.ApplyTextureOffsetChange(dx, dy);
} else { //mxd. Constraint to axis?
int newoffsetx = (General.Interface.CtrlState ? startoffsetx : startoffsetx - (int)Math.Round(offsetx)); //mxd
int newoffsety = (General.Interface.ShiftState ? startoffsety : startoffsety + (int)Math.Round(offsety)); //mxd
mode.ApplyTextureOffsetChange(prevoffsetx - newoffsetx, prevoffsety - newoffsety);
prevoffsetx = newoffsetx;
prevoffsety = newoffsety;
}
mode.ShowTargetInfo();
}

View file

@ -2175,7 +2175,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
PreAction(UndoGroup.TextureOffsetChange);
List<IVisualEventReceiver> objs = GetSelectedObjects(true, true, false, false);
foreach (IVisualEventReceiver i in objs) i.OnChangeTextureOffset(-8, 0, true);
foreach(IVisualEventReceiver i in objs) i.OnChangeTextureOffset(-General.Map.Grid.GridSize, 0, true);
PostAction();
}
@ -2184,7 +2184,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
PreAction(UndoGroup.TextureOffsetChange);
List<IVisualEventReceiver> objs = GetSelectedObjects(true, true, false, false);
foreach (IVisualEventReceiver i in objs) i.OnChangeTextureOffset(8, 0, true);
foreach (IVisualEventReceiver i in objs) i.OnChangeTextureOffset(General.Map.Grid.GridSize, 0, true);
PostAction();
}
@ -2193,7 +2193,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
PreAction(UndoGroup.TextureOffsetChange);
List<IVisualEventReceiver> objs = GetSelectedObjects(true, true, false, false);
foreach (IVisualEventReceiver i in objs) i.OnChangeTextureOffset(0, -8, true);
foreach(IVisualEventReceiver i in objs) i.OnChangeTextureOffset(0, -General.Map.Grid.GridSize, true);
PostAction();
}
@ -2202,7 +2202,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
PreAction(UndoGroup.TextureOffsetChange);
List<IVisualEventReceiver> objs = GetSelectedObjects(true, true, false, false);
foreach (IVisualEventReceiver i in objs) i.OnChangeTextureOffset(0, 8, true);
foreach(IVisualEventReceiver i in objs) i.OnChangeTextureOffset(0, General.Map.Grid.GridSize, true);
PostAction();
}