mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Merge branch 'main' into user-pfp-discord-rpc
This commit is contained in:
commit
7c9c3d35cc
@ -5,6 +5,7 @@ using System.Windows.Threading;
|
||||
using Microsoft.Win32;
|
||||
|
||||
using Bloxstrap.Resources;
|
||||
using Bloxstrap.Models.SettingTasks;
|
||||
|
||||
namespace Bloxstrap
|
||||
{
|
||||
@ -32,6 +33,8 @@ namespace Bloxstrap
|
||||
|
||||
public static readonly Logger Logger = new();
|
||||
|
||||
public static readonly Dictionary<string, ISettingTask> PendingSettingTasks = new();
|
||||
|
||||
public static readonly JsonManager<Settings> Settings = new();
|
||||
|
||||
public static readonly JsonManager<State> State = new();
|
||||
|
@ -337,6 +337,16 @@ namespace Bloxstrap
|
||||
|
||||
App.NotifyIcon?.SetActivityWatcher(activityWatcher);
|
||||
|
||||
if (App.Settings.Prop.UseDisableAppPatch)
|
||||
{
|
||||
activityWatcher.OnAppClose += (_, _) =>
|
||||
{
|
||||
App.Logger.WriteLine(LOG_IDENT, "Received desktop app exit, closing Roblox");
|
||||
using var process = Process.GetProcessById(gameClientPid);
|
||||
process.CloseMainWindow();
|
||||
};
|
||||
}
|
||||
|
||||
if (App.Settings.Prop.UseDiscordRichPresence)
|
||||
{
|
||||
App.Logger.WriteLine(LOG_IDENT, "Using Discord Rich Presence");
|
||||
|
@ -242,9 +242,21 @@ namespace Bloxstrap
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
var cleanupSequence = new List<Action>
|
||||
{
|
||||
() => File.Delete(DesktopShortcut),
|
||||
() =>
|
||||
{
|
||||
foreach (var file in Directory.GetFiles(Paths.Desktop).Where(x => x.EndsWith("lnk")))
|
||||
{
|
||||
var shortcut = ShellLink.Shortcut.ReadFromFile(file);
|
||||
|
||||
if (shortcut.ExtraData.EnvironmentVariableDataBlock?.TargetUnicode == Paths.Application)
|
||||
File.Delete(file);
|
||||
}
|
||||
},
|
||||
|
||||
() => File.Delete(StartMenuShortcut),
|
||||
|
||||
() => Directory.Delete(Paths.Versions, true),
|
||||
|
@ -29,6 +29,7 @@
|
||||
public event EventHandler<string>? OnLogEntry;
|
||||
public event EventHandler? OnGameJoin;
|
||||
public event EventHandler? OnGameLeave;
|
||||
public event EventHandler? OnAppClose;
|
||||
public event EventHandler<Message>? OnRPCMessage;
|
||||
|
||||
private readonly Dictionary<string, string> GeolocationCache = new();
|
||||
@ -138,13 +139,8 @@
|
||||
else if (_logEntriesRead % 100 == 0)
|
||||
App.Logger.WriteLine(LOG_IDENT, $"Read {_logEntriesRead} log entries");
|
||||
|
||||
|
||||
if (App.Settings.Prop.UseDisableAppPatch && entry.Contains(GameLeavingEntry))
|
||||
{
|
||||
App.Logger.WriteLine(LOG_IDENT, "Received desktop app exit, closing Roblox");
|
||||
using var process = Process.GetProcessById(_gameClientPid);
|
||||
process.CloseMainWindow();
|
||||
}
|
||||
if (entry.Contains(GameLeavingEntry))
|
||||
OnAppClose?.Invoke(this, new EventArgs());
|
||||
|
||||
if (ActivityUserId == "" && entry.Contains(GameJoinLoadTimeEntry))
|
||||
{
|
||||
|
47
Bloxstrap/Models/SettingTasks/BaseTask.cs
Normal file
47
Bloxstrap/Models/SettingTasks/BaseTask.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Bloxstrap.Models.SettingTasks
|
||||
{
|
||||
public class BaseTask : ISettingTask
|
||||
{
|
||||
private bool _originalState;
|
||||
|
||||
private bool _newState;
|
||||
|
||||
public string Name { get; set; } = "";
|
||||
|
||||
public bool OriginalState
|
||||
{
|
||||
get
|
||||
{
|
||||
return _originalState;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_originalState = value;
|
||||
_newState = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool NewState
|
||||
{
|
||||
get
|
||||
{
|
||||
return _newState;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
App.PendingSettingTasks[Name] = this;
|
||||
_newState = value;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Execute() => throw new NotImplementedException();
|
||||
}
|
||||
}
|
17
Bloxstrap/Models/SettingTasks/ISettingTask.cs
Normal file
17
Bloxstrap/Models/SettingTasks/ISettingTask.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Bloxstrap.Models.SettingTasks
|
||||
{
|
||||
public interface ISettingTask
|
||||
{
|
||||
public bool OriginalState { get; set; }
|
||||
|
||||
public bool NewState { get; set; }
|
||||
|
||||
public void Execute();
|
||||
}
|
||||
}
|
35
Bloxstrap/Models/SettingTasks/ShortcutTask.cs
Normal file
35
Bloxstrap/Models/SettingTasks/ShortcutTask.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Bloxstrap.Models.SettingTasks
|
||||
{
|
||||
public class ShortcutTask : BaseTask, ISettingTask
|
||||
{
|
||||
public string ExeFlags { get; set; } = "";
|
||||
|
||||
public string ShortcutPath { get; set; }
|
||||
|
||||
public ShortcutTask(string shortcutPath)
|
||||
{
|
||||
ShortcutPath = shortcutPath;
|
||||
|
||||
OriginalState = File.Exists(ShortcutPath);
|
||||
}
|
||||
|
||||
public override void Execute()
|
||||
{
|
||||
if (NewState == OriginalState)
|
||||
return;
|
||||
|
||||
if (NewState)
|
||||
Shortcut.Create(Paths.Application, ExeFlags, ShortcutPath);
|
||||
else if (File.Exists(ShortcutPath))
|
||||
File.Delete(ShortcutPath);
|
||||
|
||||
OriginalState = NewState;
|
||||
}
|
||||
}
|
||||
}
|
@ -11,7 +11,6 @@ namespace Bloxstrap.Models
|
||||
public string BootstrapperIconCustomLocation { get; set; } = "";
|
||||
public Theme Theme { get; set; } = Theme.Default;
|
||||
public bool CheckForUpdates { get; set; } = true;
|
||||
public bool CreateDesktopIcon { get; set; } = true;
|
||||
public bool ConfirmLaunches { get; set; } = false;
|
||||
public string Locale { get; set; } = "nil";
|
||||
public bool ForceRobloxLanguage { get; set; } = false;
|
||||
|
142
Bloxstrap/Resources/Strings.Designer.cs
generated
142
Bloxstrap/Resources/Strings.Designer.cs
generated
@ -512,6 +512,33 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Shortcuts.
|
||||
/// </summary>
|
||||
public static string Common_Shortcuts {
|
||||
get {
|
||||
return ResourceManager.GetString("Common.Shortcuts", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Desktop icon.
|
||||
/// </summary>
|
||||
public static string Common_Shortcuts_Desktop {
|
||||
get {
|
||||
return ResourceManager.GetString("Common.Shortcuts.Desktop", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Start Menu icon.
|
||||
/// </summary>
|
||||
public static string Common_Shortcuts_StartMenu {
|
||||
get {
|
||||
return ResourceManager.GetString("Common.Shortcuts.StartMenu", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to System default.
|
||||
/// </summary>
|
||||
@ -639,7 +666,7 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Located at {0}
|
||||
/// Looks up a localized string similar to Location: {0}
|
||||
///Click for more information.
|
||||
/// </summary>
|
||||
public static string ContextMenu_ServerInformation_Notification_Text {
|
||||
@ -649,11 +676,29 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Connected to {0} server.
|
||||
/// Looks up a localized string similar to Connected to private server.
|
||||
/// </summary>
|
||||
public static string ContextMenu_ServerInformation_Notification_Title {
|
||||
public static string ContextMenu_ServerInformation_Notification_Title_Private {
|
||||
get {
|
||||
return ResourceManager.GetString("ContextMenu.ServerInformation.Notification.Title", resourceCulture);
|
||||
return ResourceManager.GetString("ContextMenu.ServerInformation.Notification.Title.Private", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Connected to public server.
|
||||
/// </summary>
|
||||
public static string ContextMenu_ServerInformation_Notification_Title_Public {
|
||||
get {
|
||||
return ResourceManager.GetString("ContextMenu.ServerInformation.Notification.Title.Public", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Connected to reserved server.
|
||||
/// </summary>
|
||||
public static string ContextMenu_ServerInformation_Notification_Title_Reserved {
|
||||
get {
|
||||
return ResourceManager.GetString("ContextMenu.ServerInformation.Notification.Title.Reserved", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
@ -685,7 +730,7 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Bloxstrap was unable to create shortcuts for the Desktop and Start menu. Try creating them later through Bloxstrap Settings..
|
||||
/// Looks up a localized string similar to Bloxstrap was unable to create shortcuts for the Desktop and Start menu. Try creating them later through the settings..
|
||||
/// </summary>
|
||||
public static string Dialog_CannotCreateShortcuts {
|
||||
get {
|
||||
@ -1274,29 +1319,11 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Create Desktop shortcuts.
|
||||
/// Looks up a localized string similar to These are general shortcuts that bring up a multi-choice launch menu. Shortcuts for specific functions can be created later in the settings..
|
||||
/// </summary>
|
||||
public static string Installer_Install_Shortcuts_Desktop {
|
||||
public static string Installer_Install_Shortcuts_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Installer.Install.Shortcuts.Desktop", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Create Start Menu shortcuts.
|
||||
/// </summary>
|
||||
public static string Installer_Install_Shortcuts_StartMenu {
|
||||
get {
|
||||
return ResourceManager.GetString("Installer.Install.Shortcuts.StartMenu", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Shortcuts.
|
||||
/// </summary>
|
||||
public static string Installer_Install_Shortcuts_Title {
|
||||
get {
|
||||
return ResourceManager.GetString("Installer.Install.Shortcuts.Title", resourceCulture);
|
||||
return ResourceManager.GetString("Installer.Install.Shortcuts.Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1781,24 +1808,6 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Bloxstrap will place an icon on the desktop that launches Roblox the next time it launches..
|
||||
/// </summary>
|
||||
public static string Menu_Behaviour_CreateDesktopIcon_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Behaviour.CreateDesktopIcon.Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Create desktop icon.
|
||||
/// </summary>
|
||||
public static string Menu_Behaviour_CreateDesktopIcon_Title {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Behaviour.CreateDesktopIcon.Title", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Configure what Bloxstrap should do when launching..
|
||||
/// </summary>
|
||||
@ -2868,6 +2877,51 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Configure how Bloxstrap can be readily launched..
|
||||
/// </summary>
|
||||
public static string Menu_Shortcuts_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Shortcuts.Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Create shortcuts for quick access to specific functions. These will all be placed on the Desktop..
|
||||
/// </summary>
|
||||
public static string Menu_Shortcuts_Function_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Shortcuts.Function.Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Function.
|
||||
/// </summary>
|
||||
public static string Menu_Shortcuts_Function_Title {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Shortcuts.Function.Title", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to These are the shortcuts that bring up the multi-choice launch menu..
|
||||
/// </summary>
|
||||
public static string Menu_Shortcuts_General_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Shortcuts.General.Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to General.
|
||||
/// </summary>
|
||||
public static string Menu_Shortcuts_General_Title {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Shortcuts.General.Title", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Bloxstrap Settings.
|
||||
/// </summary>
|
||||
|
@ -287,12 +287,11 @@ Your ReShade configuration files will still be saved, and you can locate them by
|
||||
<value>Location</value>
|
||||
</data>
|
||||
<data name="ContextMenu.ServerInformation.Notification.Text" xml:space="preserve">
|
||||
<value>Located at {0}
|
||||
<value>Location: {0}
|
||||
Click for more information</value>
|
||||
</data>
|
||||
<data name="ContextMenu.ServerInformation.Notification.Title" xml:space="preserve">
|
||||
<value>Connected to {0} server</value>
|
||||
<comment>Enums.ServerType fills in {0} and is dynamically converted to lowercase when inserted here</comment>
|
||||
<data name="ContextMenu.ServerInformation.Notification.Title.Public" xml:space="preserve">
|
||||
<value>Connected to public server</value>
|
||||
</data>
|
||||
<data name="ContextMenu.ServerInformation.Title" xml:space="preserve">
|
||||
<value>Server information</value>
|
||||
@ -557,12 +556,6 @@ Would you like to upgrade your currently installed version?</value>
|
||||
<data name="Menu.Behaviour.ConfirmLaunches.Title" xml:space="preserve">
|
||||
<value>Prompt to confirm when launching another Roblox instance</value>
|
||||
</data>
|
||||
<data name="Menu.Behaviour.CreateDesktopIcon.Description" xml:space="preserve">
|
||||
<value>Bloxstrap will place an icon on the desktop that launches Roblox the next time it launches.</value>
|
||||
</data>
|
||||
<data name="Menu.Behaviour.CreateDesktopIcon.Title" xml:space="preserve">
|
||||
<value>Create desktop icon</value>
|
||||
</data>
|
||||
<data name="Menu.Behaviour.Description" xml:space="preserve">
|
||||
<value>Configure what Bloxstrap should do when launching.</value>
|
||||
</data>
|
||||
@ -1031,14 +1024,14 @@ This installation process will be quick and simple, and you will be able to conf
|
||||
<data name="Installer.Install.Location.DataFound" xml:space="preserve">
|
||||
<value>Existing data found. Your mods and settings will be restored.</value>
|
||||
</data>
|
||||
<data name="Installer.Install.Shortcuts.Title" xml:space="preserve">
|
||||
<data name="Common.Shortcuts" xml:space="preserve">
|
||||
<value>Shortcuts</value>
|
||||
</data>
|
||||
<data name="Installer.Install.Shortcuts.Desktop" xml:space="preserve">
|
||||
<value>Create Desktop shortcuts</value>
|
||||
<data name="Common.Shortcuts.Desktop" xml:space="preserve">
|
||||
<value>Desktop icon</value>
|
||||
</data>
|
||||
<data name="Installer.Install.Shortcuts.StartMenu" xml:space="preserve">
|
||||
<value>Create Start Menu shortcuts</value>
|
||||
<data name="Common.Shortcuts.StartMenu" xml:space="preserve">
|
||||
<value>Start Menu icon</value>
|
||||
</data>
|
||||
<data name="Installer.Completion.Text" xml:space="preserve">
|
||||
<value>Bloxstrap has successfully been installed.
|
||||
@ -1101,11 +1094,35 @@ Bloxstrap was installed at "{1}".</value>
|
||||
<value>You currently do not have the WebView2 runtime installed. Some Roblox features will not work properly without it, such as the desktop app. Would you like to download it now?</value>
|
||||
</data>
|
||||
<data name="Dialog.CannotCreateShortcuts" xml:space="preserve">
|
||||
<value>Bloxstrap was unable to create shortcuts for the Desktop and Start menu. Try creating them later through Bloxstrap Settings.</value>
|
||||
<value>Bloxstrap was unable to create shortcuts for the Desktop and Start menu. Try creating them later through the settings.</value>
|
||||
</data>
|
||||
<data name="Dialog.Exception.Info.2.Alt" xml:space="preserve">
|
||||
<value>Check the [Bloxstrap Wiki]({0}) first to see if this problem has already been addressed with a fix.
|
||||
|
||||
If not, then please report this exception to the maintainers of this fork. Do NOT report this to Bloxstrap's GitHub issues, as this is an unoffical build.</value>
|
||||
</data>
|
||||
<data name="Installer.Install.Shortcuts.Description" xml:space="preserve">
|
||||
<value>These are general shortcuts that bring up a multi-choice launch menu. Shortcuts for specific functions can be created later in the settings.</value>
|
||||
</data>
|
||||
<data name="Menu.Shortcuts.Description" xml:space="preserve">
|
||||
<value>Configure how Bloxstrap can be readily launched.</value>
|
||||
</data>
|
||||
<data name="Menu.Shortcuts.General.Title" xml:space="preserve">
|
||||
<value>General</value>
|
||||
</data>
|
||||
<data name="Menu.Shortcuts.General.Description" xml:space="preserve">
|
||||
<value>These are the shortcuts that bring up the multi-choice launch menu.</value>
|
||||
</data>
|
||||
<data name="Menu.Shortcuts.Function.Title" xml:space="preserve">
|
||||
<value>Function</value>
|
||||
</data>
|
||||
<data name="Menu.Shortcuts.Function.Description" xml:space="preserve">
|
||||
<value>Create shortcuts for quick access to specific functions. These will all be placed on the Desktop.</value>
|
||||
</data>
|
||||
<data name="ContextMenu.ServerInformation.Notification.Title.Private" xml:space="preserve">
|
||||
<value>Connected to private server</value>
|
||||
</data>
|
||||
<data name="ContextMenu.ServerInformation.Notification.Title.Reserved" xml:space="preserve">
|
||||
<value>Connected to reserved server</value>
|
||||
</data>
|
||||
</root>
|
||||
|
@ -35,7 +35,7 @@
|
||||
</ui:Card>
|
||||
|
||||
<TextBlock Margin="0,8,0,0" FontSize="14" Text="{x:Static resources:Strings.Installer_Install_Location_DataFound}" Visibility="{Binding DataFoundMessageVisibility, Mode=OneWay}" TextWrapping="Wrap" />
|
||||
<TextBlock FontSize="14" Text="{Binding ErrorMessage, Mode=OneWay}" Foreground="{DynamicResource SystemFillColorCriticalBrush}" TextWrapping="Wrap" Margin="0,4,0,0">
|
||||
<TextBlock Margin="0,8,0,0" FontSize="14" Text="{Binding ErrorMessage, Mode=OneWay}" Foreground="{DynamicResource SystemFillColorCriticalBrush}" TextWrapping="Wrap">
|
||||
<TextBlock.Style>
|
||||
<Style>
|
||||
<Style.Triggers>
|
||||
@ -47,15 +47,16 @@
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
|
||||
<TextBlock FontSize="20" FontWeight="SemiBold" Text="{x:Static resources:Strings.Installer_Install_Shortcuts_Title}" TextWrapping="Wrap" Margin="0,16,0,0" />
|
||||
<TextBlock FontSize="20" FontWeight="SemiBold" Text="{x:Static resources:Strings.Common_Shortcuts}" TextWrapping="Wrap" Margin="0,16,0,0" />
|
||||
<TextBlock FontSize="14" Text="{x:Static resources:Strings.Installer_Install_Shortcuts_Description}" TextWrapping="Wrap" />
|
||||
|
||||
<controls:OptionControl
|
||||
Header="{x:Static resources:Strings.Installer_Install_Shortcuts_Desktop}">
|
||||
Header="{x:Static resources:Strings.Common_Shortcuts_Desktop}">
|
||||
<ui:ToggleSwitch IsChecked="{Binding CreateDesktopShortcuts, Mode=TwoWay}" />
|
||||
</controls:OptionControl>
|
||||
|
||||
<controls:OptionControl
|
||||
Header="{x:Static resources:Strings.Installer_Install_Shortcuts_StartMenu}">
|
||||
Header="{x:Static resources:Strings.Common_Shortcuts_StartMenu}">
|
||||
<ui:ToggleSwitch IsChecked="{Binding CreateStartMenuShortcuts, Mode=TwoWay}" />
|
||||
</controls:OptionControl>
|
||||
</StackPanel>
|
||||
|
@ -55,6 +55,7 @@
|
||||
<ui:NavigationItem Content="{x:Static resources:Strings.Menu_FastFlags_Title}" PageType="{x:Type pages:FastFlagsPage}" Icon="Flag24" Tag="fastflags" />
|
||||
<ui:NavigationItem Content="{x:Static resources:Strings.Menu_Appearance_Title}" PageType="{x:Type pages:AppearancePage}" Icon="PaintBrush24" Tag="appearance" />
|
||||
<ui:NavigationItem Content="{x:Static resources:Strings.Menu_Behaviour_Title}" PageType="{x:Type pages:BehaviourPage}" Icon="Settings24" Tag="behaviour" />
|
||||
<ui:NavigationItem Content="{x:Static resources:Strings.Common_Shortcuts}" PageType="{x:Type pages:ShortcutsPage}" Icon="Apps28" Tag="shortcuts" />
|
||||
|
||||
<ui:NavigationItem Content="{x:Static resources:Strings.Menu_FastFlagEditor_Title}" PageType="{x:Type pages:FastFlagEditorPage}" Tag="fastflageditor" Visibility="Collapsed" />
|
||||
<ui:NavigationItem Content="" PageType="{x:Type pages:FastFlagEditorWarningPage}" Tag="fastflageditorwarning" Visibility="Collapsed" x:Name="EditorWarningNavItem" />
|
||||
|
@ -17,12 +17,6 @@
|
||||
<StackPanel Margin="0,0,14,14">
|
||||
<TextBlock Margin="0,0,0,8" Text="{x:Static resources:Strings.Menu_Behaviour_Description}" FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
|
||||
<controls:OptionControl
|
||||
Header="{x:Static resources:Strings.Menu_Behaviour_CreateDesktopIcon_Title}"
|
||||
Description="{x:Static resources:Strings.Menu_Behaviour_CreateDesktopIcon_Description}">
|
||||
<ui:ToggleSwitch IsChecked="{Binding CreateDesktopIcon, Mode=TwoWay}" />
|
||||
</controls:OptionControl>
|
||||
|
||||
<controls:OptionControl
|
||||
Header="{x:Static resources:Strings.Menu_Behaviour_AutoUpdate_Title}"
|
||||
Description="{x:Static resources:Strings.Menu_Behaviour_AutoUpdate_Description}">
|
||||
|
@ -51,9 +51,9 @@
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="{x:Static resources:Strings.Common_Presets}" FontSize="20" FontWeight="Medium" Margin="0,16,0,0" />
|
||||
<controls:MarkdownTextBlock MarkdownText="{Binding Source={x:Static resources:Strings.Menu_FastFlags_Presets_D3DExclusiveFullscreenInfo}, Converter={StaticResource StringFormatConverter}, ConverterParameter='https://github.com/pizzaboxer/bloxstrap/wiki/A-guide-to-FastFlags#exclusive-fullscreen'}" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
|
||||
<TextBlock Text="{x:Static resources:Strings.Menu_FastFlags_Presets_Categories_Rendering}" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
|
||||
<controls:MarkdownTextBlock MarkdownText="{Binding Source={x:Static resources:Strings.Menu_FastFlags_Presets_D3DExclusiveFullscreenInfo}, Converter={StaticResource StringFormatConverter}, ConverterParameter='https://github.com/pizzaboxer/bloxstrap/wiki/A-guide-to-FastFlags#exclusive-fullscreen'}" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
|
||||
<controls:OptionControl
|
||||
Header="{x:Static resources:Strings.Menu_FastFlags_Presets_MSAA_Title}">
|
||||
|
55
Bloxstrap/UI/Elements/Settings/Pages/ShortcutsPage.xaml
Normal file
55
Bloxstrap/UI/Elements/Settings/Pages/ShortcutsPage.xaml
Normal file
@ -0,0 +1,55 @@
|
||||
<ui:UiPage x:Class="Bloxstrap.UI.Elements.Settings.Pages.ShortcutsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
xmlns:local="clr-namespace:Bloxstrap.UI.Elements.Settings.Pages"
|
||||
xmlns:controls="clr-namespace:Bloxstrap.UI.Elements.Controls"
|
||||
xmlns:models="clr-namespace:Bloxstrap.UI.ViewModels.Settings"
|
||||
xmlns:resources="clr-namespace:Bloxstrap.Resources"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="600" d:DesignWidth="800"
|
||||
Title="ShortcutsPage"
|
||||
Scrollable="True">
|
||||
|
||||
<StackPanel Margin="0,0,14,14">
|
||||
<TextBlock Margin="0,0,0,16" Text="{x:Static resources:Strings.Menu_Shortcuts_Description}" FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
|
||||
<TextBlock Text="{x:Static resources:Strings.Menu_Shortcuts_General_Title}" FontSize="20" FontWeight="Medium" />
|
||||
<TextBlock Text="{x:Static resources:Strings.Menu_Shortcuts_General_Description}" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<controls:OptionControl Grid.Column="0" Margin="0,0,4,0" Header="{x:Static resources:Strings.Common_Shortcuts_Desktop}">
|
||||
<ui:ToggleSwitch IsChecked="{Binding DesktopIcon, Mode=TwoWay}" />
|
||||
</controls:OptionControl>
|
||||
|
||||
<controls:OptionControl Grid.Column="1" Margin="4,0,0,0" Header="{x:Static resources:Strings.Common_Shortcuts_StartMenu}">
|
||||
<ui:ToggleSwitch IsChecked="{Binding StartMenuIcon, Mode=TwoWay}" />
|
||||
</controls:OptionControl>
|
||||
</Grid>
|
||||
|
||||
<TextBlock Text="{x:Static resources:Strings.Menu_Shortcuts_Function_Title}" FontSize="20" FontWeight="Medium" Margin="0,16,0,0" />
|
||||
<TextBlock Text="{x:Static resources:Strings.Menu_Shortcuts_Function_Description}" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<controls:OptionControl Grid.Column="0" Margin="0,0,4,0" Header="{x:Static resources:Strings.LaunchMenu_LaunchRoblox}">
|
||||
<ui:ToggleSwitch IsChecked="{Binding PlayerIcon, Mode=TwoWay}" />
|
||||
</controls:OptionControl>
|
||||
|
||||
<controls:OptionControl Grid.Column="1" Margin="4,0,0,0" Header="{x:Static resources:Strings.Menu_Title}">
|
||||
<ui:ToggleSwitch IsChecked="{Binding SettingsIcon, Mode=TwoWay}" />
|
||||
</controls:OptionControl>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</ui:UiPage>
|
31
Bloxstrap/UI/Elements/Settings/Pages/ShortcutsPage.xaml.cs
Normal file
31
Bloxstrap/UI/Elements/Settings/Pages/ShortcutsPage.xaml.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
using Bloxstrap.UI.ViewModels.Settings;
|
||||
|
||||
namespace Bloxstrap.UI.Elements.Settings.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ShortcutsPage.xaml
|
||||
/// </summary>
|
||||
public partial class ShortcutsPage
|
||||
{
|
||||
public ShortcutsPage()
|
||||
{
|
||||
DataContext = new ShortcutsViewModel();
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
@ -87,9 +87,15 @@ namespace Bloxstrap.UI
|
||||
public async void OnGameJoin()
|
||||
{
|
||||
string serverLocation = await _activityWatcher!.GetServerLocation();
|
||||
string title = _activityWatcher.ActivityServerType switch
|
||||
{
|
||||
ServerType.Public => Resources.Strings.ContextMenu_ServerInformation_Notification_Title_Public,
|
||||
ServerType.Private => Resources.Strings.ContextMenu_ServerInformation_Notification_Title_Private,
|
||||
ServerType.Reserved => Resources.Strings.ContextMenu_ServerInformation_Notification_Title_Reserved
|
||||
};
|
||||
|
||||
ShowAlert(
|
||||
String.Format(Resources.Strings.ContextMenu_ServerInformation_Notification_Title, _activityWatcher.ActivityServerType.ToTranslatedString().ToLower()),
|
||||
title,
|
||||
String.Format(Resources.Strings.ContextMenu_ServerInformation_Notification_Text, serverLocation),
|
||||
10,
|
||||
(_, _) => _menuContainer?.ShowServerInformationWindow()
|
||||
|
@ -5,12 +5,6 @@
|
||||
private string _oldPlayerVersionGuid = "";
|
||||
private string _oldStudioVersionGuid = "";
|
||||
|
||||
public bool CreateDesktopIcon
|
||||
{
|
||||
get => App.Settings.Prop.CreateDesktopIcon;
|
||||
set => App.Settings.Prop.CreateDesktopIcon = value;
|
||||
}
|
||||
|
||||
public bool UpdateCheckingEnabled
|
||||
{
|
||||
get => App.Settings.Prop.CheckForUpdates;
|
||||
|
@ -16,6 +16,11 @@ namespace Bloxstrap.UI.ViewModels.Settings
|
||||
App.State.Save();
|
||||
App.FastFlags.Save();
|
||||
|
||||
foreach (var task in App.PendingSettingTasks)
|
||||
task.Value.Execute();
|
||||
|
||||
App.PendingSettingTasks.Clear();
|
||||
|
||||
RequestSaveNoticeEvent?.Invoke(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
54
Bloxstrap/UI/ViewModels/Settings/ShortcutsViewModel.cs
Normal file
54
Bloxstrap/UI/ViewModels/Settings/ShortcutsViewModel.cs
Normal file
@ -0,0 +1,54 @@
|
||||
using Bloxstrap.Models.SettingTasks;
|
||||
using Bloxstrap.Resources;
|
||||
|
||||
namespace Bloxstrap.UI.ViewModels.Settings
|
||||
{
|
||||
public class ShortcutsViewModel : NotifyPropertyChangedViewModel
|
||||
{
|
||||
private ShortcutTask _desktopIconTask = new(Path.Combine(Paths.Desktop, "Bloxstrap.lnk"))
|
||||
{
|
||||
Name = "DesktopIcon"
|
||||
};
|
||||
|
||||
private ShortcutTask _startMenuIconTask = new(Path.Combine(Paths.WindowsStartMenu, "Bloxstrap.lnk"))
|
||||
{
|
||||
Name = "StartMenuIcon"
|
||||
};
|
||||
|
||||
private ShortcutTask _playerIconTask = new(Path.Combine(Paths.Desktop, $"{Strings.LaunchMenu_LaunchRoblox}.lnk"))
|
||||
{
|
||||
Name = "RobloxPlayerIcon",
|
||||
ExeFlags = "-player"
|
||||
};
|
||||
|
||||
private ShortcutTask _settingsIconTask = new(Path.Combine(Paths.Desktop, $"{Strings.Menu_Title}.lnk"))
|
||||
{
|
||||
Name = "SettingsIcon",
|
||||
ExeFlags = "-settings"
|
||||
};
|
||||
|
||||
public bool DesktopIcon
|
||||
{
|
||||
get => _desktopIconTask.NewState;
|
||||
set => _desktopIconTask.NewState = value;
|
||||
}
|
||||
|
||||
public bool StartMenuIcon
|
||||
{
|
||||
get => _startMenuIconTask.NewState;
|
||||
set => _startMenuIconTask.NewState = value;
|
||||
}
|
||||
|
||||
public bool PlayerIcon
|
||||
{
|
||||
get => _playerIconTask.NewState;
|
||||
set => _playerIconTask.NewState = value;
|
||||
}
|
||||
|
||||
public bool SettingsIcon
|
||||
{
|
||||
get => _settingsIconTask.NewState;
|
||||
set => _settingsIconTask.NewState = value;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user