From 350b65506023369dae86602684e4b3a2049a1fc4 Mon Sep 17 00:00:00 2001 From: pizzaboxer <41478239+pizzaboxer@users.noreply.github.com> Date: Tue, 4 Oct 2022 22:03:38 +0100 Subject: [PATCH] Add revamped config menu w/ WPF and theming --- Bloxstrap/Bloxstrap.csproj | 10 +- Bloxstrap/Bootstrapper.cs | 4 +- .../BootstrapperDialogForm.cs} | 6 +- .../IBootstrapperDialog.cs | 4 +- .../LegacyDialog2009.Designer.cs | 2 +- .../LegacyDialog2009.cs | 4 +- .../LegacyDialog2009.resx | 0 .../LegacyDialog2011.Designer.cs | 2 +- .../LegacyDialog2011.cs | 4 +- .../LegacyDialog2011.resx | 0 .../ProgressDialog.Designer.cs | 2 +- .../ProgressDialog.cs | 30 +- .../ProgressDialog.resx | 0 .../VistaDialog.Designer.cs | 2 +- .../VistaDialog.cs | 4 +- .../VistaDialog.resx | 0 .../ProgressDialogDark.Designer.cs | 128 - .../BootstrapperStyles/ProgressDialogDark.cs | 59 - .../ProgressDialogDark.resx | 60 - Bloxstrap/Dialogs/Preferences.Designer.cs | 563 -- Bloxstrap/Dialogs/Preferences.cs | 297 -- Bloxstrap/Dialogs/Preferences.resx | 77 - Bloxstrap/Dialogs/Preferences.xaml | 121 + Bloxstrap/Dialogs/Preferences.xaml.cs | 346 ++ .../Dialogs/Themes/ColourfulDarkTheme.xaml | 4505 ++++++++++++++++ .../Dialogs/Themes/ColourfulDarkTheme.xaml.cs | 43 + .../Dialogs/Themes/ColourfulLightTheme.xaml | 4555 ++++++++++++++++ .../Themes/ColourfulLightTheme.xaml.cs | 43 + Bloxstrap/Dialogs/Themes/DarkTheme.xaml | 4644 +++++++++++++++++ Bloxstrap/Dialogs/Themes/DarkTheme.xaml.cs | 43 + Bloxstrap/Dialogs/Themes/LightTheme.xaml | 4461 ++++++++++++++++ Bloxstrap/Dialogs/Themes/LightTheme.xaml.cs | 43 + Bloxstrap/Enums/BootstrapperStyle.cs | 7 +- Bloxstrap/Enums/Theme.cs | 32 + Bloxstrap/Helpers/DeployManager.cs | 7 +- Bloxstrap/Models/SettingsFormat.cs | 1 + Bloxstrap/Models/VersionDeploy.cs | 6 +- Bloxstrap/Program.cs | 17 +- 38 files changed, 18905 insertions(+), 1227 deletions(-) rename Bloxstrap/Dialogs/{BootstrapperStyles/BootstrapperStyleForm.cs => BootstrapperDialogs/BootstrapperDialogForm.cs} (95%) rename Bloxstrap/Dialogs/{BootstrapperStyles => BootstrapperDialogs}/IBootstrapperDialog.cs (84%) rename Bloxstrap/Dialogs/{BootstrapperStyles => BootstrapperDialogs}/LegacyDialog2009.Designer.cs (98%) rename Bloxstrap/Dialogs/{BootstrapperStyles => BootstrapperDialogs}/LegacyDialog2009.cs (90%) rename Bloxstrap/Dialogs/{BootstrapperStyles => BootstrapperDialogs}/LegacyDialog2009.resx (100%) rename Bloxstrap/Dialogs/{BootstrapperStyles => BootstrapperDialogs}/LegacyDialog2011.Designer.cs (98%) rename Bloxstrap/Dialogs/{BootstrapperStyles => BootstrapperDialogs}/LegacyDialog2011.cs (91%) rename Bloxstrap/Dialogs/{BootstrapperStyles => BootstrapperDialogs}/LegacyDialog2011.resx (100%) rename Bloxstrap/Dialogs/{BootstrapperStyles => BootstrapperDialogs}/ProgressDialog.Designer.cs (99%) rename Bloxstrap/Dialogs/{BootstrapperStyles => BootstrapperDialogs}/ProgressDialog.cs (55%) rename Bloxstrap/Dialogs/{BootstrapperStyles => BootstrapperDialogs}/ProgressDialog.resx (100%) rename Bloxstrap/Dialogs/{BootstrapperStyles => BootstrapperDialogs}/VistaDialog.Designer.cs (96%) rename Bloxstrap/Dialogs/{BootstrapperStyles => BootstrapperDialogs}/VistaDialog.cs (97%) rename Bloxstrap/Dialogs/{BootstrapperStyles => BootstrapperDialogs}/VistaDialog.resx (100%) delete mode 100644 Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialogDark.Designer.cs delete mode 100644 Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialogDark.cs delete mode 100644 Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialogDark.resx delete mode 100644 Bloxstrap/Dialogs/Preferences.Designer.cs delete mode 100644 Bloxstrap/Dialogs/Preferences.cs delete mode 100644 Bloxstrap/Dialogs/Preferences.resx create mode 100644 Bloxstrap/Dialogs/Preferences.xaml create mode 100644 Bloxstrap/Dialogs/Preferences.xaml.cs create mode 100644 Bloxstrap/Dialogs/Themes/ColourfulDarkTheme.xaml create mode 100644 Bloxstrap/Dialogs/Themes/ColourfulDarkTheme.xaml.cs create mode 100644 Bloxstrap/Dialogs/Themes/ColourfulLightTheme.xaml create mode 100644 Bloxstrap/Dialogs/Themes/ColourfulLightTheme.xaml.cs create mode 100644 Bloxstrap/Dialogs/Themes/DarkTheme.xaml create mode 100644 Bloxstrap/Dialogs/Themes/DarkTheme.xaml.cs create mode 100644 Bloxstrap/Dialogs/Themes/LightTheme.xaml create mode 100644 Bloxstrap/Dialogs/Themes/LightTheme.xaml.cs create mode 100644 Bloxstrap/Enums/Theme.cs diff --git a/Bloxstrap/Bloxstrap.csproj b/Bloxstrap/Bloxstrap.csproj index 55b4d6a..a40bfeb 100644 --- a/Bloxstrap/Bloxstrap.csproj +++ b/Bloxstrap/Bloxstrap.csproj @@ -4,13 +4,14 @@ WinExe net6.0-windows enable - true + true + true enable AnyCPU AnyCPU;x86 Bloxstrap.ico - 1.4.4 - 1.4.4.0 + 1.5.0 + 1.5.0.0 @@ -26,8 +27,7 @@ - - + True True diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index b0ac6f7..096df02 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -6,7 +6,7 @@ using System.Net.Http; using Microsoft.Win32; using Bloxstrap.Enums; -using Bloxstrap.Dialogs.BootstrapperStyles; +using Bloxstrap.Dialogs.BootstrapperDialogs; using Bloxstrap.Helpers; using Bloxstrap.Helpers.Integrations; using Bloxstrap.Helpers.RSMM; @@ -79,7 +79,7 @@ namespace Bloxstrap private int ProgressIncrement; private bool CancelFired = false; - public IBootstrapperDialog Dialog; + public IBootstrapperDialog Dialog = null!; #endregion #region Core diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/BootstrapperStyleForm.cs b/Bloxstrap/Dialogs/BootstrapperDialogs/BootstrapperDialogForm.cs similarity index 95% rename from Bloxstrap/Dialogs/BootstrapperStyles/BootstrapperStyleForm.cs rename to Bloxstrap/Dialogs/BootstrapperDialogs/BootstrapperDialogForm.cs index 1c41347..8e28406 100644 --- a/Bloxstrap/Dialogs/BootstrapperStyles/BootstrapperStyleForm.cs +++ b/Bloxstrap/Dialogs/BootstrapperDialogs/BootstrapperDialogForm.cs @@ -1,8 +1,8 @@ using Bloxstrap.Enums; -namespace Bloxstrap.Dialogs.BootstrapperStyles +namespace Bloxstrap.Dialogs.BootstrapperDialogs { - public class BootstrapperStyleForm : Form, IBootstrapperDialog + public class BootstrapperDialogForm : Form, IBootstrapperDialog { public Bootstrapper? Bootstrapper { get; set; } @@ -66,7 +66,7 @@ namespace Bloxstrap.Dialogs.BootstrapperStyles if (Bootstrapper is null) { - Message = "Select Cancel to return to preferences"; + Message = "Style Preview - Click Cancel to return"; CancelEnabled = true; } else diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/IBootstrapperDialog.cs b/Bloxstrap/Dialogs/BootstrapperDialogs/IBootstrapperDialog.cs similarity index 84% rename from Bloxstrap/Dialogs/BootstrapperStyles/IBootstrapperDialog.cs rename to Bloxstrap/Dialogs/BootstrapperDialogs/IBootstrapperDialog.cs index c330476..394056d 100644 --- a/Bloxstrap/Dialogs/BootstrapperStyles/IBootstrapperDialog.cs +++ b/Bloxstrap/Dialogs/BootstrapperDialogs/IBootstrapperDialog.cs @@ -1,6 +1,4 @@ -using Bloxstrap.Helpers.RSMM; - -namespace Bloxstrap.Dialogs.BootstrapperStyles +namespace Bloxstrap.Dialogs.BootstrapperDialogs { public interface IBootstrapperDialog { diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2009.Designer.cs b/Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2009.Designer.cs similarity index 98% rename from Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2009.Designer.cs rename to Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2009.Designer.cs index 9e57fcc..0f161e2 100644 --- a/Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2009.Designer.cs +++ b/Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2009.Designer.cs @@ -1,4 +1,4 @@ -namespace Bloxstrap.Dialogs.BootstrapperStyles +namespace Bloxstrap.Dialogs.BootstrapperDialogs { partial class LegacyDialog2009 { diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2009.cs b/Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2009.cs similarity index 90% rename from Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2009.cs rename to Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2009.cs index c168b25..b09109b 100644 --- a/Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2009.cs +++ b/Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2009.cs @@ -1,9 +1,9 @@ -namespace Bloxstrap.Dialogs.BootstrapperStyles +namespace Bloxstrap.Dialogs.BootstrapperDialogs { // windows: https://youtu.be/VpduiruysuM?t=18 // mac: https://youtu.be/ncHhbcVDRgQ?t=63 - public partial class LegacyDialog2009 : BootstrapperStyleForm + public partial class LegacyDialog2009 : BootstrapperDialogForm { protected override string _message { diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2009.resx b/Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2009.resx similarity index 100% rename from Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2009.resx rename to Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2009.resx diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2011.Designer.cs b/Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2011.Designer.cs similarity index 98% rename from Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2011.Designer.cs rename to Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2011.Designer.cs index d552f0d..10c1a31 100644 --- a/Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2011.Designer.cs +++ b/Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2011.Designer.cs @@ -1,4 +1,4 @@ -namespace Bloxstrap.Dialogs.BootstrapperStyles +namespace Bloxstrap.Dialogs.BootstrapperDialogs { partial class LegacyDialog2011 { diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2011.cs b/Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2011.cs similarity index 91% rename from Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2011.cs rename to Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2011.cs index cc13bd0..c9dcfdd 100644 --- a/Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2011.cs +++ b/Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2011.cs @@ -1,10 +1,10 @@ using Bloxstrap.Enums; -namespace Bloxstrap.Dialogs.BootstrapperStyles +namespace Bloxstrap.Dialogs.BootstrapperDialogs { // https://youtu.be/3K9oCEMHj2s?t=35 - public partial class LegacyDialog2011 : BootstrapperStyleForm + public partial class LegacyDialog2011 : BootstrapperDialogForm { protected override string _message { diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2011.resx b/Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2011.resx similarity index 100% rename from Bloxstrap/Dialogs/BootstrapperStyles/LegacyDialog2011.resx rename to Bloxstrap/Dialogs/BootstrapperDialogs/LegacyDialog2011.resx diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialog.Designer.cs b/Bloxstrap/Dialogs/BootstrapperDialogs/ProgressDialog.Designer.cs similarity index 99% rename from Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialog.Designer.cs rename to Bloxstrap/Dialogs/BootstrapperDialogs/ProgressDialog.Designer.cs index d884efb..ab3c885 100644 --- a/Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialog.Designer.cs +++ b/Bloxstrap/Dialogs/BootstrapperDialogs/ProgressDialog.Designer.cs @@ -1,4 +1,4 @@ -namespace Bloxstrap.Dialogs.BootstrapperStyles +namespace Bloxstrap.Dialogs.BootstrapperDialogs { partial class ProgressDialog { diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialog.cs b/Bloxstrap/Dialogs/BootstrapperDialogs/ProgressDialog.cs similarity index 55% rename from Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialog.cs rename to Bloxstrap/Dialogs/BootstrapperDialogs/ProgressDialog.cs index 66c8546..fae383c 100644 --- a/Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialog.cs +++ b/Bloxstrap/Dialogs/BootstrapperDialogs/ProgressDialog.cs @@ -1,10 +1,10 @@ using Bloxstrap.Enums; -namespace Bloxstrap.Dialogs.BootstrapperStyles +namespace Bloxstrap.Dialogs.BootstrapperDialogs { // basically just the modern dialog - public partial class ProgressDialog : BootstrapperStyleForm + public partial class ProgressDialog : BootstrapperDialogForm { protected override string _message { @@ -34,6 +34,14 @@ namespace Bloxstrap.Dialogs.BootstrapperStyles { InitializeComponent(); + if (Program.Settings.Theme.GetFinal() == Theme.Dark) + { + this.labelMessage.ForeColor = SystemColors.Window; + this.buttonCancel.Image = Properties.Resources.DarkCancelButton; + this.panel1.BackColor = Color.FromArgb(35, 37, 39); + this.BackColor = Color.FromArgb(25, 27, 29); + } + Bootstrapper = bootstrapper; this.IconBox.BackgroundImage = Program.Settings.BootstrapperIcon.GetBitmap(); @@ -43,12 +51,26 @@ namespace Bloxstrap.Dialogs.BootstrapperStyles private void ButtonCancel_MouseEnter(object sender, EventArgs e) { - this.buttonCancel.Image = Properties.Resources.CancelButtonHover; + if (Program.Settings.Theme.GetFinal() == Theme.Dark) + { + this.buttonCancel.Image = Properties.Resources.DarkCancelButtonHover; + } + else + { + this.buttonCancel.Image = Properties.Resources.CancelButtonHover; + } } private void ButtonCancel_MouseLeave(object sender, EventArgs e) { - this.buttonCancel.Image = Properties.Resources.CancelButton; + if (Program.Settings.Theme.GetFinal() == Theme.Dark) + { + this.buttonCancel.Image = Properties.Resources.DarkCancelButton; + } + else + { + this.buttonCancel.Image = Properties.Resources.CancelButton; + } } private void ProgressDialog_Load(object sender, EventArgs e) diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialog.resx b/Bloxstrap/Dialogs/BootstrapperDialogs/ProgressDialog.resx similarity index 100% rename from Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialog.resx rename to Bloxstrap/Dialogs/BootstrapperDialogs/ProgressDialog.resx diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/VistaDialog.Designer.cs b/Bloxstrap/Dialogs/BootstrapperDialogs/VistaDialog.Designer.cs similarity index 96% rename from Bloxstrap/Dialogs/BootstrapperStyles/VistaDialog.Designer.cs rename to Bloxstrap/Dialogs/BootstrapperDialogs/VistaDialog.Designer.cs index defd569..8f1d397 100644 --- a/Bloxstrap/Dialogs/BootstrapperStyles/VistaDialog.Designer.cs +++ b/Bloxstrap/Dialogs/BootstrapperDialogs/VistaDialog.Designer.cs @@ -1,4 +1,4 @@ -namespace Bloxstrap.Dialogs.BootstrapperStyles +namespace Bloxstrap.Dialogs.BootstrapperDialogs { partial class VistaDialog { diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/VistaDialog.cs b/Bloxstrap/Dialogs/BootstrapperDialogs/VistaDialog.cs similarity index 97% rename from Bloxstrap/Dialogs/BootstrapperStyles/VistaDialog.cs rename to Bloxstrap/Dialogs/BootstrapperDialogs/VistaDialog.cs index bfb288a..c49a6f4 100644 --- a/Bloxstrap/Dialogs/BootstrapperStyles/VistaDialog.cs +++ b/Bloxstrap/Dialogs/BootstrapperDialogs/VistaDialog.cs @@ -1,6 +1,6 @@ using Bloxstrap.Enums; -namespace Bloxstrap.Dialogs.BootstrapperStyles +namespace Bloxstrap.Dialogs.BootstrapperDialogs { // https://youtu.be/h0_AL95Sc3o?t=48 @@ -8,7 +8,7 @@ namespace Bloxstrap.Dialogs.BootstrapperStyles // since taskdialog is part of winforms, it can't really be properly used without a form // for example, cross-threaded calls to ui controls can't really be done outside of a form - public partial class VistaDialog : BootstrapperStyleForm + public partial class VistaDialog : BootstrapperDialogForm { private TaskDialogPage Dialog; diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/VistaDialog.resx b/Bloxstrap/Dialogs/BootstrapperDialogs/VistaDialog.resx similarity index 100% rename from Bloxstrap/Dialogs/BootstrapperStyles/VistaDialog.resx rename to Bloxstrap/Dialogs/BootstrapperDialogs/VistaDialog.resx diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialogDark.Designer.cs b/Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialogDark.Designer.cs deleted file mode 100644 index f08c732..0000000 --- a/Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialogDark.Designer.cs +++ /dev/null @@ -1,128 +0,0 @@ -namespace Bloxstrap.Dialogs.BootstrapperStyles -{ - partial class ProgressDialogDark - { - /// - /// 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() - { - this.ProgressBar = new System.Windows.Forms.ProgressBar(); - this.labelMessage = new System.Windows.Forms.Label(); - this.IconBox = new System.Windows.Forms.PictureBox(); - this.buttonCancel = new System.Windows.Forms.PictureBox(); - this.panel1 = new System.Windows.Forms.Panel(); - ((System.ComponentModel.ISupportInitialize)(this.IconBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.buttonCancel)).BeginInit(); - this.panel1.SuspendLayout(); - this.SuspendLayout(); - // - // ProgressBar - // - this.ProgressBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.ProgressBar.Location = new System.Drawing.Point(29, 241); - this.ProgressBar.MarqueeAnimationSpeed = 20; - this.ProgressBar.Name = "ProgressBar"; - this.ProgressBar.Size = new System.Drawing.Size(460, 20); - this.ProgressBar.Style = System.Windows.Forms.ProgressBarStyle.Marquee; - this.ProgressBar.TabIndex = 0; - // - // labelMessage - // - this.labelMessage.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.labelMessage.ForeColor = System.Drawing.SystemColors.Window; - this.labelMessage.Location = new System.Drawing.Point(29, 199); - this.labelMessage.Name = "labelMessage"; - this.labelMessage.Size = new System.Drawing.Size(460, 18); - this.labelMessage.TabIndex = 1; - this.labelMessage.Text = "Please wait..."; - this.labelMessage.TextAlign = System.Drawing.ContentAlignment.TopCenter; - this.labelMessage.UseMnemonic = false; - // - // IconBox - // - this.IconBox.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.IconBox.ImageLocation = ""; - this.IconBox.Location = new System.Drawing.Point(212, 66); - this.IconBox.Name = "IconBox"; - this.IconBox.Size = new System.Drawing.Size(92, 92); - this.IconBox.TabIndex = 2; - this.IconBox.TabStop = false; - // - // buttonCancel - // - this.buttonCancel.Enabled = false; - this.buttonCancel.Image = global::Bloxstrap.Properties.Resources.DarkCancelButton; - this.buttonCancel.Location = new System.Drawing.Point(194, 264); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(130, 44); - this.buttonCancel.TabIndex = 3; - this.buttonCancel.TabStop = false; - this.buttonCancel.Visible = false; - this.buttonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); - this.buttonCancel.MouseEnter += new System.EventHandler(this.ButtonCancel_MouseEnter); - this.buttonCancel.MouseLeave += new System.EventHandler(this.ButtonCancel_MouseLeave); - // - // panel1 - // - this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(37)))), ((int)(((byte)(39))))); - this.panel1.Controls.Add(this.labelMessage); - this.panel1.Controls.Add(this.IconBox); - this.panel1.Controls.Add(this.buttonCancel); - this.panel1.Controls.Add(this.ProgressBar); - this.panel1.Location = new System.Drawing.Point(1, 1); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(518, 318); - this.panel1.TabIndex = 4; - // - // ProgressDialogDark - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(27)))), ((int)(((byte)(29))))); - this.ClientSize = new System.Drawing.Size(520, 320); - this.Controls.Add(this.panel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.MaximumSize = new System.Drawing.Size(520, 320); - this.MinimumSize = new System.Drawing.Size(520, 320); - this.Name = "ProgressDialogDark"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "ProgressDialog"; - this.Load += new System.EventHandler(this.ProgressDialogDark_Load); - ((System.ComponentModel.ISupportInitialize)(this.IconBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.buttonCancel)).EndInit(); - this.panel1.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private ProgressBar ProgressBar; - private Label labelMessage; - private PictureBox IconBox; - private PictureBox buttonCancel; - private Panel panel1; - } -} \ No newline at end of file diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialogDark.cs b/Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialogDark.cs deleted file mode 100644 index dea9c56..0000000 --- a/Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialogDark.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Bloxstrap.Enums; - -namespace Bloxstrap.Dialogs.BootstrapperStyles -{ - // basically just the modern dialog - - public partial class ProgressDialogDark : BootstrapperStyleForm - { - protected override string _message - { - get => labelMessage.Text; - set => labelMessage.Text = value; - } - - protected override ProgressBarStyle _progressStyle - { - get => ProgressBar.Style; - set => ProgressBar.Style = value; - } - - protected override int _progressValue - { - get => ProgressBar.Value; - set => ProgressBar.Value = value; - } - - protected override bool _cancelEnabled - { - get => this.buttonCancel.Enabled; - set => this.buttonCancel.Enabled = this.buttonCancel.Visible = value; - } - - public ProgressDialogDark(Bootstrapper? bootstrapper = null) - { - InitializeComponent(); - - Bootstrapper = bootstrapper; - - this.IconBox.BackgroundImage = Program.Settings.BootstrapperIcon.GetBitmap(); - - SetupDialog(); - } - - private void ButtonCancel_MouseEnter(object sender, EventArgs e) - { - this.buttonCancel.Image = Properties.Resources.DarkCancelButtonHover; - } - - private void ButtonCancel_MouseLeave(object sender, EventArgs e) - { - this.buttonCancel.Image = Properties.Resources.DarkCancelButton; - } - - private void ProgressDialogDark_Load(object sender, EventArgs e) - { - this.Activate(); - } - } -} diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialogDark.resx b/Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialogDark.resx deleted file mode 100644 index f298a7b..0000000 --- a/Bloxstrap/Dialogs/BootstrapperStyles/ProgressDialogDark.resx +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Bloxstrap/Dialogs/Preferences.Designer.cs b/Bloxstrap/Dialogs/Preferences.Designer.cs deleted file mode 100644 index a2100b6..0000000 --- a/Bloxstrap/Dialogs/Preferences.Designer.cs +++ /dev/null @@ -1,563 +0,0 @@ -namespace Bloxstrap.Dialogs -{ - partial class Preferences - { - /// - /// 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() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Preferences)); - this.label1 = new System.Windows.Forms.Label(); - this.Tabs = new System.Windows.Forms.TabControl(); - this.DialogTab = new System.Windows.Forms.TabPage(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.RFUWebsite = new System.Windows.Forms.LinkLabel(); - this.ToggleRFUAutoclose = new System.Windows.Forms.CheckBox(); - this.ToggleRFUEnabled = new System.Windows.Forms.CheckBox(); - this.groupBox5 = new System.Windows.Forms.GroupBox(); - this.ToggleRPCButtons = new System.Windows.Forms.CheckBox(); - this.ToggleDiscordRichPresence = new System.Windows.Forms.CheckBox(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.IconPreview = new System.Windows.Forms.PictureBox(); - this.IconSelection = new System.Windows.Forms.ListBox(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.StyleSelection = new System.Windows.Forms.ListBox(); - this.InstallationTab = new System.Windows.Forms.TabPage(); - this.groupBox6 = new System.Windows.Forms.GroupBox(); - this.ToggleShowAllChannels = new System.Windows.Forms.CheckBox(); - this.LabelChannelInfo = new System.Windows.Forms.Label(); - this.SelectChannel = new System.Windows.Forms.ComboBox(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.LabelModFolderInstall = new System.Windows.Forms.Label(); - this.ButtonOpenModFolder = new System.Windows.Forms.Button(); - this.ToggleMouseCursor = new System.Windows.Forms.CheckBox(); - this.ToggleDeathSound = new System.Windows.Forms.CheckBox(); - this.GroupBoxInstallLocation = new System.Windows.Forms.GroupBox(); - this.InstallLocationBrowseButton = new System.Windows.Forms.Button(); - this.InstallLocation = new System.Windows.Forms.TextBox(); - this.SaveButton = new System.Windows.Forms.Button(); - this.panel1 = new System.Windows.Forms.Panel(); - this.ToggleCheckForUpdates = new System.Windows.Forms.CheckBox(); - this.PreviewButton = new System.Windows.Forms.Button(); - this.InstallLocationBrowseDialog = new System.Windows.Forms.FolderBrowserDialog(); - this.InfoTooltip = new System.Windows.Forms.ToolTip(this.components); - this.label2 = new System.Windows.Forms.Label(); - this.Tabs.SuspendLayout(); - this.DialogTab.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.groupBox5.SuspendLayout(); - this.groupBox3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.IconPreview)).BeginInit(); - this.groupBox2.SuspendLayout(); - this.InstallationTab.SuspendLayout(); - this.groupBox6.SuspendLayout(); - this.groupBox4.SuspendLayout(); - this.GroupBoxInstallLocation.SuspendLayout(); - this.panel1.SuspendLayout(); - this.SuspendLayout(); - // - // label1 - // - this.label1.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.label1.ForeColor = System.Drawing.Color.Navy; - this.label1.Location = new System.Drawing.Point(8, 9); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(237, 23); - this.label1.TabIndex = 1; - this.label1.Text = "Configure Bloxstrap"; - // - // Tabs - // - this.Tabs.Controls.Add(this.DialogTab); - this.Tabs.Controls.Add(this.InstallationTab); - this.Tabs.Location = new System.Drawing.Point(12, 62); - this.Tabs.Name = "Tabs"; - this.Tabs.SelectedIndex = 0; - this.Tabs.Size = new System.Drawing.Size(442, 247); - this.Tabs.TabIndex = 2; - // - // DialogTab - // - this.DialogTab.Controls.Add(this.groupBox1); - this.DialogTab.Controls.Add(this.groupBox5); - this.DialogTab.Controls.Add(this.groupBox3); - this.DialogTab.Controls.Add(this.groupBox2); - this.DialogTab.Location = new System.Drawing.Point(4, 24); - this.DialogTab.Name = "DialogTab"; - this.DialogTab.Padding = new System.Windows.Forms.Padding(3); - this.DialogTab.Size = new System.Drawing.Size(434, 219); - this.DialogTab.TabIndex = 0; - this.DialogTab.Text = "Bootstrapper"; - this.DialogTab.UseVisualStyleBackColor = true; - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.RFUWebsite); - this.groupBox1.Controls.Add(this.ToggleRFUAutoclose); - this.groupBox1.Controls.Add(this.ToggleRFUEnabled); - this.groupBox1.Location = new System.Drawing.Point(192, 146); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(235, 67); - this.groupBox1.TabIndex = 8; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "FPS Unlocker"; - // - // RFUWebsite - // - this.RFUWebsite.BackColor = System.Drawing.Color.White; - this.RFUWebsite.Cursor = System.Windows.Forms.Cursors.Hand; - this.RFUWebsite.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; - this.RFUWebsite.Location = new System.Drawing.Point(174, 0); - this.RFUWebsite.Margin = new System.Windows.Forms.Padding(0); - this.RFUWebsite.Name = "RFUWebsite"; - this.RFUWebsite.Size = new System.Drawing.Size(55, 18); - this.RFUWebsite.TabIndex = 2; - this.RFUWebsite.TabStop = true; - this.RFUWebsite.Tag = ""; - this.RFUWebsite.Text = "(website)"; - this.RFUWebsite.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.RFUWebsite_LinkClicked); - // - // ToggleRFUAutoclose - // - this.ToggleRFUAutoclose.AutoSize = true; - this.ToggleRFUAutoclose.Enabled = false; - this.ToggleRFUAutoclose.Location = new System.Drawing.Point(9, 40); - this.ToggleRFUAutoclose.Name = "ToggleRFUAutoclose"; - this.ToggleRFUAutoclose.Size = new System.Drawing.Size(209, 19); - this.ToggleRFUAutoclose.TabIndex = 1; - this.ToggleRFUAutoclose.Text = "Automatically close on Roblox exit"; - this.InfoTooltip.SetToolTip(this.ToggleRFUAutoclose, "If enabled, rbxfpsunlocker will automatically close when Roblox is closed."); - this.ToggleRFUAutoclose.UseVisualStyleBackColor = true; - this.ToggleRFUAutoclose.CheckedChanged += new System.EventHandler(this.ToggleRFUAutoclose_CheckedChanged); - // - // ToggleRFUEnabled - // - this.ToggleRFUEnabled.AutoSize = true; - this.ToggleRFUEnabled.Location = new System.Drawing.Point(9, 19); - this.ToggleRFUEnabled.Name = "ToggleRFUEnabled"; - this.ToggleRFUEnabled.Size = new System.Drawing.Size(127, 19); - this.ToggleRFUEnabled.TabIndex = 0; - this.ToggleRFUEnabled.Text = "Use rbxfpsunlocker"; - this.InfoTooltip.SetToolTip(this.ToggleRFUEnabled, "If enabled, rbxfpsunlocker is downloaded.\r\nWhen Roblox is started, rbxfpsunlocker" + - " will automatically start too, \r\nbeing minimized to your system tray by default." + - ""); - this.ToggleRFUEnabled.UseVisualStyleBackColor = true; - this.ToggleRFUEnabled.CheckedChanged += new System.EventHandler(this.ToggleRFUEnabled_CheckedChanged); - // - // groupBox5 - // - this.groupBox5.Controls.Add(this.ToggleRPCButtons); - this.groupBox5.Controls.Add(this.ToggleDiscordRichPresence); - this.groupBox5.Location = new System.Drawing.Point(5, 146); - this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(179, 67); - this.groupBox5.TabIndex = 7; - this.groupBox5.TabStop = false; - this.groupBox5.Text = "Discord Rich Presence"; - // - // ToggleRPCButtons - // - this.ToggleRPCButtons.AutoSize = true; - this.ToggleRPCButtons.Location = new System.Drawing.Point(9, 40); - this.ToggleRPCButtons.Name = "ToggleRPCButtons"; - this.ToggleRPCButtons.Size = new System.Drawing.Size(155, 19); - this.ToggleRPCButtons.TabIndex = 1; - this.ToggleRPCButtons.Text = "Hide interaction buttons"; - this.InfoTooltip.SetToolTip(this.ToggleRPCButtons, "Choose whether the buttons to play/view game details should be hidden from your a" + - "ctivity status."); - this.ToggleRPCButtons.UseVisualStyleBackColor = true; - this.ToggleRPCButtons.CheckedChanged += new System.EventHandler(this.ToggleRPCButtons_CheckedChanged); - // - // ToggleDiscordRichPresence - // - this.ToggleDiscordRichPresence.AutoSize = true; - this.ToggleDiscordRichPresence.Checked = true; - this.ToggleDiscordRichPresence.CheckState = System.Windows.Forms.CheckState.Checked; - this.ToggleDiscordRichPresence.Location = new System.Drawing.Point(9, 19); - this.ToggleDiscordRichPresence.Name = "ToggleDiscordRichPresence"; - this.ToggleDiscordRichPresence.Size = new System.Drawing.Size(129, 19); - this.ToggleDiscordRichPresence.TabIndex = 0; - this.ToggleDiscordRichPresence.Text = "Show game activity"; - this.InfoTooltip.SetToolTip(this.ToggleDiscordRichPresence, "Choose whether to show what game you\'re playing on your Discord activity status.\r" + - "\nThis will only work when you launch a game from the website, and is not support" + - "ed in the Beta App."); - this.ToggleDiscordRichPresence.UseVisualStyleBackColor = true; - this.ToggleDiscordRichPresence.CheckedChanged += new System.EventHandler(this.ToggleDiscordRichPresence_CheckedChanged); - // - // groupBox3 - // - this.groupBox3.Controls.Add(this.IconPreview); - this.groupBox3.Controls.Add(this.IconSelection); - this.groupBox3.Location = new System.Drawing.Point(192, 3); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(235, 140); - this.groupBox3.TabIndex = 6; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "Icon"; - // - // IconPreview - // - this.IconPreview.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.IconPreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.IconPreview.Location = new System.Drawing.Point(117, 21); - this.IconPreview.Name = "IconPreview"; - this.IconPreview.Size = new System.Drawing.Size(109, 109); - this.IconPreview.TabIndex = 3; - this.IconPreview.TabStop = false; - // - // IconSelection - // - this.IconSelection.FormattingEnabled = true; - this.IconSelection.ItemHeight = 15; - this.IconSelection.Location = new System.Drawing.Point(9, 21); - this.IconSelection.Name = "IconSelection"; - this.IconSelection.Size = new System.Drawing.Size(100, 109); - this.IconSelection.TabIndex = 4; - this.InfoTooltip.SetToolTip(this.IconSelection, "Choose what icon the bootstrapper should use."); - this.IconSelection.SelectedIndexChanged += new System.EventHandler(this.IconSelection_SelectedIndexChanged); - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.StyleSelection); - this.groupBox2.Location = new System.Drawing.Point(5, 3); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(179, 140); - this.groupBox2.TabIndex = 5; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Style"; - // - // StyleSelection - // - this.StyleSelection.FormattingEnabled = true; - this.StyleSelection.ItemHeight = 15; - this.StyleSelection.Location = new System.Drawing.Point(9, 21); - this.StyleSelection.Name = "StyleSelection"; - this.StyleSelection.Size = new System.Drawing.Size(161, 109); - this.StyleSelection.TabIndex = 3; - this.InfoTooltip.SetToolTip(this.StyleSelection, "Choose how the bootstrapper dialog should look.\r\nYou can use the \'Preview\' button" + - " to preview the bootstrapper look."); - this.StyleSelection.SelectedIndexChanged += new System.EventHandler(this.StyleSelection_SelectedIndexChanged); - // - // InstallationTab - // - this.InstallationTab.Controls.Add(this.groupBox6); - this.InstallationTab.Controls.Add(this.groupBox4); - this.InstallationTab.Controls.Add(this.GroupBoxInstallLocation); - this.InstallationTab.Location = new System.Drawing.Point(4, 24); - this.InstallationTab.Name = "InstallationTab"; - this.InstallationTab.Padding = new System.Windows.Forms.Padding(3); - this.InstallationTab.Size = new System.Drawing.Size(434, 219); - this.InstallationTab.TabIndex = 2; - this.InstallationTab.Text = "Installation"; - this.InstallationTab.UseVisualStyleBackColor = true; - // - // groupBox6 - // - this.groupBox6.Controls.Add(this.ToggleShowAllChannels); - this.groupBox6.Controls.Add(this.LabelChannelInfo); - this.groupBox6.Controls.Add(this.SelectChannel); - this.groupBox6.Location = new System.Drawing.Point(5, 158); - this.groupBox6.Name = "groupBox6"; - this.groupBox6.Size = new System.Drawing.Size(422, 56); - this.groupBox6.TabIndex = 3; - this.groupBox6.TabStop = false; - this.groupBox6.Text = "Build Channel"; - // - // ToggleShowAllChannels - // - this.ToggleShowAllChannels.AutoSize = true; - this.ToggleShowAllChannels.BackColor = System.Drawing.Color.White; - this.ToggleShowAllChannels.Location = new System.Drawing.Point(289, 0); - this.ToggleShowAllChannels.Name = "ToggleShowAllChannels"; - this.ToggleShowAllChannels.Padding = new System.Windows.Forms.Padding(7, 0, 0, 0); - this.ToggleShowAllChannels.Size = new System.Drawing.Size(127, 19); - this.ToggleShowAllChannels.TabIndex = 2; - this.ToggleShowAllChannels.Text = "Show all channels"; - this.ToggleShowAllChannels.UseVisualStyleBackColor = false; - this.ToggleShowAllChannels.CheckedChanged += new System.EventHandler(this.ToggleShowAllChannels_CheckedChanged); - // - // LabelChannelInfo - // - this.LabelChannelInfo.Location = new System.Drawing.Point(134, 18); - this.LabelChannelInfo.Name = "LabelChannelInfo"; - this.LabelChannelInfo.Size = new System.Drawing.Size(282, 28); - this.LabelChannelInfo.TabIndex = 1; - this.LabelChannelInfo.Text = "Getting latest deploy, please wait..."; - this.LabelChannelInfo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // SelectChannel - // - this.SelectChannel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.SelectChannel.DropDownWidth = 265; - this.SelectChannel.FormattingEnabled = true; - this.SelectChannel.Location = new System.Drawing.Point(9, 21); - this.SelectChannel.Name = "SelectChannel"; - this.SelectChannel.Size = new System.Drawing.Size(120, 23); - this.SelectChannel.TabIndex = 0; - this.InfoTooltip.SetToolTip(this.SelectChannel, resources.GetString("SelectChannel.ToolTip")); - this.SelectChannel.SelectedValueChanged += new System.EventHandler(this.SelectChannel_SelectedValueChanged); - // - // groupBox4 - // - this.groupBox4.Controls.Add(this.LabelModFolderInstall); - this.groupBox4.Controls.Add(this.ButtonOpenModFolder); - this.groupBox4.Controls.Add(this.ToggleMouseCursor); - this.groupBox4.Controls.Add(this.ToggleDeathSound); - this.groupBox4.Location = new System.Drawing.Point(5, 60); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(422, 95); - this.groupBox4.TabIndex = 2; - this.groupBox4.TabStop = false; - this.groupBox4.Text = "Modifications"; - // - // LabelModFolderInstall - // - this.LabelModFolderInstall.AutoSize = true; - this.LabelModFolderInstall.Location = new System.Drawing.Point(6, 67); - this.LabelModFolderInstall.Margin = new System.Windows.Forms.Padding(0); - this.LabelModFolderInstall.Name = "LabelModFolderInstall"; - this.LabelModFolderInstall.Size = new System.Drawing.Size(329, 15); - this.LabelModFolderInstall.TabIndex = 7; - this.LabelModFolderInstall.Text = "Other modifications can be added once Bloxstrap is installed."; - this.LabelModFolderInstall.Visible = false; - // - // ButtonOpenModFolder - // - this.ButtonOpenModFolder.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.ButtonOpenModFolder.Location = new System.Drawing.Point(8, 62); - this.ButtonOpenModFolder.Name = "ButtonOpenModFolder"; - this.ButtonOpenModFolder.Size = new System.Drawing.Size(122, 25); - this.ButtonOpenModFolder.TabIndex = 6; - this.ButtonOpenModFolder.Text = "Open Mod Folder"; - this.InfoTooltip.SetToolTip(this.ButtonOpenModFolder, "Open the folder for applying Roblox client modifications."); - this.ButtonOpenModFolder.UseVisualStyleBackColor = true; - this.ButtonOpenModFolder.Click += new System.EventHandler(this.ButtonOpenModFolder_Click); - // - // ToggleMouseCursor - // - this.ToggleMouseCursor.AutoSize = true; - this.ToggleMouseCursor.Location = new System.Drawing.Point(9, 40); - this.ToggleMouseCursor.Margin = new System.Windows.Forms.Padding(2); - this.ToggleMouseCursor.Name = "ToggleMouseCursor"; - this.ToggleMouseCursor.Size = new System.Drawing.Size(140, 19); - this.ToggleMouseCursor.TabIndex = 2; - this.ToggleMouseCursor.Text = "Use old mouse cursor"; - this.ToggleMouseCursor.UseVisualStyleBackColor = true; - this.ToggleMouseCursor.CheckedChanged += new System.EventHandler(this.ToggleMouseCursor_CheckedChanged); - // - // ToggleDeathSound - // - this.ToggleDeathSound.AutoSize = true; - this.ToggleDeathSound.Checked = true; - this.ToggleDeathSound.CheckState = System.Windows.Forms.CheckState.Checked; - this.ToggleDeathSound.Location = new System.Drawing.Point(9, 19); - this.ToggleDeathSound.Margin = new System.Windows.Forms.Padding(2); - this.ToggleDeathSound.Name = "ToggleDeathSound"; - this.ToggleDeathSound.Size = new System.Drawing.Size(134, 19); - this.ToggleDeathSound.TabIndex = 1; - this.ToggleDeathSound.Text = "Use old death sound"; - this.ToggleDeathSound.UseVisualStyleBackColor = true; - this.ToggleDeathSound.CheckedChanged += new System.EventHandler(this.ToggleDeathSound_CheckedChanged); - // - // GroupBoxInstallLocation - // - this.GroupBoxInstallLocation.Controls.Add(this.InstallLocationBrowseButton); - this.GroupBoxInstallLocation.Controls.Add(this.InstallLocation); - this.GroupBoxInstallLocation.Location = new System.Drawing.Point(5, 3); - this.GroupBoxInstallLocation.Name = "GroupBoxInstallLocation"; - this.GroupBoxInstallLocation.Size = new System.Drawing.Size(422, 54); - this.GroupBoxInstallLocation.TabIndex = 0; - this.GroupBoxInstallLocation.TabStop = false; - this.GroupBoxInstallLocation.Text = "Location"; - // - // InstallLocationBrowseButton - // - this.InstallLocationBrowseButton.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.InstallLocationBrowseButton.Location = new System.Drawing.Point(335, 20); - this.InstallLocationBrowseButton.Name = "InstallLocationBrowseButton"; - this.InstallLocationBrowseButton.Size = new System.Drawing.Size(79, 25); - this.InstallLocationBrowseButton.TabIndex = 5; - this.InstallLocationBrowseButton.Text = "Browse..."; - this.InstallLocationBrowseButton.UseVisualStyleBackColor = true; - this.InstallLocationBrowseButton.Click += new System.EventHandler(this.InstallLocationBrowseButton_Click); - // - // InstallLocation - // - this.InstallLocation.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.InstallLocation.Location = new System.Drawing.Point(9, 21); - this.InstallLocation.MaxLength = 255; - this.InstallLocation.Name = "InstallLocation"; - this.InstallLocation.Size = new System.Drawing.Size(319, 23); - this.InstallLocation.TabIndex = 4; - this.InfoTooltip.SetToolTip(this.InstallLocation, "Choose where Bloxstrap should install to.\r\nThis is useful if you typically instal" + - "l all your games to a separate storage drive."); - // - // SaveButton - // - this.SaveButton.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.SaveButton.Location = new System.Drawing.Point(380, 9); - this.SaveButton.Name = "SaveButton"; - this.SaveButton.Size = new System.Drawing.Size(73, 23); - this.SaveButton.TabIndex = 6; - this.SaveButton.Text = "Save"; - this.SaveButton.UseVisualStyleBackColor = true; - this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click); - // - // panel1 - // - this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.panel1.BackColor = System.Drawing.SystemColors.Control; - this.panel1.Controls.Add(this.ToggleCheckForUpdates); - this.panel1.Controls.Add(this.PreviewButton); - this.panel1.Controls.Add(this.SaveButton); - this.panel1.Location = new System.Drawing.Point(-1, 320); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(466, 42); - this.panel1.TabIndex = 6; - // - // ToggleCheckForUpdates - // - this.ToggleCheckForUpdates.AutoSize = true; - this.ToggleCheckForUpdates.Checked = true; - this.ToggleCheckForUpdates.CheckState = System.Windows.Forms.CheckState.Checked; - this.ToggleCheckForUpdates.Location = new System.Drawing.Point(14, 12); - this.ToggleCheckForUpdates.Name = "ToggleCheckForUpdates"; - this.ToggleCheckForUpdates.Size = new System.Drawing.Size(179, 19); - this.ToggleCheckForUpdates.TabIndex = 7; - this.ToggleCheckForUpdates.Text = "Check for updates on startup"; - this.ToggleCheckForUpdates.UseVisualStyleBackColor = true; - this.ToggleCheckForUpdates.CheckedChanged += new System.EventHandler(this.ToggleCheckForUpdates_CheckedChanged); - // - // PreviewButton - // - this.PreviewButton.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.PreviewButton.Location = new System.Drawing.Point(297, 9); - this.PreviewButton.Name = "PreviewButton"; - this.PreviewButton.Size = new System.Drawing.Size(73, 23); - this.PreviewButton.TabIndex = 5; - this.PreviewButton.Text = "Preview"; - this.PreviewButton.UseVisualStyleBackColor = true; - this.PreviewButton.Click += new System.EventHandler(this.PreviewButton_Click); - // - // InfoTooltip - // - this.InfoTooltip.AutomaticDelay = 0; - this.InfoTooltip.AutoPopDelay = 16000; - this.InfoTooltip.InitialDelay = 500; - this.InfoTooltip.ReshowDelay = 82; - this.InfoTooltip.ShowAlways = true; - this.InfoTooltip.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info; - this.InfoTooltip.ToolTipTitle = "Information"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(9, 35); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(234, 15); - this.label2.TabIndex = 7; - this.label2.Text = "Hover over an option for more information"; - // - // Preferences - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Window; - this.ClientSize = new System.Drawing.Size(464, 361); - this.Controls.Add(this.label2); - this.Controls.Add(this.panel1); - this.Controls.Add(this.Tabs); - this.Controls.Add(this.label1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "Preferences"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Preferences"; - this.Load += new System.EventHandler(this.Preferences_Load); - this.Tabs.ResumeLayout(false); - this.DialogTab.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.groupBox5.ResumeLayout(false); - this.groupBox5.PerformLayout(); - this.groupBox3.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.IconPreview)).EndInit(); - this.groupBox2.ResumeLayout(false); - this.InstallationTab.ResumeLayout(false); - this.groupBox6.ResumeLayout(false); - this.groupBox6.PerformLayout(); - this.groupBox4.ResumeLayout(false); - this.groupBox4.PerformLayout(); - this.GroupBoxInstallLocation.ResumeLayout(false); - this.GroupBoxInstallLocation.PerformLayout(); - this.panel1.ResumeLayout(false); - this.panel1.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private Label label1; - private TabControl Tabs; - private TabPage DialogTab; - private TabPage InstallationTab; - private Button SaveButton; - private Panel panel1; - private ListBox StyleSelection; - private GroupBox GroupBoxInstallLocation; - private Button InstallLocationBrowseButton; - private TextBox InstallLocation; - private FolderBrowserDialog InstallLocationBrowseDialog; - private GroupBox groupBox2; - private GroupBox groupBox3; - private PictureBox IconPreview; - private ListBox IconSelection; - private Button PreviewButton; - private CheckBox ToggleDeathSound; - private GroupBox groupBox4; - private GroupBox groupBox5; - private CheckBox ToggleDiscordRichPresence; - private ToolTip InfoTooltip; - private CheckBox ToggleMouseCursor; - private CheckBox ToggleRPCButtons; - private GroupBox groupBox1; - private LinkLabel RFUWebsite; - private CheckBox ToggleRFUAutoclose; - private CheckBox ToggleRFUEnabled; - private CheckBox ToggleCheckForUpdates; - private Button ButtonOpenModFolder; - private Label LabelModFolderInstall; - private GroupBox groupBox6; - private ComboBox SelectChannel; - private Label LabelChannelInfo; - private CheckBox ToggleShowAllChannels; - private Label label2; - } -} \ No newline at end of file diff --git a/Bloxstrap/Dialogs/Preferences.cs b/Bloxstrap/Dialogs/Preferences.cs deleted file mode 100644 index 1e9d8ab..0000000 --- a/Bloxstrap/Dialogs/Preferences.cs +++ /dev/null @@ -1,297 +0,0 @@ -using System.IO; -using System.Diagnostics; - -using Microsoft.Win32; - -using Bloxstrap.Enums; -using Bloxstrap.Helpers; -using Bloxstrap.Helpers.Integrations; -using Bloxstrap.Models; - -namespace Bloxstrap.Dialogs -{ - public partial class Preferences : Form - { - #region Properties - private static readonly IReadOnlyDictionary SelectableStyles = new Dictionary() - { - { "Vista (2009 - 2011)", BootstrapperStyle.VistaDialog }, - { "Legacy (2009 - 2011)", BootstrapperStyle.LegacyDialog2009 }, - { "Legacy (2011 - 2014)", BootstrapperStyle.LegacyDialog2011 }, - { "Progress (~2014)", BootstrapperStyle.ProgressDialog }, - { "Progress (Dark)", BootstrapperStyle.ProgressDialogDark }, - }; - - private static readonly IReadOnlyDictionary SelectableIcons = new Dictionary() - { - { "Bloxstrap", BootstrapperIcon.IconBloxstrap }, - { "2009", BootstrapperIcon.Icon2009 }, - { "2011", BootstrapperIcon.Icon2011 }, - { "2015", BootstrapperIcon.IconEarly2015 }, - { "2016", BootstrapperIcon.IconLate2015 }, - { "2017", BootstrapperIcon.Icon2017 }, - { "2019", BootstrapperIcon.Icon2019 }, - { "2022", BootstrapperIcon.Icon2022 } - }; - - private string ChannelInfo - { - set - { - if (this.InvokeRequired) - { - this.Invoke(() => this.LabelChannelInfo.Text = value); - } - else - { - this.LabelChannelInfo.Text = value; - } - } - } - #endregion - - #region Core - private async Task GetChannelInfo(string channel) - { - ChannelInfo = "Getting latest version, please wait..."; - - VersionDeploy info = await DeployManager.GetLastDeploy(channel); - - if (info.FileVersion is null || info.Timestamp is null) - return; - - string strTimestamp = info.Timestamp.Value.ToString("MM/dd/yyyy h:mm:ss tt", Program.CultureFormat); - - ChannelInfo = $"Latest version:\nv{info.FileVersion} @ {strTimestamp}"; - } - - public Preferences() - { - InitializeComponent(); - - Program.SettingsManager.ShouldSave = false; - - this.Icon = Properties.Resources.IconBloxstrap_ico; - this.Text = Program.ProjectName; - - if (Program.IsFirstRun) - { - this.SaveButton.Text = "Install"; - this.InstallLocation.Text = Path.Combine(Program.LocalAppData, Program.ProjectName); - this.ButtonOpenModFolder.Visible = false; - this.LabelModFolderInstall.Visible = true; - } - else - { - this.InstallLocation.Text = Program.BaseDirectory; - } - - if (!Environment.Is64BitOperatingSystem) - this.ToggleRFUEnabled.Enabled = false; - - // set data sources for list controls - this.StyleSelection.DataSource = SelectableStyles.Keys.ToList(); - this.IconSelection.DataSource = SelectableIcons.Keys.ToList(); - - if (DeployManager.ChannelsAbstracted.Contains(Program.Settings.Channel)) - this.SelectChannel.DataSource = DeployManager.ChannelsAbstracted; - else - this.ToggleShowAllChannels.Checked = true; - - // populate preferences - this.StyleSelection.Text = SelectableStyles.FirstOrDefault(x => x.Value == Program.Settings.BootstrapperStyle).Key; - this.IconSelection.Text = SelectableIcons.FirstOrDefault(x => x.Value == Program.Settings.BootstrapperIcon).Key; - - this.ToggleCheckForUpdates.Checked = Program.Settings.CheckForUpdates; - - this.ToggleDiscordRichPresence.Checked = Program.Settings.UseDiscordRichPresence; - this.ToggleRPCButtons.Checked = Program.Settings.HideRPCButtons; - - this.ToggleRFUEnabled.Checked = Program.Settings.RFUEnabled; - this.ToggleRFUAutoclose.Checked = Program.Settings.RFUAutoclose; - - this.ToggleDeathSound.Checked = Program.Settings.UseOldDeathSound; - this.ToggleMouseCursor.Checked = Program.Settings.UseOldMouseCursor; - - this.SelectChannel.Text = Program.Settings.Channel; - } - #endregion - - #region Dialog Events - private void ToggleShowAllChannels_CheckedChanged(object sender, EventArgs e) - { - if (this.ToggleShowAllChannels.Checked) - this.SelectChannel.DataSource = DeployManager.ChannelsAll; - else - this.SelectChannel.DataSource = DeployManager.ChannelsAbstracted; - - } - - private void SaveButton_Click(object sender, EventArgs e) - { - string installLocation = this.InstallLocation.Text; - - if (String.IsNullOrEmpty(installLocation)) - { - Program.ShowMessageBox("You must set an install location", MessageBoxIcon.Error); - return; - } - - try - { - // check if we can write to the directory (a bit hacky but eh) - - string testPath = installLocation; - string testFile = Path.Combine(installLocation, "BloxstrapWriteTest.txt"); - bool testPathExists = Directory.Exists(testPath); - - if (!testPathExists) - Directory.CreateDirectory(testPath); - - File.WriteAllText(testFile, "hi"); - File.Delete(testFile); - - if (!testPathExists) - Directory.Delete(testPath); - } - catch (UnauthorizedAccessException) - { - Program.ShowMessageBox($"{Program.ProjectName} does not have write access to the install location you selected. Please choose another install location.", MessageBoxIcon.Error); - return; - } - catch (Exception ex) - { - Program.ShowMessageBox(ex.Message, MessageBoxIcon.Error); - return; - } - - if (Program.IsFirstRun) - { - // this will be set in the registry after first install - Program.BaseDirectory = installLocation; - } - else - { - Program.SettingsManager.ShouldSave = true; - - if (Program.BaseDirectory is not null && Program.BaseDirectory != installLocation) - { - Program.ShowMessageBox($"{Program.ProjectName} will install to the new location you've set the next time it runs.", MessageBoxIcon.Information); - - Program.Settings.VersionGuid = ""; - - using (RegistryKey registryKey = Registry.CurrentUser.CreateSubKey($@"Software\{Program.ProjectName}")) - { - registryKey.SetValue("InstallLocation", installLocation); - registryKey.SetValue("OldInstallLocation", Program.BaseDirectory); - } - - // preserve settings - // we don't need to copy the bootstrapper over since the install process will do that automatically - - Program.SettingsManager.Save(); - - File.Copy(Path.Combine(Program.BaseDirectory, "Settings.json"), Path.Combine(installLocation, "Settings.json")); - } - } - - this.Close(); - } - - private void PreviewButton_Click(object sender, EventArgs e) - { - this.Visible = false; - Program.Settings.BootstrapperStyle.Show(); - this.Visible = true; - } - - private void Preferences_Load(object sender, EventArgs e) - { - this.Activate(); - } - #endregion - - #region Preference Events - private void StyleSelection_SelectedIndexChanged(object sender, EventArgs e) - { - if (!this.Visible) - return; - - Program.Settings.BootstrapperStyle = SelectableStyles[this.StyleSelection.Text]; - } - - private void IconSelection_SelectedIndexChanged(object sender, EventArgs e) - { - BootstrapperIcon icon = SelectableIcons[this.IconSelection.Text]; - - this.IconPreview.BackgroundImage = icon.GetBitmap(); - - if (!this.Visible) - return; - - Program.Settings.BootstrapperIcon = icon; - } - - private void ToggleDiscordRichPresence_CheckedChanged(object sender, EventArgs e) - { - Program.Settings.UseDiscordRichPresence = this.ToggleRPCButtons.Enabled = this.ToggleDiscordRichPresence.Checked; - } - - private void ToggleRPCButtons_CheckedChanged(object sender, EventArgs e) - { - Program.Settings.HideRPCButtons = this.ToggleRPCButtons.Checked; - } - - private void RFUWebsite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - Utilities.OpenWebsite($"https://github.com/{RbxFpsUnlocker.ProjectRepository}"); - } - - private void ToggleRFUEnabled_CheckedChanged(object sender, EventArgs e) - { - Program.Settings.RFUEnabled = this.ToggleRFUAutoclose.Enabled = this.ToggleRFUEnabled.Checked; - } - - private void ToggleRFUAutoclose_CheckedChanged(object sender, EventArgs e) - { - Program.Settings.RFUAutoclose = this.ToggleRFUAutoclose.Checked; - } - - private void InstallLocationBrowseButton_Click(object sender, EventArgs e) - { - DialogResult result = this.InstallLocationBrowseDialog.ShowDialog(); - - if (result == DialogResult.OK) - this.InstallLocation.Text = this.InstallLocationBrowseDialog.SelectedPath; - } - - private void ToggleDeathSound_CheckedChanged(object sender, EventArgs e) - { - Program.Settings.UseOldDeathSound = this.ToggleDeathSound.Checked; - } - - private void ToggleMouseCursor_CheckedChanged(object sender, EventArgs e) - { - Program.Settings.UseOldMouseCursor = this.ToggleMouseCursor.Checked; - } - - private void ButtonOpenModFolder_Click(object sender, EventArgs e) - { - Process.Start("explorer.exe", Directories.Modifications); - } - - private void SelectChannel_SelectedValueChanged(object sender, EventArgs e) - { - if (this.Visible) - Program.Settings.Channel = this.SelectChannel.Text; - - Task.Run(() => GetChannelInfo(Program.Settings.Channel)); - } - - private void ToggleCheckForUpdates_CheckedChanged(object sender, EventArgs e) - { - Program.Settings.CheckForUpdates = this.ToggleCheckForUpdates.Checked; - } - #endregion - } -} diff --git a/Bloxstrap/Dialogs/Preferences.resx b/Bloxstrap/Dialogs/Preferences.resx deleted file mode 100644 index 1f348c9..0000000 --- a/Bloxstrap/Dialogs/Preferences.resx +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 222, 17 - - - Choose what build channel to install Roblox from. -You really shouldn't change this if you don't have to. - -Channels to note: -The default channel is LIVE. -ZCanary is equivalent to sitetest1. -ZIntegration is equivalent to sitetest2. - - - - - 17, 17 - - \ No newline at end of file diff --git a/Bloxstrap/Dialogs/Preferences.xaml b/Bloxstrap/Dialogs/Preferences.xaml new file mode 100644 index 0000000..bfd73f2 --- /dev/null +++ b/Bloxstrap/Dialogs/Preferences.xaml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +