BoxEditor is now a control instead of a form

This commit is contained in:
MayNL
2026-03-30 17:36:47 -04:00
parent e8688a4574
commit 034ef12c5d
7 changed files with 715 additions and 443 deletions

View File

@@ -0,0 +1,444 @@
namespace PckStudio.Controls
{
partial class BoxEditorControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.parentLabel = new MetroFramework.Controls.MetroLabel();
this.positionLabel = new MetroFramework.Controls.MetroLabel();
this.sizeLabel = new MetroFramework.Controls.MetroLabel();
this.uvLabel = new MetroFramework.Controls.MetroLabel();
this.inflationLabel = new MetroFramework.Controls.MetroLabel();
this.toolTip = new MetroFramework.Components.MetroToolTip();
this.parentComboBox = new MetroFramework.Controls.MetroComboBox();
this.PosXUpDown = new System.Windows.Forms.NumericUpDown();
this.PosYUpDown = new System.Windows.Forms.NumericUpDown();
this.PosZUpDown = new System.Windows.Forms.NumericUpDown();
this.SizeZUpDown = new System.Windows.Forms.NumericUpDown();
this.SizeYUpDown = new System.Windows.Forms.NumericUpDown();
this.SizeXUpDown = new System.Windows.Forms.NumericUpDown();
this.uvYUpDown = new System.Windows.Forms.NumericUpDown();
this.uvXUpDown = new System.Windows.Forms.NumericUpDown();
this.helmetCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.mirrorCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.inflationUpDown = new System.Windows.Forms.NumericUpDown();
this.chestplateCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.leggingsCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.bootsCheckBox = new MetroFramework.Controls.MetroCheckBox();
((System.ComponentModel.ISupportInitialize)(this.PosXUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PosYUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PosZUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.SizeZUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.SizeYUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.SizeXUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.uvYUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.uvXUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.inflationUpDown)).BeginInit();
this.SuspendLayout();
//
// parentLabel
//
this.parentLabel.AutoSize = true;
this.parentLabel.FontSize = MetroFramework.MetroLabelSize.Tall;
this.parentLabel.Location = new System.Drawing.Point(47, 55);
this.parentLabel.Name = "parentLabel";
this.parentLabel.Size = new System.Drawing.Size(50, 25);
this.parentLabel.TabIndex = 2;
this.parentLabel.Text = "Type:";
this.parentLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// positionLabel
//
this.positionLabel.AutoSize = true;
this.positionLabel.FontSize = MetroFramework.MetroLabelSize.Tall;
this.positionLabel.Location = new System.Drawing.Point(22, 84);
this.positionLabel.Name = "positionLabel";
this.positionLabel.Size = new System.Drawing.Size(75, 25);
this.positionLabel.TabIndex = 4;
this.positionLabel.Text = "Position:";
this.positionLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// sizeLabel
//
this.sizeLabel.AutoSize = true;
this.sizeLabel.FontSize = MetroFramework.MetroLabelSize.Tall;
this.sizeLabel.Location = new System.Drawing.Point(51, 109);
this.sizeLabel.Name = "sizeLabel";
this.sizeLabel.Size = new System.Drawing.Size(46, 25);
this.sizeLabel.TabIndex = 22;
this.sizeLabel.Text = "Size:";
this.sizeLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// uvLabel
//
this.uvLabel.AutoSize = true;
this.uvLabel.FontSize = MetroFramework.MetroLabelSize.Tall;
this.uvLabel.Location = new System.Drawing.Point(58, 135);
this.uvLabel.Name = "uvLabel";
this.uvLabel.Size = new System.Drawing.Size(39, 25);
this.uvLabel.TabIndex = 26;
this.uvLabel.Text = "UV:";
this.uvLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// inflationLabel
//
this.inflationLabel.AutoSize = true;
this.inflationLabel.FontSize = MetroFramework.MetroLabelSize.Tall;
this.inflationLabel.Location = new System.Drawing.Point(42, 165);
this.inflationLabel.Name = "inflationLabel";
this.inflationLabel.Size = new System.Drawing.Size(55, 25);
this.inflationLabel.TabIndex = 31;
this.inflationLabel.Text = "Scale:";
this.inflationLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// toolTip
//
this.toolTip.StripAmpersands = true;
this.toolTip.Style = MetroFramework.MetroColorStyle.Blue;
this.toolTip.StyleManager = null;
this.toolTip.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// parentComboBox
//
this.parentComboBox.FormattingEnabled = true;
this.parentComboBox.ItemHeight = 23;
this.parentComboBox.Items.AddRange(new object[] {
"HEAD",
"BODY",
"ARM0",
"ARM1",
"LEG0",
"LEG1",
"HEADWEAR",
"JACKET",
"SLEEVE0",
"SLEEVE1",
"PANTS0",
"PANTS1",
"WAIST",
"LEGGING0",
"LEGGING1",
"SOCK0",
"SOCK1",
"BOOT0",
"BOOT1",
"ARMARMOR1",
"ARMARMOR0",
"BODYARMOR",
"BELT"});
this.parentComboBox.Location = new System.Drawing.Point(103, 51);
this.parentComboBox.Name = "parentComboBox";
this.parentComboBox.Size = new System.Drawing.Size(163, 29);
this.parentComboBox.TabIndex = 3;
this.parentComboBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.parentComboBox.UseSelectable = true;
//
// PosXUpDown
//
this.PosXUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.PosXUpDown.DecimalPlaces = 3;
this.PosXUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.PosXUpDown.Location = new System.Drawing.Point(103, 86);
this.PosXUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.PosXUpDown.Minimum = new decimal(new int[] {
9999,
0,
0,
-2147483648});
this.PosXUpDown.Name = "PosXUpDown";
this.PosXUpDown.Size = new System.Drawing.Size(73, 20);
this.PosXUpDown.TabIndex = 19;
//
// PosYUpDown
//
this.PosYUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.PosYUpDown.DecimalPlaces = 3;
this.PosYUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.PosYUpDown.Location = new System.Drawing.Point(182, 86);
this.PosYUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.PosYUpDown.Minimum = new decimal(new int[] {
9999,
0,
0,
-2147483648});
this.PosYUpDown.Name = "PosYUpDown";
this.PosYUpDown.Size = new System.Drawing.Size(73, 20);
this.PosYUpDown.TabIndex = 20;
//
// PosZUpDown
//
this.PosZUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.PosZUpDown.DecimalPlaces = 3;
this.PosZUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.PosZUpDown.Location = new System.Drawing.Point(261, 86);
this.PosZUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.PosZUpDown.Minimum = new decimal(new int[] {
9999,
0,
0,
-2147483648});
this.PosZUpDown.Name = "PosZUpDown";
this.PosZUpDown.Size = new System.Drawing.Size(73, 20);
this.PosZUpDown.TabIndex = 21;
//
// SizeZUpDown
//
this.SizeZUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.SizeZUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.SizeZUpDown.Location = new System.Drawing.Point(261, 111);
this.SizeZUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.SizeZUpDown.Name = "SizeZUpDown";
this.SizeZUpDown.Size = new System.Drawing.Size(73, 20);
this.SizeZUpDown.TabIndex = 25;
//
// SizeYUpDown
//
this.SizeYUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.SizeYUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.SizeYUpDown.Location = new System.Drawing.Point(182, 111);
this.SizeYUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.SizeYUpDown.Name = "SizeYUpDown";
this.SizeYUpDown.Size = new System.Drawing.Size(73, 20);
this.SizeYUpDown.TabIndex = 24;
//
// SizeXUpDown
//
this.SizeXUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.SizeXUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.SizeXUpDown.Location = new System.Drawing.Point(103, 111);
this.SizeXUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.SizeXUpDown.Name = "SizeXUpDown";
this.SizeXUpDown.Size = new System.Drawing.Size(73, 20);
this.SizeXUpDown.TabIndex = 23;
//
// uvYUpDown
//
this.uvYUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.uvYUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.uvYUpDown.Location = new System.Drawing.Point(182, 137);
this.uvYUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.uvYUpDown.Minimum = new decimal(new int[] {
9999,
0,
0,
-2147483648});
this.uvYUpDown.Name = "uvYUpDown";
this.uvYUpDown.Size = new System.Drawing.Size(73, 20);
this.uvYUpDown.TabIndex = 28;
//
// uvXUpDown
//
this.uvXUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.uvXUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.uvXUpDown.Location = new System.Drawing.Point(103, 137);
this.uvXUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.uvXUpDown.Minimum = new decimal(new int[] {
9999,
0,
0,
-2147483648});
this.uvXUpDown.Name = "uvXUpDown";
this.uvXUpDown.Size = new System.Drawing.Size(73, 20);
this.uvXUpDown.TabIndex = 27;
//
// helmetCheckBox
//
this.helmetCheckBox.AutoSize = true;
this.helmetCheckBox.FontSize = MetroFramework.MetroCheckBoxSize.Tall;
this.helmetCheckBox.FontWeight = MetroFramework.MetroCheckBoxWeight.Light;
this.helmetCheckBox.Location = new System.Drawing.Point(340, 84);
this.helmetCheckBox.Name = "helmetCheckBox";
this.helmetCheckBox.Size = new System.Drawing.Size(160, 25);
this.helmetCheckBox.TabIndex = 29;
this.helmetCheckBox.Text = "Mask with helmet";
this.helmetCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.helmetCheckBox.UseSelectable = true;
//
// mirrorCheckBox
//
this.mirrorCheckBox.AutoSize = true;
this.mirrorCheckBox.FontSize = MetroFramework.MetroCheckBoxSize.Tall;
this.mirrorCheckBox.FontWeight = MetroFramework.MetroCheckBoxWeight.Light;
this.mirrorCheckBox.Location = new System.Drawing.Point(340, 58);
this.mirrorCheckBox.Name = "mirrorCheckBox";
this.mirrorCheckBox.Size = new System.Drawing.Size(133, 25);
this.mirrorCheckBox.TabIndex = 30;
this.mirrorCheckBox.Text = "Mirror Texture";
this.mirrorCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.mirrorCheckBox.UseSelectable = true;
//
// inflationUpDown
//
this.inflationUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.inflationUpDown.DecimalPlaces = 3;
this.inflationUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.inflationUpDown.Location = new System.Drawing.Point(103, 167);
this.inflationUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.inflationUpDown.Name = "inflationUpDown";
this.inflationUpDown.Size = new System.Drawing.Size(73, 20);
this.inflationUpDown.TabIndex = 32;
//
// chestplateCheckBox
//
this.chestplateCheckBox.AutoSize = true;
this.chestplateCheckBox.FontSize = MetroFramework.MetroCheckBoxSize.Tall;
this.chestplateCheckBox.FontWeight = MetroFramework.MetroCheckBoxWeight.Light;
this.chestplateCheckBox.Location = new System.Drawing.Point(340, 109);
this.chestplateCheckBox.Name = "chestplateCheckBox";
this.chestplateCheckBox.Size = new System.Drawing.Size(184, 25);
this.chestplateCheckBox.TabIndex = 33;
this.chestplateCheckBox.Text = "Mask with chestplate";
this.chestplateCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.chestplateCheckBox.UseSelectable = true;
//
// leggingsCheckBox
//
this.leggingsCheckBox.AutoSize = true;
this.leggingsCheckBox.FontSize = MetroFramework.MetroCheckBoxSize.Tall;
this.leggingsCheckBox.FontWeight = MetroFramework.MetroCheckBoxWeight.Light;
this.leggingsCheckBox.Location = new System.Drawing.Point(340, 135);
this.leggingsCheckBox.Name = "leggingsCheckBox";
this.leggingsCheckBox.Size = new System.Drawing.Size(172, 25);
this.leggingsCheckBox.TabIndex = 34;
this.leggingsCheckBox.Text = "Mask with leggings";
this.leggingsCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.leggingsCheckBox.UseSelectable = true;
//
// bootsCheckBox
//
this.bootsCheckBox.AutoSize = true;
this.bootsCheckBox.FontSize = MetroFramework.MetroCheckBoxSize.Tall;
this.bootsCheckBox.FontWeight = MetroFramework.MetroCheckBoxWeight.Light;
this.bootsCheckBox.Location = new System.Drawing.Point(340, 161);
this.bootsCheckBox.Name = "bootsCheckBox";
this.bootsCheckBox.Size = new System.Drawing.Size(150, 25);
this.bootsCheckBox.TabIndex = 35;
this.bootsCheckBox.Text = "Mask with boots";
this.bootsCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.bootsCheckBox.UseSelectable = true;
//
// BoxEditorControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(18)))), ((int)(((byte)(18)))));
this.Controls.Add(this.bootsCheckBox);
this.Controls.Add(this.leggingsCheckBox);
this.Controls.Add(this.chestplateCheckBox);
this.Controls.Add(this.inflationUpDown);
this.Controls.Add(this.uvYUpDown);
this.Controls.Add(this.uvXUpDown);
this.Controls.Add(this.SizeZUpDown);
this.Controls.Add(this.SizeYUpDown);
this.Controls.Add(this.SizeXUpDown);
this.Controls.Add(this.PosZUpDown);
this.Controls.Add(this.PosYUpDown);
this.Controls.Add(this.PosXUpDown);
this.Controls.Add(this.inflationLabel);
this.Controls.Add(this.parentComboBox);
this.Controls.Add(this.mirrorCheckBox);
this.Controls.Add(this.helmetCheckBox);
this.Controls.Add(this.uvLabel);
this.Controls.Add(this.sizeLabel);
this.Controls.Add(this.positionLabel);
this.Controls.Add(this.parentLabel);
this.Name = "BoxEditorControl";
this.Size = new System.Drawing.Size(540, 220);
((System.ComponentModel.ISupportInitialize)(this.PosXUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.PosYUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.PosZUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.SizeZUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.SizeYUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.SizeXUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.uvYUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.uvXUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.inflationUpDown)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private MetroFramework.Components.MetroToolTip toolTip;
private MetroFramework.Controls.MetroComboBox parentComboBox;
private System.Windows.Forms.NumericUpDown PosXUpDown;
private System.Windows.Forms.NumericUpDown PosYUpDown;
private System.Windows.Forms.NumericUpDown PosZUpDown;
private System.Windows.Forms.NumericUpDown SizeZUpDown;
private System.Windows.Forms.NumericUpDown SizeYUpDown;
private System.Windows.Forms.NumericUpDown SizeXUpDown;
private System.Windows.Forms.NumericUpDown uvYUpDown;
private System.Windows.Forms.NumericUpDown uvXUpDown;
private MetroFramework.Controls.MetroCheckBox helmetCheckBox;
private MetroFramework.Controls.MetroCheckBox mirrorCheckBox;
private System.Windows.Forms.NumericUpDown inflationUpDown;
private MetroFramework.Controls.MetroCheckBox chestplateCheckBox;
private MetroFramework.Controls.MetroCheckBox leggingsCheckBox;
private MetroFramework.Controls.MetroCheckBox bootsCheckBox;
private MetroFramework.Controls.MetroLabel parentLabel;
private MetroFramework.Controls.MetroLabel positionLabel;
private MetroFramework.Controls.MetroLabel sizeLabel;
private MetroFramework.Controls.MetroLabel uvLabel;
private MetroFramework.Controls.MetroLabel inflationLabel;
}
}

