mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-12 20:01:55 +00:00
Merge branch 'main' into TextureAtlasEditor
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
using System.Text;
|
||||
using OMI;
|
||||
using OMI.Workers;
|
||||
using PckStudio.Classes.FileTypes;
|
||||
using PckStudio.FileFormats;
|
||||
|
||||
namespace PckStudio.Classes.IO.CSMB
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using PckStudio.Classes.FileTypes;
|
||||
using PckStudio.FileFormats;
|
||||
using OMI.Workers;
|
||||
using OMI;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using OMI;
|
||||
using OMI.Workers;
|
||||
using PckStudio.Classes.FileTypes;
|
||||
using PckStudio.FileFormats;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using OMI;
|
||||
using OMI.Workers;
|
||||
using PckStudio.Classes.FileTypes;
|
||||
using PckStudio.FileFormats;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
35
PCK-Studio/Extensions/AnimationExtensions.cs
Normal file
35
PCK-Studio/Extensions/AnimationExtensions.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PckStudio.Internal;
|
||||
|
||||
namespace PckStudio.Extensions
|
||||
{
|
||||
internal static class AnimationExtensions
|
||||
{
|
||||
|
||||
internal static JObject ConvertToJavaAnimation(this Animation animation)
|
||||
{
|
||||
JObject janimation = new JObject();
|
||||
JObject mcmeta = new JObject();
|
||||
mcmeta["comment"] = $"Animation converted with {Application.ProductName}";
|
||||
mcmeta["animation"] = janimation;
|
||||
JArray jframes = new JArray();
|
||||
foreach (var frame in animation.GetFrames())
|
||||
{
|
||||
JObject jframe = new JObject();
|
||||
jframe["index"] = animation.GetTextureIndex(frame.Texture);
|
||||
jframe["time"] = frame.Ticks;
|
||||
jframes.Add(jframe);
|
||||
};
|
||||
janimation["interpolation"] = animation.Interpolate;
|
||||
janimation["frames"] = jframes;
|
||||
return mcmeta;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,10 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using PckStudio.Models;
|
||||
|
||||
namespace PckStudio.Classes.FileTypes
|
||||
namespace PckStudio.FileFormats
|
||||
{
|
||||
#region File Template
|
||||
#region File Structure
|
||||
/*
|
||||
Version - 4 bytes[int32]
|
||||
NumberOfParts - 4 bytes[int32]
|
||||
@@ -5,7 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OMI.Formats.Languages;
|
||||
|
||||
namespace PckStudio.Classes.FileTypes
|
||||
namespace PckStudio.FileFormats
|
||||
{
|
||||
public class PckAudioFile
|
||||
{
|
||||
@@ -12,10 +12,10 @@ namespace PckStudio.Forms.Additional_Popups.Animation
|
||||
internal partial class ChangeTile : MetroForm
|
||||
{
|
||||
string selectedTile = "";
|
||||
Editor.Animation.AnimationCategory category = Editor.Animation.AnimationCategory.Blocks;
|
||||
Internal.Animation.AnimationCategory category = Internal.Animation.AnimationCategory.Blocks;
|
||||
|
||||
public string SelectedTile => selectedTile;
|
||||
public Editor.Animation.AnimationCategory Category => category;
|
||||
public Internal.Animation.AnimationCategory Category => category;
|
||||
|
||||
List<TreeNode> treeViewBlockCache = new List<TreeNode>();
|
||||
List<TreeNode> treeViewItemCache = new List<TreeNode>();
|
||||
@@ -43,8 +43,8 @@ namespace PckStudio.Forms.Additional_Popups.Animation
|
||||
selectedTile = tileData;
|
||||
Debug.WriteLine(selectedTile);
|
||||
category = e.Node.TreeView == treeViewItems
|
||||
? Editor.Animation.AnimationCategory.Items
|
||||
: Editor.Animation.AnimationCategory.Blocks;
|
||||
? Internal.Animation.AnimationCategory.Items
|
||||
: Internal.Animation.AnimationCategory.Blocks;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace PckStudio
|
||||
{
|
||||
partial class CreateTexturePack
|
||||
partial class CreateTexturePackPrompt
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
@@ -28,11 +28,11 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CreateTexturePack));
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CreateTexturePackPrompt));
|
||||
this.TextLabel = new System.Windows.Forms.Label();
|
||||
this.OKButton = new System.Windows.Forms.Button();
|
||||
this.InputTextBox = new MetroFramework.Controls.MetroTextBox();
|
||||
this.metroComboBox1 = new MetroFramework.Controls.MetroComboBox();
|
||||
this.resolutionComboBox = new MetroFramework.Controls.MetroComboBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
@@ -80,24 +80,24 @@
|
||||
this.InputTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
|
||||
this.InputTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
|
||||
//
|
||||
// metroComboBox1
|
||||
// resolutionComboBox
|
||||
//
|
||||
this.metroComboBox1.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.metroComboBox1, "metroComboBox1");
|
||||
this.metroComboBox1.Items.AddRange(new object[] {
|
||||
resources.GetString("metroComboBox1.Items"),
|
||||
resources.GetString("metroComboBox1.Items1"),
|
||||
resources.GetString("metroComboBox1.Items2"),
|
||||
resources.GetString("metroComboBox1.Items3"),
|
||||
resources.GetString("metroComboBox1.Items4"),
|
||||
resources.GetString("metroComboBox1.Items5"),
|
||||
resources.GetString("metroComboBox1.Items6"),
|
||||
resources.GetString("metroComboBox1.Items7"),
|
||||
resources.GetString("metroComboBox1.Items8")});
|
||||
this.metroComboBox1.Name = "metroComboBox1";
|
||||
this.metroComboBox1.Style = MetroFramework.MetroColorStyle.Silver;
|
||||
this.metroComboBox1.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.metroComboBox1.UseSelectable = true;
|
||||
this.resolutionComboBox.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.resolutionComboBox, "resolutionComboBox");
|
||||
this.resolutionComboBox.Items.AddRange(new object[] {
|
||||
resources.GetString("resolutionComboBox.Items"),
|
||||
resources.GetString("resolutionComboBox.Items1"),
|
||||
resources.GetString("resolutionComboBox.Items2"),
|
||||
resources.GetString("resolutionComboBox.Items3"),
|
||||
resources.GetString("resolutionComboBox.Items4"),
|
||||
resources.GetString("resolutionComboBox.Items5"),
|
||||
resources.GetString("resolutionComboBox.Items6"),
|
||||
resources.GetString("resolutionComboBox.Items7"),
|
||||
resources.GetString("resolutionComboBox.Items8")});
|
||||
this.resolutionComboBox.Name = "resolutionComboBox";
|
||||
this.resolutionComboBox.Style = MetroFramework.MetroColorStyle.Silver;
|
||||
this.resolutionComboBox.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.resolutionComboBox.UseSelectable = true;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
@@ -112,11 +112,10 @@
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.metroComboBox1);
|
||||
this.Controls.Add(this.resolutionComboBox);
|
||||
this.Controls.Add(this.InputTextBox);
|
||||
this.Controls.Add(this.OKButton);
|
||||
this.Controls.Add(this.TextLabel);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "CreateTexturePack";
|
||||
@@ -133,7 +132,7 @@
|
||||
public System.Windows.Forms.Button OKButton;
|
||||
public System.Windows.Forms.Label TextLabel;
|
||||
private MetroFramework.Controls.MetroTextBox InputTextBox;
|
||||
private MetroFramework.Controls.MetroComboBox metroComboBox1;
|
||||
private MetroFramework.Controls.MetroComboBox resolutionComboBox;
|
||||
public System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
||||
@@ -4,22 +4,22 @@ using MetroFramework.Forms;
|
||||
|
||||
namespace PckStudio
|
||||
{
|
||||
public partial class CreateTexturePack : MetroForm
|
||||
public partial class CreateTexturePackPrompt : MetroForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Text entered <c>only access when DialogResult == DialogResult.OK</c>
|
||||
/// </summary>
|
||||
public string PackName => InputTextBox.Text;
|
||||
public string PackRes => metroComboBox1.Text;
|
||||
public string PackRes => resolutionComboBox.Text;
|
||||
|
||||
public CreateTexturePack()
|
||||
public CreateTexturePackPrompt()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OKBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (metroComboBox1.SelectedIndex < 0)
|
||||
if (resolutionComboBox.SelectedIndex < 0)
|
||||
return;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
@@ -213,55 +213,55 @@
|
||||
<data name=">>InputTextBox.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="metroComboBox1.ItemHeight" type="System.Int32, mscorlib">
|
||||
<data name="resolutionComboBox.ItemHeight" type="System.Int32, mscorlib">
|
||||
<value>23</value>
|
||||
</data>
|
||||
<data name="metroComboBox1.Items" xml:space="preserve">
|
||||
<data name="resolutionComboBox.Items" xml:space="preserve">
|
||||
<value>x8</value>
|
||||
</data>
|
||||
<data name="metroComboBox1.Items1" xml:space="preserve">
|
||||
<data name="resolutionComboBox.Items1" xml:space="preserve">
|
||||
<value>x16</value>
|
||||
</data>
|
||||
<data name="metroComboBox1.Items2" xml:space="preserve">
|
||||
<data name="resolutionComboBox.Items2" xml:space="preserve">
|
||||
<value>x32</value>
|
||||
</data>
|
||||
<data name="metroComboBox1.Items3" xml:space="preserve">
|
||||
<data name="resolutionComboBox.Items3" xml:space="preserve">
|
||||
<value>x48</value>
|
||||
</data>
|
||||
<data name="metroComboBox1.Items4" xml:space="preserve">
|
||||
<data name="resolutionComboBox.Items4" xml:space="preserve">
|
||||
<value>x64</value>
|
||||
</data>
|
||||
<data name="metroComboBox1.Items5" xml:space="preserve">
|
||||
<data name="resolutionComboBox.Items5" xml:space="preserve">
|
||||
<value>x80</value>
|
||||
</data>
|
||||
<data name="metroComboBox1.Items6" xml:space="preserve">
|
||||
<data name="resolutionComboBox.Items6" xml:space="preserve">
|
||||
<value>x96</value>
|
||||
</data>
|
||||
<data name="metroComboBox1.Items7" xml:space="preserve">
|
||||
<data name="resolutionComboBox.Items7" xml:space="preserve">
|
||||
<value>x112</value>
|
||||
</data>
|
||||
<data name="metroComboBox1.Items8" xml:space="preserve">
|
||||
<data name="resolutionComboBox.Items8" xml:space="preserve">
|
||||
<value>x128</value>
|
||||
</data>
|
||||
<data name="metroComboBox1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<data name="resolutionComboBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>60, 39</value>
|
||||
</data>
|
||||
<data name="metroComboBox1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<data name="resolutionComboBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>165, 29</value>
|
||||
</data>
|
||||
<data name="metroComboBox1.TabIndex" type="System.Int32, mscorlib">
|
||||
<data name="resolutionComboBox.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name=">>metroComboBox1.Name" xml:space="preserve">
|
||||
<value>metroComboBox1</value>
|
||||
<data name=">>resolutionComboBox.Name" xml:space="preserve">
|
||||
<value>resolutionComboBox</value>
|
||||
</data>
|
||||
<data name=">>metroComboBox1.Type" xml:space="preserve">
|
||||
<data name=">>resolutionComboBox.Type" xml:space="preserve">
|
||||
<value>MetroFramework.Controls.MetroComboBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
|
||||
</data>
|
||||
<data name=">>metroComboBox1.Parent" xml:space="preserve">
|
||||
<data name=">>resolutionComboBox.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>metroComboBox1.ZOrder" xml:space="preserve">
|
||||
<data name=">>resolutionComboBox.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
|
||||
@@ -16,6 +16,7 @@ using PckStudio.Forms.Utilities;
|
||||
using PckStudio.Extensions;
|
||||
using PckStudio.Properties;
|
||||
using System.Diagnostics;
|
||||
using PckStudio.Internal;
|
||||
|
||||
namespace PckStudio.Forms.Editor
|
||||
{
|
||||
@@ -408,7 +409,7 @@ namespace PckStudio.Forms.Editor
|
||||
fileDialog.Filter = "Animation Scripts (*.mcmeta)|*.png.mcmeta";
|
||||
if (fileDialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
JObject mcmeta = AnimationResources.ConvertAnimationToJson(currentAnimation);
|
||||
JObject mcmeta = currentAnimation.ConvertToJavaAnimation();
|
||||
string jsondata = JsonConvert.SerializeObject(mcmeta, Formatting.Indented);
|
||||
string filename = fileDialog.FileName;
|
||||
File.WriteAllText(filename, jsondata);
|
||||
|
||||
@@ -24,6 +24,7 @@ using System.Drawing.Drawing2D;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
using PckStudio.Extensions;
|
||||
using PckStudio.Internal;
|
||||
|
||||
namespace PckStudio.Forms.Editor
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ using NAudio.Wave;
|
||||
|
||||
using OMI.Formats.Pck;
|
||||
|
||||
using PckStudio.Classes.FileTypes;
|
||||
using PckStudio.FileFormats;
|
||||
using PckStudio.Classes.IO.PCK;
|
||||
using PckStudio.Forms.Additional_Popups.Audio;
|
||||
using PckStudio.Forms.Additional_Popups;
|
||||
|
||||
@@ -54,11 +54,11 @@
|
||||
this.wiiUPSVitaToolStripMenuItem = new PckStudio.ToolStripRadioButtonMenuItem();
|
||||
this.pS3ToolStripMenuItem = new PckStudio.ToolStripRadioButtonMenuItem();
|
||||
this.xbox360ToolStripMenuItem = new PckStudio.ToolStripRadioButtonMenuItem();
|
||||
this.metroPanel1 = new MetroFramework.Controls.MetroPanel();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.MessageContextMenu.SuspendLayout();
|
||||
this.DetailContextMenu.SuspendLayout();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.metroPanel1.SuspendLayout();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// GrfTreeView
|
||||
@@ -66,11 +66,11 @@
|
||||
this.GrfTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
|
||||
this.GrfTreeView.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.GrfTreeView.ContextMenuStrip = this.MessageContextMenu;
|
||||
this.GrfTreeView.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.GrfTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.GrfTreeView.ForeColor = System.Drawing.SystemColors.MenuBar;
|
||||
this.GrfTreeView.Location = new System.Drawing.Point(0, 0);
|
||||
this.GrfTreeView.Location = new System.Drawing.Point(3, 23);
|
||||
this.GrfTreeView.Name = "GrfTreeView";
|
||||
this.GrfTreeView.Size = new System.Drawing.Size(223, 312);
|
||||
this.GrfTreeView.Size = new System.Drawing.Size(219, 312);
|
||||
this.GrfTreeView.TabIndex = 0;
|
||||
this.GrfTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.GrfTreeView_AfterSelect);
|
||||
this.GrfTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.GrfTreeView_KeyDown);
|
||||
@@ -102,11 +102,11 @@
|
||||
this.GrfParametersTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
|
||||
this.GrfParametersTreeView.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.GrfParametersTreeView.ContextMenuStrip = this.DetailContextMenu;
|
||||
this.GrfParametersTreeView.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.GrfParametersTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.GrfParametersTreeView.ForeColor = System.Drawing.SystemColors.MenuBar;
|
||||
this.GrfParametersTreeView.Location = new System.Drawing.Point(227, 0);
|
||||
this.GrfParametersTreeView.Location = new System.Drawing.Point(228, 23);
|
||||
this.GrfParametersTreeView.Name = "GrfParametersTreeView";
|
||||
this.GrfParametersTreeView.Size = new System.Drawing.Size(223, 312);
|
||||
this.GrfParametersTreeView.Size = new System.Drawing.Size(219, 312);
|
||||
this.GrfParametersTreeView.TabIndex = 1;
|
||||
this.GrfParametersTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.GrfDetailsTreeView_NodeMouseDoubleClick);
|
||||
this.GrfParametersTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.GrfDetailsTreeView_KeyDown);
|
||||
@@ -136,7 +136,7 @@
|
||||
// metroLabel1
|
||||
//
|
||||
this.metroLabel1.AutoSize = true;
|
||||
this.metroLabel1.Location = new System.Drawing.Point(25, 88);
|
||||
this.metroLabel1.Location = new System.Drawing.Point(3, 0);
|
||||
this.metroLabel1.Name = "metroLabel1";
|
||||
this.metroLabel1.Size = new System.Drawing.Size(73, 19);
|
||||
this.metroLabel1.TabIndex = 2;
|
||||
@@ -146,9 +146,8 @@
|
||||
//
|
||||
// metroLabel2
|
||||
//
|
||||
this.metroLabel2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.metroLabel2.AutoSize = true;
|
||||
this.metroLabel2.Location = new System.Drawing.Point(252, 88);
|
||||
this.metroLabel2.Location = new System.Drawing.Point(228, 0);
|
||||
this.metroLabel2.Name = "metroLabel2";
|
||||
this.metroLabel2.Size = new System.Drawing.Size(75, 19);
|
||||
this.metroLabel2.TabIndex = 0;
|
||||
@@ -292,35 +291,32 @@
|
||||
this.xbox360ToolStripMenuItem.Text = "Xbox 360";
|
||||
this.xbox360ToolStripMenuItem.CheckedChanged += new System.EventHandler(this.xbox360ToolStripMenuItem_CheckedChanged);
|
||||
//
|
||||
// metroPanel1
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.metroPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
this.tableLayoutPanel1.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.metroPanel1.Controls.Add(this.GrfParametersTreeView);
|
||||
this.metroPanel1.Controls.Add(this.GrfTreeView);
|
||||
this.metroPanel1.HorizontalScrollbarBarColor = true;
|
||||
this.metroPanel1.HorizontalScrollbarHighlightOnWheel = false;
|
||||
this.metroPanel1.HorizontalScrollbarSize = 10;
|
||||
this.metroPanel1.Location = new System.Drawing.Point(25, 110);
|
||||
this.metroPanel1.Name = "metroPanel1";
|
||||
this.metroPanel1.Size = new System.Drawing.Size(450, 312);
|
||||
this.metroPanel1.TabIndex = 4;
|
||||
this.metroPanel1.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.metroPanel1.VerticalScrollbarBarColor = true;
|
||||
this.metroPanel1.VerticalScrollbarHighlightOnWheel = false;
|
||||
this.metroPanel1.VerticalScrollbarSize = 10;
|
||||
this.metroPanel1.Resize += new System.EventHandler(this.metroPanel1_Resize);
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.metroLabel1, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.GrfParametersTreeView, 1, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.GrfTreeView, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.metroLabel2, 1, 0);
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(25, 110);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 2;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(450, 312);
|
||||
this.tableLayoutPanel1.TabIndex = 4;
|
||||
//
|
||||
// GameRuleFileEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(500, 450);
|
||||
this.Controls.Add(this.metroPanel1);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.Controls.Add(this.metroLabel2);
|
||||
this.Controls.Add(this.metroLabel1);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.MaximizeBox = false;
|
||||
@@ -337,7 +333,8 @@
|
||||
this.DetailContextMenu.ResumeLayout(false);
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
this.metroPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@@ -359,7 +356,7 @@
|
||||
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
|
||||
private MetroFramework.Controls.MetroPanel metroPanel1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.ToolStripMenuItem compressionLvlToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem levelToolStripMenuItem;
|
||||
|
||||
|
||||
@@ -282,15 +282,6 @@ namespace PckStudio.Forms.Editor
|
||||
}
|
||||
}
|
||||
|
||||
private void metroPanel1_Resize(object sender, EventArgs e)
|
||||
{
|
||||
int padding = 2;
|
||||
GrfTreeView.Size = new Size(metroPanel1.Size.Width / 2 - padding, metroPanel1.Size.Height);
|
||||
GrfParametersTreeView.Size = new Size(metroPanel1.Size.Width / 2 - padding, metroPanel1.Size.Height);
|
||||
// good enough
|
||||
metroLabel2.Location = new Point(metroPanel1.Size.Width / 2 + 25, metroLabel2.Location.Y);
|
||||
}
|
||||
|
||||
private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFileDialog dialog = new OpenFileDialog();
|
||||
|
||||
@@ -29,51 +29,57 @@
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AdvancedOptions));
|
||||
this.treeMeta = new System.Windows.Forms.TreeView();
|
||||
this.comboBox1 = new MetroFramework.Controls.MetroComboBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
System.Windows.Forms.Label label1;
|
||||
System.Windows.Forms.Label label2;
|
||||
System.Windows.Forms.Label label3;
|
||||
this.propertyTreeview = new System.Windows.Forms.TreeView();
|
||||
this.fileTypeComboBox = new MetroFramework.Controls.MetroComboBox();
|
||||
this.applyButton = new MetroFramework.Controls.MetroButton();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.entryDataTextBox = new MetroFramework.Controls.MetroTextBox();
|
||||
this.entryTypeTextBox = new MetroFramework.Controls.MetroTextBox();
|
||||
this.propertyValueTextBox = new MetroFramework.Controls.MetroTextBox();
|
||||
this.propertyKeyTextBox = new MetroFramework.Controls.MetroTextBox();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
label2 = new System.Windows.Forms.Label();
|
||||
label3 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// treeMeta
|
||||
// propertyTreeview
|
||||
//
|
||||
resources.ApplyResources(this.treeMeta, "treeMeta");
|
||||
this.treeMeta.Name = "treeMeta";
|
||||
this.treeMeta.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeMeta_AfterSelect);
|
||||
this.propertyTreeview.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
|
||||
this.propertyTreeview.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.propertyTreeview.ForeColor = System.Drawing.SystemColors.Window;
|
||||
resources.ApplyResources(this.propertyTreeview, "propertyTreeview");
|
||||
this.propertyTreeview.Name = "propertyTreeview";
|
||||
this.propertyTreeview.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeMeta_AfterSelect);
|
||||
//
|
||||
// comboBox1
|
||||
// fileTypeComboBox
|
||||
//
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.comboBox1, "comboBox1");
|
||||
this.comboBox1.Items.AddRange(new object[] {
|
||||
resources.GetString("comboBox1.Items"),
|
||||
resources.GetString("comboBox1.Items1"),
|
||||
resources.GetString("comboBox1.Items2"),
|
||||
resources.GetString("comboBox1.Items3"),
|
||||
resources.GetString("comboBox1.Items4"),
|
||||
resources.GetString("comboBox1.Items5"),
|
||||
resources.GetString("comboBox1.Items6"),
|
||||
resources.GetString("comboBox1.Items7"),
|
||||
resources.GetString("comboBox1.Items8"),
|
||||
resources.GetString("comboBox1.Items9"),
|
||||
resources.GetString("comboBox1.Items10"),
|
||||
resources.GetString("comboBox1.Items11"),
|
||||
resources.GetString("comboBox1.Items12"),
|
||||
resources.GetString("comboBox1.Items13")});
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Style = MetroFramework.MetroColorStyle.Silver;
|
||||
this.comboBox1.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.comboBox1.UseSelectable = true;
|
||||
this.fileTypeComboBox.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.fileTypeComboBox, "fileTypeComboBox");
|
||||
this.fileTypeComboBox.Items.AddRange(new object[] {
|
||||
resources.GetString("fileTypeComboBox.Items"),
|
||||
resources.GetString("fileTypeComboBox.Items1"),
|
||||
resources.GetString("fileTypeComboBox.Items2"),
|
||||
resources.GetString("fileTypeComboBox.Items3"),
|
||||
resources.GetString("fileTypeComboBox.Items4"),
|
||||
resources.GetString("fileTypeComboBox.Items5"),
|
||||
resources.GetString("fileTypeComboBox.Items6"),
|
||||
resources.GetString("fileTypeComboBox.Items7"),
|
||||
resources.GetString("fileTypeComboBox.Items8"),
|
||||
resources.GetString("fileTypeComboBox.Items9"),
|
||||
resources.GetString("fileTypeComboBox.Items10"),
|
||||
resources.GetString("fileTypeComboBox.Items11"),
|
||||
resources.GetString("fileTypeComboBox.Items12"),
|
||||
resources.GetString("fileTypeComboBox.Items13")});
|
||||
this.fileTypeComboBox.Name = "fileTypeComboBox";
|
||||
this.fileTypeComboBox.Style = MetroFramework.MetroColorStyle.Silver;
|
||||
this.fileTypeComboBox.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.fileTypeComboBox.UseSelectable = true;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
resources.ApplyResources(this.label1, "label1");
|
||||
this.label1.ForeColor = System.Drawing.Color.White;
|
||||
this.label1.Name = "label1";
|
||||
resources.ApplyResources(label1, "label1");
|
||||
label1.ForeColor = System.Drawing.Color.White;
|
||||
label1.Name = "label1";
|
||||
//
|
||||
// applyButton
|
||||
//
|
||||
@@ -87,89 +93,89 @@
|
||||
//
|
||||
// label2
|
||||
//
|
||||
resources.ApplyResources(this.label2, "label2");
|
||||
this.label2.ForeColor = System.Drawing.Color.White;
|
||||
this.label2.Name = "label2";
|
||||
resources.ApplyResources(label2, "label2");
|
||||
label2.ForeColor = System.Drawing.Color.White;
|
||||
label2.Name = "label2";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
resources.ApplyResources(this.label3, "label3");
|
||||
this.label3.ForeColor = System.Drawing.Color.White;
|
||||
this.label3.Name = "label3";
|
||||
resources.ApplyResources(label3, "label3");
|
||||
label3.ForeColor = System.Drawing.Color.White;
|
||||
label3.Name = "label3";
|
||||
//
|
||||
// entryDataTextBox
|
||||
// propertyValueTextBox
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
this.entryDataTextBox.CustomButton.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image")));
|
||||
this.entryDataTextBox.CustomButton.Location = ((System.Drawing.Point)(resources.GetObject("resource.Location")));
|
||||
this.entryDataTextBox.CustomButton.Name = "";
|
||||
this.entryDataTextBox.CustomButton.Size = ((System.Drawing.Size)(resources.GetObject("resource.Size")));
|
||||
this.entryDataTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
|
||||
this.entryDataTextBox.CustomButton.TabIndex = ((int)(resources.GetObject("resource.TabIndex")));
|
||||
this.entryDataTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
|
||||
this.entryDataTextBox.CustomButton.UseSelectable = true;
|
||||
this.entryDataTextBox.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible")));
|
||||
this.entryDataTextBox.Lines = new string[0];
|
||||
resources.ApplyResources(this.entryDataTextBox, "entryDataTextBox");
|
||||
this.entryDataTextBox.MaxLength = 32767;
|
||||
this.entryDataTextBox.Name = "entryDataTextBox";
|
||||
this.entryDataTextBox.PasswordChar = '\0';
|
||||
this.entryDataTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None;
|
||||
this.entryDataTextBox.SelectedText = "";
|
||||
this.entryDataTextBox.SelectionLength = 0;
|
||||
this.entryDataTextBox.SelectionStart = 0;
|
||||
this.entryDataTextBox.ShortcutsEnabled = true;
|
||||
this.entryDataTextBox.Style = MetroFramework.MetroColorStyle.Silver;
|
||||
this.entryDataTextBox.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.entryDataTextBox.UseSelectable = true;
|
||||
this.entryDataTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
|
||||
this.entryDataTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
|
||||
this.propertyValueTextBox.CustomButton.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image")));
|
||||
this.propertyValueTextBox.CustomButton.Location = ((System.Drawing.Point)(resources.GetObject("resource.Location")));
|
||||
this.propertyValueTextBox.CustomButton.Name = "";
|
||||
this.propertyValueTextBox.CustomButton.Size = ((System.Drawing.Size)(resources.GetObject("resource.Size")));
|
||||
this.propertyValueTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
|
||||
this.propertyValueTextBox.CustomButton.TabIndex = ((int)(resources.GetObject("resource.TabIndex")));
|
||||
this.propertyValueTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
|
||||
this.propertyValueTextBox.CustomButton.UseSelectable = true;
|
||||
this.propertyValueTextBox.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible")));
|
||||
this.propertyValueTextBox.Lines = new string[0];
|
||||
resources.ApplyResources(this.propertyValueTextBox, "propertyValueTextBox");
|
||||
this.propertyValueTextBox.MaxLength = 32767;
|
||||
this.propertyValueTextBox.Name = "propertyValueTextBox";
|
||||
this.propertyValueTextBox.PasswordChar = '\0';
|
||||
this.propertyValueTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None;
|
||||
this.propertyValueTextBox.SelectedText = "";
|
||||
this.propertyValueTextBox.SelectionLength = 0;
|
||||
this.propertyValueTextBox.SelectionStart = 0;
|
||||
this.propertyValueTextBox.ShortcutsEnabled = true;
|
||||
this.propertyValueTextBox.Style = MetroFramework.MetroColorStyle.Silver;
|
||||
this.propertyValueTextBox.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.propertyValueTextBox.UseSelectable = true;
|
||||
this.propertyValueTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
|
||||
this.propertyValueTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
|
||||
//
|
||||
// entryTypeTextBox
|
||||
// propertyKeyTextBox
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
this.entryTypeTextBox.CustomButton.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image1")));
|
||||
this.entryTypeTextBox.CustomButton.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("resource.ImeMode")));
|
||||
this.entryTypeTextBox.CustomButton.Location = ((System.Drawing.Point)(resources.GetObject("resource.Location1")));
|
||||
this.entryTypeTextBox.CustomButton.Name = "";
|
||||
this.entryTypeTextBox.CustomButton.Size = ((System.Drawing.Size)(resources.GetObject("resource.Size1")));
|
||||
this.entryTypeTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
|
||||
this.entryTypeTextBox.CustomButton.TabIndex = ((int)(resources.GetObject("resource.TabIndex1")));
|
||||
this.entryTypeTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
|
||||
this.entryTypeTextBox.CustomButton.UseSelectable = true;
|
||||
this.entryTypeTextBox.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible1")));
|
||||
this.entryTypeTextBox.Lines = new string[0];
|
||||
resources.ApplyResources(this.entryTypeTextBox, "entryTypeTextBox");
|
||||
this.entryTypeTextBox.MaxLength = 32767;
|
||||
this.entryTypeTextBox.Name = "entryTypeTextBox";
|
||||
this.entryTypeTextBox.PasswordChar = '\0';
|
||||
this.entryTypeTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None;
|
||||
this.entryTypeTextBox.SelectedText = "";
|
||||
this.entryTypeTextBox.SelectionLength = 0;
|
||||
this.entryTypeTextBox.SelectionStart = 0;
|
||||
this.entryTypeTextBox.ShortcutsEnabled = true;
|
||||
this.entryTypeTextBox.Style = MetroFramework.MetroColorStyle.Silver;
|
||||
this.entryTypeTextBox.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.entryTypeTextBox.UseSelectable = true;
|
||||
this.entryTypeTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
|
||||
this.entryTypeTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
|
||||
this.propertyKeyTextBox.CustomButton.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image1")));
|
||||
this.propertyKeyTextBox.CustomButton.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("resource.ImeMode")));
|
||||
this.propertyKeyTextBox.CustomButton.Location = ((System.Drawing.Point)(resources.GetObject("resource.Location1")));
|
||||
this.propertyKeyTextBox.CustomButton.Name = "";
|
||||
this.propertyKeyTextBox.CustomButton.Size = ((System.Drawing.Size)(resources.GetObject("resource.Size1")));
|
||||
this.propertyKeyTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
|
||||
this.propertyKeyTextBox.CustomButton.TabIndex = ((int)(resources.GetObject("resource.TabIndex1")));
|
||||
this.propertyKeyTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
|
||||
this.propertyKeyTextBox.CustomButton.UseSelectable = true;
|
||||
this.propertyKeyTextBox.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible1")));
|
||||
this.propertyKeyTextBox.Lines = new string[0];
|
||||
resources.ApplyResources(this.propertyKeyTextBox, "propertyKeyTextBox");
|
||||
this.propertyKeyTextBox.MaxLength = 32767;
|
||||
this.propertyKeyTextBox.Name = "propertyKeyTextBox";
|
||||
this.propertyKeyTextBox.PasswordChar = '\0';
|
||||
this.propertyKeyTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None;
|
||||
this.propertyKeyTextBox.SelectedText = "";
|
||||
this.propertyKeyTextBox.SelectionLength = 0;
|
||||
this.propertyKeyTextBox.SelectionStart = 0;
|
||||
this.propertyKeyTextBox.ShortcutsEnabled = true;
|
||||
this.propertyKeyTextBox.Style = MetroFramework.MetroColorStyle.Silver;
|
||||
this.propertyKeyTextBox.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.propertyKeyTextBox.UseSelectable = true;
|
||||
this.propertyKeyTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
|
||||
this.propertyKeyTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
|
||||
//
|
||||
// AdvancedOptions
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.entryTypeTextBox);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.entryDataTextBox);
|
||||
this.Controls.Add(this.propertyKeyTextBox);
|
||||
this.Controls.Add(label2);
|
||||
this.Controls.Add(label3);
|
||||
this.Controls.Add(this.propertyValueTextBox);
|
||||
this.Controls.Add(this.applyButton);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.comboBox1);
|
||||
this.Controls.Add(this.treeMeta);
|
||||
this.Controls.Add(label1);
|
||||
this.Controls.Add(this.fileTypeComboBox);
|
||||
this.Controls.Add(this.propertyTreeview);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "AdvancedOptions";
|
||||
@@ -185,13 +191,10 @@
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TreeView treeMeta;
|
||||
private MetroFramework.Controls.MetroComboBox comboBox1;
|
||||
private System.Windows.Forms.TreeView propertyTreeview;
|
||||
private MetroFramework.Controls.MetroComboBox fileTypeComboBox;
|
||||
private MetroFramework.Controls.MetroButton applyButton;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private MetroFramework.Controls.MetroTextBox entryDataTextBox;
|
||||
private MetroFramework.Controls.MetroTextBox entryTypeTextBox;
|
||||
private MetroFramework.Controls.MetroTextBox propertyValueTextBox;
|
||||
private MetroFramework.Controls.MetroTextBox propertyKeyTextBox;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
using OMI.Formats.Pck;
|
||||
using OMI;
|
||||
using OMI.Formats.Pck;
|
||||
using OMI.Workers.Pck;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -11,120 +14,78 @@ namespace PckStudio
|
||||
{
|
||||
public partial class AdvancedOptions : MetroFramework.Forms.MetroForm
|
||||
{
|
||||
PckFile currentPCK;
|
||||
public bool littleEndian;
|
||||
public bool IsLittleEndian
|
||||
{
|
||||
set
|
||||
{
|
||||
_endianness = value ? Endianness.LittleEndian : Endianness.BigEndian;
|
||||
}
|
||||
}
|
||||
private PckFile _pckFile;
|
||||
private Endianness _endianness;
|
||||
|
||||
public AdvancedOptions(PckFile currentPCKIn)
|
||||
public AdvancedOptions(PckFile pckFile)
|
||||
{
|
||||
InitializeComponent();
|
||||
currentPCK = currentPCKIn;
|
||||
treeMeta.Nodes.Clear();
|
||||
treeMeta.Nodes.AddRange(currentPCK.GetPropertyList().Select((s) => new TreeNode(s)).ToArray());
|
||||
_pckFile = pckFile;
|
||||
propertyTreeview.Nodes.Clear();
|
||||
propertyTreeview.Nodes.AddRange(_pckFile.GetPropertyList().Select(s => new TreeNode(s)).ToArray());
|
||||
}
|
||||
|
||||
private void applyButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
switch (comboBox1.SelectedIndex)
|
||||
if (fileTypeComboBox.SelectedIndex >= 0 && fileTypeComboBox.SelectedIndex <= 13)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
applyBulkProperties();
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
break;
|
||||
case > 0 and <= 13:
|
||||
{
|
||||
applyBulkProperties((PckFile.FileData.FileType)(comboBox1.SelectedIndex - 1));
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
MessageBox.Show("Please select a filetype before applying");
|
||||
break;
|
||||
applyBulkProperties(_pckFile.Files, fileTypeComboBox.SelectedIndex - 1);
|
||||
DialogResult = DialogResult.OK;
|
||||
return;
|
||||
}
|
||||
MessageBox.Show("Please select a filetype before applying");
|
||||
}
|
||||
|
||||
private void applyBulkProperties()
|
||||
private void applyBulkProperties(FileCollection files, int index)
|
||||
{
|
||||
foreach (PckFile.FileData file in currentPCK.Files)
|
||||
foreach (PckFile.FileData file in files)
|
||||
{
|
||||
if (file.Filetype == PckFile.FileData.FileType.TexturePackInfoFile ||
|
||||
file.Filetype == PckFile.FileData.FileType.SkinDataFile)
|
||||
file.Filetype == PckFile.FileData.FileType.SkinDataFile)
|
||||
{
|
||||
try
|
||||
{
|
||||
var reader = new PckFileReader(littleEndian
|
||||
? OMI.Endianness.LittleEndian
|
||||
: OMI.Endianness.BigEndian);
|
||||
PckFile SubPCK = reader.FromStream(new MemoryStream(file.Data));
|
||||
foreach (PckFile.FileData SubFile in SubPCK.Files)
|
||||
var reader = new PckFileReader(_endianness);
|
||||
using var ms = new MemoryStream(file.Data);
|
||||
PckFile subPCK = reader.FromStream(ms);
|
||||
applyBulkProperties(subPCK.Files, index);
|
||||
var writer = new PckFileWriter(subPCK, _endianness);
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
SubFile.Properties.Add(entryTypeTextBox.Text, entryDataTextBox.Text);
|
||||
writer.WriteToStream(stream);
|
||||
file.SetData(stream.ToArray());
|
||||
}
|
||||
var writer = new PckFileWriter(SubPCK, littleEndian
|
||||
? OMI.Endianness.LittleEndian
|
||||
: OMI.Endianness.BigEndian);
|
||||
var stream = new MemoryStream();
|
||||
writer.WriteToStream(stream);
|
||||
file.SetData(stream.ToArray());
|
||||
stream.Dispose();
|
||||
}
|
||||
catch (OverflowException ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(ex.Message);
|
||||
Debug.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
file.Properties.Add(entryTypeTextBox.Text, entryDataTextBox.Text);
|
||||
if (index == -1 || (Enum.IsDefined(typeof(PckFile.FileData.FileType), index) && (int)file.Filetype == index))
|
||||
{
|
||||
file.Properties.Add(propertyKeyTextBox.Text, propertyValueTextBox.Text);
|
||||
}
|
||||
}
|
||||
|
||||
if (Enum.IsDefined(typeof(PckFile.FileData.FileType), index))
|
||||
{
|
||||
MessageBox.Show($"Data added to {(PckFile.FileData.FileType)index} entries");
|
||||
return;
|
||||
}
|
||||
MessageBox.Show("Data added to all entries");
|
||||
}
|
||||
|
||||
private void applyBulkProperties(PckFile.FileData.FileType filetype)
|
||||
{
|
||||
foreach (PckFile.FileData file in currentPCK.Files)
|
||||
{
|
||||
if (file.Filetype == PckFile.FileData.FileType.TexturePackInfoFile ||
|
||||
file.Filetype == PckFile.FileData.FileType.SkinDataFile)
|
||||
{
|
||||
try
|
||||
{
|
||||
var reader = new PckFileReader(littleEndian
|
||||
? OMI.Endianness.LittleEndian
|
||||
: OMI.Endianness.BigEndian);
|
||||
PckFile SubPCK = reader.FromStream(new MemoryStream(file.Data));
|
||||
foreach (PckFile.FileData SubFile in SubPCK.Files)
|
||||
{
|
||||
if (SubFile.Filetype == filetype)
|
||||
{
|
||||
SubFile.Properties.Add(entryTypeTextBox.Text, entryDataTextBox.Text);
|
||||
}
|
||||
}
|
||||
var writer = new PckFileWriter(SubPCK, littleEndian
|
||||
? OMI.Endianness.LittleEndian
|
||||
: OMI.Endianness.BigEndian);
|
||||
var stream = new MemoryStream();
|
||||
writer.WriteToStream(stream);
|
||||
file.SetData(stream.ToArray());
|
||||
stream.Dispose();
|
||||
}
|
||||
catch (OverflowException ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
if (file.Filetype == filetype)
|
||||
{
|
||||
file.Properties.Add(entryTypeTextBox.Text, entryDataTextBox.Text);
|
||||
}
|
||||
}
|
||||
MessageBox.Show($"Data Added to {filetype} File Entries");
|
||||
}
|
||||
|
||||
private void treeMeta_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
entryTypeTextBox.Text = treeMeta.SelectedNode.Text;
|
||||
propertyKeyTextBox.Text = propertyTreeview.SelectedNode.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,99 +118,102 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="treeMeta.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<data name="propertyTreeview.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>23, 63</value>
|
||||
</data>
|
||||
<data name="treeMeta.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<data name="propertyTreeview.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>272, 142</value>
|
||||
</data>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="treeMeta.TabIndex" type="System.Int32, mscorlib">
|
||||
<data name="propertyTreeview.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>13</value>
|
||||
</data>
|
||||
<data name=">>treeMeta.Name" xml:space="preserve">
|
||||
<value>treeMeta</value>
|
||||
<data name=">>propertyTreeview.Name" xml:space="preserve">
|
||||
<value>propertyTreeview</value>
|
||||
</data>
|
||||
<data name=">>treeMeta.Type" xml:space="preserve">
|
||||
<data name=">>propertyTreeview.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.TreeView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>treeMeta.Parent" xml:space="preserve">
|
||||
<data name=">>propertyTreeview.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>treeMeta.ZOrder" xml:space="preserve">
|
||||
<data name=">>propertyTreeview.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="comboBox1.ItemHeight" type="System.Int32, mscorlib">
|
||||
<data name="fileTypeComboBox.ItemHeight" type="System.Int32, mscorlib">
|
||||
<value>23</value>
|
||||
</data>
|
||||
<data name="comboBox1.Items" xml:space="preserve">
|
||||
<data name="fileTypeComboBox.Items" xml:space="preserve">
|
||||
<value>All Files</value>
|
||||
</data>
|
||||
<data name="comboBox1.Items1" xml:space="preserve">
|
||||
<data name="fileTypeComboBox.Items1" xml:space="preserve">
|
||||
<value>Skin Files (.png;.tga)</value>
|
||||
</data>
|
||||
<data name="comboBox1.Items2" xml:space="preserve">
|
||||
<data name="fileTypeComboBox.Items2" xml:space="preserve">
|
||||
<value>Cape Files (.png;.tga)</value>
|
||||
</data>
|
||||
<data name="comboBox1.Items3" xml:space="preserve">
|
||||
<data name="fileTypeComboBox.Items3" xml:space="preserve">
|
||||
<value>Texture Files (.png;.tga)</value>
|
||||
</data>
|
||||
<data name="comboBox1.Items4" xml:space="preserve">
|
||||
<data name="fileTypeComboBox.Items4" xml:space="preserve">
|
||||
<value>UI Data Files (?)</value>
|
||||
</data>
|
||||
<data name="comboBox1.Items5" xml:space="preserve">
|
||||
<data name="fileTypeComboBox.Items5" xml:space="preserve">
|
||||
<value>Info Files (0)</value>
|
||||
</data>
|
||||
<data name="comboBox1.Items6" xml:space="preserve">
|
||||
<data name="fileTypeComboBox.Items6" xml:space="preserve">
|
||||
<value>Texture Pack Info Files (.pck)</value>
|
||||
</data>
|
||||
<data name="comboBox1.Items7" xml:space="preserve">
|
||||
<data name="fileTypeComboBox.Items7" xml:space="preserve">
|
||||
<value>Localization Files (.loc)</value>
|
||||
</data>
|
||||
<data name="comboBox1.Items8" xml:space="preserve">
|
||||
<data name="fileTypeComboBox.Items8" xml:space="preserve">
|
||||
<value>Game Rules Files (.grf)</value>
|
||||
</data>
|
||||
<data name="comboBox1.Items9" xml:space="preserve">
|
||||
<data name="fileTypeComboBox.Items9" xml:space="preserve">
|
||||
<value>Audio Files (.pck)</value>
|
||||
</data>
|
||||
<data name="comboBox1.Items10" xml:space="preserve">
|
||||
<data name="fileTypeComboBox.Items10" xml:space="preserve">
|
||||
<value>Colour Table Files (.col)</value>
|
||||
</data>
|
||||
<data name="comboBox1.Items11" xml:space="preserve">
|
||||
<data name="fileTypeComboBox.Items11" xml:space="preserve">
|
||||
<value>Game Rules Header Files (.grh)</value>
|
||||
</data>
|
||||
<data name="comboBox1.Items12" xml:space="preserve">
|
||||
<data name="fileTypeComboBox.Items12" xml:space="preserve">
|
||||
<value>Skin Data Files (.pck)</value>
|
||||
</data>
|
||||
<data name="comboBox1.Items13" xml:space="preserve">
|
||||
<data name="fileTypeComboBox.Items13" xml:space="preserve">
|
||||
<value>Material Files (.bin)</value>
|
||||
</data>
|
||||
<data name="comboBox1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<data name="fileTypeComboBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>65, 254</value>
|
||||
</data>
|
||||
<data name="comboBox1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<data name="fileTypeComboBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>157, 29</value>
|
||||
</data>
|
||||
<data name="comboBox1.TabIndex" type="System.Int32, mscorlib">
|
||||
<data name="fileTypeComboBox.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name=">>comboBox1.Name" xml:space="preserve">
|
||||
<value>comboBox1</value>
|
||||
<data name=">>fileTypeComboBox.Name" xml:space="preserve">
|
||||
<value>fileTypeComboBox</value>
|
||||
</data>
|
||||
<data name=">>comboBox1.Type" xml:space="preserve">
|
||||
<data name=">>fileTypeComboBox.Type" xml:space="preserve">
|
||||
<value>MetroFramework.Controls.MetroComboBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
|
||||
</data>
|
||||
<data name=">>comboBox1.Parent" xml:space="preserve">
|
||||
<data name=">>fileTypeComboBox.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>comboBox1.ZOrder" xml:space="preserve">
|
||||
<data name=">>fileTypeComboBox.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
</data>
|
||||
<metadata name="label1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>20, 260</value>
|
||||
<value>20, 261</value>
|
||||
</data>
|
||||
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>45, 13</value>
|
||||
@@ -234,7 +237,7 @@
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="applyButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>228, 260</value>
|
||||
<value>228, 257</value>
|
||||
</data>
|
||||
<data name="applyButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>75, 23</value>
|
||||
@@ -257,6 +260,9 @@
|
||||
<data name=">>applyButton.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
</data>
|
||||
<metadata name="label2.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
@@ -284,6 +290,9 @@
|
||||
<data name=">>label2.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<metadata name="label3.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
@@ -327,25 +336,25 @@
|
||||
<data name="resource.Visible" type="System.Boolean, mscorlib">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="entryDataTextBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<data name="propertyValueTextBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>164, 224</value>
|
||||
</data>
|
||||
<data name="entryDataTextBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<data name="propertyValueTextBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>139, 20</value>
|
||||
</data>
|
||||
<data name="entryDataTextBox.TabIndex" type="System.Int32, mscorlib">
|
||||
<data name="propertyValueTextBox.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name=">>entryDataTextBox.Name" xml:space="preserve">
|
||||
<value>entryDataTextBox</value>
|
||||
<data name=">>propertyValueTextBox.Name" xml:space="preserve">
|
||||
<value>propertyValueTextBox</value>
|
||||
</data>
|
||||
<data name=">>entryDataTextBox.Type" xml:space="preserve">
|
||||
<data name=">>propertyValueTextBox.Type" xml:space="preserve">
|
||||
<value>MetroFramework.Controls.MetroTextBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
|
||||
</data>
|
||||
<data name=">>entryDataTextBox.Parent" xml:space="preserve">
|
||||
<data name=">>propertyValueTextBox.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>entryDataTextBox.ZOrder" xml:space="preserve">
|
||||
<data name=">>propertyValueTextBox.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="resource.Image1" type="System.Resources.ResXNullRef, System.Windows.Forms">
|
||||
@@ -366,25 +375,25 @@
|
||||
<data name="resource.Visible1" type="System.Boolean, mscorlib">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="entryTypeTextBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<data name="propertyKeyTextBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>19, 224</value>
|
||||
</data>
|
||||
<data name="entryTypeTextBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<data name="propertyKeyTextBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>139, 20</value>
|
||||
</data>
|
||||
<data name="entryTypeTextBox.TabIndex" type="System.Int32, mscorlib">
|
||||
<data name="propertyKeyTextBox.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>14</value>
|
||||
</data>
|
||||
<data name=">>entryTypeTextBox.Name" xml:space="preserve">
|
||||
<value>entryTypeTextBox</value>
|
||||
<data name=">>propertyKeyTextBox.Name" xml:space="preserve">
|
||||
<value>propertyKeyTextBox</value>
|
||||
</data>
|
||||
<data name=">>entryTypeTextBox.Type" xml:space="preserve">
|
||||
<data name=">>propertyKeyTextBox.Type" xml:space="preserve">
|
||||
<value>MetroFramework.Controls.MetroTextBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
|
||||
</data>
|
||||
<data name=">>entryTypeTextBox.Parent" xml:space="preserve">
|
||||
<data name=">>propertyKeyTextBox.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>entryTypeTextBox.ZOrder" xml:space="preserve">
|
||||
<data name=">>propertyKeyTextBox.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
|
||||
@@ -80,24 +80,5 @@ namespace PckStudio.Forms.Utilities
|
||||
return _blockImageList;
|
||||
}
|
||||
}
|
||||
|
||||
internal static JObject ConvertAnimationToJson(Animation animation)
|
||||
{
|
||||
JObject janimation = new JObject();
|
||||
JObject mcmeta = new JObject();
|
||||
mcmeta["comment"] = $"Animation converted by {Application.ProductName}";
|
||||
mcmeta["animation"] = janimation;
|
||||
JArray jframes = new JArray();
|
||||
foreach (var frame in animation.GetFrames())
|
||||
{
|
||||
JObject jframe = new JObject();
|
||||
jframe["index"] = animation.GetTextureIndex(frame.Texture);
|
||||
jframe["time"] = frame.Ticks;
|
||||
jframes.Add(jframe);
|
||||
};
|
||||
janimation["interpolation"] = animation.Interpolate;
|
||||
janimation["frames"] = jframes;
|
||||
return mcmeta;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ using System.Windows.Media.Imaging;
|
||||
using System.IO.Packaging;
|
||||
using PckStudio;
|
||||
using System.IO.Compression;
|
||||
using PckStudio.Classes.FileTypes;
|
||||
using PckStudio.Classes.IO.PCK;
|
||||
using OMI.Formats.Pck;
|
||||
using OMI.Workers.Pck;
|
||||
|
||||
@@ -21,11 +21,9 @@ using System.Drawing;
|
||||
using PckStudio.Extensions;
|
||||
using System.Text;
|
||||
|
||||
|
||||
// TODO: change namespace
|
||||
namespace PckStudio.Forms.Editor
|
||||
namespace PckStudio.Internal
|
||||
{
|
||||
sealed class Animation
|
||||
internal sealed class Animation
|
||||
{
|
||||
public const int MinimumFrameTime = 1;
|
||||
|
||||
@@ -18,7 +18,7 @@ using OMI.Workers.GameRule;
|
||||
using OMI.Workers.Language;
|
||||
|
||||
using PckStudio.Properties;
|
||||
using PckStudio.Classes.FileTypes;
|
||||
using PckStudio.FileFormats;
|
||||
using PckStudio.Forms;
|
||||
using PckStudio.Forms.Utilities;
|
||||
using PckStudio.Forms.Editor;
|
||||
@@ -157,6 +157,7 @@ namespace PckStudio
|
||||
|
||||
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
PckManager?.Close();
|
||||
checkSaveState();
|
||||
}
|
||||
|
||||
@@ -430,20 +431,12 @@ namespace PckStudio
|
||||
|
||||
private void HandleColourFile(PckFile.FileData file)
|
||||
{
|
||||
if (file.Size == 0)
|
||||
{
|
||||
MessageBox.Show("No Color data found.", "Error", MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
using COLEditor diag = new COLEditor(file);
|
||||
wasModified = diag.ShowDialog(this) == DialogResult.OK;
|
||||
}
|
||||
|
||||
public void HandleSkinFile(PckFile.FileData file)
|
||||
{
|
||||
if (file.Size <= 0)
|
||||
return;
|
||||
using (var ms = new MemoryStream(file.Data))
|
||||
{
|
||||
var texture = Image.FromStream(ms);
|
||||
@@ -988,7 +981,12 @@ namespace PckStudio
|
||||
{
|
||||
if (treeViewMain.SelectedNode is TreeNode t && t.Tag is PckFile.FileData file)
|
||||
{
|
||||
pckFileTypeHandler[file.Filetype]?.Invoke(file);
|
||||
if (file.Size <= 0)
|
||||
{
|
||||
Debug.WriteLine($"'{file.Filename}' has no data attached.", category: nameof(HandleTextureFile));
|
||||
return;
|
||||
}
|
||||
pckFileTypeHandler[file.Filetype]?.Invoke(file);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1324,7 +1322,7 @@ namespace PckStudio
|
||||
private void texturePackToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
checkSaveState();
|
||||
CreateTexturePack packPrompt = new CreateTexturePack();
|
||||
CreateTexturePackPrompt packPrompt = new CreateTexturePackPrompt();
|
||||
if (packPrompt.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
currentPCK = InitializeTexturePack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes);
|
||||
@@ -1337,7 +1335,7 @@ namespace PckStudio
|
||||
private void mashUpPackToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
checkSaveState();
|
||||
CreateTexturePack packPrompt = new CreateTexturePack();
|
||||
CreateTexturePackPrompt packPrompt = new CreateTexturePackPrompt();
|
||||
if (packPrompt.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
currentPCK = InitializeMashUpPack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes);
|
||||
@@ -1350,7 +1348,7 @@ namespace PckStudio
|
||||
private void quickChangeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
using AdvancedOptions advanced = new AdvancedOptions(currentPCK);
|
||||
advanced.littleEndian = LittleEndianCheckBox.Checked;
|
||||
advanced.IsLittleEndian = LittleEndianCheckBox.Checked;
|
||||
if (advanced.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
wasModified = true;
|
||||
@@ -2283,13 +2281,15 @@ namespace PckStudio
|
||||
private void openPckManagerToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
PckManager ??= new PckManager();
|
||||
PckManager.BringToFront();
|
||||
PckManager.Focus();
|
||||
if (!PckManager.Visible)
|
||||
PckManager.FormClosing += (s, e) =>
|
||||
{
|
||||
PckManager.FormClosed += delegate { PckManager = null; };
|
||||
PckManager.Show(this);
|
||||
}
|
||||
PckManager.Hide();
|
||||
e.Cancel = true;
|
||||
};
|
||||
if (!PckManager.Visible)
|
||||
PckManager.Show();
|
||||
if (PckManager.Focus())
|
||||
PckManager.BringToFront();
|
||||
}
|
||||
|
||||
private async void wavBinkaToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -2339,7 +2339,7 @@ namespace PckStudio
|
||||
|
||||
if (exitCode == 0)
|
||||
convertedCount++;
|
||||
}
|
||||
}
|
||||
|
||||
int fileCount = fileDialog.FileNames.Length;
|
||||
|
||||
|
||||
@@ -178,6 +178,7 @@
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Classes\Utils\BinkaConverter.cs" />
|
||||
<Compile Include="Extensions\AnimationExtensions.cs" />
|
||||
<Compile Include="Extensions\ImageLayoutDirection.cs" />
|
||||
<Compile Include="Extensions\ImageSection.cs" />
|
||||
<Compile Include="Extensions\ListExtensions.cs" />
|
||||
@@ -210,8 +211,8 @@
|
||||
<Compile Include="Extensions\ColorExtensions.cs" />
|
||||
<Compile Include="Extensions\EnumerableExtensions.cs" />
|
||||
<Compile Include="Extensions\GraphicsExtensions.cs" />
|
||||
<Compile Include="Classes\FileTypes\CSMBFile.cs" />
|
||||
<Compile Include="Classes\FileTypes\PckAudioFile.cs" />
|
||||
<Compile Include="FileFormats\CSMBFile.cs" />
|
||||
<Compile Include="FileFormats\PckAudioFile.cs" />
|
||||
<Compile Include="Classes\API\Miles\Binka.cs" />
|
||||
<Compile Include="Classes\IO\3DST\3DSTextureReader.cs" />
|
||||
<Compile Include="Classes\IO\3DST\3DSTextureWriter.cs" />
|
||||
@@ -281,11 +282,11 @@
|
||||
<Compile Include="Forms\Additional-Popups\Loc\AddLanguage.Designer.cs">
|
||||
<DependentUpon>AddLanguage.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Additional-Popups\CreateTexturePack.cs">
|
||||
<Compile Include="Forms\Additional-Popups\CreateTexturePackPrompt.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Additional-Popups\CreateTexturePack.Designer.cs">
|
||||
<DependentUpon>CreateTexturePack.cs</DependentUpon>
|
||||
<Compile Include="Forms\Additional-Popups\CreateTexturePackPrompt.Designer.cs">
|
||||
<DependentUpon>CreateTexturePackPrompt.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Additional-Popups\AddFilePrompt.cs">
|
||||
<SubType>Form</SubType>
|
||||
@@ -305,7 +306,7 @@
|
||||
<Compile Include="Forms\Additional-Popups\MultiTextPrompt.Designer.cs">
|
||||
<DependentUpon>MultiTextPrompt.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Editor\Animation.cs" />
|
||||
<Compile Include="Internal\Animation.cs" />
|
||||
<Compile Include="Forms\Editor\AnimationPictureBox.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
@@ -508,8 +509,8 @@
|
||||
<EmbeddedResource Include="Forms\Additional-Popups\Loc\AddLanguage.resx">
|
||||
<DependentUpon>AddLanguage.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\Additional-Popups\CreateTexturePack.resx">
|
||||
<DependentUpon>CreateTexturePack.cs</DependentUpon>
|
||||
<EmbeddedResource Include="Forms\Additional-Popups\CreateTexturePackPrompt.resx">
|
||||
<DependentUpon>CreateTexturePackPrompt.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\Additional-Popups\AddFilePrompt.resx">
|
||||
|
||||
Reference in New Issue
Block a user