mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-07-15 21:48:09 +00:00
CreateTexturePackPrompt - Added Checkbox fro creating skins.pck file
This commit is contained in:
@@ -29,11 +29,12 @@
|
||||
private void InitializeComponent()
|
||||
{
|
||||
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.TextLabel = new MetroFramework.Controls.MetroLabel();
|
||||
this.OKButton = new MetroFramework.Controls.MetroButton();
|
||||
this.InputTextBox = new MetroFramework.Controls.MetroTextBox();
|
||||
this.resolutionComboBox = new MetroFramework.Controls.MetroComboBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label1 = new MetroFramework.Controls.MetroLabel();
|
||||
this.createSkinsPckCheckBox = new MetroFramework.Controls.MetroCheckBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// TextLabel
|
||||
@@ -41,13 +42,14 @@
|
||||
resources.ApplyResources(this.TextLabel, "TextLabel");
|
||||
this.TextLabel.ForeColor = System.Drawing.Color.White;
|
||||
this.TextLabel.Name = "TextLabel";
|
||||
this.TextLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
//
|
||||
// OKButton
|
||||
//
|
||||
resources.ApplyResources(this.OKButton, "OKButton");
|
||||
this.OKButton.ForeColor = System.Drawing.Color.White;
|
||||
this.OKButton.Name = "OKButton";
|
||||
this.OKButton.UseVisualStyleBackColor = true;
|
||||
this.OKButton.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.OKButton.UseSelectable = true;
|
||||
this.OKButton.Click += new System.EventHandler(this.OKBtn_Click);
|
||||
//
|
||||
// InputTextBox
|
||||
@@ -105,12 +107,22 @@
|
||||
this.label1.BackColor = System.Drawing.Color.Transparent;
|
||||
this.label1.ForeColor = System.Drawing.Color.White;
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
//
|
||||
// CreateTexturePack
|
||||
// createSkinsPckCheckBox
|
||||
//
|
||||
resources.ApplyResources(this.createSkinsPckCheckBox, "createSkinsPckCheckBox");
|
||||
this.createSkinsPckCheckBox.Name = "createSkinsPckCheckBox";
|
||||
this.createSkinsPckCheckBox.Style = MetroFramework.MetroColorStyle.White;
|
||||
this.createSkinsPckCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.createSkinsPckCheckBox.UseSelectable = true;
|
||||
//
|
||||
// CreateTexturePackPrompt
|
||||
//
|
||||
this.AcceptButton = this.OKButton;
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.createSkinsPckCheckBox);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.resolutionComboBox);
|
||||
this.Controls.Add(this.InputTextBox);
|
||||
@@ -118,7 +130,7 @@
|
||||
this.Controls.Add(this.TextLabel);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "CreateTexturePack";
|
||||
this.Name = "CreateTexturePackPrompt";
|
||||
this.Resizable = false;
|
||||
this.ShadowType = MetroFramework.Forms.MetroFormShadowType.DropShadow;
|
||||
this.Style = MetroFramework.MetroColorStyle.Silver;
|
||||
@@ -129,10 +141,11 @@
|
||||
}
|
||||
|
||||
#endregion
|
||||
public System.Windows.Forms.Button OKButton;
|
||||
public System.Windows.Forms.Label TextLabel;
|
||||
public MetroFramework.Controls.MetroButton OKButton;
|
||||
public MetroFramework.Controls.MetroLabel TextLabel;
|
||||
private MetroFramework.Controls.MetroTextBox InputTextBox;
|
||||
private MetroFramework.Controls.MetroComboBox resolutionComboBox;
|
||||
public System.Windows.Forms.Label label1;
|
||||
}
|
||||
public MetroFramework.Controls.MetroLabel label1;
|
||||
private MetroFramework.Controls.MetroCheckBox createSkinsPckCheckBox;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ namespace PckStudio
|
||||
/// <summary>
|
||||
/// Text entered <c>only access when DialogResult == DialogResult.OK</c>
|
||||
/// </summary>
|
||||
public bool CreateSkinsPck => createSkinsPckCheckBox.Checked;
|
||||
public string PackName => InputTextBox.Text;
|
||||
public string PackRes => resolutionComboBox.Text;
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
<value>19, 17</value>
|
||||
</data>
|
||||
<data name="TextLabel.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>35, 13</value>
|
||||
<value>45, 19</value>
|
||||
</data>
|
||||
<data name="TextLabel.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>3</value>
|
||||
@@ -141,20 +141,16 @@
|
||||
<value>TextLabel</value>
|
||||
</data>
|
||||
<data name=">>TextLabel.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>MetroFramework.Controls.MetroLabel, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
|
||||
</data>
|
||||
<data name=">>TextLabel.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>TextLabel.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="OKButton.FlatStyle" type="System.Windows.Forms.FlatStyle, System.Windows.Forms">
|
||||
<value>Flat</value>
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="OKButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>101, 74</value>
|
||||
<value>166, 74</value>
|
||||
</data>
|
||||
<data name="OKButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>75, 23</value>
|
||||
@@ -169,14 +165,15 @@
|
||||
<value>OKButton</value>
|
||||
</data>
|
||||
<data name=">>OKButton.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>MetroFramework.Controls.MetroButton, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
|
||||
</data>
|
||||
<data name=">>OKButton.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>OKButton.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
<value>4</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="resource.Image" type="System.Resources.ResXNullRef, System.Windows.Forms">
|
||||
<value />
|
||||
</data>
|
||||
@@ -193,7 +190,7 @@
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="InputTextBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>60, 12</value>
|
||||
<value>76, 13</value>
|
||||
</data>
|
||||
<data name="InputTextBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>165, 23</value>
|
||||
@@ -211,7 +208,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>InputTextBox.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="resolutionComboBox.ItemHeight" type="System.Int32, mscorlib">
|
||||
<value>23</value>
|
||||
@@ -244,7 +241,7 @@
|
||||
<value>x128</value>
|
||||
</data>
|
||||
<data name="resolutionComboBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>60, 39</value>
|
||||
<value>76, 40</value>
|
||||
</data>
|
||||
<data name="resolutionComboBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>165, 29</value>
|
||||
@@ -262,19 +259,16 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>resolutionComboBox.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>2, 48</value>
|
||||
</data>
|
||||
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>57, 13</value>
|
||||
<value>69, 19</value>
|
||||
</data>
|
||||
<data name="label1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>7</value>
|
||||
@@ -289,12 +283,39 @@
|
||||
<value>label1</value>
|
||||
</data>
|
||||
<data name=">>label1.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>MetroFramework.Controls.MetroLabel, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
|
||||
</data>
|
||||
<data name=">>label1.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label1.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="createSkinsPckCheckBox.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="createSkinsPckCheckBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>19, 77</value>
|
||||
</data>
|
||||
<data name="createSkinsPckCheckBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>109, 15</value>
|
||||
</data>
|
||||
<data name="createSkinsPckCheckBox.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="createSkinsPckCheckBox.Text" xml:space="preserve">
|
||||
<value>Create Skins.pck</value>
|
||||
</data>
|
||||
<data name=">>createSkinsPckCheckBox.Name" xml:space="preserve">
|
||||
<value>createSkinsPckCheckBox</value>
|
||||
</data>
|
||||
<data name=">>createSkinsPckCheckBox.Type" xml:space="preserve">
|
||||
<value>MetroFramework.Controls.MetroCheckBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
|
||||
</data>
|
||||
<data name=">>createSkinsPckCheckBox.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>createSkinsPckCheckBox.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">
|
||||
@@ -2816,7 +2837,7 @@
|
||||
<value>CenterParent</value>
|
||||
</data>
|
||||
<data name=">>$this.Name" xml:space="preserve">
|
||||
<value>CreateTexturePack</value>
|
||||
<value>CreateTexturePackPrompt</value>
|
||||
</data>
|
||||
<data name=">>$this.Type" xml:space="preserve">
|
||||
<value>MetroFramework.Forms.MetroForm, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
|
||||
|
||||
@@ -949,7 +949,7 @@ namespace PckStudio
|
||||
}
|
||||
|
||||
parent_file.SetData(new PckFileWriter(newPCKFile, LittleEndianCheckBox.Checked ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian));
|
||||
parent.Tag = parent_file;
|
||||
parent.Tag = parent_file;
|
||||
|
||||
BuildMainTreeView();
|
||||
}
|
||||
@@ -1193,28 +1193,28 @@ namespace PckStudio
|
||||
zeroFile.Properties.Add("PACKID", packId.ToString());
|
||||
zeroFile.Properties.Add("PACKVERSION", packVersion.ToString());
|
||||
|
||||
var locFile = new LOCFile();
|
||||
locFile.InitializeDefault(packName);
|
||||
var locFile = new LOCFile();
|
||||
locFile.InitializeDefault(packName);
|
||||
pack.CreateNewFile("localisation.loc", PckFile.FileData.FileType.LocalisationFile, new LOCFileWriter(locFile, 2));
|
||||
|
||||
pack.CreateNewFileIf(createSkinsPCK, "Skins.pck", PckFile.FileData.FileType.SkinDataFile, new PckFileWriter(new PckFile(3, true),
|
||||
LittleEndianCheckBox.Checked
|
||||
? OMI.Endianness.LittleEndian
|
||||
LittleEndianCheckBox.Checked
|
||||
? OMI.Endianness.LittleEndian
|
||||
: OMI.Endianness.BigEndian));
|
||||
|
||||
return pack;
|
||||
}
|
||||
}
|
||||
|
||||
private PckFile InitializeTexturePack(int packId, int packVersion, string packName, string res, bool createSkinsPCK = false)
|
||||
private PckFile InitializeTexturePack(int packId, int packVersion, string packName, string res, bool createSkinsPCK)
|
||||
{
|
||||
var pack = InitializePack(packId, packVersion, packName, createSkinsPCK);
|
||||
|
||||
PckFile infoPCK = new PckFile(3);
|
||||
|
||||
var icon = infoPCK.CreateNewFile("icon.png", PckFile.FileData.FileType.TextureFile);
|
||||
var icon = infoPCK.CreateNewFile("icon.png", PckFile.FileData.FileType.TextureFile);
|
||||
icon.SetData(Resources.TexturePackIcon, ImageFormat.Png);
|
||||
|
||||
var comparison = infoPCK.CreateNewFile("comparison.png", PckFile.FileData.FileType.TextureFile);
|
||||
var comparison = infoPCK.CreateNewFile("comparison.png", PckFile.FileData.FileType.TextureFile);
|
||||
comparison.SetData(Resources.Comparison, ImageFormat.Png);
|
||||
|
||||
var texturepackInfo = pack.CreateNewFile($"{res}/{res}Info.pck", PckFile.FileData.FileType.TexturePackInfoFile);
|
||||
@@ -1250,7 +1250,7 @@ namespace PckStudio
|
||||
gameRuleFile.SetData(new GameRuleFileWriter(grfFile));
|
||||
|
||||
return pack;
|
||||
}
|
||||
}
|
||||
|
||||
private void skinPackToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -1272,7 +1272,7 @@ namespace PckStudio
|
||||
CreateTexturePackPrompt packPrompt = new CreateTexturePackPrompt();
|
||||
if (packPrompt.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
currentPCK = InitializeTexturePack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes);
|
||||
currentPCK = InitializeTexturePack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes, packPrompt.CreateSkinsPck);
|
||||
isTemplateFile = true;
|
||||
wasModified = true;
|
||||
LoadEditorTab();
|
||||
@@ -1928,7 +1928,7 @@ namespace PckStudio
|
||||
gfx.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||
gfx.DrawImage(originalTexture, tileArea);
|
||||
}
|
||||
|
||||
|
||||
MipMappedFile.SetData(mippedTexture, ImageFormat.Png);
|
||||
|
||||
currentPCK.Files.Insert(currentPCK.Files.IndexOf(file) + i - 1, MipMappedFile);
|
||||
|
||||
Reference in New Issue
Block a user