mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-07-13 01:31:24 +00:00
Added Setting for loading sub pcks
This commit is contained in:
@@ -58,6 +58,9 @@
|
||||
<setting name="UseLittleEndianAsDefault" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="LoadSubPcks" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
</PckStudio.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
this.SettingToolTip = new MetroFramework.Components.MetroToolTip();
|
||||
this.endianCheckBox = new MetroFramework.Controls.MetroCheckBox();
|
||||
this.autoUpdateCheckBox = new MetroFramework.Controls.MetroCheckBox();
|
||||
this.autoLoadPckCheckBox = new MetroFramework.Controls.MetroCheckBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// autoSaveCheckBox
|
||||
@@ -83,11 +84,26 @@
|
||||
this.SettingToolTip.SetToolTip(this.autoUpdateCheckBox, "Whether to automatically check for updates");
|
||||
this.autoUpdateCheckBox.UseSelectable = true;
|
||||
//
|
||||
// autoLoadPckCheckBox
|
||||
//
|
||||
this.autoLoadPckCheckBox.AutoSize = true;
|
||||
this.autoLoadPckCheckBox.Location = new System.Drawing.Point(23, 126);
|
||||
this.autoLoadPckCheckBox.Name = "autoLoadPckCheckBox";
|
||||
this.autoLoadPckCheckBox.Size = new System.Drawing.Size(184, 15);
|
||||
this.autoLoadPckCheckBox.Style = MetroFramework.MetroColorStyle.White;
|
||||
this.autoLoadPckCheckBox.TabIndex = 3;
|
||||
this.autoLoadPckCheckBox.Text = "Auto Load addittional pck files";
|
||||
this.autoLoadPckCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.SettingToolTip.SetToolTip(this.autoLoadPckCheckBox, "Whether to automatically load files inside that end in .pck");
|
||||
this.autoLoadPckCheckBox.UseSelectable = true;
|
||||
this.autoLoadPckCheckBox.CheckedChanged += new System.EventHandler(this.autoLoadPckCheckBox_CheckedChanged);
|
||||
//
|
||||
// AppBehaviorSettingsForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(527, 270);
|
||||
this.Controls.Add(this.autoLoadPckCheckBox);
|
||||
this.Controls.Add(this.autoUpdateCheckBox);
|
||||
this.Controls.Add(this.endianCheckBox);
|
||||
this.Controls.Add(this.autoSaveCheckBox);
|
||||
@@ -111,5 +127,6 @@
|
||||
private MetroFramework.Components.MetroToolTip SettingToolTip;
|
||||
private MetroFramework.Controls.MetroCheckBox endianCheckBox;
|
||||
private MetroFramework.Controls.MetroCheckBox autoUpdateCheckBox;
|
||||
private MetroFramework.Controls.MetroCheckBox autoLoadPckCheckBox;
|
||||
}
|
||||
}
|
||||
@@ -30,10 +30,16 @@ namespace PckStudio.Forms.Utilities
|
||||
Settings.Default.UseLittleEndianAsDefault = endianCheckBox.Checked;
|
||||
}
|
||||
|
||||
private void autoLoadPckCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Settings.Default.LoadSubPcks = autoLoadPckCheckBox.Checked;
|
||||
}
|
||||
|
||||
private void LoadSettings()
|
||||
{
|
||||
autoSaveCheckBox.Checked = Settings.Default.AutoSaveChanges;
|
||||
endianCheckBox.Checked = Settings.Default.UseLittleEndianAsDefault;
|
||||
autoLoadPckCheckBox.Checked = Settings.Default.LoadSubPcks;
|
||||
}
|
||||
|
||||
private void AppBehaviorSettingsForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
|
||||
@@ -120,4 +120,7 @@
|
||||
<metadata name="SettingToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="SettingToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -289,10 +289,9 @@ namespace PckStudio
|
||||
file.Filename = file.Filename.Remove(0, parentPath.Length);
|
||||
TreeNode node = BuildNodeTreeBySeperator(root, file.Filename, '/');
|
||||
node.Tag = file;
|
||||
switch (file.Filetype)
|
||||
if (Settings.Default.LoadSubPcks && (file.Filetype == PckFile.FileData.FileType.SkinDataFile ||
|
||||
file.Filetype == PckFile.FileData.FileType.TexturePackInfoFile))
|
||||
{
|
||||
case PckFile.FileData.FileType.SkinDataFile:
|
||||
case PckFile.FileData.FileType.TexturePackInfoFile:
|
||||
if (file.Data.Length == 0)
|
||||
break;
|
||||
using (var stream = new MemoryStream(file.Data))
|
||||
@@ -312,10 +311,6 @@ namespace PckStudio
|
||||
Debug.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default: // unknown file format
|
||||
//throw new InvalidDataException(nameof(file.filetype));
|
||||
break;
|
||||
}
|
||||
SetPckFileIcon(node, file.Filetype);
|
||||
};
|
||||
|
||||
12
PCK-Studio/Properties/Settings.Designer.cs
generated
12
PCK-Studio/Properties/Settings.Designer.cs
generated
@@ -55,5 +55,17 @@ namespace PckStudio.Properties {
|
||||
this["UseLittleEndianAsDefault"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool LoadSubPcks {
|
||||
get {
|
||||
return ((bool)(this["LoadSubPcks"]));
|
||||
}
|
||||
set {
|
||||
this["LoadSubPcks"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,5 +11,8 @@
|
||||
<Setting Name="UseLittleEndianAsDefault" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="LoadSubPcks" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
Reference in New Issue
Block a user