Remove old configuration menu

This commit is contained in:
pizzaboxer 2023-02-03 17:45:46 +00:00
parent 8552d94a4a
commit 5c331a8ee4
33 changed files with 28 additions and 19065 deletions

View File

@ -9,7 +9,6 @@ using System.Windows;
using Microsoft.Win32;
using Bloxstrap.Models;
using Bloxstrap.Dialogs.Menu;
using Bloxstrap.Enums;
using Bloxstrap.Helpers;
using Bloxstrap.Views;

View File

@ -11,7 +11,7 @@ using System.Windows;
using Microsoft.Win32;
using Bloxstrap.Dialogs.BootstrapperDialogs;
using Bloxstrap.Dialogs;
using Bloxstrap.Helpers;
using Bloxstrap.Helpers.Integrations;
using Bloxstrap.Helpers.RSMM;
@ -381,7 +381,20 @@ namespace Bloxstrap
.WriteToFile(Path.Combine(Directories.StartMenu, "Play Roblox.lnk"));
ShellLink.Shortcut.CreateShortcut(Directories.Application, "-preferences", Directories.Application, 0)
.WriteToFile(Path.Combine(Directories.StartMenu, $"Configure {App.ProjectName}.lnk"));
.WriteToFile(Path.Combine(Directories.StartMenu, $"{App.ProjectName} Menu.lnk"));
}
else
{
// v2.0.0 - rebadge configuration menu as just "Bloxstrap Menu"
string oldMenuShortcut = Path.Combine(Directories.StartMenu, $"Configure {App.ProjectName}.lnk");
string newMenuShortcut = Path.Combine(Directories.StartMenu, $"{App.ProjectName} Menu.lnk");
if (File.Exists(oldMenuShortcut))
File.Delete(oldMenuShortcut);
if (!File.Exists(newMenuShortcut))
ShellLink.Shortcut.CreateShortcut(Directories.Application, "-preferences", Directories.Application, 0)
.WriteToFile(newMenuShortcut);
}
if (App.Settings.CreateDesktopIcon && !File.Exists(Path.Combine(Directories.Desktop, "Play Roblox.lnk")))

View File

