mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-16 17:11:28 +00:00
Model rendering (all modes): UDMF scale, pitch and roll are now displayed.
Thing Edit Form, UDMF: added controls for setting pitch, roll, scale, render style, fill color, alpha, health and score. Visual mode, UDMF: UDMF scale is now applied when rendering sprites. Added Thing Statistics form (Edit -> View Thing Types...), which shows all loaded thing types with some additional info. Visual mode: sprites with negative ScaleX and positive ScaleY were not rendered properly. Classic modes: display was not updated after loading a sprite. Current testing engine change was not saved on closing the program when no other game configuration settings were changed.
This commit is contained in:
parent
26e3d53140
commit
9c7b8e4e3c
52 changed files with 5160 additions and 3593 deletions
|
@ -207,23 +207,23 @@ Note: All <bool> fields default to false unless mentioned otherwise.
|
|||
// Parameter is the conversation ID, 0 meaning none.
|
||||
countsecret = <bool>; // Picking up this actor counts as a secret.
|
||||
arg0str = <string>; // Alternate string-based version of arg0
|
||||
gravity = <float>; // Set per-actor gravity. Positive values are multiplied with the class's property,
|
||||
gravity = <float>; // Set per-actor gravity. Positive values are multiplied with the class's property,
|
||||
// negative values are used as their absolute. Default = 1.0.
|
||||
|
||||
health = <int>; // Set per-actor health. Positive values are multiplied with the class's property,
|
||||
// negative values are used as their absolute. Default = 1.
|
||||
health = <int>; // Set per-actor health. Positive values are multiplied with the class's property,
|
||||
// negative values are used as their absolute. Default = 1.
|
||||
|
||||
renderstyle = <string>; // Set per-actor render style, overriding the class default. Possible values can be "normal",
|
||||
// "none", "add" or "additive", "subtract" or "subtractive", "stencil", "translucentstencil",
|
||||
// "translucent", "fuzzy", "optfuzzy", "soultrans". Default is an empty string for no change.
|
||||
fillcolor = <integer>; // Fill color used by the "stencil" and "translucentstencil" rendestyles, as RRGGBB value, default = 0x000000.
|
||||
alpha = <float>; // Translucency of this actor (if applicable to renderstyle), default is 1.0.
|
||||
score = <int>; // Score value of this actor, overriding the class default if not null. Default = 0.
|
||||
renderstyle = <string>; // Set per-actor render style, overriding the class default. Possible values can be "normal",
|
||||
// "none", "add" or "additive", "subtract" or "subtractive", "stencil", "translucentstencil",
|
||||
// "translucent", "fuzzy", "optfuzzy", "soultrans". Default is an empty string for no change.
|
||||
fillcolor = <integer>; // Fill color used by the "stencil" and "translucentstencil" rendestyles, as RRGGBB value, default = 0x000000.
|
||||
alpha = <float>; // Translucency of this actor (if applicable to renderstyle), default is 1.0.
|
||||
score = <int>; // Score value of this actor, overriding the class default if not null. Default = 0.
|
||||
pitch = <integer>; // Pitch of thing in degrees. Default = 0 (horizontal).
|
||||
roll = <integer>; // Pitch of thing in degrees. Default = 0 (horizontal).
|
||||
scalex = <float>; // Vertical scaling on thing. Default = 0 (ignored).
|
||||
scaley = <float>; // Horizontal scaling on thing. Default = 0 (ignored).
|
||||
scale = <float>; // Vertical and horizontal scaling on thing. Default = 0 (ignored).
|
||||
scalex = <float>; // Vertical scaling on thing. Default = 0 (ignored).
|
||||
scaley = <float>; // Horizontal scaling on thing. Default = 0 (ignored).
|
||||
scale = <float>; // Vertical and horizontal scaling on thing. Default = 0 (ignored).
|
||||
|
||||
* Note about arg0str
|
||||
|
||||
|
|
|
@ -147,6 +147,18 @@
|
|||
<Compile Include="Actions\ActionManager.cs" />
|
||||
<Compile Include="Config\CompilerInfo.cs" />
|
||||
<Compile Include="Config\ConfigurationInfo.cs" />
|
||||
<Compile Include="GZBuilder\Controls\PairedFloatControl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GZBuilder\Controls\PairedFloatControl.Designer.cs">
|
||||
<DependentUpon>PairedFloatControl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GZBuilder\Windows\ThingStatisticsForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GZBuilder\Windows\ThingStatisticsForm.Designer.cs">
|
||||
<DependentUpon>ThingStatisticsForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="VisualModes\VisualBlockMap.cs" />
|
||||
<Compile Include="VisualModes\VisualMode.cs" />
|
||||
<Compile Include="General\Clock.cs" />
|
||||
|
@ -511,6 +523,12 @@
|
|||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="GZBuilder\Controls\PairedFloatControl.resx">
|
||||
<DependentUpon>PairedFloatControl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="GZBuilder\Windows\ThingStatisticsForm.resx">
|
||||
<DependentUpon>ThingStatisticsForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Windows\AboutForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>AboutForm.cs</DependentUpon>
|
||||
|
@ -653,6 +671,7 @@
|
|||
<EmbeddedResource Include="Resources\Thing2D_0.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\ThingStatistics.png" />
|
||||
<None Include="Resources\Copy.png" />
|
||||
<None Include="Resources\Cut.png" />
|
||||
<None Include="Resources\Close.png" />
|
||||
|
@ -1129,6 +1148,9 @@
|
|||
<SubType>Designer</SubType>
|
||||
<DependentUpon>ThingEditForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Windows\ThingEditFormUDMF.resx">
|
||||
<DependentUpon>ThingEditFormUDMF.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Windows\ThingsFiltersForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>ThingsFiltersForm.cs</DependentUpon>
|
||||
|
|
|
@ -321,6 +321,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
loadModeldefs(actorsByClass);
|
||||
loadGldefs(actorsByClass);
|
||||
actorsByClass = null; //don't need them any more
|
||||
foreach (Thing t in General.Map.Map.Things) t.UpdateCache();
|
||||
General.MainWindow.DisplayReady();
|
||||
|
||||
// Process colormaps (we just put them in as textures)
|
||||
|
@ -593,9 +594,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
image.LoadImage();
|
||||
}
|
||||
|
||||
// Unload this image?
|
||||
if(!image.IsReferenced && image.AllowUnload && (image.ImageState != ImageLoadState.None))
|
||||
else if(!image.IsReferenced && image.AllowUnload && (image.ImageState != ImageLoadState.None))
|
||||
{
|
||||
// Still unreferenced?
|
||||
image.UnloadImage();
|
||||
|
@ -1421,7 +1421,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
General.MainWindow.DisplayStatus(StatusType.Busy, "Reloading voxel definitions...");
|
||||
loadVoxels();
|
||||
|
||||
foreach(Thing t in General.Map.Map.Things) t.UpdateModelStatus();
|
||||
foreach(Thing t in General.Map.Map.Things) t.UpdateCache();
|
||||
|
||||
//rebuild geometry if in Visual mode
|
||||
if (General.Editing.Mode != null && General.Editing.Mode.GetType().Name == "BaseVisualMode") {
|
||||
|
@ -1501,8 +1501,6 @@ namespace CodeImp.DoomBuilder.Data
|
|||
else if(!invalidDecorateActors.Contains(e.Key))
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Got MODELDEF override for class '" + e.Key + "', but haven't found such class in Decorate");
|
||||
}
|
||||
|
||||
foreach(Thing t in General.Map.Map.Things) t.UpdateModelStatus();
|
||||
}
|
||||
|
||||
//mxd
|
||||
|
|
|
@ -214,7 +214,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// This loads the image
|
||||
public void LoadImage()
|
||||
public virtual void LoadImage()
|
||||
{
|
||||
// Do the loading
|
||||
LocalLoadImage();
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
using System;
|
||||
using CodeImp.DoomBuilder.IO;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -56,6 +58,17 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
#region ================== Methods
|
||||
|
||||
//mxd
|
||||
override public void LoadImage()
|
||||
{
|
||||
// Do the loading
|
||||
LocalLoadImage();
|
||||
|
||||
// Notify the main thread about the change to redraw display
|
||||
IntPtr strptr = Marshal.StringToCoTaskMemAuto(this.Name);
|
||||
General.SendMessage(General.MainWindow.Handle, (int)MainForm.ThreadMessages.SpriteDataLoaded, strptr.ToInt32(), 0);
|
||||
}
|
||||
|
||||
// This loads the image
|
||||
protected override void LocalLoadImage()
|
||||
{
|
||||
|
|
|
@ -17,15 +17,16 @@
|
|||
#region ================== Namespaces
|
||||
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
using CodeImp.DoomBuilder.IO;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Actions;
|
||||
using CodeImp.DoomBuilder.Config;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using CodeImp.DoomBuilder.GZBuilder.Data; //mxd
|
||||
using CodeImp.DoomBuilder.GZBuilder.Data;
|
||||
using CodeImp.DoomBuilder.IO;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -302,14 +303,15 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
memstream.Dispose();
|
||||
|
||||
// Check if anything was pasted
|
||||
int totalpasted = General.Map.Map.GetMarkedThings(true).Count;
|
||||
List<Thing> things = General.Map.Map.GetMarkedThings(true); //mxd
|
||||
int totalpasted = things.Count;
|
||||
totalpasted += General.Map.Map.GetMarkedVertices(true).Count;
|
||||
totalpasted += General.Map.Map.GetMarkedLinedefs(true).Count;
|
||||
totalpasted += General.Map.Map.GetMarkedSidedefs(true).Count;
|
||||
totalpasted += General.Map.Map.GetMarkedSectors(true).Count;
|
||||
if(totalpasted > 0)
|
||||
{
|
||||
General.Map.Map.UpdateConfiguration();
|
||||
foreach (Thing t in things) t.UpdateConfiguration(); //mxd
|
||||
General.Map.ThingsFilter.Update();
|
||||
General.Editing.Mode.OnPasteEnd(options.Copy());
|
||||
General.Plugins.OnPasteEnd(options);
|
||||
|
|
|
@ -145,6 +145,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
|
|||
|
||||
if(e.Button == MouseButtons.Left) {
|
||||
thisAngle = (int)Math.Round(thisAngle / 45f) * 45;
|
||||
if (thisAngle == 360) thisAngle = 0;
|
||||
}
|
||||
|
||||
if(thisAngle != this.Angle) {
|
||||
|
|
132
Source/Core/GZBuilder/Controls/PairedFloatControl.Designer.cs
generated
Normal file
132
Source/Core/GZBuilder/Controls/PairedFloatControl.Designer.cs
generated
Normal file
|
@ -0,0 +1,132 @@
|
|||
namespace CodeImp.DoomBuilder.GZBuilder.Controls
|
||||
{
|
||||
partial class PairedFloatControl
|
||||
{
|
||||
/// <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 Component 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.value1 = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
|
||||
this.value2 = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
|
||||
this.label = new System.Windows.Forms.Label();
|
||||
this.bReset = new System.Windows.Forms.Button();
|
||||
this.bLink = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// value1
|
||||
//
|
||||
this.value1.AllowDecimal = true;
|
||||
this.value1.AllowNegative = true;
|
||||
this.value1.AllowRelative = true;
|
||||
this.value1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.value1.ButtonStep = 1;
|
||||
this.value1.ButtonStepFloat = 1F;
|
||||
this.value1.Location = new System.Drawing.Point(86, 1);
|
||||
this.value1.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.value1.Name = "value1";
|
||||
this.value1.Size = new System.Drawing.Size(62, 24);
|
||||
this.value1.StepValues = null;
|
||||
this.value1.TabIndex = 42;
|
||||
this.value1.Tag = "offsetx_top";
|
||||
this.value1.WhenTextChanged += new System.EventHandler(this.value1_WhenTextChanged);
|
||||
//
|
||||
// value2
|
||||
//
|
||||
this.value2.AllowDecimal = true;
|
||||
this.value2.AllowNegative = true;
|
||||
this.value2.AllowRelative = true;
|
||||
this.value2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.value2.ButtonStep = 1;
|
||||
this.value2.ButtonStepFloat = 1F;
|
||||
this.value2.Location = new System.Drawing.Point(155, 1);
|
||||
this.value2.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.value2.Name = "value2";
|
||||
this.value2.Size = new System.Drawing.Size(62, 24);
|
||||
this.value2.StepValues = null;
|
||||
this.value2.TabIndex = 43;
|
||||
this.value2.Tag = "offsety_top";
|
||||
this.value2.WhenTextChanged += new System.EventHandler(this.value2_WhenTextChanged);
|
||||
//
|
||||
// label
|
||||
//
|
||||
this.label.Location = new System.Drawing.Point(0, 6);
|
||||
this.label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label.Name = "label";
|
||||
this.label.Size = new System.Drawing.Size(86, 15);
|
||||
this.label.TabIndex = 41;
|
||||
this.label.Text = "Texture Offsets:";
|
||||
this.label.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// bReset
|
||||
//
|
||||
this.bReset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.bReset.Image = global::CodeImp.DoomBuilder.Properties.Resources.Reset;
|
||||
this.bReset.Location = new System.Drawing.Point(245, 1);
|
||||
this.bReset.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.bReset.Name = "bReset";
|
||||
this.bReset.Size = new System.Drawing.Size(23, 25);
|
||||
this.bReset.TabIndex = 45;
|
||||
this.bReset.UseVisualStyleBackColor = true;
|
||||
this.bReset.Visible = false;
|
||||
this.bReset.Click += new System.EventHandler(this.bReset_Click);
|
||||
//
|
||||
// bLink
|
||||
//
|
||||
this.bLink.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.bLink.Image = global::CodeImp.DoomBuilder.Properties.Resources.Link;
|
||||
this.bLink.Location = new System.Drawing.Point(220, 1);
|
||||
this.bLink.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.bLink.Name = "bLink";
|
||||
this.bLink.Size = new System.Drawing.Size(23, 25);
|
||||
this.bLink.TabIndex = 44;
|
||||
this.bLink.UseVisualStyleBackColor = true;
|
||||
this.bLink.Click += new System.EventHandler(this.bLink_Click);
|
||||
//
|
||||
// PairedFloatControl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.bReset);
|
||||
this.Controls.Add(this.bLink);
|
||||
this.Controls.Add(this.value1);
|
||||
this.Controls.Add(this.value2);
|
||||
this.Controls.Add(this.label);
|
||||
this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
this.Name = "PairedFloatControl";
|
||||
this.Size = new System.Drawing.Size(268, 26);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button bReset;
|
||||
private System.Windows.Forms.Button bLink;
|
||||
private DoomBuilder.Controls.ButtonsNumericTextbox value1;
|
||||
private DoomBuilder.Controls.ButtonsNumericTextbox value2;
|
||||
private System.Windows.Forms.Label label;
|
||||
}
|
||||
}
|
116
Source/Core/GZBuilder/Controls/PairedFloatControl.cs
Normal file
116
Source/Core/GZBuilder/Controls/PairedFloatControl.cs
Normal file
|
@ -0,0 +1,116 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Properties;
|
||||
|
||||
namespace CodeImp.DoomBuilder.GZBuilder.Controls
|
||||
{
|
||||
public partial class PairedFloatControl : UserControl
|
||||
{
|
||||
#region ================== Events
|
||||
|
||||
public event EventHandler OnValuesChanged;
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Variables
|
||||
|
||||
private float defaultValue;
|
||||
private bool blockUpdate;
|
||||
private bool linkValues;
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Properties
|
||||
|
||||
public string Label { get { return label.Text; } set { label.Text = value; } }
|
||||
public float DefaultValue { get { return defaultValue; } set { defaultValue = value; } }
|
||||
public float ButtonStep { get { return value1.ButtonStepFloat; } set { value1.ButtonStepFloat = value; value2.ButtonStepFloat = value; } }
|
||||
|
||||
#endregion
|
||||
|
||||
public PairedFloatControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void SetValues(float val1, float val2, bool first)
|
||||
{
|
||||
blockUpdate = true;
|
||||
|
||||
if (first) {
|
||||
value1.Text = val1.ToString();
|
||||
value2.Text = val2.ToString();
|
||||
} else {
|
||||
if (!string.IsNullOrEmpty(value1.Text) && value1.Text != val1.ToString())
|
||||
value1.Text = string.Empty;
|
||||
|
||||
if (!string.IsNullOrEmpty(value2.Text) && value2.Text != val2.ToString())
|
||||
value2.Text = string.Empty;
|
||||
}
|
||||
|
||||
checkValues();
|
||||
|
||||
blockUpdate = false;
|
||||
}
|
||||
|
||||
public float GetValue1(float original)
|
||||
{
|
||||
return value1.GetResultFloat(original);
|
||||
}
|
||||
|
||||
public float GetValue2(float original)
|
||||
{
|
||||
return value2.GetResultFloat(original);
|
||||
}
|
||||
|
||||
private void checkValues()
|
||||
{
|
||||
bool changed = string.IsNullOrEmpty(value1.Text) || string.IsNullOrEmpty(value2.Text)
|
||||
|| value1.GetResultFloat(defaultValue) != defaultValue || value2.GetResultFloat(defaultValue) != defaultValue;
|
||||
label.Enabled = changed;
|
||||
bReset.Visible = changed;
|
||||
|
||||
if (!blockUpdate && OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private void bReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
string newValue = String.Format("{0:0.0}", defaultValue);
|
||||
value1.Text = newValue;
|
||||
value2.Text = newValue;
|
||||
checkValues();
|
||||
}
|
||||
|
||||
private void bLink_Click(object sender, EventArgs e)
|
||||
{
|
||||
linkValues = !linkValues;
|
||||
bLink.Image = (linkValues ? Resources.Link : Resources.Unlink);
|
||||
}
|
||||
|
||||
private void value1_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (blockUpdate) return;
|
||||
|
||||
if (linkValues) {
|
||||
blockUpdate = true;
|
||||
value2.Text = value1.Text;
|
||||
blockUpdate = false;
|
||||
}
|
||||
|
||||
checkValues();
|
||||
}
|
||||
|
||||
private void value2_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (blockUpdate) return;
|
||||
|
||||
if (linkValues) {
|
||||
blockUpdate = true;
|
||||
value1.Text = value2.Text;
|
||||
blockUpdate = false;
|
||||
}
|
||||
|
||||
checkValues();
|
||||
}
|
||||
}
|
||||
}
|
120
Source/Core/GZBuilder/Controls/PairedFloatControl.resx
Normal file
120
Source/Core/GZBuilder/Controls/PairedFloatControl.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>
|
|
@ -23,6 +23,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
|
|||
internal float RollOffset; //in radians
|
||||
internal bool OverridePalette; //used for voxel models only
|
||||
internal bool IsVoxel;
|
||||
internal bool InheritActorPitch;
|
||||
internal bool InheritActorRoll;
|
||||
|
||||
internal ModelData() {
|
||||
ModelNames = new List<string>();
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
|
||||
|
|
|
@ -18,285 +18,301 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom {
|
|||
float angleOffset = 0;
|
||||
float pitchOffset = 0;
|
||||
float rollOffset = 0;
|
||||
bool inheritactorpitch = false;
|
||||
bool inheritactorroll = false;
|
||||
|
||||
string token;
|
||||
bool gotErrors = false;
|
||||
bool allParsed = false;
|
||||
|
||||
//read modeldef structure contents
|
||||
while (parser.SkipWhitespace(true)) {
|
||||
while(!gotErrors && !allParsed && parser.SkipWhitespace(true)) {
|
||||
token = parser.ReadToken();
|
||||
|
||||
if (!string.IsNullOrEmpty(token)) {
|
||||
token = parser.StripTokenQuotes(token).ToLowerInvariant(); //ANYTHING can be quoted...
|
||||
//path
|
||||
if (token == "path") {
|
||||
parser.SkipWhitespace(true);
|
||||
path = parser.StripTokenQuotes(parser.ReadToken()).Replace("/", "\\");
|
||||
switch (token) {
|
||||
case "path":
|
||||
parser.SkipWhitespace(true);
|
||||
path = parser.StripTokenQuotes(parser.ReadToken()).Replace("/", "\\");
|
||||
|
||||
if (string.IsNullOrEmpty(path)) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected path to model, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
//model
|
||||
} else if (token == "model") {
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
//model index
|
||||
int modelIndex;
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if (!int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out modelIndex)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected model index, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (modelIndex >= MAX_MODELS) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": GZDoom doesn't allow more than " + MAX_MODELS + " models per MODELDEF entry!");
|
||||
break;
|
||||
}
|
||||
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
//model path
|
||||
token = parser.StripTokenQuotes(parser.ReadToken()).ToLowerInvariant();
|
||||
if (string.IsNullOrEmpty(token)) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected model name, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
break;
|
||||
} else {
|
||||
//check extension
|
||||
string fileExt = Path.GetExtension(token);
|
||||
if (string.IsNullOrEmpty(fileExt)){
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": model '" + token + "' won't be loaded. Models without extension are not supported by GZDoom.");
|
||||
if(string.IsNullOrEmpty(path)) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected path to model, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
if(fileExt != ".md3" && fileExt != ".md2") {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": model '" + token + "' won't be loaded. Only MD2 and MD3 models are supported.");
|
||||
break;
|
||||
|
||||
case "model":
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
//model index
|
||||
int index;
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if(!int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out index)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected model index, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
//GZDoom allows models with identical modelIndex, it uses the last one encountered
|
||||
modelNames[modelIndex] = Path.Combine(path, token);
|
||||
}
|
||||
//skin
|
||||
} else if (token == "skin") {
|
||||
parser.SkipWhitespace(true);
|
||||
if(index >= MAX_MODELS) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": GZDoom doesn't allow more than " + MAX_MODELS + " models per MODELDEF entry!");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
//skin index
|
||||
int skinIndex;
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if (!int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out skinIndex)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected skin index, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
if (skinIndex >= MAX_MODELS) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": GZDoom doesn't allow more than " + MAX_MODELS + " skins per MODELDEF entry!");
|
||||
break;
|
||||
}
|
||||
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
//skin path
|
||||
token = parser.StripTokenQuotes(parser.ReadToken()).ToLowerInvariant();
|
||||
if (string.IsNullOrEmpty(token)) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected skin name, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
break;
|
||||
} else {
|
||||
//check extension
|
||||
string ext = Path.GetExtension(token);
|
||||
if(Array.IndexOf(TextureData.SUPPORTED_TEXTURE_EXTENSIONS, ext) == -1) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": image format '" + ext + "' is not supported!");
|
||||
textureNames[skinIndex] = TextureData.INVALID_TEXTURE;
|
||||
//model path
|
||||
token = parser.StripTokenQuotes(parser.ReadToken()).ToLowerInvariant();
|
||||
if(string.IsNullOrEmpty(token)) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected model name, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
} else {
|
||||
//GZDoom allows skins with identical modelIndex, it uses the last one encountered
|
||||
textureNames[skinIndex] = Path.Combine(path, token);
|
||||
//check extension
|
||||
string fileExt = Path.GetExtension(token);
|
||||
if(string.IsNullOrEmpty(fileExt)) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": model '" + token + "' won't be loaded. Models without extension are not supported by GZDoom.");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
if(fileExt != ".md3" && fileExt != ".md2") {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": model '" + token + "' won't be loaded. Only MD2 and MD3 models are supported.");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
//GZDoom allows models with identical modelIndex, it uses the last one encountered
|
||||
modelNames[index] = Path.Combine(path, token);
|
||||
}
|
||||
}
|
||||
//scale
|
||||
} else if (token == "scale") {
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if (!parser.ReadSignedFloat(token, ref scale.X)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected scale X value, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
parser.SkipWhitespace(true);
|
||||
case "skin":
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if (!parser.ReadSignedFloat(token, ref scale.Y)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected scale Y value, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
//skin index
|
||||
int skinIndex;
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if(!int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out skinIndex)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected skin index, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(skinIndex >= MAX_MODELS) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": GZDoom doesn't allow more than " + MAX_MODELS + " skins per MODELDEF entry!");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
//skin path
|
||||
token = parser.StripTokenQuotes(parser.ReadToken()).ToLowerInvariant();
|
||||
if(string.IsNullOrEmpty(token)) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected skin name, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
} else {
|
||||
//check extension
|
||||
string ext = Path.GetExtension(token);
|
||||
if(Array.IndexOf(TextureData.SUPPORTED_TEXTURE_EXTENSIONS, ext) == -1) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": image format '" + ext + "' is not supported!");
|
||||
textureNames[skinIndex] = TextureData.INVALID_TEXTURE;
|
||||
} else {
|
||||
//GZDoom allows skins with identical modelIndex, it uses the last one encountered
|
||||
textureNames[skinIndex] = Path.Combine(path, token);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
parser.SkipWhitespace(true);
|
||||
case "scale":
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if (!parser.ReadSignedFloat(token, ref scale.Z)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected scale Z value, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if(!parser.ReadSignedFloat(token, ref scale.X)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected scale X value, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if(!parser.ReadSignedFloat(token, ref scale.Y)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected scale Y value, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if(!parser.ReadSignedFloat(token, ref scale.Z)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected scale Z value, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
//zoffset
|
||||
} else if (token == "zoffset") {
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if (!parser.ReadSignedFloat(token, ref zOffset)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected ZOffset value, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
case "zoffset":
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if(!parser.ReadSignedFloat(token, ref zOffset)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected ZOffset value, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
//angleoffset
|
||||
} else if (token == "angleoffset") {
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if (!parser.ReadSignedFloat(token, ref angleOffset)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected AngleOffset value, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
case "angleoffset":
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if(!parser.ReadSignedFloat(token, ref angleOffset)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected AngleOffset value, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
//pitchoffset
|
||||
} else if (token == "pitchoffset") {
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if (!parser.ReadSignedFloat(token, ref pitchOffset)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected PitchOffset value, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
case "pitchoffset":
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if(!parser.ReadSignedFloat(token, ref pitchOffset)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected PitchOffset value, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
//rolloffset
|
||||
} else if (token == "rolloffset") {
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if (!parser.ReadSignedFloat(token, ref rollOffset)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected RollOffset value, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
case "rolloffset":
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
if(!parser.ReadSignedFloat(token, ref rollOffset)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected RollOffset value, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
//frameindex
|
||||
} else if(token == "frameindex" || token == "frame") {
|
||||
//parsed all required fields. if got more than one model - find which one(s) should be displayed
|
||||
int len = modelNames.GetLength(0);
|
||||
if (!gotErrors && len > 1) {
|
||||
string spriteLump = null;
|
||||
string spriteFrame = null;
|
||||
bool[] modelsUsed = new bool[MAX_MODELS];
|
||||
|
||||
//step back
|
||||
parser.DataStream.Seek(-token.Length - 1, SeekOrigin.Current);
|
||||
case "inheritactorpitch":
|
||||
inheritactorpitch = true;
|
||||
break;
|
||||
|
||||
//here we check which models are used in first encountered lump and frame
|
||||
while (parser.SkipWhitespace(true)) {
|
||||
token = parser.StripTokenQuotes(parser.ReadToken()).ToLowerInvariant();
|
||||
case "inheritactorroll":
|
||||
inheritactorroll = true;
|
||||
break;
|
||||
|
||||
if(token == "frameindex" || token == "frame") {
|
||||
bool frameIndex = (token == "frameindex");
|
||||
parser.SkipWhitespace(true);
|
||||
case "frameindex":
|
||||
case "frame":
|
||||
//parsed all required fields. if got more than one model - find which one(s) should be displayed
|
||||
int len = modelNames.GetLength(0);
|
||||
if(!gotErrors && len > 1) {
|
||||
string spriteLump = null;
|
||||
string spriteFrame = null;
|
||||
bool[] modelsUsed = new bool[MAX_MODELS];
|
||||
|
||||
//should be sprite lump
|
||||
//step back
|
||||
parser.DataStream.Seek(-token.Length - 1, SeekOrigin.Current);
|
||||
|
||||
//here we check which models are used in first encountered lump and frame
|
||||
while(parser.SkipWhitespace(true)) {
|
||||
token = parser.StripTokenQuotes(parser.ReadToken()).ToLowerInvariant();
|
||||
|
||||
if (string.IsNullOrEmpty(spriteLump)) {
|
||||
spriteLump = token;
|
||||
} else if (spriteLump != token) { //got another lump
|
||||
for (int i = 0; i < modelsUsed.Length; i++) {
|
||||
if (!modelsUsed[i]) {
|
||||
modelNames[i] = null;
|
||||
textureNames[i] = null;
|
||||
if(token == "frameindex" || token == "frame") {
|
||||
bool frameIndex = (token == "frameindex");
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
//should be sprite lump
|
||||
token = parser.StripTokenQuotes(parser.ReadToken()).ToLowerInvariant();
|
||||
|
||||
if(string.IsNullOrEmpty(spriteLump)) {
|
||||
spriteLump = token;
|
||||
} else if(spriteLump != token) { //got another lump
|
||||
for(int i = 0; i < modelsUsed.Length; i++) {
|
||||
if(!modelsUsed[i]) {
|
||||
modelNames[i] = null;
|
||||
textureNames[i] = null;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
parser.SkipWhitespace(true);
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
//should be sprite frame
|
||||
token = parser.StripTokenQuotes(parser.ReadToken()).ToLowerInvariant();
|
||||
//should be sprite frame
|
||||
token = parser.StripTokenQuotes(parser.ReadToken()).ToLowerInvariant();
|
||||
|
||||
if (string.IsNullOrEmpty(spriteFrame)) {
|
||||
spriteFrame = token;
|
||||
} else if (spriteFrame != token) { //got another frame
|
||||
for (int i = 0; i < modelsUsed.Length; i++) {
|
||||
if (!modelsUsed[i]) {
|
||||
modelNames[i] = null;
|
||||
textureNames[i] = null;
|
||||
if(string.IsNullOrEmpty(spriteFrame)) {
|
||||
spriteFrame = token;
|
||||
} else if(spriteFrame != token) { //got another frame
|
||||
for(int i = 0; i < modelsUsed.Length; i++) {
|
||||
if(!modelsUsed[i]) {
|
||||
modelNames[i] = null;
|
||||
textureNames[i] = null;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
parser.SkipWhitespace(true);
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
//should be model index
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
//should be model index
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
|
||||
int modelIndex;
|
||||
if (!int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out modelIndex)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected model index, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (modelIndex >= MAX_MODELS) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": GZDoom doesn't allow more than " + MAX_MODELS + " models per MODELDEF entry!");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (modelNames[modelIndex] == null) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": got model index, which doesn't correspond to any defined model!");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
modelsUsed[modelIndex] = true;
|
||||
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
//should be frame name or index. Currently I have no use for it
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
|
||||
if(frameIndex) {
|
||||
int frame;
|
||||
if(!int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out frame)) {
|
||||
int modelIndex;
|
||||
if(!int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out modelIndex)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected model frame, but got '" + token + "'");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected model index, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
//must be "}", step back
|
||||
parser.DataStream.Seek(-token.Length - 1, SeekOrigin.Current);
|
||||
break;
|
||||
if(modelIndex >= MAX_MODELS) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": GZDoom doesn't allow more than " + MAX_MODELS + " models per MODELDEF entry!");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(modelNames[modelIndex] == null) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": got model index, which doesn't correspond to any defined model!");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
modelsUsed[modelIndex] = true;
|
||||
|
||||
parser.SkipWhitespace(true);
|
||||
|
||||
//should be frame name or index. Currently I have no use for it
|
||||
token = parser.StripTokenQuotes(parser.ReadToken());
|
||||
|
||||
if(frameIndex) {
|
||||
int frame;
|
||||
if(!int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out frame)) {
|
||||
// Not numeric!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected model frame, but got '" + token + "'");
|
||||
gotErrors = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
//must be "}", step back
|
||||
parser.DataStream.Seek(-token.Length - 1, SeekOrigin.Current);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
allParsed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -304,8 +320,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom {
|
|||
//find closing brace, then quit;
|
||||
while (parser.SkipWhitespace(true)) {
|
||||
token = parser.ReadToken();
|
||||
if (token == "}")
|
||||
break;
|
||||
if (token == "}") break;
|
||||
}
|
||||
|
||||
if (gotErrors) return null;
|
||||
|
@ -317,6 +332,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom {
|
|||
mde.AngleOffset = Angle2D.DegToRad(angleOffset);
|
||||
mde.RollOffset = Angle2D.DegToRad(rollOffset);
|
||||
mde.PitchOffset = Angle2D.DegToRad(pitchOffset);
|
||||
mde.InheritActorPitch = inheritactorpitch;
|
||||
mde.InheritActorRoll = inheritactorroll;
|
||||
|
||||
for(int i = 0; i < modelNames.Length; i++) {
|
||||
if (!string.IsNullOrEmpty(modelNames[i])) {
|
||||
|
|
|
@ -59,6 +59,19 @@ namespace CodeImp.DoomBuilder.GZBuilder.Tools
|
|||
return fields.GetValue(key, defaultValue);
|
||||
}
|
||||
|
||||
public static void SetString(UniFields fields, string key, string value, string defaultValue) {
|
||||
if(fields == null) return;
|
||||
|
||||
if(value != defaultValue) {
|
||||
if(!fields.ContainsKey(key))
|
||||
fields.Add(key, new UniValue(UniversalType.String, value));
|
||||
else
|
||||
fields[key].Value = value;
|
||||
} else if(fields.ContainsKey(key)) { //don't save default value
|
||||
fields.Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ClearFields(UniFields fields, string[] keys) {
|
||||
if(fields == null) return;
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Windows
|
|||
"Invalid Error",
|
||||
"Beam me up Scotty, there’s no life out here",
|
||||
"Well, you ran into something and the game is over",
|
||||
"I'm good at writing bad code",
|
||||
"I'm good at writing bad code",
|
||||
"$FUNNY_ERROR_CAPTION",
|
||||
"In Soviet Russia, exception throws YOU!",
|
||||
"...and then GZDB was the demons!",
|
||||
|
@ -94,6 +94,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Windows
|
|||
"This function is only available in the retail version of GZDoom Builder",
|
||||
"You picked up the Random Exception.",
|
||||
"Pinky says that you're the new hope. Bear that in mind.",
|
||||
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
|
||||
};
|
||||
this.Text = titles[new Random().Next(0, titles.Length - 1)];
|
||||
}
|
||||
|
|
|
@ -25,171 +25,172 @@
|
|||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.dataGridView = new System.Windows.Forms.DataGridView();
|
||||
this.TagColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Label = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Sectors = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Linedefs = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Things = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.apply = new System.Windows.Forms.Button();
|
||||
this.cancel = new System.Windows.Forms.Button();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
this.dataGridView.AllowUserToAddRows = false;
|
||||
this.dataGridView.AllowUserToResizeColumns = false;
|
||||
this.dataGridView.AllowUserToResizeRows = false;
|
||||
this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.Window;
|
||||
this.dataGridView.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.dataGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
|
||||
this.dataGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
|
||||
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.dataGridView = new System.Windows.Forms.DataGridView();
|
||||
this.TagColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Label = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Sectors = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Linedefs = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Things = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.apply = new System.Windows.Forms.Button();
|
||||
this.cancel = new System.Windows.Forms.Button();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
this.dataGridView.AllowUserToAddRows = false;
|
||||
this.dataGridView.AllowUserToResizeColumns = false;
|
||||
this.dataGridView.AllowUserToResizeRows = false;
|
||||
this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.Window;
|
||||
this.dataGridView.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.dataGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
|
||||
this.dataGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
|
||||
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.TagColumn,
|
||||
this.Label,
|
||||
this.Sectors,
|
||||
this.Linedefs,
|
||||
this.Things});
|
||||
this.dataGridView.Location = new System.Drawing.Point(12, 12);
|
||||
this.dataGridView.MultiSelect = false;
|
||||
this.dataGridView.Name = "dataGridView";
|
||||
this.dataGridView.RowHeadersVisible = false;
|
||||
this.dataGridView.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
|
||||
this.dataGridView.Size = new System.Drawing.Size(477, 256);
|
||||
this.dataGridView.TabIndex = 3;
|
||||
this.dataGridView.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView_CellMouseClick);
|
||||
this.dataGridView.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView_CellMouseDoubleClick);
|
||||
//
|
||||
// TagColumn
|
||||
//
|
||||
this.TagColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
|
||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
this.TagColumn.DefaultCellStyle = dataGridViewCellStyle2;
|
||||
this.TagColumn.HeaderText = "Tag";
|
||||
this.TagColumn.Name = "TagColumn";
|
||||
this.TagColumn.ReadOnly = true;
|
||||
this.TagColumn.Width = 51;
|
||||
//
|
||||
// Label
|
||||
//
|
||||
this.Label.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.Label.DefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.Label.HeaderText = "Label";
|
||||
this.Label.Name = "Label";
|
||||
//
|
||||
// Sectors
|
||||
//
|
||||
this.Sectors.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
|
||||
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
this.Sectors.DefaultCellStyle = dataGridViewCellStyle4;
|
||||
this.Sectors.HeaderText = "Sectors";
|
||||
this.Sectors.Name = "Sectors";
|
||||
this.Sectors.ReadOnly = true;
|
||||
this.Sectors.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.Sectors.Width = 68;
|
||||
//
|
||||
// Linedefs
|
||||
//
|
||||
this.Linedefs.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
|
||||
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
this.Linedefs.DefaultCellStyle = dataGridViewCellStyle5;
|
||||
this.Linedefs.HeaderText = "Linedefs";
|
||||
this.Linedefs.Name = "Linedefs";
|
||||
this.Linedefs.ReadOnly = true;
|
||||
this.Linedefs.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.Linedefs.Width = 72;
|
||||
//
|
||||
// Things
|
||||
//
|
||||
this.Things.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
|
||||
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
this.Things.DefaultCellStyle = dataGridViewCellStyle6;
|
||||
this.Things.HeaderText = "Things";
|
||||
this.Things.Name = "Things";
|
||||
this.Things.ReadOnly = true;
|
||||
this.Things.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.Things.Width = 64;
|
||||
//
|
||||
// apply
|
||||
//
|
||||
this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.apply.Location = new System.Drawing.Point(399, 319);
|
||||
this.apply.Name = "apply";
|
||||
this.apply.Size = new System.Drawing.Size(90, 23);
|
||||
this.apply.TabIndex = 4;
|
||||
this.apply.Text = "OK";
|
||||
this.apply.UseVisualStyleBackColor = true;
|
||||
this.apply.Click += new System.EventHandler(this.apply_Click);
|
||||
//
|
||||
// cancel
|
||||
//
|
||||
this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancel.Location = new System.Drawing.Point(303, 319);
|
||||
this.cancel.Name = "cancel";
|
||||
this.cancel.Size = new System.Drawing.Size(90, 23);
|
||||
this.cancel.TabIndex = 5;
|
||||
this.cancel.Text = "Cancel";
|
||||
this.cancel.UseVisualStyleBackColor = true;
|
||||
this.cancel.Click += new System.EventHandler(this.cancel_Click);
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.textBox1.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.textBox1.Location = new System.Drawing.Point(12, 274);
|
||||
this.textBox1.Multiline = true;
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(477, 68);
|
||||
this.textBox1.TabIndex = 7;
|
||||
this.textBox1.Text = "Click on a cell in Sectors, Linedefs or Things column to select map elements with" +
|
||||
" given tag.\r\nRight click to open Properties form for map elements with given tag" +
|
||||
".";
|
||||
//
|
||||
// TagStatisticsForm
|
||||
//
|
||||
this.AcceptButton = this.apply;
|
||||
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(501, 348);
|
||||
this.Controls.Add(this.cancel);
|
||||
this.Controls.Add(this.apply);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.dataGridView);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
|
||||
this.MinimumSize = new System.Drawing.Size(120, 80);
|
||||
this.Name = "TagStatisticsForm";
|
||||
this.ShowInTaskbar = false;
|
||||
this.Text = "Tag statistics";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.TagStatisticsForm_FormClosing);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
this.dataGridView.Location = new System.Drawing.Point(12, 12);
|
||||
this.dataGridView.MultiSelect = false;
|
||||
this.dataGridView.Name = "dataGridView";
|
||||
this.dataGridView.RowHeadersVisible = false;
|
||||
this.dataGridView.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
|
||||
this.dataGridView.Size = new System.Drawing.Size(477, 256);
|
||||
this.dataGridView.TabIndex = 3;
|
||||
this.dataGridView.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView_CellMouseClick);
|
||||
this.dataGridView.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView_CellMouseDoubleClick);
|
||||
//
|
||||
// TagColumn
|
||||
//
|
||||
this.TagColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
|
||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
this.TagColumn.DefaultCellStyle = dataGridViewCellStyle2;
|
||||
this.TagColumn.HeaderText = "Tag";
|
||||
this.TagColumn.Name = "TagColumn";
|
||||
this.TagColumn.ReadOnly = true;
|
||||
this.TagColumn.Width = 49;
|
||||
//
|
||||
// Label
|
||||
//
|
||||
this.Label.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.Label.DefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.Label.HeaderText = "Label";
|
||||
this.Label.Name = "Label";
|
||||
//
|
||||
// Sectors
|
||||
//
|
||||
this.Sectors.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
|
||||
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
this.Sectors.DefaultCellStyle = dataGridViewCellStyle4;
|
||||
this.Sectors.HeaderText = "Sectors";
|
||||
this.Sectors.Name = "Sectors";
|
||||
this.Sectors.ReadOnly = true;
|
||||
this.Sectors.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.Sectors.Width = 70;
|
||||
//
|
||||
// Linedefs
|
||||
//
|
||||
this.Linedefs.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
|
||||
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
this.Linedefs.DefaultCellStyle = dataGridViewCellStyle5;
|
||||
this.Linedefs.HeaderText = "Linedefs";
|
||||
this.Linedefs.Name = "Linedefs";
|
||||
this.Linedefs.ReadOnly = true;
|
||||
this.Linedefs.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.Linedefs.Width = 74;
|
||||
//
|
||||
// Things
|
||||
//
|
||||
this.Things.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
|
||||
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
this.Things.DefaultCellStyle = dataGridViewCellStyle6;
|
||||
this.Things.HeaderText = "Things";
|
||||
this.Things.Name = "Things";
|
||||
this.Things.ReadOnly = true;
|
||||
this.Things.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.Things.Width = 64;
|
||||
//
|
||||
// apply
|
||||
//
|
||||
this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.apply.Location = new System.Drawing.Point(399, 319);
|
||||
this.apply.Name = "apply";
|
||||
this.apply.Size = new System.Drawing.Size(90, 23);
|
||||
this.apply.TabIndex = 4;
|
||||
this.apply.Text = "OK";
|
||||
this.apply.UseVisualStyleBackColor = true;
|
||||
this.apply.Click += new System.EventHandler(this.apply_Click);
|
||||
//
|
||||
// cancel
|
||||
//
|
||||
this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancel.Location = new System.Drawing.Point(303, 319);
|
||||
this.cancel.Name = "cancel";
|
||||
this.cancel.Size = new System.Drawing.Size(90, 23);
|
||||
this.cancel.TabIndex = 5;
|
||||
this.cancel.Text = "Cancel";
|
||||
this.cancel.UseVisualStyleBackColor = true;
|
||||
this.cancel.Click += new System.EventHandler(this.cancel_Click);
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.textBox1.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.textBox1.Location = new System.Drawing.Point(12, 274);
|
||||
this.textBox1.Multiline = true;
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(477, 68);
|
||||
this.textBox1.TabIndex = 7;
|
||||
this.textBox1.Text = "Click on a cell in Sectors, Linedefs or Things column to select map elements with" +
|
||||
" given tag.\r\nRight click to open Properties form for map elements with given tag" +
|
||||
".";
|
||||
//
|
||||
// TagStatisticsForm
|
||||
//
|
||||
this.AcceptButton = this.apply;
|
||||
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(501, 348);
|
||||
this.Controls.Add(this.cancel);
|
||||
this.Controls.Add(this.apply);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.dataGridView);
|
||||
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.SizableToolWindow;
|
||||
this.MinimumSize = new System.Drawing.Size(120, 80);
|
||||
this.Name = "TagStatisticsForm";
|
||||
this.ShowInTaskbar = false;
|
||||
this.Text = "Tag statistics";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.TagStatisticsForm_FormClosing);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -91,17 +91,11 @@ namespace CodeImp.DoomBuilder.GZBuilder.Windows
|
|||
private void addRow(int tag, string label, int sectorsCount, int linesCount, int thingsCount) {
|
||||
DataGridViewRow row = new DataGridViewRow();
|
||||
|
||||
var cTag = new DataGridViewTextBoxCell {Value = tag};
|
||||
var cLabel = new DataGridViewTextBoxCell { Value = label };
|
||||
var cSectors = new DataGridViewTextBoxCell { Value = sectorsCount };
|
||||
var cLines = new DataGridViewTextBoxCell { Value = linesCount };
|
||||
var cThings = new DataGridViewTextBoxCell { Value = thingsCount };
|
||||
|
||||
row.Cells.Add(cTag);
|
||||
row.Cells.Add(cLabel);
|
||||
row.Cells.Add(cSectors);
|
||||
row.Cells.Add(cLines);
|
||||
row.Cells.Add(cThings);
|
||||
row.Cells.Add(new DataGridViewTextBoxCell { Value = tag });
|
||||
row.Cells.Add(new DataGridViewTextBoxCell { Value = label });
|
||||
row.Cells.Add(new DataGridViewTextBoxCell { Value = sectorsCount });
|
||||
row.Cells.Add(new DataGridViewTextBoxCell { Value = linesCount });
|
||||
row.Cells.Add(new DataGridViewTextBoxCell { Value = thingsCount });
|
||||
|
||||
dataGridView.Rows.Add(row);
|
||||
}
|
||||
|
|
176
Source/Core/GZBuilder/Windows/ThingStatisticsForm.Designer.cs
generated
Normal file
176
Source/Core/GZBuilder/Windows/ThingStatisticsForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,176 @@
|
|||
namespace CodeImp.DoomBuilder.GZBuilder.Windows
|
||||
{
|
||||
partial class ThingStatisticsForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.apply = new System.Windows.Forms.Button();
|
||||
this.dataGridView = new System.Windows.Forms.DataGridView();
|
||||
this.ThingType = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ThingTitle = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ThingClassName = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ThingCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.hideUnused = new System.Windows.Forms.CheckBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// apply
|
||||
//
|
||||
this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.apply.Location = new System.Drawing.Point(369, 319);
|
||||
this.apply.Name = "apply";
|
||||
this.apply.Size = new System.Drawing.Size(120, 23);
|
||||
this.apply.TabIndex = 7;
|
||||
this.apply.Text = "Close";
|
||||
this.apply.UseVisualStyleBackColor = true;
|
||||
this.apply.Click += new System.EventHandler(this.apply_Click);
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
this.dataGridView.AllowUserToAddRows = false;
|
||||
this.dataGridView.AllowUserToResizeColumns = false;
|
||||
this.dataGridView.AllowUserToResizeRows = false;
|
||||
this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.Window;
|
||||
this.dataGridView.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.dataGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
|
||||
this.dataGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
|
||||
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.ThingType,
|
||||
this.ThingTitle,
|
||||
this.ThingClassName,
|
||||
this.ThingCount});
|
||||
this.dataGridView.Location = new System.Drawing.Point(12, 12);
|
||||
this.dataGridView.MultiSelect = false;
|
||||
this.dataGridView.Name = "dataGridView";
|
||||
this.dataGridView.RowHeadersVisible = false;
|
||||
this.dataGridView.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dataGridView.Size = new System.Drawing.Size(477, 301);
|
||||
this.dataGridView.TabIndex = 6;
|
||||
this.dataGridView.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView_CellMouseClick);
|
||||
//
|
||||
// ThingType
|
||||
//
|
||||
this.ThingType.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
|
||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
this.ThingType.DefaultCellStyle = dataGridViewCellStyle2;
|
||||
this.ThingType.HeaderText = "№";
|
||||
this.ThingType.Name = "ThingType";
|
||||
this.ThingType.ReadOnly = true;
|
||||
this.ThingType.Width = 45;
|
||||
//
|
||||
// ThingTitle
|
||||
//
|
||||
this.ThingTitle.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.ThingTitle.DefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.ThingTitle.HeaderText = "Thing Name";
|
||||
this.ThingTitle.Name = "ThingTitle";
|
||||
//
|
||||
// ThingClassName
|
||||
//
|
||||
this.ThingClassName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
|
||||
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
this.ThingClassName.DefaultCellStyle = dataGridViewCellStyle4;
|
||||
this.ThingClassName.HeaderText = "Class Name";
|
||||
this.ThingClassName.Name = "ThingClassName";
|
||||
this.ThingClassName.ReadOnly = true;
|
||||
this.ThingClassName.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.ThingClassName.Width = 89;
|
||||
//
|
||||
// ThingCount
|
||||
//
|
||||
this.ThingCount.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
|
||||
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
this.ThingCount.DefaultCellStyle = dataGridViewCellStyle5;
|
||||
this.ThingCount.HeaderText = "Count";
|
||||
this.ThingCount.Name = "ThingCount";
|
||||
this.ThingCount.ReadOnly = true;
|
||||
this.ThingCount.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.ThingCount.Width = 60;
|
||||
//
|
||||
// hideUnused
|
||||
//
|
||||
this.hideUnused.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.hideUnused.AutoSize = true;
|
||||
this.hideUnused.Location = new System.Drawing.Point(13, 322);
|
||||
this.hideUnused.Name = "hideUnused";
|
||||
this.hideUnused.Size = new System.Drawing.Size(122, 18);
|
||||
this.hideUnused.TabIndex = 8;
|
||||
this.hideUnused.Text = "Hide Unused Things";
|
||||
this.hideUnused.UseVisualStyleBackColor = true;
|
||||
this.hideUnused.CheckedChanged += new System.EventHandler(this.hideUnused_CheckedChanged);
|
||||
//
|
||||
// ThingStatisticsForm
|
||||
//
|
||||
this.AcceptButton = this.apply;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.ClientSize = new System.Drawing.Size(501, 348);
|
||||
this.Controls.Add(this.hideUnused);
|
||||
this.Controls.Add(this.apply);
|
||||
this.Controls.Add(this.dataGridView);
|
||||
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.SizableToolWindow;
|
||||
this.Name = "ThingStatisticsForm";
|
||||
this.ShowInTaskbar = false;
|
||||
this.Text = "Thing statistics";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ThingStatisticsForm_FormClosing);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button apply;
|
||||
private System.Windows.Forms.DataGridView dataGridView;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn ThingType;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn ThingTitle;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn ThingClassName;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn ThingCount;
|
||||
private System.Windows.Forms.CheckBox hideUnused;
|
||||
}
|
||||
}
|
152
Source/Core/GZBuilder/Windows/ThingStatisticsForm.cs
Normal file
152
Source/Core/GZBuilder/Windows/ThingStatisticsForm.cs
Normal file
|
@ -0,0 +1,152 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Config;
|
||||
using CodeImp.DoomBuilder.Editing;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
|
||||
namespace CodeImp.DoomBuilder.GZBuilder.Windows
|
||||
{
|
||||
public partial class ThingStatisticsForm : Form
|
||||
{
|
||||
private static Size size = Size.Empty;
|
||||
private static Point location = Point.Empty;
|
||||
|
||||
public ThingStatisticsForm() {
|
||||
InitializeComponent();
|
||||
|
||||
//apply window size and location
|
||||
if (!size.IsEmpty && !location.IsEmpty) {
|
||||
this.StartPosition = FormStartPosition.Manual;
|
||||
this.Size = size;
|
||||
this.Location = location;
|
||||
}
|
||||
|
||||
setup();
|
||||
}
|
||||
|
||||
private void setup() {
|
||||
Dictionary<int, int> thingcounts = new Dictionary<int, int>();
|
||||
Dictionary<int, string> thingtitles = new Dictionary<int, string>();
|
||||
Dictionary<int, string> thingclasses = new Dictionary<int, string>();
|
||||
|
||||
dataGridView.Rows.Clear();
|
||||
|
||||
foreach(ThingTypeInfo ti in General.Map.Data.ThingTypes) {
|
||||
thingcounts.Add(ti.Index, 0);
|
||||
thingtitles.Add(ti.Index, ti.Title);
|
||||
thingclasses.Add(ti.Index, ti.ClassName);
|
||||
}
|
||||
|
||||
foreach(Thing t in General.Map.Map.Things) {
|
||||
if (thingcounts.ContainsKey(t.Type)) {
|
||||
thingcounts[t.Type]++;
|
||||
} else {
|
||||
thingcounts.Add(t.Type, 1);
|
||||
thingtitles.Add(t.Type, "Unknown thing");
|
||||
thingclasses.Add(t.Type, "-");
|
||||
}
|
||||
}
|
||||
|
||||
//add rows
|
||||
foreach (KeyValuePair<int, int> group in thingcounts) {
|
||||
if (hideUnused.Checked && group.Value == 0) continue;
|
||||
|
||||
DataGridViewRow row = new DataGridViewRow();
|
||||
|
||||
row.Cells.Add(new DataGridViewTextBoxCell { Value = group.Key }); //type
|
||||
row.Cells.Add(new DataGridViewTextBoxCell { Value = thingtitles[group.Key] }); //title
|
||||
row.Cells.Add(new DataGridViewTextBoxCell { Value = thingclasses[group.Key] }); //class
|
||||
row.Cells.Add(new DataGridViewTextBoxCell { Value = group.Value }); //count
|
||||
|
||||
dataGridView.Rows.Add(row);
|
||||
}
|
||||
|
||||
dataGridView.Sort(ThingType, ListSortDirection.Ascending);
|
||||
}
|
||||
|
||||
private List<Thing> getThingsByType(int type) {
|
||||
List<Thing> list = new List<Thing>();
|
||||
foreach (Thing t in General.Map.Map.Things) {
|
||||
if (t.Type == type) list.Add(t);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private void showSelection(List<Vector2D> points) {
|
||||
RectangleF area = MapSet.CreateEmptyArea();
|
||||
|
||||
// Make a view area from the points
|
||||
foreach (Vector2D p in points) area = MapSet.IncreaseArea(area, p);
|
||||
|
||||
// Make the area square, using the largest side
|
||||
if (area.Width > area.Height) {
|
||||
float delta = area.Width - area.Height;
|
||||
area.Y -= delta * 0.5f;
|
||||
area.Height += delta;
|
||||
} else {
|
||||
float delta = area.Height - area.Width;
|
||||
area.X -= delta * 0.5f;
|
||||
area.Width += delta;
|
||||
}
|
||||
|
||||
// Add padding
|
||||
area.Inflate(100f, 100f);
|
||||
|
||||
// Zoom to area
|
||||
ClassicMode editmode = (General.Editing.Mode as ClassicMode);
|
||||
editmode.CenterOnArea(area, 0.6f);
|
||||
}
|
||||
|
||||
private void dataGridView_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) {
|
||||
if (e.Button == MouseButtons.Left) { //select
|
||||
List<Thing> list = getThingsByType((int)dataGridView.Rows[e.RowIndex].Cells[0].Value);
|
||||
if (list.Count > 0) {
|
||||
General.Map.Map.ClearSelectedThings();
|
||||
|
||||
List<Vector2D> points = new List<Vector2D>();
|
||||
foreach (Thing t in list) {
|
||||
t.Selected = true;
|
||||
|
||||
Vector2D p = t.Position;
|
||||
points.Add(p);
|
||||
points.Add(p + new Vector2D(t.Size * 2.0f, t.Size * 2.0f));
|
||||
points.Add(p + new Vector2D(t.Size * 2.0f, -t.Size * 2.0f));
|
||||
points.Add(p + new Vector2D(-t.Size * 2.0f, t.Size * 2.0f));
|
||||
points.Add(p + new Vector2D(-t.Size * 2.0f, -t.Size * 2.0f));
|
||||
}
|
||||
|
||||
General.Map.Map.Update();
|
||||
General.Editing.ChangeMode("ThingsMode");
|
||||
showSelection(points);
|
||||
}
|
||||
} else if (e.Button == MouseButtons.Right) { //edit
|
||||
List<Thing> list = getThingsByType((int)dataGridView.Rows[e.RowIndex].Cells[0].Value);
|
||||
if (list.Count > 0) {
|
||||
General.MainWindow.ShowEditThings(list);
|
||||
General.Map.Map.Update();
|
||||
setup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void hideUnused_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
private void apply_Click(object sender, EventArgs e) {
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void ThingStatisticsForm_FormClosing(object sender, FormClosingEventArgs e) {
|
||||
size = this.Size;
|
||||
location = this.Location;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
132
Source/Core/GZBuilder/Windows/ThingStatisticsForm.resx
Normal file
132
Source/Core/GZBuilder/Windows/ThingStatisticsForm.resx
Normal file
|
@ -0,0 +1,132 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="ThingType.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThingTitle.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThingClassName.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThingCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -237,8 +237,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
s.Position += 12;
|
||||
int ofsSurfaces = br.ReadInt32();
|
||||
|
||||
if (s.Position != ofsSurfaces + start)
|
||||
s.Position = ofsSurfaces + start;
|
||||
s.Position = ofsSurfaces + start;
|
||||
|
||||
List<int> polyIndecesList = new List<int>();
|
||||
List<WorldVertex> vertList = new List<WorldVertex>();
|
||||
|
@ -352,10 +351,6 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
//rotation angles
|
||||
float angleOfsetCos = (float)Math.Cos(mde.AngleOffset);
|
||||
float angleOfsetSin = (float)Math.Sin(mde.AngleOffset);
|
||||
float pitchOfsetCos = (float)Math.Cos(-mde.PitchOffset);
|
||||
float pitchOfsetSin = (float)Math.Sin(-mde.PitchOffset);
|
||||
float rollOfsetCos = (float)Math.Cos(mde.RollOffset);
|
||||
float rollOfsetSin = (float)Math.Sin(mde.RollOffset);
|
||||
|
||||
for (int i = vertexOffset; i < vertexOffset + numVerts; i++) {
|
||||
WorldVertex v = vertList[i];
|
||||
|
@ -372,18 +367,6 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
v.y = ry;
|
||||
v.x = rx;
|
||||
}
|
||||
if (mde.PitchOffset != 0) {
|
||||
float ry = pitchOfsetCos * v.y - pitchOfsetSin * v.z;
|
||||
float rz = pitchOfsetSin * v.y + pitchOfsetCos * v.z;
|
||||
v.z = rz;
|
||||
v.y = ry;
|
||||
}
|
||||
if (mde.RollOffset != 0) {
|
||||
float rx = rollOfsetCos * v.x - rollOfsetSin * v.z;
|
||||
float rz = rollOfsetSin * v.x + rollOfsetCos * v.z;
|
||||
v.z = rz;
|
||||
v.x = rx;
|
||||
}
|
||||
|
||||
//scale it
|
||||
v.y *= mde.Scale.X;
|
||||
|
@ -479,8 +462,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
List<WorldVertex> vertList = new List<WorldVertex>();
|
||||
|
||||
//polygons
|
||||
if (s.Position != ofs_tris + start)
|
||||
s.Position = ofs_tris + start;
|
||||
s.Position = ofs_tris + start;
|
||||
|
||||
for (int i = 0; i < num_tris; i++) {
|
||||
polyIndecesList.Add(br.ReadUInt16());
|
||||
|
@ -493,16 +475,14 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
}
|
||||
|
||||
//UV coords
|
||||
if (s.Position != ofs_uv + start)
|
||||
s.Position = ofs_uv + start;
|
||||
s.Position = ofs_uv + start;
|
||||
|
||||
for (int i = 0; i < num_uv; i++)
|
||||
uvCoordsList.Add(new Vector2((float)br.ReadInt16() / texWidth, (float)br.ReadInt16() / texHeight));
|
||||
|
||||
//first frame
|
||||
//header
|
||||
if (s.Position != ofs_animFrame + start)
|
||||
s.Position = ofs_animFrame + start;
|
||||
s.Position = ofs_animFrame + start;
|
||||
|
||||
Vector3 scale = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
|
||||
Vector3 translate = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
|
||||
|
@ -513,10 +493,6 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
float angle = mde.AngleOffset - Angle2D.PIHALF; // subtract 90 degrees to get correct rotation
|
||||
float angleOfsetCos = (float)Math.Cos(angle);
|
||||
float angleOfsetSin = (float)Math.Sin(angle);
|
||||
float pitchOfsetCos = (float)Math.Cos(-mde.PitchOffset);
|
||||
float pitchOfsetSin = (float)Math.Sin(-mde.PitchOffset);
|
||||
float rollOfsetCos = (float)Math.Cos(mde.RollOffset);
|
||||
float rollOfsetSin = (float)Math.Sin(mde.RollOffset);
|
||||
|
||||
//verts
|
||||
for (int i = 0; i < num_verts; i++) {
|
||||
|
@ -527,21 +503,10 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
v.z = (br.ReadByte() * scale.Z + translate.Z);
|
||||
|
||||
//rotate it
|
||||
float rx = angleOfsetCos * v.x - angleOfsetSin * v.y;
|
||||
float ry = angleOfsetSin * v.x + angleOfsetCos * v.y;
|
||||
v.y = ry;
|
||||
v.x = rx;
|
||||
|
||||
if (mde.PitchOffset != 0) {
|
||||
ry = pitchOfsetCos * v.y - pitchOfsetSin * v.z;
|
||||
float rz = pitchOfsetSin * v.y + pitchOfsetCos * v.z;
|
||||
v.z = rz;
|
||||
if (angle != 0) {
|
||||
float rx = angleOfsetCos * v.x - angleOfsetSin * v.y;
|
||||
float ry = angleOfsetSin * v.x + angleOfsetCos * v.y;
|
||||
v.y = ry;
|
||||
}
|
||||
if (mde.RollOffset != 0) {
|
||||
rx = rollOfsetCos * v.x - rollOfsetSin * v.z;
|
||||
float rz = rollOfsetSin * v.x + rollOfsetCos * v.z;
|
||||
v.z = rz;
|
||||
v.x = rx;
|
||||
}
|
||||
|
||||
|
@ -555,7 +520,6 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
v.z += mde.zOffset;
|
||||
|
||||
vertList.Add(v);
|
||||
|
||||
s.Position += 1; //vertex normal
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ using System.Diagnostics;
|
|||
using CodeImp.DoomBuilder.Actions;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
using System.Threading;
|
||||
using CodeImp.DoomBuilder.IO;
|
||||
using CodeImp.DoomBuilder.Editing;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -355,6 +355,7 @@ namespace CodeImp.DoomBuilder
|
|||
|
||||
General.Plugins.OnMapSaveEnd(SavePurpose.Testing);
|
||||
General.MainWindow.FocusDisplay();
|
||||
if(General.Editing.Mode is ClassicMode) General.MainWindow.RedrawDisplay();
|
||||
}
|
||||
|
||||
//mxd
|
||||
|
|
|
@ -273,6 +273,10 @@ namespace CodeImp.DoomBuilder.IO
|
|||
float y = reader.ReadSingle();
|
||||
float height = reader.ReadSingle();
|
||||
int angledeg = reader.ReadInt32();
|
||||
int pitch = reader.ReadInt32(); //mxd
|
||||
int roll = reader.ReadInt32(); //mxd
|
||||
float scaleX = reader.ReadSingle(); //mxd
|
||||
float scaleY = reader.ReadSingle(); //mxd
|
||||
int type = reader.ReadInt32();
|
||||
int special = reader.ReadInt32();
|
||||
for(int a = 0; a < Linedef.NUM_ARGS; a++) {
|
||||
|
@ -295,7 +299,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
Dictionary<string, UniValue> fields = ReadCustomFields(reader);
|
||||
Thing t = map.CreateThing();
|
||||
if(t != null) {
|
||||
t.Update(type, x, y, height, angledeg, stringflags, tag, special, args);
|
||||
t.Update(type, x, y, height, angledeg, pitch, roll, scaleX, scaleY, stringflags, tag, special, args);
|
||||
|
||||
// Add custom fields
|
||||
t.Fields.BeforeFieldsChange();
|
||||
|
|
|
@ -205,6 +205,10 @@ namespace CodeImp.DoomBuilder.IO
|
|||
writer.Write(t.Position.y);
|
||||
writer.Write(t.Position.z);
|
||||
writer.Write(t.AngleDoom);
|
||||
writer.Write(t.Pitch); //mxd
|
||||
writer.Write(t.Roll); //mxd
|
||||
writer.Write(t.ScaleX); //mxd
|
||||
writer.Write(t.ScaleY); //mxd
|
||||
writer.Write(t.Type);
|
||||
writer.Write(t.Action);
|
||||
for(int i = 0; i < t.Args.Length; i++) writer.Write(t.Args[i]);
|
||||
|
|
|
@ -155,7 +155,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
|
||||
// Create new item
|
||||
t = map.CreateThing();
|
||||
t.Update(type, x, y, 0, angle, stringflags, 0, 0, new int[Thing.NUM_ARGS]);
|
||||
t.Update(type, x, y, 0, angle, 0, 0, 1.0f, 1.0f, stringflags, 0, 0, new int[Thing.NUM_ARGS]);
|
||||
}
|
||||
|
||||
// Done
|
||||
|
|
|
@ -165,7 +165,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
|
||||
// Create new item
|
||||
t = map.CreateThing();
|
||||
t.Update(type, x, y, z, angle, stringflags, tag, action, args);
|
||||
t.Update(type, x, y, z, angle, 0, 0, 1.0f, 1.0f, stringflags, tag, action, args);
|
||||
}
|
||||
|
||||
// Done
|
||||
|
|
|
@ -198,6 +198,11 @@ namespace CodeImp.DoomBuilder.IO
|
|||
float height = GetCollectionEntry<float>(c, "height", false, 0.0f, where);
|
||||
int tag = GetCollectionEntry<int>(c, "id", false, 0, where);
|
||||
int angledeg = GetCollectionEntry<int>(c, "angle", false, 0, where);
|
||||
int pitch = GetCollectionEntry<int>(c, "pitch", false, 0, where); //mxd
|
||||
int roll = GetCollectionEntry<int>(c, "roll", false, 0, where); //mxd
|
||||
float scaleX = GetCollectionEntry<float>(c, "scalex", false, 1.0f, where); //mxd
|
||||
float scaleY = GetCollectionEntry<float>(c, "scaley", false, 1.0f, where); //mxd
|
||||
float scale = GetCollectionEntry<float>(c, "scale", false, 0f, where); //mxd
|
||||
int type = GetCollectionEntry<int>(c, "type", true, 0, where);
|
||||
int special = GetCollectionEntry<int>(c, "special", false, 0, where);
|
||||
args[0] = GetCollectionEntry<int>(c, "arg0", false, 0, where);
|
||||
|
@ -206,6 +211,12 @@ namespace CodeImp.DoomBuilder.IO
|
|||
args[3] = GetCollectionEntry<int>(c, "arg3", false, 0, where);
|
||||
args[4] = GetCollectionEntry<int>(c, "arg4", false, 0, where);
|
||||
|
||||
if (scale != 0) //mxd
|
||||
{
|
||||
scaleX = scale;
|
||||
scaleY = scale;
|
||||
}
|
||||
|
||||
// Flags
|
||||
Dictionary<string, bool> stringflags = new Dictionary<string, bool>(StringComparer.Ordinal);
|
||||
foreach(KeyValuePair<string, string> flag in General.Map.Config.ThingFlags)
|
||||
|
@ -220,7 +231,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
Thing t = map.CreateThing();
|
||||
if(t != null)
|
||||
{
|
||||
t.Update(type, x, y, height, angledeg, stringflags, tag, special, args);
|
||||
t.Update(type, x, y, height, angledeg, pitch, roll, scaleX, scaleY, stringflags, tag, special, args);
|
||||
|
||||
// Custom fields
|
||||
ReadCustomFields(c, t, "thing");
|
||||
|
|
|
@ -295,6 +295,10 @@ namespace CodeImp.DoomBuilder.IO
|
|||
coll.Add("y", t.Position.y);
|
||||
if(t.Position.z != 0.0f) coll.Add("height", t.Position.z);
|
||||
coll.Add("angle", t.AngleDoom);
|
||||
if (t.Pitch != 0) coll.Add("pitch", t.Pitch); //mxd
|
||||
if (t.Roll != 0) coll.Add("roll", t.Roll); //mxd
|
||||
if (t.ScaleX != 0 && t.ScaleX != 1.0f) coll.Add("scalex", t.ScaleX); //mxd
|
||||
if (t.ScaleY != 0 && t.ScaleY != 1.0f) coll.Add("scaley", t.ScaleY); //mxd
|
||||
coll.Add("type", t.Type);
|
||||
if(t.Action != 0) coll.Add("special", t.Action);
|
||||
if(t.Args[0] != 0) coll.Add("arg0", t.Args[0]);
|
||||
|
|
|
@ -18,12 +18,13 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
using System.Drawing;
|
||||
using CodeImp.DoomBuilder.Config;
|
||||
using CodeImp.DoomBuilder.IO;
|
||||
using CodeImp.DoomBuilder.VisualModes;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using CodeImp.DoomBuilder.GZBuilder.Data;
|
||||
using CodeImp.DoomBuilder.IO;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
using CodeImp.DoomBuilder.VisualModes;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -57,7 +58,13 @@ namespace CodeImp.DoomBuilder.Map
|
|||
private int tag;
|
||||
private int action;
|
||||
private int[] args;
|
||||
private float scale; //mxd. Used in model rendering
|
||||
private float scaleX; //mxd
|
||||
private float scaleY; //mxd
|
||||
private SizeF spritescale; //mxd
|
||||
private int pitch; //mxd. Used in model rendering
|
||||
private int roll; //mxd. Used in model rendering
|
||||
private float pitchrad; //mxd
|
||||
private float rollrad; //mxd
|
||||
private bool isModel; //mxd
|
||||
|
||||
// Configuration
|
||||
|
@ -71,9 +78,15 @@ namespace CodeImp.DoomBuilder.Map
|
|||
#region ================== Properties
|
||||
|
||||
public MapSet Map { get { return map; } }
|
||||
public int Type { get { return type; } set { BeforePropsChange(); type = value; UpdateModelStatus(); } } //mxd
|
||||
public int Type { get { return type; } set { BeforePropsChange(); type = value; /*UpdateCache();*/ } } //mxd
|
||||
public Vector3D Position { get { return pos; } }
|
||||
public float Scale { get { return scale; } } //mxd
|
||||
public float ScaleX { get { return scaleX; } } //mxd. This is UDMF property, not actual scale!
|
||||
public float ScaleY { get { return scaleY; } } //mxd. This is UDMF property, not actual scale!
|
||||
public int Pitch { get { return pitch; } } //mxd
|
||||
public float PitchRad { get { return pitchrad; } }
|
||||
public int Roll { get { return roll; } } //mxd
|
||||
public float RollRad { get { return rollrad; } }
|
||||
public SizeF ActorScale { get { return spritescale; } } //mxd. Actor scale set in DECORATE
|
||||
public float Angle { get { return anglerad; } }
|
||||
public int AngleDoom { get { return angledoom; } }
|
||||
internal Dictionary<string, bool> Flags { get { return flags; } }
|
||||
|
@ -99,7 +112,9 @@ namespace CodeImp.DoomBuilder.Map
|
|||
this.listindex = listindex;
|
||||
this.flags = new Dictionary<string, bool>(StringComparer.Ordinal);
|
||||
this.args = new int[NUM_ARGS];
|
||||
this.scale = 1.0f; //mxd
|
||||
this.scaleX = 1.0f;
|
||||
this.scaleY = 1.0f;
|
||||
this.spritescale = new SizeF(1.0f, 1.0f);
|
||||
|
||||
if(map == General.Map.Map)
|
||||
General.Map.UndoRedo.RecAddThing(this);
|
||||
|
@ -122,9 +137,6 @@ namespace CodeImp.DoomBuilder.Map
|
|||
|
||||
// Remove from main list
|
||||
map.RemoveThing(listindex);
|
||||
|
||||
// Remove from sector
|
||||
//if(sector != null) sector.DetachThing(sectorlistitem);
|
||||
|
||||
// Clean up
|
||||
map = null;
|
||||
|
@ -179,13 +191,17 @@ namespace CodeImp.DoomBuilder.Map
|
|||
s.rwInt(ref type);
|
||||
s.rwVector3D(ref pos);
|
||||
s.rwInt(ref angledoom);
|
||||
s.rwInt(ref pitch); //mxd
|
||||
s.rwInt(ref roll); //mxd
|
||||
s.rwFloat(ref scaleX); //mxd
|
||||
s.rwFloat(ref scaleY); //mxd
|
||||
s.rwInt(ref tag);
|
||||
s.rwInt(ref action);
|
||||
for(int i = 0; i < NUM_ARGS; i++) s.rwInt(ref args[i]);
|
||||
|
||||
if(!s.IsWriting) {
|
||||
anglerad = Angle2D.DoomToReal(angledoom);
|
||||
UpdateModelStatus(); //mxd
|
||||
UpdateCache(); //mxd
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -196,9 +212,15 @@ namespace CodeImp.DoomBuilder.Map
|
|||
|
||||
// Copy properties
|
||||
t.type = type;
|
||||
t.UpdateModelStatus();
|
||||
t.anglerad = anglerad;
|
||||
t.angledoom = angledoom;
|
||||
t.roll = roll; //mxd
|
||||
t.pitch = pitch; //mxd
|
||||
t.rollrad = rollrad; //mxd
|
||||
t.pitchrad = pitchrad; //mxd
|
||||
t.scaleX = scaleX; //mxd
|
||||
t.scaleY = scaleY; //mxd
|
||||
t.spritescale = spritescale; //mxd
|
||||
t.pos = pos;
|
||||
t.flags = new Dictionary<string,bool>(flags);
|
||||
t.tag = tag;
|
||||
|
@ -208,6 +230,7 @@ namespace CodeImp.DoomBuilder.Map
|
|||
t.color = color;
|
||||
t.directional = directional;
|
||||
t.fixedsize = fixedsize;
|
||||
t.isModel = isModel; //mxd
|
||||
|
||||
base.CopyPropertiesTo(t);
|
||||
}
|
||||
|
@ -237,20 +260,6 @@ namespace CodeImp.DoomBuilder.Map
|
|||
}
|
||||
}
|
||||
|
||||
//mxd. This checks if the thing has model override
|
||||
internal void UpdateModelStatus() {
|
||||
if(General.Map.Data == null) {
|
||||
isModel = false;
|
||||
return;
|
||||
}
|
||||
|
||||
isModel = General.Map.Data.ModeldefEntries.ContainsKey(type);
|
||||
if(!isModel) return;
|
||||
|
||||
if(General.Map.Data.ModeldefEntries[type].LoadState == ModelLoadState.None)
|
||||
isModel = General.Map.Data.ProcessModel(type);
|
||||
}
|
||||
|
||||
// This translates the flags into UDMF fields
|
||||
internal void TranslateToUDMF()
|
||||
{
|
||||
|
@ -405,37 +414,77 @@ namespace CodeImp.DoomBuilder.Map
|
|||
if(type != General.Map.Config.Start3DModeThingType)
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
|
||||
//mxd
|
||||
public void SetPitch(int p)
|
||||
{
|
||||
BeforePropsChange();
|
||||
|
||||
pitch = p;
|
||||
pitchrad = ((isModel && General.Map.Data.ModeldefEntries[type].InheritActorRoll) ? Angle2D.DegToRad(pitch) : 0);
|
||||
|
||||
if (type != General.Map.Config.Start3DModeThingType)
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
|
||||
//mxd
|
||||
public void SetRoll(int r)
|
||||
{
|
||||
BeforePropsChange();
|
||||
|
||||
roll = r;
|
||||
rollrad = ((isModel && General.Map.Data.ModeldefEntries[type].InheritActorRoll) ? Angle2D.DegToRad(roll) : 0);
|
||||
//rotation = Matrix.RotationYawPitchRoll(rollrad, pitchrad, anglerad); //mxd
|
||||
|
||||
if (type != General.Map.Config.Start3DModeThingType)
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
|
||||
//mxd
|
||||
public void SetScale(float scalex, float scaley)
|
||||
{
|
||||
BeforePropsChange();
|
||||
|
||||
scaleX = scalex;
|
||||
scaleY = scaley;
|
||||
|
||||
if (type != General.Map.Config.Start3DModeThingType)
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
|
||||
// This updates all properties
|
||||
// NOTE: This does not update sector! (call DetermineSector)
|
||||
public void Update(int type, float x, float y, float zoffset, int angle,
|
||||
public void Update(int type, float x, float y, float zoffset, int angle, int pitch, int roll, float scaleX, float scaleY,
|
||||
Dictionary<string, bool> flags, int tag, int action, int[] args)
|
||||
{
|
||||
// Apply changes
|
||||
this.type = type;
|
||||
this.anglerad = Angle2D.DoomToReal(angle);
|
||||
this.angledoom = angle;
|
||||
this.pitch = pitch; //mxd
|
||||
this.roll = roll; //mxd
|
||||
this.scaleX = (scaleX == 0 ? 1.0f : scaleX); //mxd
|
||||
this.scaleY = (scaleY == 0 ? 1.0f : scaleY); //mxd
|
||||
this.flags = new Dictionary<string, bool>(flags);
|
||||
this.tag = tag;
|
||||
this.action = action;
|
||||
this.args = new int[NUM_ARGS];
|
||||
args.CopyTo(this.args, 0);
|
||||
this.Move(x, y, zoffset);
|
||||
UpdateModelStatus(); //mxd
|
||||
|
||||
UpdateCache(); //mxd
|
||||
}
|
||||
|
||||
// This updates the settings from configuration
|
||||
public void UpdateConfiguration()
|
||||
{
|
||||
ThingTypeInfo ti;
|
||||
|
||||
// Lookup settings
|
||||
ti = General.Map.Data.GetThingInfo(type);
|
||||
ThingTypeInfo ti = General.Map.Data.GetThingInfo(type);
|
||||
|
||||
// Apply size
|
||||
size = ti.Radius;
|
||||
fixedsize = ti.FixedSize;
|
||||
scale = ti.SpriteScale.Width; //mxd
|
||||
spritescale = ti.SpriteScale; //mxd
|
||||
|
||||
// Color valid?
|
||||
if((ti.Color >= 0) && (ti.Color < ColorCollection.NUM_THING_COLORS))
|
||||
|
@ -449,9 +498,30 @@ namespace CodeImp.DoomBuilder.Map
|
|||
color = General.Colors.Colors[ColorCollection.THING_COLORS_OFFSET];
|
||||
}
|
||||
|
||||
// Apply icon offset (arrow or dot)
|
||||
//if(ti.Arrow) iconoffset = 0f; else iconoffset = 0.25f;
|
||||
directional = ti.Arrow; //mxd
|
||||
UpdateCache(); //mxd
|
||||
}
|
||||
|
||||
//mxd. This checks if the thing has model override
|
||||
internal void UpdateCache()
|
||||
{
|
||||
if (General.Map.Data == null)
|
||||
{
|
||||
isModel = false;
|
||||
return;
|
||||
}
|
||||
|
||||
isModel = General.Map.Data.ModeldefEntries.ContainsKey(type);
|
||||
if (isModel && General.Map.Data.ModeldefEntries[type].LoadState == ModelLoadState.None)
|
||||
isModel = General.Map.Data.ProcessModel(type);
|
||||
|
||||
if (isModel) {
|
||||
rollrad = (General.Map.Data.ModeldefEntries[type].InheritActorRoll ? Angle2D.DegToRad(roll) : 0);
|
||||
pitchrad = (General.Map.Data.ModeldefEntries[type].InheritActorPitch ? Angle2D.DegToRad(pitch) : 0);
|
||||
} else {
|
||||
rollrad = 0;
|
||||
pitchrad = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
7
Source/Core/Properties/Resources.Designer.cs
generated
7
Source/Core/Properties/Resources.Designer.cs
generated
|
@ -662,6 +662,13 @@ namespace CodeImp.DoomBuilder.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
internal static System.Drawing.Bitmap ThingStatistics {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("ThingStatistics", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
internal static System.Drawing.Bitmap treeview {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("treeview", resourceCulture);
|
||||
|
|
|
@ -421,4 +421,7 @@
|
|||
<data name="ImageStack" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ImageStack.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="ThingStatistics" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ThingStatistics.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
|
@ -1305,6 +1305,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
|
||||
Color4 cSel = General.Colors.Selection.ToColorValue();
|
||||
Color4 cWire = General.Colors.ModelWireframe.ToColorValue();
|
||||
Matrix viewscale = Matrix.Scaling(scale, -scale, 0.0f);
|
||||
ModelData mde;
|
||||
|
||||
foreach(KeyValuePair<int, List<Thing>> group in modelsByType) {
|
||||
|
@ -1316,7 +1317,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
foreach(Thing t in group.Value) {
|
||||
if(General.Settings.GZDrawSelectedModelsOnly && !t.Selected) continue;
|
||||
Vector2D screenpos = ((Vector2D)t.Position).GetTransformed(translatex, translatey, scale, -scale);
|
||||
float modelScale = scale * t.Scale;
|
||||
float modelScale = scale * t.ActorScale.Width * t.ScaleX;
|
||||
|
||||
//should we render this model?
|
||||
if(((screenpos.x + maxSize * modelScale) <= 0.0f) || ((screenpos.x - maxSize * modelScale) >= windowsize.Width) ||
|
||||
|
@ -1326,7 +1327,12 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
graphics.Shaders.Things2D.FillColor = t.Selected ? cSel : cWire;
|
||||
|
||||
for(int i = 0; i < mde.Model.Meshes.Count; i++) {
|
||||
graphics.Shaders.Things2D.SetTransformSettings(screenpos, t.Angle, modelScale);
|
||||
Matrix finalscale = viewscale * Matrix.Scaling(t.ScaleX, t.ScaleX, t.ScaleY);
|
||||
Matrix rotation = Matrix.RotationY(-(t.RollRad - General.Map.Data.ModeldefEntries[t.Type].RollOffset))
|
||||
* Matrix.RotationX(-(t.PitchRad + General.Map.Data.ModeldefEntries[t.Type].PitchOffset))
|
||||
* Matrix.RotationZ(t.Angle);
|
||||
|
||||
graphics.Shaders.Things2D.SetTransformSettings(screenpos, rotation, finalscale);
|
||||
graphics.Shaders.Things2D.ApplySettings();
|
||||
|
||||
// Draw
|
||||
|
|
|
@ -832,6 +832,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
graphics.Device.SetSamplerState(0, SamplerState.AddressU, TextureAddress.Clamp);
|
||||
graphics.Device.SetSamplerState(0, SamplerState.AddressV, TextureAddress.Clamp);
|
||||
graphics.Device.SetSamplerState(0, SamplerState.AddressW, TextureAddress.Clamp);
|
||||
graphics.Device.SetRenderState(RenderState.CullMode, Cull.None); //mxd. Disable backside culling, because otherwise sprites with positive ScaleY and negative ScaleX will be facing away from the camera...
|
||||
|
||||
// Render things collected
|
||||
foreach(KeyValuePair<ImageData, List<VisualThing>> group in thingspass)
|
||||
|
@ -902,9 +903,10 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
}
|
||||
|
||||
// Create the matrix for positioning / rotation
|
||||
world = t.Orientation;
|
||||
if (t.Billboard) world = Matrix.Multiply(world, billboard);
|
||||
world = Matrix.Multiply(world, t.Position);
|
||||
world = billboard
|
||||
* Matrix.Scaling(t.Thing.ScaleX, t.Thing.ScaleX, t.Thing.ScaleY)
|
||||
* t.Position; //mxd
|
||||
|
||||
ApplyMatrices3D();
|
||||
|
||||
//mxd. set variables for fog rendering
|
||||
|
@ -931,6 +933,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
graphics.Device.SetSamplerState(0, SamplerState.AddressU, TextureAddress.Wrap);
|
||||
graphics.Device.SetSamplerState(0, SamplerState.AddressV, TextureAddress.Wrap);
|
||||
graphics.Device.SetSamplerState(0, SamplerState.AddressW, TextureAddress.Wrap);
|
||||
graphics.Device.SetRenderState(RenderState.CullMode, Cull.Counterclockwise); //mxd
|
||||
}
|
||||
|
||||
// Done rendering with this shader
|
||||
|
@ -1058,9 +1061,13 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
}
|
||||
|
||||
// Create the matrix for positioning / rotation
|
||||
world = Matrix.Multiply(t.Orientation, Matrix.RotationZ(t.Thing.Angle));
|
||||
world = Matrix.Multiply(world, t.Scale);
|
||||
world = Matrix.Multiply(world, t.Position);
|
||||
float sx = t.Thing.ScaleX * t.Thing.ActorScale.Width;
|
||||
float sy = t.Thing.ScaleY * t.Thing.ActorScale.Height;
|
||||
Matrix rotation = Matrix.RotationY(-(t.Thing.RollRad - General.Map.Data.ModeldefEntries[t.Thing.Type].RollOffset))
|
||||
* Matrix.RotationX(-(t.Thing.PitchRad + General.Map.Data.ModeldefEntries[t.Thing.Type].PitchOffset))
|
||||
* Matrix.RotationZ(t.Thing.Angle);
|
||||
|
||||
world = rotation * Matrix.Scaling(sx, sx, sy) * t.Position;
|
||||
ApplyMatrices3D();
|
||||
|
||||
//mxd. set variables for fog rendering
|
||||
|
|
|
@ -115,15 +115,13 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
}
|
||||
|
||||
//mxd. Used to render models
|
||||
public void SetTransformSettings(Vector2D position, float rotation, float scale) {
|
||||
public void SetTransformSettings(Vector2D position, Matrix rotation, Matrix scale)
|
||||
{
|
||||
if (manager.Enabled) {
|
||||
Matrix view = manager.D3DDevice.Device.GetTransform(TransformState.View);
|
||||
|
||||
Matrix m_position = Matrix.Translation(position.x, position.y, 0.0f);
|
||||
Matrix m_scale = Matrix.Scaling(scale, -scale, 0.0f);
|
||||
Matrix m_rotation = Matrix.RotationZ(rotation);
|
||||
|
||||
Matrix world = m_rotation * m_scale * m_position;
|
||||
Matrix world = rotation * scale * m_position;
|
||||
effect.SetValue(transformsettings, Matrix.Multiply(world, view));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -207,6 +207,17 @@ viewusedtags
|
|||
allowscroll = false;
|
||||
}
|
||||
|
||||
//mxd
|
||||
viewthingtypes
|
||||
{
|
||||
title = "View Thing Types";
|
||||
category = "edit";
|
||||
description = "Opens Thing Statistics form, which shows all thing types available in current game configuration.";
|
||||
allowkeys = true;
|
||||
allowmouse = false;
|
||||
allowscroll = false;
|
||||
}
|
||||
|
||||
cancelmode
|
||||
{
|
||||
title = "Cancel Action";
|
||||
|
|
BIN
Source/Core/Resources/ThingStatistics.png
Normal file
BIN
Source/Core/Resources/ThingStatistics.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 442 B |
|
@ -57,6 +57,11 @@ managedfields
|
|||
y;
|
||||
height;
|
||||
angle;
|
||||
pitch;
|
||||
roll;
|
||||
scalex;
|
||||
scaley;
|
||||
scale;
|
||||
type;
|
||||
special;
|
||||
arg0;
|
||||
|
|
|
@ -63,5 +63,10 @@ uifields
|
|||
arg0str = 2;
|
||||
conversation = 0;
|
||||
gravity = 1;
|
||||
health = 0;
|
||||
fillcolor = 0;
|
||||
alpha = 1;
|
||||
score = 0;
|
||||
renderstyle = 2;
|
||||
}
|
||||
}
|
|
@ -54,10 +54,8 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
|
||||
// Rendering
|
||||
private int renderpass;
|
||||
private Matrix orientation;
|
||||
private Matrix position;
|
||||
private Matrix cagescales;
|
||||
private bool billboard;
|
||||
private Vector2D pos2d;
|
||||
private float cameradistance;
|
||||
private int cagecolor;
|
||||
|
@ -72,7 +70,6 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
//mxd
|
||||
private int cameraDistance3D;
|
||||
private int thingHeight;
|
||||
protected Matrix scale; //mxd. Used in model rendering
|
||||
|
||||
//mxd. light properties
|
||||
private DynamicLightType lightType;
|
||||
|
@ -97,14 +94,12 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
internal bool NeedsUpdateGeo { get { return updategeo; } }
|
||||
internal int Triangles { get { return triangles; } }
|
||||
internal int RenderPassInt { get { return renderpass; } }
|
||||
internal Matrix Orientation { get { return orientation; } }
|
||||
internal Matrix Position { get { return position; } }
|
||||
internal Matrix CageScales { get { return cagescales; } }
|
||||
internal int CageColor { get { return cagecolor; } }
|
||||
|
||||
//mxd
|
||||
internal int VertexColor { get { return vertices.Length > 0 ? vertices[0].c : 0;} }
|
||||
internal Matrix Scale { get { return scale; } }
|
||||
public int CameraDistance3D { get { return cameraDistance3D; } }
|
||||
public bool Sizeless { get { return sizeless; } }
|
||||
public Vector3 Center {
|
||||
|
@ -122,12 +117,6 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
public DynamicLightRenderStyle LightRenderStyle { get { return lightRenderStyle; } }
|
||||
public Color4 LightColor { get { return lightColor; } }
|
||||
|
||||
/// <summary>
|
||||
/// Set to True to use billboarding for this thing. When using billboarding,
|
||||
/// the geometry will be rotated on the XY plane to face the camera.
|
||||
/// </summary>
|
||||
public bool Billboard { get { return billboard; } set { billboard = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the Thing that this VisualThing is created for.
|
||||
/// </summary>
|
||||
|
@ -163,11 +152,8 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
// Initialize
|
||||
this.thing = t;
|
||||
this.renderpass = (int)RenderPass.Mask;
|
||||
this.billboard = true;
|
||||
this.orientation = Matrix.Identity;
|
||||
this.position = Matrix.Identity;
|
||||
this.cagescales = Matrix.Identity;
|
||||
this.scale = Matrix.Identity; //mxd
|
||||
|
||||
//mxd
|
||||
lightType = DynamicLightType.NONE;
|
||||
|
@ -271,14 +257,6 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This sets the orientation to use for the thing geometry. When using this, you may want to turn off billboarding.
|
||||
/// </summary>
|
||||
public void SetOrientation(Vector3D angles)
|
||||
{
|
||||
orientation = Matrix.RotationYawPitchRoll(angles.z, angles.y, angles.x);
|
||||
}
|
||||
|
||||
// This sets the vertices for the thing sprite
|
||||
protected void SetVertices(ICollection<WorldVertex> verts)
|
||||
{
|
||||
|
@ -288,11 +266,6 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
triangles = vertices.Length / 3;
|
||||
updategeo = true;
|
||||
}
|
||||
|
||||
//mxd
|
||||
protected void SetScale(float scaleX, float scaleY) {
|
||||
scale = Matrix.Scaling(scaleX, scaleX, scaleY);
|
||||
}
|
||||
|
||||
// This updates the visual thing
|
||||
public virtual void Update()
|
||||
|
|
|
@ -52,6 +52,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
private bool preventchanges;
|
||||
private string arg0str; //mxd
|
||||
private bool haveArg0Str; //mxd
|
||||
//TODO: move this into game configuration!
|
||||
private readonly List<string> renderStyles = new List<string>() { "translucent", "add", "subtract" };
|
||||
|
||||
//mxd. Persistent settings
|
||||
|
|
4528
Source/Core/Windows/MainForm.Designer.cs
generated
4528
Source/Core/Windows/MainForm.Designer.cs
generated
File diff suppressed because it is too large
Load diff
|
@ -90,7 +90,10 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
|
||||
// This is sent by the background thread when images are loaded
|
||||
// but only when first loaded or when dimensions were changed
|
||||
ImageDataLoaded = General.WM_USER + 2
|
||||
ImageDataLoaded = General.WM_USER + 2,
|
||||
|
||||
//mxd. This is sent by the background thread when sprites are loaded
|
||||
SpriteDataLoaded = General.WM_USER + 3,
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1509,6 +1512,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//mxd
|
||||
private void engineItem_Click(object sender, EventArgs e) {
|
||||
General.Map.ConfigSettings.CurrentEngineIndex = (int)(((ToolStripMenuItem)sender).Tag);
|
||||
General.Map.ConfigSettings.Changed = true;
|
||||
UpdateSkills();
|
||||
}
|
||||
|
||||
|
@ -2450,6 +2454,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
itemgridinc.Enabled = (General.Map != null);
|
||||
itemgriddec.Enabled = (General.Map != null);
|
||||
itemviewusedtags.Enabled = (General.Map != null); //mxd
|
||||
itemviewthingtypes.Enabled = (General.Map != null); //mxd
|
||||
addToGroup.Enabled = (General.Map != null); //mxd
|
||||
selectGroup.Enabled = (General.Map != null); //mxd
|
||||
clearGroup.Enabled = (General.Map != null); //mxd
|
||||
|
@ -2553,6 +2558,14 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
TagStatisticsForm f = new TagStatisticsForm();
|
||||
f.ShowDialog(this);
|
||||
}
|
||||
|
||||
//mxd
|
||||
[BeginAction("viewthingtypes")]
|
||||
internal void ViewThingTypes()
|
||||
{
|
||||
ThingStatisticsForm f = new ThingStatisticsForm();
|
||||
f.ShowDialog(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -3324,7 +3337,20 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
if((General.Map != null) && (General.Map.Data != null))
|
||||
{
|
||||
ImageData img = General.Map.Data.GetFlatImage(imagename);
|
||||
if(img != null) ImageDataLoaded(img);
|
||||
ImageDataLoaded(img);
|
||||
}
|
||||
break;
|
||||
|
||||
case (int)ThreadMessages.SpriteDataLoaded: //mxd
|
||||
string spritename = Marshal.PtrToStringAuto(m.WParam);
|
||||
Marshal.FreeCoTaskMem(m.WParam);
|
||||
if ((General.Map != null) && (General.Map.Data != null))
|
||||
{
|
||||
ImageData img = General.Map.Data.GetSpriteImage(spritename);
|
||||
if (img != null && img.UsedInMap && !img.IsDisposed)
|
||||
{
|
||||
DelayedRedraw();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -186,6 +186,27 @@
|
|||
<metadata name="sectorinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="heightpanel1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="labelcollapsedinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="modename.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="buttontoggleinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="linedefinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="thinginfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="sectorinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="redrawtimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>433, 17</value>
|
||||
</metadata>
|
||||
|
@ -201,12 +222,12 @@
|
|||
<metadata name="dockersspace.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="modestoolbar.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="modestoolbar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>324, 56</value>
|
||||
</metadata>
|
||||
<metadata name="modestoolbar.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="dockerspanel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
|
1749
Source/Core/Windows/ThingEditFormUDMF.Designer.cs
generated
1749
Source/Core/Windows/ThingEditFormUDMF.Designer.cs
generated
File diff suppressed because it is too large
Load diff
|
@ -55,6 +55,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
private bool haveArg0Str;
|
||||
|
||||
private List<ThingProperties> thingProps; //mxd
|
||||
//TODO: move this into game configuration!
|
||||
private readonly List<string> renderStyles = new List<string>() { "normal", "translucent", "soultrans", "translucentstencil", "add", "subtract", "stencil", "fuzzy", "optfuzzy", "none" };
|
||||
|
||||
//mxd. Window setup stuff
|
||||
private static Point location = Point.Empty;
|
||||
|
@ -64,6 +66,10 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
{
|
||||
public readonly int Type;
|
||||
public readonly int AngleDoom;
|
||||
public readonly int Pitch;
|
||||
public readonly int Roll;
|
||||
public readonly float ScaleX;
|
||||
public readonly float ScaleY;
|
||||
public readonly float X;
|
||||
public readonly float Y;
|
||||
public readonly float Z;
|
||||
|
@ -74,6 +80,10 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
Z = t.Position.z;
|
||||
Type = t.Type;
|
||||
AngleDoom = t.AngleDoom;
|
||||
Pitch = t.Pitch;
|
||||
Roll = t.Roll;
|
||||
ScaleX = t.ScaleX;
|
||||
ScaleY = t.ScaleY;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,15 +115,18 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
action.GeneralizedCategories = General.Map.Config.GenActionCategories;
|
||||
action.AddInfo(General.Map.Config.SortedLinedefActions.ToArray());
|
||||
|
||||
// Initialize custom fields editor
|
||||
fieldslist.Setup("thing");
|
||||
if (General.Map.FormatInterface.HasCustomFields) {
|
||||
// Initialize custom fields editor
|
||||
fieldslist.Setup("thing");
|
||||
|
||||
// Fill universal fields list
|
||||
fieldslist.ListFixedFields(General.Map.Config.ThingFields);
|
||||
// Fill universal fields list
|
||||
fieldslist.ListFixedFields(General.Map.Config.ThingFields);
|
||||
}
|
||||
|
||||
// Tag/Effects
|
||||
scriptNames.Location = arg0.Location;
|
||||
scriptNumbers.Location = arg0.Location;
|
||||
cbArgStr.Visible = General.Map.FormatInterface.HasCustomFields;
|
||||
|
||||
foreach(ScriptItem nsi in General.Map.NamedScripts)
|
||||
scriptNames.Items.Add(nsi);
|
||||
|
@ -185,12 +198,23 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
posY.ButtonStep = General.Map.Grid.GridSize;
|
||||
posZ.ButtonStep = General.Map.Grid.GridSize;
|
||||
|
||||
//mxd. Custom fields
|
||||
fieldslist.SetValues(ft.Fields, true);
|
||||
conversationID.Text = ft.Fields.GetValue("conversation", 0).ToString();
|
||||
gravity.Text = ft.Fields.GetValue("gravity", 1.0f).ToString();
|
||||
arg0str = ft.Fields.GetValue("arg0str", string.Empty);
|
||||
haveArg0Str = !string.IsNullOrEmpty(arg0str);
|
||||
// Custom fields
|
||||
if (General.Map.FormatInterface.HasCustomFields) {
|
||||
fieldslist.SetValues(ft.Fields, true);
|
||||
conversationID.Text = ft.Fields.GetValue("conversation", 0).ToString();
|
||||
gravity.Text = ft.Fields.GetValue("gravity", 1.0f).ToString();
|
||||
score.Text = ft.Fields.GetValue("score", 0).ToString();
|
||||
health.Text = ft.Fields.GetValue("health", 1).ToString();
|
||||
alpha.Text = ft.Fields.GetValue("alpha", 1.0f).ToString();
|
||||
color.SetValueFrom(ft.Fields);
|
||||
arg0str = ft.Fields.GetValue("arg0str", string.Empty);
|
||||
haveArg0Str = !string.IsNullOrEmpty(arg0str);
|
||||
scale.SetValues(ft.ScaleX, ft.ScaleY, true);
|
||||
pitch.Text = ft.Pitch.ToString();
|
||||
roll.Text = ft.Roll.ToString();
|
||||
int renderstyle = renderStyles.IndexOf(ft.Fields.GetValue("renderstyle", string.Empty));
|
||||
renderStyle.SelectedIndex = (renderstyle == -1 ? 0 : renderstyle);
|
||||
}
|
||||
|
||||
// Action/tags
|
||||
action.Value = ft.Action;
|
||||
|
@ -244,18 +268,39 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
if(t.Args[4] != arg4.GetResult(-1)) arg4.ClearValue();
|
||||
|
||||
//mxd. Custom fields
|
||||
t.Fields.BeforeFieldsChange(); //mxd
|
||||
fieldslist.SetValues(t.Fields, false);
|
||||
if (General.Map.FormatInterface.HasCustomFields) {
|
||||
t.Fields.BeforeFieldsChange(); //mxd
|
||||
fieldslist.SetValues(t.Fields, false);
|
||||
|
||||
if(t.Fields.GetValue("conversation", 0).ToString() != conversationID.Text)
|
||||
conversationID.Text = "";
|
||||
if (t.Fields.GetValue("conversation", 0).ToString() != conversationID.Text)
|
||||
conversationID.Text = "";
|
||||
|
||||
if(t.Fields.GetValue("gravity", 1.0f).ToString() != gravity.Text)
|
||||
gravity.Text = "";
|
||||
if (t.Fields.GetValue("gravity", 1.0f).ToString() != gravity.Text)
|
||||
gravity.Text = "";
|
||||
|
||||
if(arg0str != t.Fields.GetValue("arg0str", string.Empty)) {
|
||||
haveArg0Str = true;
|
||||
arg0str = string.Empty;
|
||||
if (t.Fields.GetValue("score", 0).ToString() != score.Text)
|
||||
score.Text = "";
|
||||
|
||||
if (t.Fields.GetValue("health", 1).ToString() != health.Text)
|
||||
health.Text = "";
|
||||
|
||||
if (t.Fields.GetValue("alpha", 1.0f).ToString() != alpha.Text)
|
||||
alpha.Text = "";
|
||||
|
||||
scale.SetValues(t.ScaleX, t.ScaleY, false);
|
||||
color.SetValueFrom(t.Fields);
|
||||
|
||||
if (t.Pitch.ToString() != pitch.Text) pitch.Text = "";
|
||||
if (t.Roll.ToString() != roll.Text) roll.Text = "";
|
||||
|
||||
int i = Math.Max(0, renderStyles.IndexOf(t.Fields.GetValue("renderstyle", string.Empty)));
|
||||
if (renderStyle.SelectedIndex != -1 && i != renderStyle.SelectedIndex)
|
||||
renderStyle.SelectedIndex = -1;
|
||||
|
||||
if (arg0str != t.Fields.GetValue("arg0str", string.Empty)) {
|
||||
haveArg0Str = true;
|
||||
arg0str = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
//mxd. Store initial properties
|
||||
|
@ -389,6 +434,26 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
updateAngle();
|
||||
}
|
||||
|
||||
private void pitch_WhenTextChanged(object sender, EventArgs e) {
|
||||
pitchControl.Angle = pitch.GetResult(int.MinValue);
|
||||
updatePitch();
|
||||
}
|
||||
|
||||
private void pitchControl_AngleChanged() {
|
||||
pitch.Text = pitchControl.Angle.ToString();
|
||||
updatePitch();
|
||||
}
|
||||
|
||||
private void roll_WhenTextChanged(object sender, EventArgs e) {
|
||||
rollControl.Angle = roll.GetResult(int.MinValue);
|
||||
updateRoll();
|
||||
}
|
||||
|
||||
private void rollControl_AngleChanged() {
|
||||
roll.Text = rollControl.Angle.ToString();
|
||||
updateRoll();
|
||||
}
|
||||
|
||||
// Apply clicked
|
||||
private void apply_Click(object sender, EventArgs e) {
|
||||
List<string> defaultflags = new List<string>();
|
||||
|
@ -420,9 +485,6 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Go for all the things
|
||||
foreach(Thing t in things) {
|
||||
// Coordination
|
||||
if(cbRandomAngle.Checked)
|
||||
t.Rotate(General.Random(0, 359)); //mxd
|
||||
|
||||
//mxd. Check position
|
||||
float px = General.Clamp(t.Position.x, General.Map.Config.LeftBoundary, General.Map.Config.RightBoundary);
|
||||
float py = General.Clamp(t.Position.y, General.Map.Config.BottomBoundary, General.Map.Config.TopBoundary);
|
||||
|
@ -450,7 +512,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
else if(!int.TryParse(scriptNumbers.Text.Trim(), out t.Args[0]))
|
||||
t.Args[0] = 0;
|
||||
|
||||
if(t.Fields.ContainsKey("arg0str"))
|
||||
if(General.Map.FormatInterface.HasCustomFields && t.Fields.ContainsKey("arg0str"))
|
||||
t.Fields.Remove("arg0str");
|
||||
}
|
||||
} else { //apply arg0str
|
||||
|
@ -459,7 +521,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
}
|
||||
} else {
|
||||
t.Args[0] = arg0.GetResult(t.Args[0]);
|
||||
if(t.Fields.ContainsKey("arg0str"))
|
||||
if(General.Map.FormatInterface.HasCustomFields && t.Fields.ContainsKey("arg0str"))
|
||||
t.Fields.Remove("arg0str");
|
||||
}
|
||||
} else {
|
||||
|
@ -472,11 +534,22 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
t.Args[4] = arg4.GetResult(t.Args[4]);
|
||||
|
||||
//mxd. Custom fields
|
||||
fieldslist.Apply(t.Fields);
|
||||
if(!string.IsNullOrEmpty(conversationID.Text))
|
||||
UDMFTools.SetInteger(t.Fields, "conversation", conversationID.GetResult(t.Fields.GetValue("conversation", 0)), 0);
|
||||
if(!string.IsNullOrEmpty(gravity.Text))
|
||||
UDMFTools.SetFloat(t.Fields, "gravity", gravity.GetResultFloat(t.Fields.GetValue("gravity", 1.0f)), 1.0f);
|
||||
if (General.Map.FormatInterface.HasCustomFields) {
|
||||
fieldslist.Apply(t.Fields);
|
||||
if (!string.IsNullOrEmpty(conversationID.Text))
|
||||
UDMFTools.SetInteger(t.Fields, "conversation", conversationID.GetResult(t.Fields.GetValue("conversation", 0)), 0);
|
||||
if (!string.IsNullOrEmpty(gravity.Text))
|
||||
UDMFTools.SetFloat(t.Fields, "gravity", gravity.GetResultFloat(t.Fields.GetValue("gravity", 1.0f)), 1.0f);
|
||||
if (!string.IsNullOrEmpty(health.Text))
|
||||
UDMFTools.SetInteger(t.Fields, "health", health.GetResult(t.Fields.GetValue("health", 1)), 1);
|
||||
if (!string.IsNullOrEmpty(score.Text))
|
||||
UDMFTools.SetInteger(t.Fields, "score", score.GetResult(t.Fields.GetValue("score", 0)), 0);
|
||||
if (!string.IsNullOrEmpty(alpha.Text))
|
||||
UDMFTools.SetFloat(t.Fields, "alpha", alpha.GetResultFloat(t.Fields.GetValue("alpha", 1.0f)), 1.0f);
|
||||
|
||||
color.ApplyTo(t.Fields, t.Fields.GetValue("fillcolor", 0));
|
||||
if (renderStyle.SelectedIndex > -1) UDMFTools.SetString(t.Fields, "renderstyle", renderStyles[renderStyle.SelectedIndex], "normal");
|
||||
}
|
||||
|
||||
// Update settings
|
||||
t.UpdateConfiguration();
|
||||
|
@ -523,13 +596,6 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
posZ.Text = (useAbsoluteHeight ? initialFloorHeight + initialPosition.z : initialPosition.z).ToString();
|
||||
}
|
||||
|
||||
//mxd
|
||||
private void cbRandomAngle_CheckedChanged(object sender, EventArgs e) {
|
||||
angle.Enabled = !cbRandomAngle.Checked;
|
||||
anglecontrol.Enabled = !cbRandomAngle.Checked;
|
||||
labelAngle.Enabled = !cbRandomAngle.Checked;
|
||||
}
|
||||
|
||||
//mxd
|
||||
private void tabcustom_MouseEnter(object sender, EventArgs e) {
|
||||
fieldslist.Focus();
|
||||
|
@ -617,6 +683,21 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private void scale_OnValuesChanged(object sender, EventArgs e) {
|
||||
if (preventchanges) return;
|
||||
int i = 0;
|
||||
|
||||
foreach (Thing t in things){
|
||||
float sx = scale.GetValue1(thingProps[i].ScaleX);
|
||||
float sy = scale.GetValue2(thingProps[i].ScaleY);
|
||||
t.SetScale((sx == 0 ? 1.0f : sx), (sy == 0 ? 1.0f : sy));
|
||||
i++;
|
||||
}
|
||||
|
||||
General.Map.IsChanged = true;
|
||||
if (OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
// Selected type changes
|
||||
private void thingtype_OnTypeChanged(ThingTypeInfo value) {
|
||||
thinginfo = value;
|
||||
|
@ -639,9 +720,9 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
action_ValueChanges(this, EventArgs.Empty);
|
||||
|
||||
//mxd. Update things
|
||||
if(preventchanges)
|
||||
return;
|
||||
if(((thingtype.GetResult(0) < General.Map.FormatInterface.MinThingType) || (thingtype.GetResult(0) > General.Map.FormatInterface.MaxThingType)))
|
||||
if (preventchanges
|
||||
|| (thingtype.GetResult(0) < General.Map.FormatInterface.MinThingType)
|
||||
|| (thingtype.GetResult(0) > General.Map.FormatInterface.MaxThingType))
|
||||
return;
|
||||
|
||||
foreach(Thing t in things) {
|
||||
|
@ -663,11 +744,9 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
|
||||
//restore values
|
||||
if(string.IsNullOrEmpty(angle.Text)) {
|
||||
// Apply rotation
|
||||
foreach(Thing t in things)
|
||||
t.Rotate(thingProps[i++].AngleDoom);
|
||||
} else { //update values
|
||||
// Apply rotation
|
||||
foreach(Thing t in things)
|
||||
t.Rotate(angle.GetResult(thingProps[i++].AngleDoom));
|
||||
}
|
||||
|
@ -676,6 +755,40 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private void updatePitch() {
|
||||
if (preventchanges) return;
|
||||
int i = 0;
|
||||
|
||||
//restore values
|
||||
if (string.IsNullOrEmpty(pitch.Text)) {
|
||||
foreach (Thing t in things)
|
||||
t.SetPitch(thingProps[i++].Pitch);
|
||||
} else { //update values
|
||||
foreach (Thing t in things)
|
||||
t.SetPitch(pitch.GetResult(thingProps[i++].Pitch));
|
||||
}
|
||||
|
||||
General.Map.IsChanged = true;
|
||||
if (OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private void updateRoll() {
|
||||
if (preventchanges) return;
|
||||
int i = 0;
|
||||
|
||||
//restore values
|
||||
if (string.IsNullOrEmpty(roll.Text)) {
|
||||
foreach (Thing t in things)
|
||||
t.SetRoll(thingProps[i++].Roll);
|
||||
} else { //update values
|
||||
foreach (Thing t in things)
|
||||
t.SetRoll(roll.GetResult(thingProps[i++].Roll));
|
||||
}
|
||||
|
||||
General.Map.IsChanged = true;
|
||||
if (OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
|
120
Source/Core/Windows/ThingEditFormUDMF.resx
Normal file
120
Source/Core/Windows/ThingEditFormUDMF.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>
|
|
@ -5,7 +5,6 @@ using System.Collections.Generic;
|
|||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Actions;
|
||||
using CodeImp.DoomBuilder.Controls;
|
||||
using CodeImp.DoomBuilder.Editing;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
|
|
|
@ -5,7 +5,6 @@ using System.Collections.Generic;
|
|||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Actions;
|
||||
using CodeImp.DoomBuilder.Controls;
|
||||
using CodeImp.DoomBuilder.Editing;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
|
|
|
@ -4,7 +4,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Controls;
|
||||
using CodeImp.DoomBuilder.Editing;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
|
|
|
@ -18,26 +18,25 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using System.Drawing;
|
||||
using CodeImp.DoomBuilder.Editing;
|
||||
using CodeImp.DoomBuilder.Plugins;
|
||||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.Config;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
using CodeImp.DoomBuilder.Controls;
|
||||
using CodeImp.DoomBuilder.GZBuilder.Geometry;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Actions;
|
||||
using CodeImp.DoomBuilder.BuilderModes.IO;
|
||||
using CodeImp.DoomBuilder.BuilderModes.Interface;
|
||||
using CodeImp.DoomBuilder.GZBuilder.Tools;
|
||||
using CodeImp.DoomBuilder.BuilderModes.IO;
|
||||
using CodeImp.DoomBuilder.Config;
|
||||
using CodeImp.DoomBuilder.Controls;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
using CodeImp.DoomBuilder.Editing;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using CodeImp.DoomBuilder.GZBuilder.Geometry;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Plugins;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -228,6 +228,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
public static bool Type = true; //mxd
|
||||
public static bool Angle = true; //mxd
|
||||
public static bool Pitch = true; //mxd
|
||||
public static bool Roll = true; //mxd
|
||||
public static bool Scale = true; //mxd
|
||||
public static bool Action = true; //mxd
|
||||
public static bool Tag = true; //mxd
|
||||
public static bool Flags = true; //mxd
|
||||
|
@ -235,6 +238,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
private readonly int type;
|
||||
private readonly float angle;
|
||||
private readonly int pitch; //mxd
|
||||
private readonly int roll; //mxd
|
||||
private readonly float scalex; //mxd
|
||||
private readonly float scaley; //mxd
|
||||
private readonly Dictionary<string, bool> flags;
|
||||
private readonly int tag;
|
||||
private readonly int action;
|
||||
|
@ -245,9 +252,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
type = t.Type;
|
||||
angle = t.Angle;
|
||||
pitch = t.Pitch;
|
||||
roll = t.Roll;
|
||||
scalex = t.ScaleX;
|
||||
scaley = t.ScaleY;
|
||||
flags = t.GetFlags();
|
||||
tag = t.Tag;
|
||||
action = t.Action;
|
||||
action = t.Action;
|
||||
args = (int[])(t.Args.Clone());
|
||||
fields = new UniFields(t.Fields);
|
||||
}
|
||||
|
@ -256,6 +267,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
if (Type) t.Type = type;
|
||||
if (Angle) t.Rotate(angle);
|
||||
if (Pitch) t.SetPitch(pitch);
|
||||
if (Roll) t.SetRoll(roll);
|
||||
if (Scale) t.SetScale(scalex, scaley);
|
||||
if (Flags) {
|
||||
t.ClearFlags();
|
||||
foreach (KeyValuePair<string, bool> f in flags)
|
||||
|
|
|
@ -264,7 +264,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
SetPosition(pos);
|
||||
SetCageSize(infoRadius, infoHeight);
|
||||
SetCageColor(Thing.Color);
|
||||
SetScale(info.SpriteScale.Width, info.SpriteScale.Height); //mxd
|
||||
|
||||
// Keep info for object picking
|
||||
cageradius2 = infoRadius * Angle2D.SQRT2;
|
||||
|
|
Loading…
Reference in a new issue