View File

@@ -0,0 +1,126 @@
using OpenTK;
using PckStudio.Core.Skin;
using PckStudio.Properties;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
namespace PckStudio.Controls
{
internal partial class BoxEditorControl : UserControl
{
public event EventHandler BoxChanged;
private SkinBOX result;
private int boxVersion = 0;
public BoxEditorControl(SkinBOX box, int xmlVersion)
: this(xmlVersion)
{
SetBOX(box);
}
public BoxEditorControl()
:this(0)
{
}
public BoxEditorControl(int xmlVersion = 0)
{
InitializeComponent();
SetBOXVersion(xmlVersion);
parentComboBox.SelectedIndexChanged += this.HandleBoxChanged;
PosXUpDown.ValueChanged += this.HandleBoxChanged;
PosYUpDown.ValueChanged += this.HandleBoxChanged;
PosZUpDown.ValueChanged += this.HandleBoxChanged;
SizeXUpDown.ValueChanged += this.HandleBoxChanged;
SizeYUpDown.ValueChanged += this.HandleBoxChanged;
SizeZUpDown.ValueChanged += this.HandleBoxChanged;
uvXUpDown.ValueChanged += this.HandleBoxChanged;
uvYUpDown.ValueChanged += this.HandleBoxChanged;
helmetCheckBox.CheckedChanged += this.HandleBoxChanged;
chestplateCheckBox.CheckedChanged += this.HandleBoxChanged;
leggingsCheckBox.CheckedChanged += this.HandleBoxChanged;
bootsCheckBox.CheckedChanged += this.HandleBoxChanged;
mirrorCheckBox.CheckedChanged += this.HandleBoxChanged;
inflationUpDown.ValueChanged += this.HandleBoxChanged;
}
public void SetBOXVersion(int xmlVersion)
{
boxVersion = xmlVersion;
Debug.WriteLine(xmlVersion);
inflationUpDown.Enabled = boxVersion == 3;
}
public void SetBOX(SkinBOX box)
{
if (string.IsNullOrEmpty(box.Type) || !parentComboBox.Items.Contains(box.Type))
{
throw new Exception("Failed to parse BOX value");
}
parentComboBox.SelectedItem = parentComboBox.Items[parentComboBox.Items.IndexOf(box.Type)];
PosXUpDown.Value = (decimal)box.Pos.X;
PosYUpDown.Value = (decimal)box.Pos.Y;
PosZUpDown.Value = (decimal)box.Pos.Z;
SizeXUpDown.Value = (decimal)box.Size.X;
SizeYUpDown.Value = (decimal)box.Size.Y;
SizeZUpDown.Value = (decimal)box.Size.Z;
uvXUpDown.Value = (decimal)box.UV.X;
uvYUpDown.Value = (decimal)box.UV.Y;
helmetCheckBox.Checked = (box.ArmorMaskFlags & 1) != 0;
chestplateCheckBox.Checked = (box.ArmorMaskFlags & 2) != 0;
leggingsCheckBox.Checked = (box.ArmorMaskFlags & 4) != 0;
bootsCheckBox.Checked = (box.ArmorMaskFlags & 8) != 0;
mirrorCheckBox.Checked = box.Mirror;
inflationUpDown.Value = (decimal)box.Scale;
}
public SkinBOX GetBOX()
{
int mask = 0;
if (helmetCheckBox.Checked) mask |= 1;
if (chestplateCheckBox.Checked) mask |= 2;
if (leggingsCheckBox.Checked) mask |= 4;
if (bootsCheckBox.Checked) mask |= 8;
result = SkinBOX.FromString(
$"{parentComboBox.SelectedItem} " +
$"{PosXUpDown.Value} {PosYUpDown.Value} {PosZUpDown.Value} " +
$"{SizeXUpDown.Value} {SizeYUpDown.Value} {SizeZUpDown.Value} " +
$"{uvXUpDown.Value} {uvYUpDown.Value} " +
$"{mask} " +
$"{Convert.ToInt32(mirrorCheckBox.Checked)} " +
$"{inflationUpDown.Value}");
return result;
}
private void HandleBoxChanged(object sender, EventArgs e)
{
// we'll explain this in a minute
this.OnBoxChanged(EventArgs.Empty);
}
protected virtual void OnBoxChanged(EventArgs e)
{
EventHandler handler = this.BoxChanged;
if (handler != null)
{
handler(this, e);
}
}
}
}

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -28,100 +28,12 @@
/// </summary>
private void InitializeComponent()
{
MetroFramework.Controls.MetroLabel parentLabel;
MetroFramework.Controls.MetroLabel positionLabel;
MetroFramework.Controls.MetroLabel sizeLabel;
MetroFramework.Controls.MetroLabel uvLabel;
MetroFramework.Controls.MetroLabel inflationLabel;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BoxEditor));
this.closeButton = new MetroFramework.Controls.MetroButton();
this.toolTip = new MetroFramework.Components.MetroToolTip();
this.parentComboBox = new MetroFramework.Controls.MetroComboBox();
this.PosXUpDown = new System.Windows.Forms.NumericUpDown();
this.PosYUpDown = new System.Windows.Forms.NumericUpDown();
this.PosZUpDown = new System.Windows.Forms.NumericUpDown();
this.SizeZUpDown = new System.Windows.Forms.NumericUpDown();
this.SizeYUpDown = new System.Windows.Forms.NumericUpDown();
this.SizeXUpDown = new System.Windows.Forms.NumericUpDown();
this.uvYUpDown = new System.Windows.Forms.NumericUpDown();
this.uvXUpDown = new System.Windows.Forms.NumericUpDown();
this.helmetCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.mirrorCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.inflationUpDown = new System.Windows.Forms.NumericUpDown();
this.chestplateCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.leggingsCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.bootsCheckBox = new MetroFramework.Controls.MetroCheckBox();
parentLabel = new MetroFramework.Controls.MetroLabel();
positionLabel = new MetroFramework.Controls.MetroLabel();
sizeLabel = new MetroFramework.Controls.MetroLabel();
uvLabel = new MetroFramework.Controls.MetroLabel();
inflationLabel = new MetroFramework.Controls.MetroLabel();
((System.ComponentModel.ISupportInitialize)(this.PosXUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PosYUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PosZUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.SizeZUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.SizeYUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.SizeXUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.uvYUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.uvXUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.inflationUpDown)).BeginInit();
this.boxEditorControl1 = new PckStudio.Controls.BoxEditorControl();
this.SuspendLayout();
//
// parentLabel
//
parentLabel.AutoSize = true;
parentLabel.FontSize = MetroFramework.MetroLabelSize.Tall;
parentLabel.Location = new System.Drawing.Point(47, 55);
parentLabel.Name = "parentLabel";
parentLabel.Size = new System.Drawing.Size(50, 25);
parentLabel.TabIndex = 2;
parentLabel.Text = "Type:";
parentLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// positionLabel
//
positionLabel.AutoSize = true;
positionLabel.FontSize = MetroFramework.MetroLabelSize.Tall;
positionLabel.Location = new System.Drawing.Point(22, 84);
positionLabel.Name = "positionLabel";
positionLabel.Size = new System.Drawing.Size(75, 25);
positionLabel.TabIndex = 4;
positionLabel.Text = "Position:";
positionLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// sizeLabel
//
sizeLabel.AutoSize = true;
sizeLabel.FontSize = MetroFramework.MetroLabelSize.Tall;
sizeLabel.Location = new System.Drawing.Point(51, 109);
sizeLabel.Name = "sizeLabel";
sizeLabel.Size = new System.Drawing.Size(46, 25);
sizeLabel.TabIndex = 22;
sizeLabel.Text = "Size:";
sizeLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// uvLabel
//
uvLabel.AutoSize = true;
uvLabel.FontSize = MetroFramework.MetroLabelSize.Tall;
uvLabel.Location = new System.Drawing.Point(58, 135);
uvLabel.Name = "uvLabel";
uvLabel.Size = new System.Drawing.Size(39, 25);
uvLabel.TabIndex = 26;
uvLabel.Text = "UV:";
uvLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// inflationLabel
//
inflationLabel.AutoSize = true;
inflationLabel.FontSize = MetroFramework.MetroLabelSize.Tall;
inflationLabel.Location = new System.Drawing.Point(42, 165);
inflationLabel.Name = "inflationLabel";
inflationLabel.Size = new System.Drawing.Size(55, 25);
inflationLabel.TabIndex = 31;
inflationLabel.Text = "Scale:";
inflationLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// closeButton
//
this.closeButton.Location = new System.Drawing.Point(207, 187);
@@ -140,287 +52,21 @@
this.toolTip.StyleManager = null;
this.toolTip.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// parentComboBox
// boxEditorControl1
//
this.parentComboBox.FormattingEnabled = true;
this.parentComboBox.ItemHeight = 23;
this.parentComboBox.Items.AddRange(new object[] {
"HEAD",
"BODY",
"ARM0",
"ARM1",
"LEG0",
"LEG1",
"HEADWEAR",
"JACKET",
"SLEEVE0",
"SLEEVE1",
"PANTS0",
"PANTS1",
"WAIST",
"LEGGING0",
"LEGGING1",
"SOCK0",
"SOCK1",
"BOOT0",
"BOOT1",
"ARMARMOR1",
"ARMARMOR0",
"BODYARMOR",
"BELT"});
this.parentComboBox.Location = new System.Drawing.Point(103, 51);
this.parentComboBox.Name = "parentComboBox";
this.parentComboBox.Size = new System.Drawing.Size(163, 29);
this.parentComboBox.TabIndex = 3;
this.parentComboBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.parentComboBox.UseSelectable = true;
//
// PosXUpDown
//
this.PosXUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.PosXUpDown.DecimalPlaces = 3;
this.PosXUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.PosXUpDown.Location = new System.Drawing.Point(103, 86);
this.PosXUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.PosXUpDown.Minimum = new decimal(new int[] {
9999,
0,
0,
-2147483648});
this.PosXUpDown.Name = "PosXUpDown";
this.PosXUpDown.Size = new System.Drawing.Size(73, 20);
this.PosXUpDown.TabIndex = 19;
//
// PosYUpDown
//
this.PosYUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.PosYUpDown.DecimalPlaces = 3;
this.PosYUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.PosYUpDown.Location = new System.Drawing.Point(182, 86);
this.PosYUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.PosYUpDown.Minimum = new decimal(new int[] {
9999,
0,
0,
-2147483648});
this.PosYUpDown.Name = "PosYUpDown";
this.PosYUpDown.Size = new System.Drawing.Size(73, 20);
this.PosYUpDown.TabIndex = 20;
//
// PosZUpDown
//
this.PosZUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.PosZUpDown.DecimalPlaces = 3;
this.PosZUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.PosZUpDown.Location = new System.Drawing.Point(261, 86);
this.PosZUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.PosZUpDown.Minimum = new decimal(new int[] {
9999,
0,
0,
-2147483648});
this.PosZUpDown.Name = "PosZUpDown";
this.PosZUpDown.Size = new System.Drawing.Size(73, 20);
this.PosZUpDown.TabIndex = 21;
//
// SizeZUpDown
//
this.SizeZUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.SizeZUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.SizeZUpDown.Location = new System.Drawing.Point(261, 111);
this.SizeZUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.SizeZUpDown.Name = "SizeZUpDown";
this.SizeZUpDown.Size = new System.Drawing.Size(73, 20);
this.SizeZUpDown.TabIndex = 25;
//
// SizeYUpDown
//
this.SizeYUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.SizeYUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.SizeYUpDown.Location = new System.Drawing.Point(182, 111);
this.SizeYUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.SizeYUpDown.Name = "SizeYUpDown";
this.SizeYUpDown.Size = new System.Drawing.Size(73, 20);
this.SizeYUpDown.TabIndex = 24;
//
// SizeXUpDown
//
this.SizeXUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.SizeXUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.SizeXUpDown.Location = new System.Drawing.Point(103, 111);
this.SizeXUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.SizeXUpDown.Name = "SizeXUpDown";
this.SizeXUpDown.Size = new System.Drawing.Size(73, 20);
this.SizeXUpDown.TabIndex = 23;
//
// uvYUpDown
//
this.uvYUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.uvYUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.uvYUpDown.Location = new System.Drawing.Point(182, 137);
this.uvYUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.uvYUpDown.Minimum = new decimal(new int[] {
9999,
0,
0,
-2147483648});
this.uvYUpDown.Name = "uvYUpDown";
this.uvYUpDown.Size = new System.Drawing.Size(73, 20);
this.uvYUpDown.TabIndex = 28;
//
// uvXUpDown
//
this.uvXUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.uvXUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.uvXUpDown.Location = new System.Drawing.Point(103, 137);
this.uvXUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.uvXUpDown.Minimum = new decimal(new int[] {
9999,
0,
0,
-2147483648});
this.uvXUpDown.Name = "uvXUpDown";
this.uvXUpDown.Size = new System.Drawing.Size(73, 20);
this.uvXUpDown.TabIndex = 27;
//
// helmetCheckBox
//
this.helmetCheckBox.AutoSize = true;
this.helmetCheckBox.FontSize = MetroFramework.MetroCheckBoxSize.Tall;
this.helmetCheckBox.FontWeight = MetroFramework.MetroCheckBoxWeight.Light;
this.helmetCheckBox.Location = new System.Drawing.Point(340, 84);
this.helmetCheckBox.Name = "helmetCheckBox";
this.helmetCheckBox.Size = new System.Drawing.Size(160, 25);
this.helmetCheckBox.TabIndex = 29;
this.helmetCheckBox.Text = "Mask with helmet";
this.helmetCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.helmetCheckBox.UseSelectable = true;
//
// mirrorCheckBox
//
this.mirrorCheckBox.AutoSize = true;
this.mirrorCheckBox.FontSize = MetroFramework.MetroCheckBoxSize.Tall;
this.mirrorCheckBox.FontWeight = MetroFramework.MetroCheckBoxWeight.Light;
this.mirrorCheckBox.Location = new System.Drawing.Point(340, 58);
this.mirrorCheckBox.Name = "mirrorCheckBox";
this.mirrorCheckBox.Size = new System.Drawing.Size(133, 25);
this.mirrorCheckBox.TabIndex = 30;
this.mirrorCheckBox.Text = "Mirror Texture";
this.mirrorCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.mirrorCheckBox.UseSelectable = true;
//
// inflationUpDown
//
this.inflationUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
this.inflationUpDown.DecimalPlaces = 3;
this.inflationUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
this.inflationUpDown.Location = new System.Drawing.Point(103, 167);
this.inflationUpDown.Maximum = new decimal(new int[] {
9999,
0,
0,
0});
this.inflationUpDown.Name = "inflationUpDown";
this.inflationUpDown.Size = new System.Drawing.Size(73, 20);
this.inflationUpDown.TabIndex = 32;
//
// chestplateCheckBox
//
this.chestplateCheckBox.AutoSize = true;
this.chestplateCheckBox.FontSize = MetroFramework.MetroCheckBoxSize.Tall;
this.chestplateCheckBox.FontWeight = MetroFramework.MetroCheckBoxWeight.Light;
this.chestplateCheckBox.Location = new System.Drawing.Point(340, 109);
this.chestplateCheckBox.Name = "chestplateCheckBox";
this.chestplateCheckBox.Size = new System.Drawing.Size(184, 25);
this.chestplateCheckBox.TabIndex = 33;
this.chestplateCheckBox.Text = "Mask with chestplate";
this.chestplateCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.chestplateCheckBox.UseSelectable = true;
//
// leggingsCheckBox
//
this.leggingsCheckBox.AutoSize = true;
this.leggingsCheckBox.FontSize = MetroFramework.MetroCheckBoxSize.Tall;
this.leggingsCheckBox.FontWeight = MetroFramework.MetroCheckBoxWeight.Light;
this.leggingsCheckBox.Location = new System.Drawing.Point(340, 135);
this.leggingsCheckBox.Name = "leggingsCheckBox";
this.leggingsCheckBox.Size = new System.Drawing.Size(172, 25);
this.leggingsCheckBox.TabIndex = 34;
this.leggingsCheckBox.Text = "Mask with leggings";
this.leggingsCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.leggingsCheckBox.UseSelectable = true;
//
// bootsCheckBox
//
this.bootsCheckBox.AutoSize = true;
this.bootsCheckBox.FontSize = MetroFramework.MetroCheckBoxSize.Tall;
this.bootsCheckBox.FontWeight = MetroFramework.MetroCheckBoxWeight.Light;
this.bootsCheckBox.Location = new System.Drawing.Point(340, 161);
this.bootsCheckBox.Name = "bootsCheckBox";
this.bootsCheckBox.Size = new System.Drawing.Size(150, 25);
this.bootsCheckBox.TabIndex = 35;
this.bootsCheckBox.Text = "Mask with boots";
this.bootsCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.bootsCheckBox.UseSelectable = true;
this.boxEditorControl1.BackColor = System.Drawing.Color.Transparent;
this.boxEditorControl1.Location = new System.Drawing.Point(0, 0);
this.boxEditorControl1.Name = "boxEditorControl1";
this.boxEditorControl1.Size = new System.Drawing.Size(540, 220);
this.boxEditorControl1.TabIndex = 2;
//
// BoxEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(540, 220);
this.Controls.Add(this.bootsCheckBox);
this.Controls.Add(this.leggingsCheckBox);
this.Controls.Add(this.chestplateCheckBox);
this.Controls.Add(this.inflationUpDown);
this.Controls.Add(this.uvYUpDown);
this.Controls.Add(this.uvXUpDown);
this.Controls.Add(this.SizeZUpDown);
this.Controls.Add(this.SizeYUpDown);
this.Controls.Add(this.SizeXUpDown);
this.Controls.Add(this.PosZUpDown);
this.Controls.Add(this.PosYUpDown);
this.Controls.Add(this.PosXUpDown);
this.Controls.Add(inflationLabel);
this.Controls.Add(this.parentComboBox);
this.Controls.Add(this.mirrorCheckBox);
this.Controls.Add(this.helmetCheckBox);
this.Controls.Add(uvLabel);
this.Controls.Add(sizeLabel);
this.Controls.Add(positionLabel);
this.Controls.Add(parentLabel);
this.Controls.Add(this.closeButton);
this.Controls.Add(this.boxEditorControl1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(540, 554);
@@ -433,37 +79,13 @@
this.Text = "BOX Editor";
this.Theme = MetroFramework.MetroThemeStyle.Dark;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BoxEditor_FormClosing);
((System.ComponentModel.ISupportInitialize)(this.PosXUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.PosYUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.PosZUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.SizeZUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.SizeYUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.SizeXUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.uvYUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.uvXUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.inflationUpDown)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private MetroFramework.Controls.MetroButton closeButton;
private MetroFramework.Components.MetroToolTip toolTip;
private MetroFramework.Controls.MetroComboBox parentComboBox;
private System.Windows.Forms.NumericUpDown PosXUpDown;
private System.Windows.Forms.NumericUpDown PosYUpDown;
private System.Windows.Forms.NumericUpDown PosZUpDown;
private System.Windows.Forms.NumericUpDown SizeZUpDown;
private System.Windows.Forms.NumericUpDown SizeYUpDown;
private System.Windows.Forms.NumericUpDown SizeXUpDown;
private System.Windows.Forms.NumericUpDown uvYUpDown;
private System.Windows.Forms.NumericUpDown uvXUpDown;
private MetroFramework.Controls.MetroCheckBox helmetCheckBox;
private MetroFramework.Controls.MetroCheckBox mirrorCheckBox;
private System.Windows.Forms.NumericUpDown inflationUpDown;
private MetroFramework.Controls.MetroCheckBox chestplateCheckBox;
private MetroFramework.Controls.MetroCheckBox leggingsCheckBox;
private MetroFramework.Controls.MetroCheckBox bootsCheckBox;
private Controls.BoxEditorControl boxEditorControl1;
}
}