@ -6,7 +6,7 @@ using System.Windows.Forms;
using Bloxstrap.Enums;
using Bloxstrap.Helpers;
namespace Bloxstrap.Dialogs.BootstrapperDialogs
namespace Bloxstrap.Dialogs
{
public class BootstrapperDialogForm : Form, IBootstrapperDialog
{

View File

@ -1,6 +1,6 @@
using System.Windows.Forms;
namespace Bloxstrap.Dialogs.BootstrapperDialogs
namespace Bloxstrap.Dialogs
{
public interface IBootstrapperDialog
{

View File

@ -1,6 +1,6 @@
using System.Windows.Forms;
namespace Bloxstrap.Dialogs.BootstrapperDialogs
namespace Bloxstrap.Dialogs
{
partial class LegacyDialog2009
{

View File

@ -1,7 +1,7 @@
using System;
using System.Windows.Forms;
namespace Bloxstrap.Dialogs.BootstrapperDialogs
namespace Bloxstrap.Dialogs
{
// windows: https://youtu.be/VpduiruysuM?t=18
// mac: https://youtu.be/ncHhbcVDRgQ?t=63

View File

@ -1,6 +1,6 @@
using System.Windows.Forms;
namespace Bloxstrap.Dialogs.BootstrapperDialogs
namespace Bloxstrap.Dialogs
{
partial class LegacyDialog2011
{

View File

@ -3,7 +3,7 @@ using System.Windows.Forms;
using Bloxstrap.Enums;
namespace Bloxstrap.Dialogs.BootstrapperDialogs
namespace Bloxstrap.Dialogs
{
// https://youtu.be/3K9oCEMHj2s?t=35

View File

@ -1,31 +0,0 @@
<Window x:Class="Bloxstrap.Dialogs.Menu.ModHelp"
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.Menu"
mc:Ignorable="d"
Style="{DynamicResource MainWindowStyle}"
Title="Modification Help"
SizeToContent="WidthAndHeight"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen">
<Grid Width="420" Height="260">
<StackPanel Margin="10">
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Modification Help" VerticalAlignment="Top" FontSize="18" />
<StackPanel Margin="10">
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="The Modifications folder is where you can modify your Roblox files while ensuring that they're preserved whenever Roblox updates." />
<TextBlock HorizontalAlignment="Left" Margin="0,10,0,0" TextWrapping="Wrap" Text="For example, Modifications\content\sounds\ouch.ogg will automatically override Versions\Version-{id}\content\sounds\ouch.ogg" />
<TextBlock HorizontalAlignment="Left" Margin="0,10,0,0" TextWrapping="Wrap" Text="When you remove a file from the folder, Bloxstrap restores the original version of the file the next time Roblox launches." />
<TextBlock HorizontalAlignment="Left" Margin="0,10,0,0" TextWrapping="Wrap" Text="The folder is also used for handling presets and files for ReShade, so if you find any files or folders that already exist, you can just ignore them." />
</StackPanel>
</StackPanel>
<Border Background="{DynamicResource ControlSelectedBackground}" BorderBrush="{DynamicResource ControlSelectedBorderBrush}" BorderThickness="1" Margin="-1,0,-1,0" Height="42" VerticalAlignment="Bottom">
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="ButtonClose" Content="Close" Width="66" Height="23" HorizontalAlignment="Right" Margin="0,0,10,0" Click="ButtonClose_Click" />
</StackPanel>
</Grid>
</Border>
</Grid>
</Window>

View File

@ -1,21 +0,0 @@
using System;
using System.Windows;
namespace Bloxstrap.Dialogs.Menu
{
/// <summary>
/// Interaction logic for ModHelp.xaml
/// </summary>
public partial class ModHelp : Window
{
public ModHelp()
{
InitializeComponent();
}
private void ButtonClose_Click(object sender, EventArgs e)
{
this.Close();
}
}
}

View File

@ -1,169 +0,0 @@
<Window x:Class="Bloxstrap.Dialogs.Menu.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.Menu"
mc:Ignorable="d"
Style="{DynamicResource MainWindowStyle}"
Title="PreferencesWPF"
SizeToContent="WidthAndHeight"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen">
<Grid Width="480" Height="360">
<TextBlock HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Configure Bloxstrap" VerticalAlignment="Top" FontSize="18"/>
<TextBlock HorizontalAlignment="Right" Margin="0,14,10,0" TextWrapping="Wrap" Text="{Binding BloxstrapVersion, Mode=OneTime}" VerticalAlignment="Top" FontSize="12"/>
<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" ToolTip="Choose whether the game you're currently playing should be shown on your Discord game activity." Margin="5" IsChecked="{Binding DRPEnabled, Mode=TwoWay}" />
<CheckBox x:Name="CheckBoxDRPButtons" Content=" Allow activity joining" ToolTip="Choose whether people can join the game you're in through your Discord game activity." Margin="5" 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" ToolTip="Choose whether rbxfpsunlocker should be downloaded and launched whenever Roblox starts." Margin="5" IsChecked="{Binding RFUEnabled, Mode=TwoWay}" />
<CheckBox x:Name="CheckBoxRFUAutoclose" Content=" Exit when Roblox closes" ToolTip="Choose whether rbxfpsunlocker should stop running when Roblox closes." Margin="5" IsEnabled="{Binding IsChecked, ElementName=CheckBoxRFUEnabled, Mode=OneWay}" IsChecked="{Binding RFUAutoclose, Mode=TwoWay}" />
</StackPanel>
</GroupBox>
</Grid>
<GroupBox Header="ReShade" Margin="10,5,10,0">
<StackPanel VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="155" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<CheckBox Grid.Column="0" x:Name="CheckBoxUseReShade" Content=" Use ReShade" ToolTip="Choose whether to use ReShade to enhance your graphics with shaders." Margin="5" IsChecked="{Binding UseReShade, Mode=TwoWay}" />
<CheckBox Grid.Column="1" x:Name="CheckBoxUseReShadeExtraviPresets" Content=" Use Extravi's shader presets" ToolTip="Choose whether to use Extravi's shader presets with ReShade." Margin="5" IsEnabled="{Binding IsChecked, ElementName=CheckBoxUseReShade, Mode=OneWay}" IsChecked="{Binding UseReShadeExtraviPresets, Mode=TwoWay}" />
</Grid>
<Grid Margin="5,5,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="80" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" x:Name="ButtonOpenReShadeFolder" ToolTip="{Binding ReShadeFolderButtonTooltip, Mode=OneTime}" IsEnabled="{Binding ReShadeFolderButtonEnabled, Mode=OneTime}" Content="Open ReShade folder" Height="23" Margin="0,0,5,0" Click="ButtonOpenReShadeFolder_Click" />
<Button Grid.Column="1" x:Name="ButtonOpenReShadeHelp" Content="Help" Height="23" Margin="5,0,0,0" Click="ButtonOpenReShadeHelp_Click" />
</Grid>
</StackPanel>
</GroupBox>
</StackPanel>
</TabItem>
<TabItem Padding="5">
<TabItem.Header>
<TextBlock Text="Modifications" FontSize="13" />
</TabItem.Header>
<StackPanel>
<GroupBox Header="Presets" Margin="10,10,10,5">
<StackPanel VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<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}" />
</StackPanel>
<StackPanel Grid.Column="1">
<CheckBox x:Name="CheckBoxDisableAppPatch" Content=" Disable desktop app" Margin="5" IsChecked="{Binding ModDisableAppPatch, Mode=TwoWay}" />
</StackPanel>
</Grid>
</StackPanel>
</GroupBox>
<Grid Margin="10,5,10,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="80" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" x:Name="ButtonOpenModFolder" Content="Open Modifications folder" ToolTip="{Binding ModFolderButtonTooltip, Mode=OneTime}" IsEnabled="{Binding ModFolderButtonEnabled, Mode=OneTime}" Height="23" Margin="0,0,5,0" Click="ButtonOpenModFolder_Click" />
<Button Grid.Column="1" x:Name="ButtonOpenModHelp" Content="Help" Height="23" Margin="5,0,0,0" Click="ButtonOpenModHelp_Click" />
</Grid>
</StackPanel>
</TabItem>
<TabItem Padding="5">
<TabItem.Header>
<TextBlock Text="Installation" FontSize="13" />
</TabItem.Header>
<StackPanel>
<GroupBox Header="Location" 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" Margin="10,5,10,5">
<StackPanel VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="130" />
</Grid.ColumnDefinitions>
<ComboBox x:Name="ComboBoxChannel" ToolTip="Choose which release channel to download Roblox from. If you're not sure what this does, just leave it as LIVE." 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" />
<CheckBox x:Name="TextBoxPromptChannelChange" Content=" Prompt on Roblox-forced channel change" ToolTip="Choose whether to be prompted when Roblox mandates a channel change through the website. Otherwise, the channel changes automatically." Margin="5" IsChecked="{Binding PromptChannelChange, Mode=TwoWay}" />
</StackPanel>
</GroupBox>
</StackPanel>
</TabItem>
<TabItem Padding="5">
<TabItem.Header>
<TextBlock Text="Bloxstrap" FontSize="13" />
</TabItem.Header>
<StackPanel>
<GroupBox Header="Style" Margin="10,10,10,0">
<StackPanel Margin="5">
<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" 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>
</GroupBox>
<CheckBox Content=" Create desktop icon" IsChecked="{Binding CreateDesktopIcon, Mode=TwoWay}" Margin="10,10,10,0" />
<CheckBox Content=" Check for Bloxstrap updates on startup" IsChecked="{Binding CheckForUpdates, Mode=TwoWay}" Margin="10,10,10,0" />
</StackPanel>
</TabItem>
</TabControl>
<Border Background="{DynamicResource ControlSelectedBackground}" BorderBrush="{DynamicResource ControlSelectedBorderBrush}" BorderThickness="1" Margin="-1,0,-1,0" Height="42" VerticalAlignment="Bottom">
<Grid>
<TextBlock Text="Like Bloxstrap? " VerticalAlignment="Center" Margin="10,0,0,0" ><Hyperlink NavigateUri="https://github.com/pizzaboxer/bloxstrap" RequestNavigate="Hyperlink_RequestNavigate">Leave a star on GitHub!</Hyperlink></TextBlock>
<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>
</Grid>
</Border>
</Grid>
</Window>

View File

@ -1,424 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media.Imaging;
using Microsoft.Win32;
using Bloxstrap.Enums;
using Bloxstrap.Helpers;
using Bloxstrap.Models;
namespace Bloxstrap.Dialogs.Menu
{
/// <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;
App.SettingsManager.ShouldSave = false;
this.Icon = Imaging.CreateBitmapSourceFromHIcon(
Properties.Resources.IconBloxstrap_ico.Handle,
Int32Rect.Empty,
BitmapSizeOptions.FromEmptyOptions()
);
this.Title = App.ProjectName;
// just in case i guess?
if (!Environment.Is64BitOperatingSystem)
this.CheckBoxRFUEnabled.IsEnabled = false;
}
public void SetTheme()
{
string theme = "Light";
if (App.Settings.Theme.GetFinal() == Theme.Dark)
theme = "ColourfulDark";
Application.Current.Resources.MergedDictionaries[0] = new ResourceDictionary() { Source = new Uri($"Dialogs/Menu/Themes/{theme}Theme.xaml", UriKind.Relative) };
}
private void ButtonOpenReShadeFolder_Click(object sender, EventArgs e)
{
Process.Start("explorer.exe", Directories.ReShade);
}
private void ButtonOpenReShadeHelp_Click(object sender, EventArgs e)
{
new ReShadeHelp().Show();
}
private void ButtonOpenModFolder_Click(object sender, EventArgs e)
{
Process.Start("explorer.exe", Directories.Modifications);
}
private void ButtonOpenModHelp_Click(object sender, EventArgs e)
{
new ModHelp().Show();
}
private void ButtonLocationBrowse_Click(object sender, EventArgs e)
{
using (var dialog = new System.Windows.Forms.FolderBrowserDialog())
{
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
ViewModel.InstallLocation = dialog.SelectedPath;
}
}
private void ButtonPreview_Click(object sender, EventArgs e)
{
//this.Visible = false;
App.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))
{
App.ShowMessageBox("You must set an install location", MessageBoxImage.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)
{
App.ShowMessageBox($"{App.ProjectName} does not have write access to the install location you selected. Please choose another install location.", MessageBoxImage.Error);
return;
}
catch (Exception ex)
{
App.ShowMessageBox(ex.Message, MessageBoxImage.Error);
return;
}
if (App.IsFirstRun)
{
// this will be set in the registry after first install
App.BaseDirectory = installLocation;
}
else
{
App.SettingsManager.ShouldSave = true;
if (App.BaseDirectory is not null && App.BaseDirectory != installLocation)
{
App.ShowMessageBox($"{App.ProjectName} will install to the new location you've set the next time it runs.", MessageBoxImage.Information);
App.Settings.VersionGuid = "";
using (RegistryKey registryKey = Registry.CurrentUser.CreateSubKey($@"Software\{App.ProjectName}"))
{
registryKey.SetValue("InstallLocation", installLocation);
registryKey.SetValue("OldInstallLocation", App.BaseDirectory);
}
// preserve settings
// we don't need to copy the bootstrapper over since the install process will do that automatically
App.SettingsManager.Save();
File.Copy(Path.Combine(App.BaseDirectory, "Settings.json"), Path.Combine(installLocation, "Settings.json"));
}
}
this.Close();
}
private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
{
Utilities.OpenWebsite(e.Uri.AbsoluteUri);
e.Handled = true;
}
}
public class PreferencesViewModel : INotifyPropertyChanged
{
private readonly Preferences _window;
public event PropertyChangedEventHandler? PropertyChanged;
public string BloxstrapVersion { get; } = $"Version {App.Version}";
#region Integrations
public bool DRPEnabled
{
get => App.Settings.UseDiscordRichPresence;
set
{
// if user wants discord rpc, auto-enable buttons by default
_window.CheckBoxDRPButtons.IsChecked = value;
App.Settings.UseDiscordRichPresence = value;
}
}
public bool DRPButtons
{
get => !App.Settings.HideRPCButtons;
set => App.Settings.HideRPCButtons = !value;
}
public bool RFUEnabled
{
get => App.Settings.RFUEnabled;
set
{
// if user wants to use rbxfpsunlocker, auto-enable autoclosing by default
_window.CheckBoxRFUAutoclose.IsChecked = value;
App.Settings.RFUEnabled = value;
}
}
public bool RFUAutoclose
{
get => App.Settings.RFUAutoclose;
set => App.Settings.RFUAutoclose = value;
}
public bool UseReShade
{
get => App.Settings.UseReShade;
set
{
// if user wants to use reshade, auto-enable use of extravi's presets by default
_window.CheckBoxUseReShadeExtraviPresets.IsChecked = value;
App.Settings.UseReShade = value;
}
}
public bool UseReShadeExtraviPresets
{
get => App.Settings.UseReShadeExtraviPresets;
set => App.Settings.UseReShadeExtraviPresets = value;
}
public bool ReShadeFolderButtonEnabled { get; } = !App.IsFirstRun;
public string ReShadeFolderButtonTooltip { get; } = App.IsFirstRun ? "Bloxstrap must first be installed before managing ReShade" : "This is the folder that contains all your ReShade resources for presets, shaders and textures.";
#endregion
#region Modifications
public bool ModOldDeathSound
{
get => App.Settings.UseOldDeathSound;
set => App.Settings.UseOldDeathSound = value;
}
public bool ModOldMouseCursor
{
get => App.Settings.UseOldMouseCursor;
set => App.Settings.UseOldMouseCursor = value;
}
public bool ModDisableAppPatch
{
get => App.Settings.UseDisableAppPatch;
set => App.Settings.UseDisableAppPatch = value;
}
public bool ModFolderButtonEnabled { get; } = !App.IsFirstRun;
public string ModFolderButtonTooltip { get; } = App.IsFirstRun ? "Bloxstrap must first be installed before managing mods" : "This is the folder that contains all your file modifications, including presets and any ReShade files needed.";
#endregion
#region Installation
private string installLocation = App.IsFirstRun ? Path.Combine(Directories.LocalAppData, App.ProjectName) : App.BaseDirectory;
public string InstallLocation
{
get => installLocation;
set
{
installLocation = value;
OnPropertyChanged();
}
}
private bool showAllChannels = !DeployManager.ChannelsAbstracted.Contains(App.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(App.Settings.Channel) ? DeployManager.ChannelsAbstracted : DeployManager.ChannelsAll;
public IEnumerable<string> Channels
{
get => channels;
set
{
channels = value;
OnPropertyChanged();
}
}
public string Channel
{
get => App.Settings.Channel;
set
{
Task.Run(() => GetChannelInfo(value));
App.Settings.Channel = value;
}
}
private string channelInfo = "Getting latest version info, please wait...\n";
public string ChannelInfo
{
get => channelInfo;
set
{
channelInfo = value;
OnPropertyChanged();
}
}
public bool PromptChannelChange
{
get => App.Settings.PromptChannelChange;
set => App.Settings.PromptChannelChange = value;
}
#endregion
#region Bloxstrap
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 == App.Settings.Theme).Key;
set
{
App.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 == App.Settings.BootstrapperStyle).Key;
set => App.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 == App.Settings.BootstrapperIcon).Key;
set => App.Settings.BootstrapperIcon = Icons[value];
}
public bool CreateDesktopIcon
{
get => App.Settings.CreateDesktopIcon;
set => App.Settings.CreateDesktopIcon = value;
}
public bool CheckForUpdates
{
get => App.Settings.CheckForUpdates;
set => App.Settings.CheckForUpdates = value;
}
#endregion
public string ConfirmButtonText { get; } = App.IsFirstRun ? "Install" : "Save";
public PreferencesViewModel(Preferences window)
{
_window = window;
Task.Run(() => GetChannelInfo(App.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";
ClientVersion info = await DeployManager.GetLastDeploy(channel, true);
string? strTimestamp = info.Timestamp?.ToString("MM/dd/yyyy h:mm:ss tt", App.CultureFormat);
ChannelInfo = $"Version: v{info.Version} ({info.VersionGuid})\nDeployed: {strTimestamp}";
}
}
}

View File

@ -1,46 +0,0 @@
<Window x:Class="Bloxstrap.Dialogs.Menu.ReShadeHelp"
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.Menu"
mc:Ignorable="d"
Style="{DynamicResource MainWindowStyle}"
Title="ReShade Help"
SizeToContent="WidthAndHeight"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen">
<Grid Width="420" Height="220">
<StackPanel Margin="10">
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="ReShade Help" VerticalAlignment="Top" FontSize="18" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<TextBlock HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Toggle Menu" FontSize="16" />
<TextBlock HorizontalAlignment="Left" Margin="10,0,0,0" TextWrapping="Wrap" Text="Shift + Tab" />
</StackPanel>
<StackPanel Grid.Column="1">
<TextBlock HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Toggle Shaders" FontSize="16" />
<TextBlock HorizontalAlignment="Left" Margin="10,0,0,0" TextWrapping="Wrap" Text="Shift + F6" />
</StackPanel>
<StackPanel Grid.Column="2">
<TextBlock HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Take Screenshot" FontSize="16" />
<TextBlock HorizontalAlignment="Left" Margin="10,0,0,0" TextWrapping="Wrap" Text="Print Screen" />
</StackPanel>
</Grid>
<TextBlock HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="If you're using a compact keyboard, you may have to hold down the Fn key when pressing F6." />
<TextBlock HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Any screenshots you take are saved to the Screenshots folder in the ReShade folder." />
</StackPanel>
<Border Background="{DynamicResource ControlSelectedBackground}" BorderBrush="{DynamicResource ControlSelectedBorderBrush}" BorderThickness="1" Margin="-1,0,-1,0" Height="42" VerticalAlignment="Bottom">
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="ButtonClose" Content="Close" Width="66" Height="23" HorizontalAlignment="Right" Margin="0,0,10,0" Click="ButtonClose_Click" />
</StackPanel>
</Grid>
</Border>
</Grid>
</Window>

View File

@ -1,21 +0,0 @@
using System;
using System.Windows;
namespace Bloxstrap.Dialogs.Menu
{
/// <summary>
/// Interaction logic for ReShadeHelp.xaml
/// </summary>
public partial class ReShadeHelp : Window
{
public ReShadeHelp()
{
InitializeComponent();
}
private void ButtonClose_Click(object sender, EventArgs e)
{
this.Close();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,43 +0,0 @@
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

@ -1,43 +0,0 @@
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

@ -1,43 +0,0 @@
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

@ -1,43 +0,0 @@
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,6 +1,6 @@
using System.Windows.Forms;
namespace Bloxstrap.Dialogs.BootstrapperDialogs
namespace Bloxstrap.Dialogs
{
partial class ProgressDialog
{

View File

@ -4,7 +4,7 @@ using System.Windows.Forms;
using Bloxstrap.Enums;
namespace Bloxstrap.Dialogs.BootstrapperDialogs
namespace Bloxstrap.Dialogs
{
// basically just the modern dialog

View File

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

View File

@ -3,7 +3,7 @@ using System.Windows.Forms;
using Bloxstrap.Enums;
namespace Bloxstrap.Dialogs.BootstrapperDialogs
namespace Bloxstrap.Dialogs
{
// https://youtu.be/h0_AL95Sc3o?t=48

View File

@ -1,6 +1,6 @@
using System.Windows.Forms;
using Bloxstrap.Dialogs.BootstrapperDialogs;
using Bloxstrap.Dialogs;
namespace Bloxstrap.Enums
{

View File

@ -3,7 +3,6 @@ using System.Diagnostics;
using System.IO;
using System.Windows;
using Bloxstrap.Dialogs.Menu;
using Bloxstrap.Views;
namespace Bloxstrap.Helpers

View File

@ -1,7 +1,8 @@
{
"profiles": {
"Bloxstrap": {
"commandName": "Project"
"commandName": "Project",
"commandLineArgs": "-preferences"
}
}
}