Add revamped config menu w/ WPF and theming

This commit is contained in:
pizzaboxer 2022-10-04 22:03:38 +01:00
parent a160efaf98
commit 350b655060
38 changed files with 18905 additions and 1227 deletions

View File

@ -4,13 +4,14 @@
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<ImplicitUsings>enable</ImplicitUsings>
<PlatformTarget>AnyCPU</PlatformTarget>
<Platforms>AnyCPU;x86</Platforms>
<ApplicationIcon>Bloxstrap.ico</ApplicationIcon>
<Version>1.4.4</Version>
<FileVersion>1.4.4.0</FileVersion>
<Version>1.5.0</Version>
<FileVersion>1.5.0.0</FileVersion>
</PropertyGroup>
<ItemGroup>
@ -26,8 +27,7 @@
</ItemGroup>
<ItemGroup>
<Compile Update="Dialogs\BootstrapperStyles\LegacyDialog2009.cs" />
<Compile Update="Dialogs\BootstrapperStyles\ProgressDialogDark.cs" />
<Compile Update="Dialogs\BootstrapperDialogs\LegacyDialog2009.cs" />
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>

View File

@ -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

View File

@ -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

View File

@ -1,6 +1,4 @@
using Bloxstrap.Helpers.RSMM;
namespace Bloxstrap.Dialogs.BootstrapperStyles
namespace Bloxstrap.Dialogs.BootstrapperDialogs
{
public interface IBootstrapperDialog
{

View File

@ -1,4 +1,4 @@
namespace Bloxstrap.Dialogs.BootstrapperStyles
namespace Bloxstrap.Dialogs.BootstrapperDialogs
{
partial class LegacyDialog2009
{

View File

@ -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
{

View File

@ -1,4 +1,4 @@
namespace Bloxstrap.Dialogs.BootstrapperStyles
namespace Bloxstrap.Dialogs.BootstrapperDialogs
{
partial class LegacyDialog2011
{

View File

@ -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
{

View File

@ -1,4 +1,4 @@
namespace Bloxstrap.Dialogs.BootstrapperStyles
namespace Bloxstrap.Dialogs.BootstrapperDialogs
{
partial class ProgressDialog
{

View File

@ -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)

View File

@ -1,4 +1,4 @@
namespace Bloxstrap.Dialogs.BootstrapperStyles
namespace Bloxstrap.Dialogs.BootstrapperDialogs
{
partial class VistaDialog
{

View File

@ -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;

View File

@ -1,128 +0,0 @@
namespace Bloxstrap.Dialogs.BootstrapperStyles
{
partial class ProgressDialogDark
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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;
}
}

View File

@ -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();
}
}
}

View File

@ -1,60 +0,0 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,563 +0,0 @@
namespace Bloxstrap.Dialogs
{
partial class Preferences
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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;
}
}

View File

@ -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<string, BootstrapperStyle> SelectableStyles = new Dictionary<string, BootstrapperStyle>()
{
{ "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<string, BootstrapperIcon> SelectableIcons = new Dictionary<string, BootstrapperIcon>()
{
{ "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
}
}

View File

@ -1,77 +0,0 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="InfoTooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>222, 17</value>
</metadata>
<data name="SelectChannel.ToolTip" xml:space="preserve">
<value>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.
</value>
</data>
<metadata name="InstallLocationBrowseDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,121 @@
<Window x:Class="Bloxstrap.Dialogs.Preferences"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Bloxstrap.Dialogs"
mc:Ignorable="d"
Style="{DynamicResource MainWindowStyle}"
Title="PreferencesWPF"
SizeToContent="WidthAndHeight"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--<ResourceDictionary Source="Themes\ColourfulDarkTheme.xaml" />-->
<ResourceDictionary Source="Themes\LightTheme.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Grid Width="480" Height="360">
<TextBlock HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Configure Bloxstrap" VerticalAlignment="Top" FontSize="18"/>
<TabControl TabStripPlacement="Left" Margin="10,40,10,51" Padding="0">
<TabItem Padding="5">
<TabItem.Header>
<TextBlock Text="Integrations" FontSize="13" />
</TabItem.Header>
<StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<GroupBox Grid.Column="0" Header="Discord Rich Presence" Margin="10,10,5,5">
<StackPanel VerticalAlignment="Center">
<CheckBox x:Name="CheckBoxDRPEnabled" Content=" Show game activity" Margin="5" VerticalAlignment="Top" IsChecked="{Binding DRPEnabled, Mode=TwoWay}" />
<CheckBox x:Name="CheckBoxDRPButtons" Content=" Show activity buttons" Margin="5" VerticalAlignment="Top" IsEnabled="{Binding IsChecked, ElementName=CheckBoxDRPEnabled, Mode=OneWay}" IsChecked="{Binding DRPButtons, Mode=TwoWay}" />
</StackPanel>
</GroupBox>
<GroupBox Grid.Column="1" Header="FPS Unlocking" Margin="5,10,10,5">
<StackPanel VerticalAlignment="Center">
<CheckBox x:Name="CheckBoxRFUEnabled" Content=" Use rbxfpsunlocker" Margin="5" VerticalAlignment="Top" IsChecked="{Binding RFUEnabled, Mode=TwoWay}" />
<CheckBox x:Name="CheckBoxRFUAutoclose" Content=" Exit when Roblox closes" Margin="5" VerticalAlignment="Top" IsEnabled="{Binding IsChecked, ElementName=CheckBoxRFUEnabled, Mode=OneWay}" IsChecked="{Binding RFUAutoclose, Mode=TwoWay}" />
</StackPanel>
</GroupBox>
</Grid>
<GroupBox Header="Modifications" VerticalAlignment="Top" Margin="10,5,10,0">
<StackPanel VerticalAlignment="Center">
<CheckBox x:Name="CheckBoxModDeathSound" Content=" Use old death sound" Margin="5" IsChecked="{Binding ModOldDeathSound, Mode=TwoWay}" />
<CheckBox x:Name="CheckBoxModMouseCursor" Content=" Use old mouse cursor" Margin="5" IsChecked="{Binding ModOldMouseCursor, Mode=TwoWay}" />
<Button x:Name="ButtonOpenModFolder" Content="Open folder" VerticalAlignment="Bottom" Height="23" Margin="5,5,5,5" Click="ButtonOpenModFolder_Click" />
</StackPanel>
</GroupBox>
</StackPanel>
</TabItem>
<TabItem Padding="5">
<TabItem.Header>
<TextBlock Text="Installation" FontSize="13" />
</TabItem.Header>
<StackPanel>
<GroupBox Header="Location" VerticalAlignment="Top" Margin="10,10,10,5">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="75" />
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" x:Name="TextBoxInstallLocation" Padding="0,1,0,2" Margin="0,0,5,0" Text="{Binding InstallLocation, Mode=OneWay}" />
<Button Grid.Column="1" x:Name="ButtonInstallLocationBrowse" Content="Browse..." Margin="5,0,0,0" Click="ButtonLocationBrowse_Click" />
</Grid>
</GroupBox>
<GroupBox Header="Channel" VerticalAlignment="Top" Margin="10, 5, 10, 0">
<StackPanel VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="130" />
</Grid.ColumnDefinitions>
<ComboBox x:Name="ComboBoxChannel" Margin="5" ItemsSource="{Binding Channels, Mode=OneWay}" Text="{Binding Channel, Mode=TwoWay}" />
<CheckBox Grid.Column="1" x:Name="CheckBoxShowAllChannels" Content=" Show all channels" VerticalAlignment="Center" Margin="5" IsChecked="{Binding ShowAllChannels, Mode=TwoWay}" />
</Grid>
<TextBlock x:Name="TextBlockChannelInfo" Text="{Binding ChannelInfo, Mode=OneWay}" TextWrapping="Wrap" Margin="5" />
</StackPanel>
</GroupBox>
</StackPanel>
</TabItem>
<TabItem Padding="5">
<TabItem.Header>
<TextBlock Text="Style" FontSize="13" />
</TabItem.Header>
<StackPanel Margin="10">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="Theme*" VerticalAlignment="Center" Margin="0,0,0,5" />
<ComboBox Grid.Row="0" Grid.Column="1" x:Name="ComboBoxTheme" VerticalAlignment="Center" Margin="0,0,0,0" ItemsSource="{Binding Themes.Keys, Mode=OneTime}" Text="{Binding Theme, Mode=TwoWay}" />
<TextBlock Grid.Row="1" Grid.Column="1" Text="*Dark theme only applies to the Progress Dialog style" FontSize="10" VerticalAlignment="Center" Margin="0,0,0,5" />
<TextBlock Grid.Row="2" Grid.Column="0" Text="Dialog" VerticalAlignment="Center" Margin="0,5,0,5" />
<ComboBox Grid.Row="2" Grid.Column="1" x:Name="ComboBoxDialog" VerticalAlignment="Center" Margin="0,5,0,5" ItemsSource="{Binding Dialogs.Keys, Mode=OneTime}" Text="{Binding Dialog, Mode=TwoWay}" />
<TextBlock Grid.Row="3" Grid.Column="0" Text="Icon" VerticalAlignment="Center" Margin="0,5,0,5" />
<ComboBox Grid.Row="3" Grid.Column="1" x:Name="ComboBoxIcon" VerticalAlignment="Center" Margin="0,5,0,5" ItemsSource="{Binding Icons.Keys, Mode=OneTime}" Text="{Binding Icon, Mode=TwoWay}" />
</Grid>
<Button x:Name="ButtonPreview" Content="Preview" Margin="0,5,0,0" VerticalAlignment="Bottom" Height="23" Click="ButtonPreview_Click" />
</StackPanel>
</TabItem>
</TabControl>
<Border Background="{DynamicResource ControlSelectedBackground}" BorderBrush="{DynamicResource ControlSelectedBorderBrush}" BorderThickness="1" Margin="-1,0,-1,-1" Height="42" VerticalAlignment="Bottom">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="ButtonConfirm" Content="{Binding ConfirmButtonText, Mode=OneTime}" Width="66" Height="23" HorizontalAlignment="Right" Margin="0,0,10,0" Click="ButtonConfirm_Click" />
<Button x:Name="ButtonCancel" Content="Cancel" Width="66" Height="23" HorizontalAlignment="Right" Margin="0,0,10,0" Click="ButtonCancel_Click" />
</StackPanel>
</Border>
</Grid>
</Window>

View File

@ -0,0 +1,346 @@
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media.Imaging;
using Microsoft.Win32;
using Bloxstrap.Enums;
using Bloxstrap.Helpers;
using Bloxstrap.Models;
using REghZyFramework.Themes;
using System.Windows.Forms;
namespace Bloxstrap.Dialogs
{
/// <summary>
/// Interaction logic for PreferencesWPF.xaml
/// </summary>
public partial class Preferences : Window
{
public readonly PreferencesViewModel ViewModel;
public Preferences()
{
InitializeComponent();
SetTheme();
ViewModel = new(this);
this.DataContext = ViewModel;
Program.SettingsManager.ShouldSave = false;
this.Icon = Imaging.CreateBitmapSourceFromHIcon(
Properties.Resources.IconBloxstrap_ico.Handle,
Int32Rect.Empty,
BitmapSizeOptions.FromEmptyOptions()
);
this.Title = Program.ProjectName;
// just in case i guess?
if (!Environment.Is64BitOperatingSystem)
this.CheckBoxRFUEnabled.IsEnabled = false;
}
public void SetTheme()
{
string theme = "Light";
if (Program.Settings.Theme.GetFinal() == Theme.Dark)
theme = "ColourfulDark";
this.Resources.MergedDictionaries[0] = new ResourceDictionary() { Source = new Uri($"Dialogs/Themes/{theme}Theme.xaml", UriKind.Relative) };
}
private void ButtonOpenModFolder_Click(object sender, EventArgs e)
{
Process.Start("explorer.exe", Directories.Modifications);
}
private void ButtonLocationBrowse_Click(object sender, EventArgs e)
{
using (var dialog = new FolderBrowserDialog())
{
DialogResult result = dialog.ShowDialog();
if (result == System.Windows.Forms.DialogResult.OK)
ViewModel.InstallLocation = dialog.SelectedPath;
}
}
private void ButtonPreview_Click(object sender, EventArgs e)
{
//this.Visible = false;
Program.Settings.BootstrapperStyle.Show();
//this.Visible = true;
}
private void ButtonCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void ButtonConfirm_Click(object sender, EventArgs e)
{
string installLocation = this.TextBoxInstallLocation.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();
}
}
public class PreferencesViewModel : INotifyPropertyChanged
{
private readonly Preferences _window;
public event PropertyChangedEventHandler? PropertyChanged;
#region Integrations
public bool DRPEnabled
{
get => Program.Settings.UseDiscordRichPresence;
set => Program.Settings.UseDiscordRichPresence = value;
}
public bool DRPButtons
{
get => !Program.Settings.HideRPCButtons;
set => Program.Settings.HideRPCButtons = !value;
}
public bool RFUEnabled
{
get => Program.Settings.RFUEnabled;
set => Program.Settings.RFUEnabled = value;
}
public bool RFUAutoclose
{
get => Program.Settings.RFUAutoclose;
set => Program.Settings.RFUAutoclose = value;
}
public bool ModOldDeathSound
{
get => Program.Settings.UseOldDeathSound;
set => Program.Settings.UseOldDeathSound = value;
}
public bool ModOldMouseCursor
{
get => Program.Settings.UseOldMouseCursor;
set => Program.Settings.UseOldMouseCursor = value;
}
public bool ModFolderButtonEnabled { get; } = !Program.IsFirstRun;
public string ModFolderButtonText { get; } = Program.IsFirstRun ? "Install Bloxstrap first to add custom mods" : "Open mod folder";
#endregion
#region Installation
private string installLocation = Program.IsFirstRun ? Path.Combine(Program.LocalAppData, Program.ProjectName) : Program.BaseDirectory;
public string InstallLocation
{
get => installLocation;
set
{
installLocation = value;
OnPropertyChanged();
}
}
private bool showAllChannels = !DeployManager.ChannelsAbstracted.Contains(Program.Settings.Channel);
public bool ShowAllChannels
{
get => showAllChannels;
set
{
if (value)
{
Channels = DeployManager.ChannelsAll;
}
else
{
Channels = DeployManager.ChannelsAbstracted;
Channel = DeployManager.DefaultChannel;
OnPropertyChanged("Channel");
}
showAllChannels = value;
}
}
private IEnumerable<string> channels = DeployManager.ChannelsAbstracted.Contains(Program.Settings.Channel) ? DeployManager.ChannelsAbstracted : DeployManager.ChannelsAll;
public IEnumerable<string> Channels
{
get => channels;
set
{
channels = value;
OnPropertyChanged();
}
}
public string Channel
{
get => Program.Settings.Channel;
set
{
Task.Run(() => GetChannelInfo(value));
Program.Settings.Channel = value;
}
}
private string channelInfo = "Getting latest version info, please wait...\n";
public string ChannelInfo
{
get => channelInfo;
set
{
channelInfo = value;
OnPropertyChanged();
}
}
#endregion
#region Style
public IReadOnlyDictionary<string, Theme> Themes { get; set; } = new Dictionary<string, Theme>()
{
{ "System Default", Enums.Theme.Default },
{ "Light", Enums.Theme.Light },
{ "Dark", Enums.Theme.Dark },
};
public string Theme
{
get => Themes.FirstOrDefault(x => x.Value == Program.Settings.Theme).Key;
set
{
Program.Settings.Theme = Themes[value];
_window.SetTheme();
}
}
public IReadOnlyDictionary<string, BootstrapperStyle> Dialogs { get; set; } = new Dictionary<string, BootstrapperStyle>()
{
{ "Vista (2009 - 2011)", BootstrapperStyle.VistaDialog },
{ "Legacy (2009 - 2011)", BootstrapperStyle.LegacyDialog2009 },
{ "Legacy (2011 - 2014)", BootstrapperStyle.LegacyDialog2011 },
{ "Progress (~2014)", BootstrapperStyle.ProgressDialog },
};
public string Dialog
{
get => Dialogs.FirstOrDefault(x => x.Value == Program.Settings.BootstrapperStyle).Key;
set => Program.Settings.BootstrapperStyle = Dialogs[value];
}
public IReadOnlyDictionary<string, BootstrapperIcon> Icons { get; set; } = new Dictionary<string, BootstrapperIcon>()
{
{ "Bloxstrap", BootstrapperIcon.IconBloxstrap },
{ "2009", BootstrapperIcon.Icon2009 },
{ "2011", BootstrapperIcon.Icon2011 },
{ "2015", BootstrapperIcon.IconEarly2015 },
{ "2016", BootstrapperIcon.IconLate2015 },
{ "2017", BootstrapperIcon.Icon2017 },
{ "2019", BootstrapperIcon.Icon2019 },
{ "2022", BootstrapperIcon.Icon2022 }
};
public string Icon
{
get => Icons.FirstOrDefault(x => x.Value == Program.Settings.BootstrapperIcon).Key;
set => Program.Settings.BootstrapperIcon = Icons[value];
}
#endregion
public string ConfirmButtonText { get; } = Program.IsFirstRun ? "Install" : "Save";
public PreferencesViewModel(Preferences window)
{
_window = window;
Task.Run(() => GetChannelInfo(Program.Settings.Channel));
}
protected void OnPropertyChanged([CallerMemberName] string? name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
private async Task GetChannelInfo(string channel)
{
ChannelInfo = "Getting latest version info, please wait...\n";
VersionDeploy info = await DeployManager.GetLastDeploy(channel);
string strTimestamp = info.Timestamp.ToString("MM/dd/yyyy h:mm:ss tt", Program.CultureFormat);
ChannelInfo = $"Version: v{info.FileVersion} ({info.VersionGuid})\nDeployed: {strTimestamp}";
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
using System.Windows;
namespace REghZyFramework.Themes {
public partial class ColourfulDarkTheme {
private void CloseWindow_Event(object sender, RoutedEventArgs e) {
if (e.Source != null)
try {
CloseWind(Window.GetWindow((FrameworkElement) e.Source));
}
catch {
}
}
private void AutoMinimize_Event(object sender, RoutedEventArgs e) {
if (e.Source != null)
try {
MaximizeRestore(Window.GetWindow((FrameworkElement) e.Source));
}
catch {
}
}
private void Minimize_Event(object sender, RoutedEventArgs e) {
if (e.Source != null)
try {
MinimizeWind(Window.GetWindow((FrameworkElement) e.Source));
}
catch {
}
}
public void CloseWind(Window window) => window.Close();
public void MaximizeRestore(Window window) {
if (window.WindowState == WindowState.Maximized)
window.WindowState = WindowState.Normal;
else if (window.WindowState == WindowState.Normal)
window.WindowState = WindowState.Maximized;
}
public void MinimizeWind(Window window) => window.WindowState = WindowState.Minimized;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
using System.Windows;
namespace REghZyFramework.Themes {
public partial class ColourfulLightTheme {
private void CloseWindow_Event(object sender, RoutedEventArgs e) {
if (e.Source != null)
try {
CloseWind(Window.GetWindow((FrameworkElement) e.Source));
}
catch {
}
}
private void AutoMinimize_Event(object sender, RoutedEventArgs e) {
if (e.Source != null)
try {
MaximizeRestore(Window.GetWindow((FrameworkElement) e.Source));
}
catch {
}
}
private void Minimize_Event(object sender, RoutedEventArgs e) {
if (e.Source != null)
try {
MinimizeWind(Window.GetWindow((FrameworkElement) e.Source));
}
catch {
}
}
public void CloseWind(Window window) => window.Close();
public void MaximizeRestore(Window window) {
if (window.WindowState == WindowState.Maximized)
window.WindowState = WindowState.Normal;
else if (window.WindowState == WindowState.Normal)
window.WindowState = WindowState.Maximized;
}
public void MinimizeWind(Window window) => window.WindowState = WindowState.Minimized;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
using System.Windows;
namespace REghZyFramework.Themes {
public partial class DarkTheme {
private void CloseWindow_Event(object sender, RoutedEventArgs e) {
if (e.Source != null)
try {
CloseWind(Window.GetWindow((FrameworkElement) e.Source));
}
catch {
}
}
private void AutoMinimize_Event(object sender, RoutedEventArgs e) {
if (e.Source != null)
try {
MaximizeRestore(Window.GetWindow((FrameworkElement) e.Source));
}
catch {
}
}
private void Minimize_Event(object sender, RoutedEventArgs e) {
if (e.Source != null)
try {
MinimizeWind(Window.GetWindow((FrameworkElement) e.Source));
}
catch {
}
}
public void CloseWind(Window window) => window.Close();
public void MaximizeRestore(Window window) {
if (window.WindowState == WindowState.Maximized)
window.WindowState = WindowState.Normal;
else if (window.WindowState == WindowState.Normal)
window.WindowState = WindowState.Maximized;
}
public void MinimizeWind(Window window) => window.WindowState = WindowState.Minimized;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
using System.Windows;
namespace REghZyFramework.Themes {
public partial class LightTheme {
private void CloseWindow_Event(object sender, RoutedEventArgs e) {
if (e.Source != null)
try {
CloseWind(Window.GetWindow((FrameworkElement) e.Source));
}
catch {
}
}
private void AutoMinimize_Event(object sender, RoutedEventArgs e) {
if (e.Source != null)
try {
MaximizeRestore(Window.GetWindow((FrameworkElement) e.Source));
}
catch {
}
}
private void Minimize_Event(object sender, RoutedEventArgs e) {
if (e.Source != null)
try {
MinimizeWind(Window.GetWindow((FrameworkElement) e.Source));
}
catch {
}
}
public void CloseWind(Window window) => window.Close();
public void MaximizeRestore(Window window) {
if (window.WindowState == WindowState.Maximized)
window.WindowState = WindowState.Normal;
else if (window.WindowState == WindowState.Normal)
window.WindowState = WindowState.Maximized;
}
public void MinimizeWind(Window window) => window.WindowState = WindowState.Minimized;
}
}

View File

@ -1,4 +1,4 @@
using Bloxstrap.Dialogs.BootstrapperStyles;
using Bloxstrap.Dialogs.BootstrapperDialogs;
namespace Bloxstrap.Enums
{
@ -8,7 +8,6 @@ namespace Bloxstrap.Enums
LegacyDialog2009,
LegacyDialog2011,
ProgressDialog,
ProgressDialogDark,
}
public static class BootstrapperStyleEx
@ -35,10 +34,6 @@ namespace Bloxstrap.Enums
default:
dialog = new ProgressDialog(bootstrapper);
break;
case BootstrapperStyle.ProgressDialogDark:
dialog = new ProgressDialogDark(bootstrapper);
break;
}
if (bootstrapper is null)

32
Bloxstrap/Enums/Theme.cs Normal file
View File

@ -0,0 +1,32 @@
using Microsoft.Win32;
namespace Bloxstrap.Enums
{
public enum Theme
{
Default,
Light,
Dark
}
public static class DialogThemeEx
{
public static Theme GetFinal(this Theme dialogTheme)
{
if (dialogTheme != Theme.Default)
return dialogTheme;
RegistryKey? key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize");
if (key is not null)
{
var value = key.GetValue("AppsUseLightTheme");
if (value is not null && (int)value == 0)
return Theme.Dark;
}
return Theme.Light;
}
}
}

View File

@ -1,4 +1,7 @@
using Bloxstrap.Models;
using System.IO;
using System.Net.Http;
using Bloxstrap.Models;
namespace Bloxstrap.Helpers
{
@ -21,7 +24,7 @@ namespace Bloxstrap.Helpers
"ZIntegration",
"ZLive",
"ZNext",
"ZPublic",
//"ZPublic",
"ZSocialTeam"
};

View File

@ -12,6 +12,7 @@ namespace Bloxstrap.Models
public BootstrapperStyle BootstrapperStyle { get; set; } = BootstrapperStyle.ProgressDialog;
public BootstrapperIcon BootstrapperIcon { get; set; } = BootstrapperIcon.IconBloxstrap;
public Theme Theme { get; set; } = Theme.Default;
public bool UseDiscordRichPresence { get; set; } = true;
public bool HideRPCButtons { get; set; } = false;

View File

@ -8,8 +8,8 @@ namespace Bloxstrap.Models
{
public class VersionDeploy
{
public string? VersionGuid { get; set; }
public DateTime? Timestamp { get; set; }
public string? FileVersion { get; set; }
public string VersionGuid { get; set; } = null!;
public string FileVersion { get; set; } = null!;
public DateTime Timestamp { get; set; }
}
}

View File

@ -7,6 +7,7 @@ using Microsoft.Win32;
using Bloxstrap.Enums;
using Bloxstrap.Helpers;
using Bloxstrap.Models;
using Bloxstrap.Dialogs;
namespace Bloxstrap
{
@ -25,11 +26,11 @@ namespace Bloxstrap
public const string Base64OldArrowFarCursor = "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAQAAAAAYLlVAAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfdBwoWHwRtdYxgAAAAfElEQVRo3u3WwQmAMBQEUetPtXYQERE10VyEHcSZNPBOPztNZmZmZmZmZmYvK7VUGDCzhBWAEjYASNgBGOEAQIQzACFcAQChBcQJPSBMuANECfeAIOEJECM8A0KEESBCGAMChP4Qte9Ppxj+jODvGB4k8CSDRyk8y83s8y1ZdnQ0Empj3AAAAABJRU5ErkJggg==";
#endregion
public static string? BaseDirectory;
public static string BaseDirectory = null!;
public static bool IsFirstRun { get; private set; } = false;
public static string LocalAppData { get; private set; } = "";
public static string StartMenu { get; private set; } = "";
public static string LocalAppData { get; private set; } = null!;
public static string StartMenu { get; private set; } = null!;
public static SettingsManager SettingsManager = new();
public static SettingsFormat Settings = SettingsManager.Settings;
@ -66,7 +67,7 @@ namespace Bloxstrap
{
IsFirstRun = true;
Settings = SettingsManager.Settings;
Application.Run(new Dialogs.Preferences());
new Preferences().ShowDialog();
}
else
{
@ -91,10 +92,15 @@ namespace Bloxstrap
SettingsManager.ShouldSave = true;
}
#if !DEBUG
Updater.Check().Wait();
#endif
string commandLine = "";
#if DEBUG
new Preferences().ShowDialog();
#else
if (args.Length > 0)
{
if (args[0] == "-preferences")
@ -105,7 +111,7 @@ namespace Bloxstrap
return;
}
Application.Run(new Dialogs.Preferences());
new PreferencesWPF().ShowDialog();
}
else if (args[0].StartsWith("roblox-player:"))
{
@ -124,6 +130,7 @@ namespace Bloxstrap
{
commandLine = "--app";
}
#endif
if (!String.IsNullOrEmpty(commandLine))