View File

@@ -19,50 +19,13 @@ namespace PckStudio.Forms.Editor
public BoxEditor(SkinBOX box, int xmlVersion)
{
InitializeComponent();
if (string.IsNullOrEmpty(box.Type) || !parentComboBox.Items.Contains(box.Type))
{
throw new Exception("Failed to parse BOX value");
}
closeButton.Visible = !Settings.Default.AutoSaveChanges;
inflationUpDown.Enabled = xmlVersion == 3;
parentComboBox.SelectedItem = parentComboBox.Items[parentComboBox.Items.IndexOf(box.Type)];
PosXUpDown.Value = (decimal)box.Pos.X;
PosYUpDown.Value = (decimal)box.Pos.Y;
PosZUpDown.Value = (decimal)box.Pos.Z;
SizeXUpDown.Value = (decimal)box.Size.X;
SizeYUpDown.Value = (decimal)box.Size.Y;
SizeZUpDown.Value = (decimal)box.Size.Z;
uvXUpDown.Value = (decimal)box.UV.X;
uvYUpDown.Value = (decimal)box.UV.Y;
helmetCheckBox.Checked = (box.ArmorMaskFlags & 1) != 0;
chestplateCheckBox.Checked = (box.ArmorMaskFlags & 2) != 0;
leggingsCheckBox.Checked = (box.ArmorMaskFlags & 4) != 0;
bootsCheckBox.Checked = (box.ArmorMaskFlags & 8) != 0;
mirrorCheckBox.Checked = box.Mirror;
inflationUpDown.Value = (decimal)box.Scale;
}
boxEditorControl1.SetBOXVersion(xmlVersion);
boxEditorControl1.SetBOX(box);
}
private void saveButton_Click(object sender, EventArgs e)
{
int mask = 0;
if (helmetCheckBox.Checked) mask |= 1;
if (chestplateCheckBox.Checked) mask |= 2;
if (leggingsCheckBox.Checked) mask |= 4;
if (bootsCheckBox.Checked) mask |= 8;
result = SkinBOX.FromString(
$"{parentComboBox.SelectedItem} " +
$"{PosXUpDown.Value} {PosYUpDown.Value} {PosZUpDown.Value} " +
$"{SizeXUpDown.Value} {SizeYUpDown.Value} {SizeZUpDown.Value} " +
$"{uvXUpDown.Value} {uvYUpDown.Value} " +
$"{mask} " +
$"{Convert.ToInt32(mirrorCheckBox.Checked)} " +
$"{inflationUpDown.Value}");
result = boxEditorControl1.GetBOX();
DialogResult = DialogResult.OK;
}

View File

@@ -117,21 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="parentLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="positionLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="sizeLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="uvLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="inflationLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>

View File

@@ -137,6 +137,12 @@
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<Compile Include="Controls\BoxEditorControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\BoxEditorControl.Designer.cs">
<DependentUpon>BoxEditorControl.cs</DependentUpon>
</Compile>
<Compile Include="Controls\CustomTabControl.cs">
<SubType>Component</SubType>
</Compile>
@@ -396,6 +402,9 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Controls\BoxEditorControl.resx">
<DependentUpon>BoxEditorControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\PckEditor.resx">
<DependentUpon>PckEditor.cs</DependentUpon>
</EmbeddedResource>