From cbe4796da656f72747cffc5ff7a90a0f331e6e8d Mon Sep 17 00:00:00 2001
From: miku-666 <74728189+NessieHax@users.noreply.github.com>
Date: Sun, 19 May 2024 17:46:52 +0200
Subject: [PATCH] CustomSkinEditor - Update UI
---
.../Forms/Editor/CustomSkinEditor.Designer.cs | 275 ++-----
PCK-Studio/Forms/Editor/CustomSkinEditor.cs | 29 +-
PCK-Studio/Forms/Editor/CustomSkinEditor.resx | 764 +++++++-----------
PCK-Studio/Rendering/SkinRenderer.cs | 5 +-
4 files changed, 388 insertions(+), 685 deletions(-)
diff --git a/PCK-Studio/Forms/Editor/CustomSkinEditor.Designer.cs b/PCK-Studio/Forms/Editor/CustomSkinEditor.Designer.cs
index ee98be8f..654abfaa 100644
--- a/PCK-Studio/Forms/Editor/CustomSkinEditor.Designer.cs
+++ b/PCK-Studio/Forms/Editor/CustomSkinEditor.Designer.cs
@@ -29,35 +29,27 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
- System.Windows.Forms.Label label5;
+ System.Windows.Forms.Label labelTextureMapping;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CustomSkinEditor));
- System.Windows.Forms.Label label3;
- System.Windows.Forms.Label label7;
- System.Windows.Forms.Label labelTextureMappingPreview;
+ System.Windows.Forms.GroupBox groupBox1;
+ this.importTextureButton = new MetroFramework.Controls.MetroButton();
+ this.exportTextureButton = new MetroFramework.Controls.MetroButton();
+ this.positionLabel = new System.Windows.Forms.Label();
+ this.sizeLabel = new System.Windows.Forms.Label();
+ this.uvLabel = new System.Windows.Forms.Label();
this.skinPartTabContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.createToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.cloneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.changeColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.buttonDone = new MetroFramework.Controls.MetroButton();
- this.exportTextureButton = new MetroFramework.Controls.MetroButton();
- this.importTextureButton = new MetroFramework.Controls.MetroButton();
this.importSkinButton = new MetroFramework.Controls.MetroButton();
this.exportSkinButton = new MetroFramework.Controls.MetroButton();
this.outlineColorButton = new MetroFramework.Controls.MetroButton();
this.generateTextureCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.checkGuide = new MetroFramework.Controls.MetroCheckBox();
this.showArmorCheckbox = new MetroFramework.Controls.MetroCheckBox();
- this.SizeXUpDown = new System.Windows.Forms.NumericUpDown();
- this.SizeYUpDown = new System.Windows.Forms.NumericUpDown();
- this.SizeZUpDown = new System.Windows.Forms.NumericUpDown();
- this.TextureXUpDown = new System.Windows.Forms.NumericUpDown();
- this.TextureYUpDown = new System.Windows.Forms.NumericUpDown();
- this.PosZUpDown = new System.Windows.Forms.NumericUpDown();
- this.PosYUpDown = new System.Windows.Forms.NumericUpDown();
- this.PosXUpDown = new System.Windows.Forms.NumericUpDown();
this.skinPartListBox = new System.Windows.Forms.ListBox();
- this.clampToViewCheckbox = new MetroFramework.Controls.MetroCheckBox();
this.captureScreenshotButton = new MetroFramework.Controls.MetroButton();
this.showToolsCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.skinNameLabel = new MetroFramework.Controls.MetroLabel();
@@ -71,19 +63,12 @@
this.renderer3D1 = new PckStudio.Rendering.SkinRenderer();
this.uvPictureBox = new PckStudio.ToolboxItems.InterpolationPictureBox();
this.skinAnimateCheckBox = new MetroFramework.Controls.MetroCheckBox();
- label5 = new System.Windows.Forms.Label();
- label3 = new System.Windows.Forms.Label();
- label7 = new System.Windows.Forms.Label();
- labelTextureMappingPreview = new System.Windows.Forms.Label();
+ this.centerSelectionCheckbox = new MetroFramework.Controls.MetroCheckBox();
+ this.textureSizeLabel = new System.Windows.Forms.Label();
+ labelTextureMapping = new System.Windows.Forms.Label();
+ groupBox1 = new System.Windows.Forms.GroupBox();
+ groupBox1.SuspendLayout();
this.skinPartTabContextMenu.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.SizeXUpDown)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.SizeYUpDown)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.SizeZUpDown)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.TextureXUpDown)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.TextureYUpDown)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.PosZUpDown)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.PosYUpDown)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.PosXUpDown)).BeginInit();
this.metroTabControl1.SuspendLayout();
this.skinPartsTabPage.SuspendLayout();
this.skinOffsetsTabPage.SuspendLayout();
@@ -91,29 +76,56 @@
((System.ComponentModel.ISupportInitialize)(this.uvPictureBox)).BeginInit();
this.SuspendLayout();
//
- // label5
+ // labelTextureMapping
//
- resources.ApplyResources(label5, "label5");
- label5.ForeColor = System.Drawing.Color.White;
- label5.Name = "label5";
+ resources.ApplyResources(labelTextureMapping, "labelTextureMapping");
+ labelTextureMapping.ForeColor = System.Drawing.Color.White;
+ labelTextureMapping.Name = "labelTextureMapping";
//
- // label3
+ // groupBox1
//
- resources.ApplyResources(label3, "label3");
- label3.ForeColor = System.Drawing.Color.White;
- label3.Name = "label3";
+ resources.ApplyResources(groupBox1, "groupBox1");
+ groupBox1.Controls.Add(this.importTextureButton);
+ groupBox1.Controls.Add(this.exportTextureButton);
+ groupBox1.ForeColor = System.Drawing.SystemColors.Control;
+ groupBox1.Name = "groupBox1";
+ groupBox1.TabStop = false;
//
- // label7
+ // importTextureButton
//
- resources.ApplyResources(label7, "label7");
- label7.ForeColor = System.Drawing.Color.White;
- label7.Name = "label7";
+ this.importTextureButton.ForeColor = System.Drawing.Color.White;
+ resources.ApplyResources(this.importTextureButton, "importTextureButton");
+ this.importTextureButton.Name = "importTextureButton";
+ this.importTextureButton.Theme = MetroFramework.MetroThemeStyle.Dark;
+ this.importTextureButton.UseSelectable = true;
+ this.importTextureButton.Click += new System.EventHandler(this.importTextureButton_Click);
//
- // labelTextureMappingPreview
+ // exportTextureButton
//
- resources.ApplyResources(labelTextureMappingPreview, "labelTextureMappingPreview");
- labelTextureMappingPreview.ForeColor = System.Drawing.Color.White;
- labelTextureMappingPreview.Name = "labelTextureMappingPreview";
+ this.exportTextureButton.ForeColor = System.Drawing.Color.White;
+ resources.ApplyResources(this.exportTextureButton, "exportTextureButton");
+ this.exportTextureButton.Name = "exportTextureButton";
+ this.exportTextureButton.Theme = MetroFramework.MetroThemeStyle.Dark;
+ this.exportTextureButton.UseSelectable = true;
+ this.exportTextureButton.Click += new System.EventHandler(this.exportTextureButton_Click);
+ //
+ // positionLabel
+ //
+ resources.ApplyResources(this.positionLabel, "positionLabel");
+ this.positionLabel.ForeColor = System.Drawing.Color.White;
+ this.positionLabel.Name = "positionLabel";
+ //
+ // sizeLabel
+ //
+ resources.ApplyResources(this.sizeLabel, "sizeLabel");
+ this.sizeLabel.ForeColor = System.Drawing.Color.White;
+ this.sizeLabel.Name = "sizeLabel";
+ //
+ // uvLabel
+ //
+ resources.ApplyResources(this.uvLabel, "uvLabel");
+ this.uvLabel.ForeColor = System.Drawing.Color.White;
+ this.uvLabel.Name = "uvLabel";
//
// skinPartTabContextMenu
//
@@ -159,24 +171,6 @@
this.buttonDone.UseSelectable = true;
this.buttonDone.Click += new System.EventHandler(this.buttonDone_Click);
//
- // exportTextureButton
- //
- resources.ApplyResources(this.exportTextureButton, "exportTextureButton");
- this.exportTextureButton.ForeColor = System.Drawing.Color.White;
- this.exportTextureButton.Name = "exportTextureButton";
- this.exportTextureButton.Theme = MetroFramework.MetroThemeStyle.Dark;
- this.exportTextureButton.UseSelectable = true;
- this.exportTextureButton.Click += new System.EventHandler(this.exportTextureButton_Click);
- //
- // importTextureButton
- //
- resources.ApplyResources(this.importTextureButton, "importTextureButton");
- this.importTextureButton.ForeColor = System.Drawing.Color.White;
- this.importTextureButton.Name = "importTextureButton";
- this.importTextureButton.Theme = MetroFramework.MetroThemeStyle.Dark;
- this.importTextureButton.UseSelectable = true;
- this.importTextureButton.Click += new System.EventHandler(this.importTextureButton_Click);
- //
// importSkinButton
//
resources.ApplyResources(this.importSkinButton, "importSkinButton");
@@ -227,93 +221,6 @@
this.showArmorCheckbox.UseSelectable = true;
this.showArmorCheckbox.CheckedChanged += new System.EventHandler(this.showArmorCheckbox_CheckedChanged);
//
- // SizeXUpDown
- //
- resources.ApplyResources(this.SizeXUpDown, "SizeXUpDown");
- this.SizeXUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
- this.SizeXUpDown.DecimalPlaces = 1;
- this.SizeXUpDown.ForeColor = System.Drawing.SystemColors.Menu;
- this.SizeXUpDown.Name = "SizeXUpDown";
- //
- // SizeYUpDown
- //
- resources.ApplyResources(this.SizeYUpDown, "SizeYUpDown");
- this.SizeYUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
- this.SizeYUpDown.DecimalPlaces = 1;
- this.SizeYUpDown.ForeColor = System.Drawing.SystemColors.Menu;
- this.SizeYUpDown.Name = "SizeYUpDown";
- //
- // SizeZUpDown
- //
- resources.ApplyResources(this.SizeZUpDown, "SizeZUpDown");
- this.SizeZUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
- this.SizeZUpDown.DecimalPlaces = 1;
- this.SizeZUpDown.ForeColor = System.Drawing.SystemColors.Menu;
- this.SizeZUpDown.Name = "SizeZUpDown";
- //
- // TextureXUpDown
- //
- resources.ApplyResources(this.TextureXUpDown, "TextureXUpDown");
- this.TextureXUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
- this.TextureXUpDown.ForeColor = System.Drawing.SystemColors.Menu;
- this.TextureXUpDown.Maximum = new decimal(new int[] {
- 64,
- 0,
- 0,
- 0});
- this.TextureXUpDown.Name = "TextureXUpDown";
- //
- // TextureYUpDown
- //
- resources.ApplyResources(this.TextureYUpDown, "TextureYUpDown");
- this.TextureYUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
- this.TextureYUpDown.ForeColor = System.Drawing.SystemColors.Menu;
- this.TextureYUpDown.Maximum = new decimal(new int[] {
- 64,
- 0,
- 0,
- 0});
- this.TextureYUpDown.Name = "TextureYUpDown";
- //
- // PosZUpDown
- //
- resources.ApplyResources(this.PosZUpDown, "PosZUpDown");
- this.PosZUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
- this.PosZUpDown.DecimalPlaces = 1;
- this.PosZUpDown.ForeColor = System.Drawing.SystemColors.Menu;
- this.PosZUpDown.Minimum = new decimal(new int[] {
- 100,
- 0,
- 0,
- -2147483648});
- this.PosZUpDown.Name = "PosZUpDown";
- //
- // PosYUpDown
- //
- resources.ApplyResources(this.PosYUpDown, "PosYUpDown");
- this.PosYUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
- this.PosYUpDown.DecimalPlaces = 1;
- this.PosYUpDown.ForeColor = System.Drawing.SystemColors.Menu;
- this.PosYUpDown.Minimum = new decimal(new int[] {
- 100,
- 0,
- 0,
- -2147483648});
- this.PosYUpDown.Name = "PosYUpDown";
- //
- // PosXUpDown
- //
- resources.ApplyResources(this.PosXUpDown, "PosXUpDown");
- this.PosXUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
- this.PosXUpDown.DecimalPlaces = 1;
- this.PosXUpDown.ForeColor = System.Drawing.SystemColors.Menu;
- this.PosXUpDown.Minimum = new decimal(new int[] {
- 100,
- 0,
- 0,
- -2147483648});
- this.PosXUpDown.Name = "PosXUpDown";
- //
// skinPartListBox
//
this.skinPartListBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
@@ -327,14 +234,6 @@
this.skinPartListBox.DoubleClick += new System.EventHandler(this.skinPartListBox_DoubleClick);
this.skinPartListBox.KeyUp += new System.Windows.Forms.KeyEventHandler(this.skinPartListBox_KeyUp);
//
- // clampToViewCheckbox
- //
- resources.ApplyResources(this.clampToViewCheckbox, "clampToViewCheckbox");
- this.clampToViewCheckbox.Name = "clampToViewCheckbox";
- this.clampToViewCheckbox.Theme = MetroFramework.MetroThemeStyle.Dark;
- this.clampToViewCheckbox.UseSelectable = true;
- this.clampToViewCheckbox.CheckedChanged += new System.EventHandler(this.clampToViewCheckbox_CheckedChanged);
- //
// captureScreenshotButton
//
resources.ApplyResources(this.captureScreenshotButton, "captureScreenshotButton");
@@ -415,10 +314,11 @@
this.renderer3D1.Animate = true;
this.renderer3D1.BackColor = System.Drawing.Color.DimGray;
this.renderer3D1.CapeTexture = null;
- this.renderer3D1.ClampModel = false;
+ this.renderer3D1.CenterOnSelect = false;
+ this.renderer3D1.GuideLineColor = System.Drawing.Color.Empty;
+ this.renderer3D1.HighlightlingColor = System.Drawing.Color.Aqua;
this.renderer3D1.MouseSensetivity = 0.01F;
this.renderer3D1.Name = "renderer3D1";
- this.renderer3D1.GuideLineColor = System.Drawing.Color.Empty;
this.renderer3D1.RefreshRate = 50;
this.renderer3D1.SelectedIndex = -1;
this.renderer3D1.ShowArmor = false;
@@ -445,52 +345,51 @@
this.skinAnimateCheckBox.UseSelectable = true;
this.skinAnimateCheckBox.CheckedChanged += new System.EventHandler(this.skinAnimateCheckBox_CheckedChanged);
//
+ // centerSelectionCheckbox
+ //
+ resources.ApplyResources(this.centerSelectionCheckbox, "centerSelectionCheckbox");
+ this.centerSelectionCheckbox.Name = "centerSelectionCheckbox";
+ this.centerSelectionCheckbox.Theme = MetroFramework.MetroThemeStyle.Dark;
+ this.centerSelectionCheckbox.UseSelectable = true;
+ this.centerSelectionCheckbox.CheckedChanged += new System.EventHandler(this.centerSelectionCheckbox_CheckedChanged);
+ //
+ // textureSizeLabel
+ //
+ resources.ApplyResources(this.textureSizeLabel, "textureSizeLabel");
+ this.textureSizeLabel.ForeColor = System.Drawing.Color.White;
+ this.textureSizeLabel.Name = "textureSizeLabel";
+ //
// CustomSkinEditor
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.textureSizeLabel);
+ this.Controls.Add(groupBox1);
this.Controls.Add(this.skinAnimateCheckBox);
this.Controls.Add(this.metroTabControl1);
this.Controls.Add(this.skinNameLabel);
this.Controls.Add(this.showToolsCheckBox);
this.Controls.Add(this.captureScreenshotButton);
- this.Controls.Add(this.clampToViewCheckbox);
- this.Controls.Add(this.PosZUpDown);
- this.Controls.Add(this.PosYUpDown);
- this.Controls.Add(this.PosXUpDown);
+ this.Controls.Add(this.centerSelectionCheckbox);
this.Controls.Add(this.renderer3D1);
- this.Controls.Add(this.TextureYUpDown);
- this.Controls.Add(this.TextureXUpDown);
- this.Controls.Add(this.SizeZUpDown);
- this.Controls.Add(this.SizeYUpDown);
- this.Controls.Add(this.SizeXUpDown);
this.Controls.Add(this.showArmorCheckbox);
this.Controls.Add(this.checkGuide);
this.Controls.Add(this.generateTextureCheckBox);
this.Controls.Add(this.outlineColorButton);
this.Controls.Add(this.exportSkinButton);
this.Controls.Add(this.importSkinButton);
- this.Controls.Add(this.exportTextureButton);
- this.Controls.Add(labelTextureMappingPreview);
- this.Controls.Add(this.importTextureButton);
- this.Controls.Add(label7);
+ this.Controls.Add(labelTextureMapping);
+ this.Controls.Add(this.uvLabel);
this.Controls.Add(this.buttonDone);
- this.Controls.Add(label3);
- this.Controls.Add(label5);
+ this.Controls.Add(this.sizeLabel);
+ this.Controls.Add(this.positionLabel);
this.Controls.Add(this.uvPictureBox);
this.Name = "CustomSkinEditor";
this.Style = MetroFramework.MetroColorStyle.Silver;
this.Theme = MetroFramework.MetroThemeStyle.Dark;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.CustomSkinEditor_FormClosing);
+ groupBox1.ResumeLayout(false);
this.skinPartTabContextMenu.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.SizeXUpDown)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.SizeYUpDown)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.SizeZUpDown)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.TextureXUpDown)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.TextureYUpDown)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.PosZUpDown)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.PosYUpDown)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.PosXUpDown)).EndInit();
this.metroTabControl1.ResumeLayout(false);
this.skinPartsTabPage.ResumeLayout(false);
this.skinOffsetsTabPage.ResumeLayout(false);
@@ -517,17 +416,8 @@
private MetroFramework.Controls.MetroCheckBox generateTextureCheckBox;
private MetroFramework.Controls.MetroCheckBox checkGuide;
private MetroFramework.Controls.MetroCheckBox showArmorCheckbox;
- private System.Windows.Forms.NumericUpDown SizeXUpDown;
- private System.Windows.Forms.NumericUpDown SizeYUpDown;
- private System.Windows.Forms.NumericUpDown SizeZUpDown;
- private System.Windows.Forms.NumericUpDown TextureXUpDown;
- private System.Windows.Forms.NumericUpDown TextureYUpDown;
- private System.Windows.Forms.NumericUpDown PosZUpDown;
- private System.Windows.Forms.NumericUpDown PosYUpDown;
- private System.Windows.Forms.NumericUpDown PosXUpDown;
private Rendering.SkinRenderer renderer3D1;
private System.Windows.Forms.ListBox skinPartListBox;
- private MetroFramework.Controls.MetroCheckBox clampToViewCheckbox;
private MetroFramework.Controls.MetroButton captureScreenshotButton;
private MetroFramework.Controls.MetroCheckBox showToolsCheckBox;
private MetroFramework.Controls.MetroLabel skinNameLabel;
@@ -539,5 +429,10 @@
private System.Windows.Forms.ToolStripMenuItem addOffsetToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem removeOffsetToolStripMenuItem;
private MetroFramework.Controls.MetroCheckBox skinAnimateCheckBox;
+ private MetroFramework.Controls.MetroCheckBox centerSelectionCheckbox;
+ private System.Windows.Forms.Label positionLabel;
+ private System.Windows.Forms.Label sizeLabel;
+ private System.Windows.Forms.Label uvLabel;
+ private System.Windows.Forms.Label textureSizeLabel;
}
}
\ No newline at end of file
diff --git a/PCK-Studio/Forms/Editor/CustomSkinEditor.cs b/PCK-Studio/Forms/Editor/CustomSkinEditor.cs
index 299edb2d..12a29a18 100644
--- a/PCK-Studio/Forms/Editor/CustomSkinEditor.cs
+++ b/PCK-Studio/Forms/Editor/CustomSkinEditor.cs
@@ -1,25 +1,14 @@
using System;
-using System.IO;
-using System.Text;
+using System.Linq;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
-using System.Collections.Generic;
using MetroFramework.Forms;
+
using PckStudio.Internal;
using PckStudio.Extensions;
-using PckStudio.Internal.IO.PSM;
-using PckStudio.Internal.FileFormats;
-using System.Linq;
using PckStudio.Forms.Additional_Popups;
-using PckStudio.External.Format;
-using Newtonsoft.Json;
-using System.Numerics;
-using PckStudio.Rendering;
-using System.Diagnostics;
-using Newtonsoft.Json.Linq;
-using PckStudio.Properties;
namespace PckStudio.Forms.Editor
{
@@ -241,6 +230,7 @@ namespace PckStudio.Forms.Editor
return;
}
uvPictureBox.Image = _skin.Model.Texture = img;
+ textureSizeLabel.Text = $"{img.Width}x{img.Height}";
}
private void skinPartListBox_DoubleClick(object sender, EventArgs e)
@@ -263,6 +253,9 @@ namespace PckStudio.Forms.Editor
if (skinPartListBox.SelectedItem is SkinBOX box)
{
renderer3D1.SelectedIndex = skinPartListBox.SelectedIndex;
+ uvLabel.Text = $"UV: {box.UV}";
+ sizeLabel.Text = $"Size: {box.Size}";
+ positionLabel.Text = $"Position: {box.Pos}";
Size scaleSize = new Size(_skin.Model.Texture.Width * scale, _skin.Model.Texture.Height * scale);
uvPictureBox.Image = new Bitmap(scaleSize.Width, scaleSize.Height);
using (Graphics g = Graphics.FromImage(uvPictureBox.Image))
@@ -277,11 +270,6 @@ namespace PckStudio.Forms.Editor
}
}
- private void clampToViewCheckbox_CheckedChanged(object sender, EventArgs e)
- {
- renderer3D1.ClampModel = clampToViewCheckbox.Checked;
- }
-
private void captureScreenshotButton_Click(object sender, EventArgs e)
{
using SaveFileDialog saveFileDialog = new SaveFileDialog()
@@ -382,5 +370,10 @@ namespace PckStudio.Forms.Editor
{
renderer3D1.Animate = skinAnimateCheckBox.Checked;
}
+
+ private void centerSelectionCheckbox_CheckedChanged(object sender, EventArgs e)
+ {
+ renderer3D1.CenterOnSelect = centerSelectionCheckbox.Checked;
+ }
}
}
\ No newline at end of file
diff --git a/PCK-Studio/Forms/Editor/CustomSkinEditor.resx b/PCK-Studio/Forms/Editor/CustomSkinEditor.resx
index 95c16f98..200e4c86 100644
--- a/PCK-Studio/Forms/Editor/CustomSkinEditor.resx
+++ b/PCK-Studio/Forms/Editor/CustomSkinEditor.resx
@@ -117,161 +117,227 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
False
-
+
Top, Right
-
+
True
-
- False
-
-
+
NoControl
-
- 624, 404
+
+ 702, 43
-
- 44, 13
+
+ 87, 13
-
- 127
-
-
- Position
-
-
- label5
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 29
-
-
- False
-
-
- Top, Right
-
-
- True
-
-
- False
-
-
- NoControl
-
-
- 627, 374
-
-
- 27, 13
-
-
- 142
-
-
- Size
-
-
- label3
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 28
-
-
- False
-
-
- Top, Right
-
-
- True
-
-
- False
-
-
- NoControl
-
-
- 679, 345
-
-
- 22, 13
-
-
- 131
-
-
- UV
-
-
- label7
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 26
-
-
- False
-
-
- Top, Right
-
-
- True
-
-
- NoControl
-
-
- 690, 41
-
-
- 128, 13
-
-
+
113
-
- Texture Mapping Preview
+
+ Texture Mapping
-
- labelTextureMappingPreview
+
+ labelTextureMapping
-
+
System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
$this
-
- 24
+
+ 17
+
+
+ False
+
+
+ Top, Right
+
+
+ True
+
+
+ 7, 19
+
+
+ 61, 21
+
+
+ 128
+
+
+ Import
+
+
+ importTextureButton
+
+
+ MetroFramework.Controls.MetroButton, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a
+
+
+ groupBox1
+
+
+ 0
+
+
+ 7, 46
+
+
+ 61, 21
+
+
+ 114
+
+
+ Export
+
+
+ exportTextureButton
+
+
+ MetroFramework.Controls.MetroButton, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a
+
+
+ groupBox1
+
+
+ 1
+
+
+ 803, 329
+
+
+ 3, 3, 3, 0
+
+
+ 74, 83
+
+
+ 170
+
+
+ Texture
+
+
+ groupBox1
+
+
+ System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 3
+
+
+ Top, Right
+
+
+ True
+
+
+ NoControl
+
+
+ 632, 392
+
+
+ 44, 13
+
+
+ 127
+
+
+ Position
+
+
+ positionLabel
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 21
+
+
+ Top, Right
+
+
+ True
+
+
+ NoControl
+
+
+ 632, 363
+
+
+ 27, 13
+
+
+ 142
+
+
+ Size
+
+
+ sizeLabel
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 20
+
+
+ Top, Right
+
+
+ True
+
+
+ NoControl
+
+
+ 632, 337
+
+
+ 22, 13
+
+
+ 131
+
+
+ UV
+
+
+ uvLabel
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 18
17, 17
@@ -382,61 +448,7 @@
$this
- 27
-
-
- Top, Right
-
-
- 747, 315
-
-
- 61, 21
-
-
- 114
-
-
- Export
-
-
- exportTextureButton
-
-
- MetroFramework.Controls.MetroButton, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a
-
-
- $this
-
-
- 23
-
-
- Top, Right
-
-
- 680, 315
-
-
- 61, 21
-
-
- 128
-
-
- Import
-
-
- importTextureButton
-
-
- MetroFramework.Controls.MetroButton, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a
-
-
- $this
-
-
- 25
+ 19
Bottom, Left
@@ -445,7 +457,7 @@
27, 553
- 80, 21
+ 75, 21
96
@@ -463,16 +475,16 @@
$this
- 22
+ 16
Bottom, Left
- 113, 553
+ 105, 553
- 67, 21
+ 75, 21
97
@@ -490,13 +502,13 @@
$this
- 21
+ 15
Bottom, Right
- 777, 460
+ 777, 485
100, 21
@@ -520,7 +532,7 @@
$this
- 20
+ 14
Bottom, Right
@@ -529,7 +541,7 @@
True
- 627, 440
+ 627, 465
140, 15
@@ -550,7 +562,7 @@
$this
- 19
+ 13
Bottom, Right
@@ -559,7 +571,7 @@
True
- 627, 461
+ 627, 486
84, 15
@@ -580,7 +592,7 @@
$this
- 18
+ 12
Bottom, Right
@@ -589,7 +601,7 @@
True
- 627, 503
+ 627, 528
89, 15
@@ -610,241 +622,7 @@
$this
- 17
-
-
- Top, Right
-
-
- False
-
-
- 669, 371
-
-
- 53, 20
-
-
- 150
-
-
- Center
-
-
- SizeXUpDown
-
-
- System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 16
-
-
- Top, Right
-
-
- False
-
-
- 728, 371
-
-
- 53, 20
-
-
- 151
-
-
- Center
-
-
- SizeYUpDown
-
-
- System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 15
-
-
- Top, Right
-
-
- False
-
-
- 787, 371
-
-
- 58, 20
-
-
- 152
-
-
- Center
-
-
- SizeZUpDown
-
-
- System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 14
-
-
- Top, Right
-
-
- False
-
-
- 707, 342
-
-
- 43, 20
-
-
- 156
-
-
- TextureXUpDown
-
-
- System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 13
-
-
- Top, Right
-
-
- False
-
-
- 756, 342
-
-
- 43, 20
-
-
- 157
-
-
- TextureYUpDown
-
-
- System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 12
-
-
- Top, Right
-
-
- False
-
-
- 787, 403
-
-
- 58, 20
-
-
- 160
-
-
- Center
-
-
- PosZUpDown
-
-
- System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 8
-
-
- Top, Right
-
-
- False
-
-
- 728, 403
-
-
- 53, 20
-
-
- 159
-
-
- Center
-
-
- PosYUpDown
-
-
- System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 9
-
-
- Top, Right
-
-
- False
-
-
- 669, 403
-
-
- 53, 20
-
-
- 158
-
-
- Center
-
-
- PosXUpDown
-
-
- System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 10
+ 11
Fill
@@ -870,36 +648,6 @@
0
-
- Bottom, Right
-
-
- True
-
-
- 627, 482
-
-
- 137, 15
-
-
- 162
-
-
- Clamp Model to View
-
-
- clampToViewCheckbox
-
-
- MetroFramework.Controls.MetroCheckBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a
-
-
- $this
-
-
- 7
-
Bottom, Left
@@ -925,7 +673,7 @@
$this
- 6
+ 8
Bottom, Right
@@ -934,7 +682,7 @@
True
- 627, 524
+ 722, 528
82, 15
@@ -955,7 +703,7 @@
$this
- 5
+ 7
Bottom, Left
@@ -964,7 +712,7 @@
True
- 370, 553
+ 367, 553
73, 19
@@ -985,7 +733,7 @@
$this
- 4
+ 6
4, 38
@@ -1102,7 +850,7 @@
$this
- 3
+ 5
Top, Bottom, Left, Right
@@ -1111,7 +859,7 @@
190, 59
- 431, 488
+ 431, 484
167
@@ -1126,7 +874,7 @@
$this
- 11
+ 10
Top, Right
@@ -1159,7 +907,10 @@
$this
- 30
+ 22
+
+
+ Bottom, Right
True
@@ -1186,6 +937,69 @@
$this
+ 4
+
+
+ Bottom, Right
+
+
+ True
+
+
+ 627, 507
+
+
+ 108, 15
+
+
+ 162
+
+
+ Center on select
+
+
+ centerSelectionCheckbox
+
+
+ MetroFramework.Controls.MetroCheckBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a
+
+
+ $this
+
+
+ 9
+
+
+ Top, Right
+
+
+ True
+
+
+ NoControl
+
+
+ 729, 312
+
+
+ 51, 13
+
+
+ 171
+
+
+ (TexSize)
+
+
+ textureSizeLabel
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
2
diff --git a/PCK-Studio/Rendering/SkinRenderer.cs b/PCK-Studio/Rendering/SkinRenderer.cs
index 5b4ff7a8..b550c35d 100644
--- a/PCK-Studio/Rendering/SkinRenderer.cs
+++ b/PCK-Studio/Rendering/SkinRenderer.cs
@@ -93,11 +93,12 @@ namespace PckStudio.Rendering
set
{
selectedIndex = value;
- CenterSelectedObject();
+ if (CenterOnSelect)
+ CenterSelectedObject();
}
}
- public bool ClampModel { get; set; } = false;
+ public bool CenterOnSelect { get; set; } = false;
public bool ShowArmor { get; set; } = false;
public bool Animate { get; set; } = true;
public bool ShowGuideLines