diff --git a/PCK-Studio/Classes/Utils/ARC/ARCUtil.cs b/PCK-Studio/Classes/Utils/ARC/ARCUtil.cs index a4c0946d..9ce8c140 100644 --- a/PCK-Studio/Classes/Utils/ARC/ARCUtil.cs +++ b/PCK-Studio/Classes/Utils/ARC/ARCUtil.cs @@ -14,5 +14,19 @@ namespace PckStudio.Classes.Utils.ARC stream.Seek(0, SeekOrigin.Begin); writer.WriteToStream(stream); } + + public static bool ContainsFile(Stream stream, string filepath) + { + var reader = new ARCFileReader(); + var archive = reader.FromStream(stream); + return archive.ContainsKey(filepath); + } + + public static void Remove(Stream stream, string filepath) + { + var reader = new ARCFileReader(); + var archive = reader.FromStream(stream); + archive.Remove(filepath); + } } } \ No newline at end of file diff --git a/PCK-Studio/Forms/Additional-Popups/MipMapPrompt.Designer.cs b/PCK-Studio/Forms/Additional-Popups/MipMapPrompt.Designer.cs deleted file mode 100644 index 7fae0a04..00000000 --- a/PCK-Studio/Forms/Additional-Popups/MipMapPrompt.Designer.cs +++ /dev/null @@ -1,110 +0,0 @@ -namespace PckStudio -{ - partial class MipMapPrompt - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MipMapPrompt)); - this.TextLabel = new System.Windows.Forms.Label(); - this.CancelBtn = new System.Windows.Forms.Button(); - this.button1 = new System.Windows.Forms.Button(); - this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); - this.SuspendLayout(); - // - // TextLabel - // - resources.ApplyResources(this.TextLabel, "TextLabel"); - this.TextLabel.ForeColor = System.Drawing.Color.White; - this.TextLabel.Name = "TextLabel"; - // - // CancelButton - // - resources.ApplyResources(this.CancelBtn, "CancelButton"); - this.CancelBtn.ForeColor = System.Drawing.Color.White; - this.CancelBtn.Name = "CancelButton"; - this.CancelBtn.UseVisualStyleBackColor = true; - this.CancelBtn.Click += new System.EventHandler(this.CancelButton_Click); - // - // button1 - // - resources.ApplyResources(this.button1, "button1"); - this.button1.ForeColor = System.Drawing.Color.White; - this.button1.Name = "button1"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.OKBtn_Click); - // - // numericUpDown1 - // - resources.ApplyResources(this.numericUpDown1, "numericUpDown1"); - this.numericUpDown1.Maximum = new decimal(new int[] { - 4, - 0, - 0, - 0}); - this.numericUpDown1.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.numericUpDown1.Name = "numericUpDown1"; - this.numericUpDown1.Value = new decimal(new int[] { - 1, - 0, - 0, - 0}); - // - // MipMapPrompt - // - this.AcceptButton = this.CancelBtn; - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.numericUpDown1); - this.Controls.Add(this.button1); - this.Controls.Add(this.CancelBtn); - this.Controls.Add(this.TextLabel); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "MipMapPrompt"; - this.Resizable = false; - this.ShadowType = MetroFramework.Forms.MetroFormShadowType.DropShadow; - this.Style = MetroFramework.MetroColorStyle.Silver; - this.Theme = MetroFramework.MetroThemeStyle.Dark; - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - public System.Windows.Forms.Button CancelBtn; - public System.Windows.Forms.Label TextLabel; - public System.Windows.Forms.Button button1; - private System.Windows.Forms.NumericUpDown numericUpDown1; - } -} \ No newline at end of file diff --git a/PCK-Studio/Forms/Additional-Popups/MipMapPrompt.cs b/PCK-Studio/Forms/Additional-Popups/MipMapPrompt.cs deleted file mode 100644 index 76f813e4..00000000 --- a/PCK-Studio/Forms/Additional-Popups/MipMapPrompt.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Windows.Forms; -using MetroFramework.Forms; - -namespace PckStudio -{ - public partial class MipMapPrompt : MetroForm - { - /// - /// Text entered only access when DialogResult == DialogResult.OK - /// - public int Levels => (int)numericUpDown1.Value; - - public MipMapPrompt() - { - InitializeComponent(); - } - - private void OKBtn_Click(object sender, EventArgs e) - { - DialogResult = DialogResult.OK; - } - - private void CancelButton_Click(object sender, EventArgs e) - { - DialogResult = DialogResult.Cancel; - } - } -} diff --git a/PCK-Studio/Forms/Additional-Popups/NumericPrompt.Designer.cs b/PCK-Studio/Forms/Additional-Popups/NumericPrompt.Designer.cs new file mode 100644 index 00000000..e25dee84 --- /dev/null +++ b/PCK-Studio/Forms/Additional-Popups/NumericPrompt.Designer.cs @@ -0,0 +1,95 @@ +namespace PckStudio +{ + partial class NumericPrompt + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NumericPrompt)); + this.TextLabel = new System.Windows.Forms.Label(); + this.OKButton = new System.Windows.Forms.Button(); + this.ContextLabel = new MetroFramework.Controls.MetroLabel(); + this.ValueUpDown = new System.Windows.Forms.NumericUpDown(); + ((System.ComponentModel.ISupportInitialize)(this.ValueUpDown)).BeginInit(); + this.SuspendLayout(); + // + // TextLabel + // + resources.ApplyResources(this.TextLabel, "TextLabel"); + this.TextLabel.ForeColor = System.Drawing.Color.White; + this.TextLabel.Name = "TextLabel"; + // + // OKButton + // + resources.ApplyResources(this.OKButton, "OKButton"); + this.OKButton.ForeColor = System.Drawing.Color.White; + this.OKButton.Name = "OKButton"; + this.OKButton.UseVisualStyleBackColor = true; + this.OKButton.Click += new System.EventHandler(this.OKBtn_Click); + // + // contextLabel + // + resources.ApplyResources(this.ContextLabel, "contextLabel"); + this.ContextLabel.FontSize = MetroFramework.MetroLabelSize.Small; + this.ContextLabel.Name = "contextLabel"; + this.ContextLabel.Theme = MetroFramework.MetroThemeStyle.Dark; + this.ContextLabel.WrapToLine = true; + // + // valueUpDown + // + resources.ApplyResources(this.ValueUpDown, "valueUpDown"); + this.ValueUpDown.Name = "valueUpDown"; + // + // NumericPrompt + // + this.AcceptButton = this.OKButton; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.ValueUpDown); + this.Controls.Add(this.ContextLabel); + this.Controls.Add(this.OKButton); + this.Controls.Add(this.TextLabel); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "NumericPrompt"; + this.Resizable = false; + this.ShadowType = MetroFramework.Forms.MetroFormShadowType.DropShadow; + this.Style = MetroFramework.MetroColorStyle.Silver; + this.Theme = MetroFramework.MetroThemeStyle.Dark; + this.Load += new System.EventHandler(this.RenamePrompt_Load); + ((System.ComponentModel.ISupportInitialize)(this.ValueUpDown)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + public System.Windows.Forms.Button OKButton; + public System.Windows.Forms.Label TextLabel; + public MetroFramework.Controls.MetroLabel ContextLabel; + public System.Windows.Forms.NumericUpDown ValueUpDown; + } +} \ No newline at end of file diff --git a/PCK-Studio/Forms/Additional-Popups/NumericPrompt.cs b/PCK-Studio/Forms/Additional-Popups/NumericPrompt.cs new file mode 100644 index 00000000..3d600bea --- /dev/null +++ b/PCK-Studio/Forms/Additional-Popups/NumericPrompt.cs @@ -0,0 +1,33 @@ +using System; +using System.Windows.Forms; +using MetroFramework.Forms; + +namespace PckStudio +{ + public partial class NumericPrompt : MetroForm + { + /// + /// Text entered only access when DialogResult == DialogResult.OK + /// + public int NewValue => (int)ValueUpDown.Value; + + public NumericPrompt(int InitialValue) + { + InitializeComponent(); + ValueUpDown.Value = InitialValue; + } + private void OKBtn_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.OK; + } + + private void RenamePrompt_Load(object sender, EventArgs e) + { + if(String.IsNullOrEmpty(ContextLabel.Text)) + { + ContextLabel.Visible = false; + Size = new System.Drawing.Size(264, 85); + } + } + } +} diff --git a/PCK-Studio/Forms/Additional-Popups/MipMapPrompt.resx b/PCK-Studio/Forms/Additional-Popups/NumericPrompt.resx similarity index 98% rename from PCK-Studio/Forms/Additional-Popups/MipMapPrompt.resx rename to PCK-Studio/Forms/Additional-Popups/NumericPrompt.resx index 208d5144..f1926f18 100644 --- a/PCK-Studio/Forms/Additional-Popups/MipMapPrompt.resx +++ b/PCK-Studio/Forms/Additional-Popups/NumericPrompt.resx @@ -117,22 +117,26 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Bottom + True - 22, 26 + 19, 90 - 220, 13 + 34, 13 3 - How many levels would you like to generate? + Value MiddleCenter @@ -149,83 +153,85 @@ 3 - - + + Bottom + + Flat - - 135, 74 - - - 75, 23 - - - 4 - - - Cancel - - - CancelButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - Flat - - + NoControl - - 54, 74 + + 95, 118 - + 75, 23 - - 6 + + 4 - - Generate + + Set - - button1 + + OKButton - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - + + 2 + + + Top + + + 28, 39 + + + 208, 39 + + + 6 + + + TopCenter + + + contextLabel + + + MetroFramework.Controls.MetroLabel, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a + + + $this + + 1 - - 72, 47 + + 71, 88 - - 120, 20 + + 164, 20 - + 7 - - numericUpDown1 + + valueUpDown - + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - + 0 @@ -235,7 +241,7 @@ 6, 13 - 264, 105 + 264, 150 @@ -2461,7 +2467,7 @@ CenterParent - MipMapPrompt + NumericPrompt MetroFramework.Forms.MetroForm, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a diff --git a/PCK-Studio/Forms/Utilities/AppBehaviorSettingsForm.Designer.cs b/PCK-Studio/Forms/Utilities/AppBehaviorSettingsForm.Designer.cs index d92e3c80..4f79e58b 100644 --- a/PCK-Studio/Forms/Utilities/AppBehaviorSettingsForm.Designer.cs +++ b/PCK-Studio/Forms/Utilities/AppBehaviorSettingsForm.Designer.cs @@ -28,112 +28,112 @@ /// private void InitializeComponent() { - this.autoSaveCheckBox = new MetroFramework.Controls.MetroCheckBox(); - 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.showPresenceCheckBox = new MetroFramework.Controls.MetroCheckBox(); - this.SuspendLayout(); - // - // autoSaveCheckBox - // - this.autoSaveCheckBox.AutoSize = true; - this.autoSaveCheckBox.Location = new System.Drawing.Point(23, 63); - this.autoSaveCheckBox.Name = "autoSaveCheckBox"; - this.autoSaveCheckBox.Size = new System.Drawing.Size(76, 15); - this.autoSaveCheckBox.Style = MetroFramework.MetroColorStyle.White; - this.autoSaveCheckBox.TabIndex = 0; - this.autoSaveCheckBox.Text = "Auto Save"; - this.autoSaveCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark; - this.SettingToolTip.SetToolTip(this.autoSaveCheckBox, "Whether to automatically save changes inside of file editor such as the loc edito" + + this.autoSaveCheckBox = new MetroFramework.Controls.MetroCheckBox(); + 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.showPresenceCheckBox = new MetroFramework.Controls.MetroCheckBox(); + this.SuspendLayout(); + // + // autoSaveCheckBox + // + this.autoSaveCheckBox.AutoSize = true; + this.autoSaveCheckBox.Location = new System.Drawing.Point(23, 63); + this.autoSaveCheckBox.Name = "autoSaveCheckBox"; + this.autoSaveCheckBox.Size = new System.Drawing.Size(76, 15); + this.autoSaveCheckBox.Style = MetroFramework.MetroColorStyle.White; + this.autoSaveCheckBox.TabIndex = 0; + this.autoSaveCheckBox.Text = "Auto Save"; + this.autoSaveCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark; + this.SettingToolTip.SetToolTip(this.autoSaveCheckBox, "Whether to automatically save changes inside of file editor such as the loc edito" + "r"); - this.autoSaveCheckBox.UseSelectable = true; - this.autoSaveCheckBox.CheckedChanged += new System.EventHandler(this.autoSaveCheckBox_CheckedChanged); - // - // SettingToolTip - // - this.SettingToolTip.Style = MetroFramework.MetroColorStyle.White; - this.SettingToolTip.StyleManager = null; - this.SettingToolTip.Theme = MetroFramework.MetroThemeStyle.Dark; - // - // endianCheckBox - // - this.endianCheckBox.AutoSize = true; - this.endianCheckBox.Location = new System.Drawing.Point(23, 84); - this.endianCheckBox.Name = "endianCheckBox"; - this.endianCheckBox.Size = new System.Drawing.Size(75, 15); - this.endianCheckBox.Style = MetroFramework.MetroColorStyle.White; - this.endianCheckBox.TabIndex = 1; - this.endianCheckBox.Text = "Open Vita"; - this.endianCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark; - this.SettingToolTip.SetToolTip(this.endianCheckBox, "Whether to automatically set the \'Open as Switch/Vita pck\' checkbox"); - this.endianCheckBox.UseSelectable = true; - this.endianCheckBox.CheckedChanged += new System.EventHandler(this.endianCheckBox_CheckedChanged); - // - // autoUpdateCheckBox - // - this.autoUpdateCheckBox.AutoSize = true; - this.autoUpdateCheckBox.Enabled = false; - this.autoUpdateCheckBox.Location = new System.Drawing.Point(23, 105); - this.autoUpdateCheckBox.Name = "autoUpdateCheckBox"; - this.autoUpdateCheckBox.Size = new System.Drawing.Size(90, 15); - this.autoUpdateCheckBox.Style = MetroFramework.MetroColorStyle.White; - this.autoUpdateCheckBox.TabIndex = 2; - this.autoUpdateCheckBox.Text = "Auto Update"; - this.autoUpdateCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark; - 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); - // - // showPresenceCheckBox - // - this.showPresenceCheckBox.AutoSize = true; - this.showPresenceCheckBox.Location = new System.Drawing.Point(23, 147); - this.showPresenceCheckBox.Name = "showPresenceCheckBox"; - this.showPresenceCheckBox.Size = new System.Drawing.Size(171, 15); - this.showPresenceCheckBox.Style = MetroFramework.MetroColorStyle.White; - this.showPresenceCheckBox.TabIndex = 4; - this.showPresenceCheckBox.Text = "Show Discord Rich Presence"; - this.showPresenceCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark; - this.SettingToolTip.SetToolTip(this.showPresenceCheckBox, "Whether to show a rich presence on discord"); - this.showPresenceCheckBox.UseSelectable = true; - this.showPresenceCheckBox.CheckedChanged += new System.EventHandler(this.showPresenceCheckBox_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.showPresenceCheckBox); - this.Controls.Add(this.autoLoadPckCheckBox); - this.Controls.Add(this.autoUpdateCheckBox); - this.Controls.Add(this.endianCheckBox); - this.Controls.Add(this.autoSaveCheckBox); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "AppBehaviorSettingsForm"; - this.Resizable = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Style = MetroFramework.MetroColorStyle.Black; - this.Text = "Application Settings"; - this.Theme = MetroFramework.MetroThemeStyle.Dark; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AppBehaviorSettingsForm_FormClosing); - this.ResumeLayout(false); - this.PerformLayout(); + this.autoSaveCheckBox.UseSelectable = true; + this.autoSaveCheckBox.CheckedChanged += new System.EventHandler(this.autoSaveCheckBox_CheckedChanged); + // + // SettingToolTip + // + this.SettingToolTip.Style = MetroFramework.MetroColorStyle.White; + this.SettingToolTip.StyleManager = null; + this.SettingToolTip.Theme = MetroFramework.MetroThemeStyle.Dark; + // + // endianCheckBox + // + this.endianCheckBox.AutoSize = true; + this.endianCheckBox.Location = new System.Drawing.Point(23, 84); + this.endianCheckBox.Name = "endianCheckBox"; + this.endianCheckBox.Size = new System.Drawing.Size(75, 15); + this.endianCheckBox.Style = MetroFramework.MetroColorStyle.White; + this.endianCheckBox.TabIndex = 1; + this.endianCheckBox.Text = "Open Vita"; + this.endianCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark; + this.SettingToolTip.SetToolTip(this.endianCheckBox, "Whether to automatically set the \'Open as Switch/Vita pck\' checkbox"); + this.endianCheckBox.UseSelectable = true; + this.endianCheckBox.CheckedChanged += new System.EventHandler(this.endianCheckBox_CheckedChanged); + // + // autoUpdateCheckBox + // + this.autoUpdateCheckBox.AutoSize = true; + this.autoUpdateCheckBox.Enabled = false; + this.autoUpdateCheckBox.Location = new System.Drawing.Point(23, 105); + this.autoUpdateCheckBox.Name = "autoUpdateCheckBox"; + this.autoUpdateCheckBox.Size = new System.Drawing.Size(90, 15); + this.autoUpdateCheckBox.Style = MetroFramework.MetroColorStyle.White; + this.autoUpdateCheckBox.TabIndex = 2; + this.autoUpdateCheckBox.Text = "Auto Update"; + this.autoUpdateCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark; + 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(331, 15); + this.autoLoadPckCheckBox.Style = MetroFramework.MetroColorStyle.White; + this.autoLoadPckCheckBox.TabIndex = 3; + this.autoLoadPckCheckBox.Text = "Auto load additional pck files (also known as SubPCK 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); + // + // showPresenceCheckBox + // + this.showPresenceCheckBox.AutoSize = true; + this.showPresenceCheckBox.Location = new System.Drawing.Point(23, 147); + this.showPresenceCheckBox.Name = "showPresenceCheckBox"; + this.showPresenceCheckBox.Size = new System.Drawing.Size(171, 15); + this.showPresenceCheckBox.Style = MetroFramework.MetroColorStyle.White; + this.showPresenceCheckBox.TabIndex = 4; + this.showPresenceCheckBox.Text = "Show Discord Rich Presence"; + this.showPresenceCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark; + this.SettingToolTip.SetToolTip(this.showPresenceCheckBox, "Whether to show a rich presence on discord"); + this.showPresenceCheckBox.UseSelectable = true; + this.showPresenceCheckBox.CheckedChanged += new System.EventHandler(this.showPresenceCheckBox_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.showPresenceCheckBox); + this.Controls.Add(this.autoLoadPckCheckBox); + this.Controls.Add(this.autoUpdateCheckBox); + this.Controls.Add(this.endianCheckBox); + this.Controls.Add(this.autoSaveCheckBox); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "AppBehaviorSettingsForm"; + this.Resizable = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Style = MetroFramework.MetroColorStyle.Black; + this.Text = "Application Settings"; + this.Theme = MetroFramework.MetroThemeStyle.Dark; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AppBehaviorSettingsForm_FormClosing); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/PCK-Studio/Forms/Utilities/AppBehaviorSettingsForm.resx b/PCK-Studio/Forms/Utilities/AppBehaviorSettingsForm.resx index ab1b49e0..9b5d83ba 100644 --- a/PCK-Studio/Forms/Utilities/AppBehaviorSettingsForm.resx +++ b/PCK-Studio/Forms/Utilities/AppBehaviorSettingsForm.resx @@ -120,7 +120,4 @@ 17, 17 - - 17, 17 - \ No newline at end of file diff --git a/PCK-Studio/Internals/ApplicationBuildInfo.cs b/PCK-Studio/Internals/ApplicationBuildInfo.cs index acd9f6e8..f887b0e4 100644 --- a/PCK-Studio/Internals/ApplicationBuildInfo.cs +++ b/PCK-Studio/Internals/ApplicationBuildInfo.cs @@ -35,7 +35,7 @@ namespace PckStudio.Internal get { // adopted Minecraft Java Edition Snapshot format (YYwWWn) - // to keep better track of work in progress features and builds + // to keep track of work in progress features and builds _buildCalendar ??= new System.Globalization.CultureInfo("en-US").Calendar; return _betaBuildVersion ??= string.Format("#{0}w{1}{2}", date.ToString("yy"), diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index af50539d..acc391ec 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -137,11 +137,9 @@ namespace PckStudio modelsFileBINToolStripMenuItem.Click += (sender, e) => setFileType_Click(sender, e, PckFile.FileData.FileType.ModelsFile); behavioursFileBINToolStripMenuItem.Click += (sender, e) => setFileType_Click(sender, e, PckFile.FileData.FileType.BehavioursFile); entityMaterialsFileBINToolStripMenuItem.Click += (sender, e) => setFileType_Click(sender, e, PckFile.FileData.FileType.MaterialFile); - - LoadUserSettings(); } - private void LoadUserSettings() + public void LoadUserSettings() { LittleEndianCheckBox.Checked = Settings.Default.UseLittleEndianAsDefault; } @@ -1950,10 +1948,16 @@ namespace PckStudio // TGA is not yet supported if (textureExtension == ".tga") return; - using MipMapPrompt diag = new MipMapPrompt(); - if (diag.ShowDialog(this) == DialogResult.OK) + using NumericPrompt numericPrompt = new NumericPrompt(0); + numericPrompt.ValueUpDown.Minimum = 1; + numericPrompt.ValueUpDown.Maximum = 4; // 5 is the presumed max MipMap level + numericPrompt.ContextLabel.Text = "You can enter the amount of MipMap levels that you would like to generate. " + + "For example: if you enter 2, MipMapLevel1.png and MipMapLevel2.png will be generated"; + numericPrompt.TextLabel.Text = "Levels"; + + if (numericPrompt.ShowDialog(this) == DialogResult.OK) { - for (int i = 2; i < 2 + diag.Levels; i++) + for (int i = 2; i < 2 + numericPrompt.NewValue; i++) { string mippedPath = $"{textureDirectory}/{textureName}MipMapLevel{i}{textureExtension}"; Debug.WriteLine(mippedPath); diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index c01ac9fb..e22c95b5 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -178,6 +178,12 @@ + + Form + + + NumericPrompt.cs + Form @@ -269,12 +275,6 @@ CreateTexturePack.cs - - Form - - - MipMapPrompt.cs - Form @@ -500,14 +500,14 @@ CreateTexturePack.cs Designer - - MipMapPrompt.cs - Designer - AddFilePrompt.cs Designer + + NumericPrompt.cs + Designer + RenamePrompt.cs Designer diff --git a/PCK-Studio/Program.cs b/PCK-Studio/Program.cs index ce550b93..1883db52 100644 --- a/PCK-Studio/Program.cs +++ b/PCK-Studio/Program.cs @@ -25,6 +25,7 @@ namespace PckStudio ApplicationScope.Initialize(); RPC.Initialize(); MainInstance = new MainForm(); + MainInstance.LoadUserSettings(); if (args.Length > 0 && File.Exists(args[0]) && args[0].EndsWith(".pck")) MainInstance.LoadPckFromFile(args[0]); Application.Run(MainInstance); diff --git a/PCK-Studio/Properties/Settings.Designer.cs b/PCK-Studio/Properties/Settings.Designer.cs index 3af8d381..c154a761 100644 --- a/PCK-Studio/Properties/Settings.Designer.cs +++ b/PCK-Studio/Properties/Settings.Designer.cs @@ -58,7 +58,7 @@ namespace PckStudio.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] + [global::System.Configuration.DefaultSettingValueAttribute("True")] public bool LoadSubPcks { get { return ((bool)(this["LoadSubPcks"]));