Add easy access to player compatibility settings

This commit is contained in:
pizzaboxer 2024-09-12 10:53:43 +01:00
parent c5fa2c0bc0
commit 1b60e30a0b
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
6 changed files with 66 additions and 3 deletions

View File

@ -2,4 +2,4 @@
FlashWindow
GetWindowLong
SetWindowLong
EnumDisplaySettings
SHObjectProperties

View File

@ -557,6 +557,15 @@ namespace Bloxstrap.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Roblox has not yet been installed. Please launch Roblox using Bloxstrap at least once before trying to use this option..
/// </summary>
public static string Common_RobloxNotInstalled {
get {
return ResourceManager.GetString("Common.RobloxNotInstalled", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Shortcuts.
/// </summary>
@ -2809,6 +2818,24 @@ namespace Bloxstrap.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Configure application parameters such as DPI scaling behaviour and [fullscreen optimizations]({0})..
/// </summary>
public static string Menu_Mods_Misc_CompatibilitySettings_Description {
get {
return ResourceManager.GetString("Menu.Mods.Misc.CompatibilitySettings.Description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Manage compatibility settings.
/// </summary>
public static string Menu_Mods_Misc_CompatibilitySettings_Title {
get {
return ResourceManager.GetString("Menu.Mods.Misc.CompatibilitySettings.Title", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Choose font....
/// </summary>

View File

@ -1183,4 +1183,13 @@ Please manually delete Bloxstrap.exe from the install location or try restarting
<data name="Common.NotAvailable" xml:space="preserve">
<value>Not available</value>
</data>
<data name="Menu.Mods.Misc.CompatibilitySettings.Title" xml:space="preserve">
<value>Manage compatibility settings</value>
</data>
<data name="Menu.Mods.Misc.CompatibilitySettings.Description" xml:space="preserve">
<value>Configure application parameters such as DPI scaling behaviour and [fullscreen optimizations]({0}).</value>
</data>
<data name="Common.RobloxNotInstalled" xml:space="preserve">
<value>Roblox has not yet been installed. Please launch Roblox using Bloxstrap at least once before trying to use this option.</value>
</data>
</root>

View File

@ -25,18 +25,27 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ui:CardAction Grid.Row="0" Grid.Column="0" x:Name="OpenModFolderCardAction" Margin="0,0,4,0" Icon="Folder24" Command="{Binding OpenModsFolderCommand}">
<StackPanel>
<TextBlock FontSize="14" Text="{x:Static resources:Strings.Menu_Mods_OpenModsFolder_Title}" TextWrapping="Wrap" />
<TextBlock Margin="0,2,0,0" FontSize="12" Text="{x:Static resources:Strings.Menu_Mods_OpenModsFolder_Description}" Foreground="{DynamicResource TextFillColorTertiaryBrush}" TextWrapping="Wrap" />
</StackPanel>
</ui:CardAction>
<ui:CardAction Grid.Row="0" Grid.Column="1" Margin="4,0,0,0" Icon="BookQuestionMark24" Command="models:GlobalViewModel.OpenWebpageCommand" CommandParameter="https://github.com/pizzaboxer/bloxstrap/wiki/Adding-custom-mods">
<StackPanel>
<TextBlock FontSize="14" Text="{x:Static resources:Strings.Common_Help}" />
<TextBlock Margin="0,2,0,0" FontSize="12" Text="{x:Static resources:Strings.Menu_Mods_Help_Description}" Padding="0,0,16,0" Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
</StackPanel>
</ui:CardAction>
<ui:CardAction Grid.Row="1" Grid.ColumnSpan="2" Margin="0,8,0,0" Icon="WindowWrench24" Command="{Binding OpenCompatSettingsCommand}">
<StackPanel>
<TextBlock FontSize="14" Text="{x:Static resources:Strings.Menu_Mods_Misc_CompatibilitySettings_Title}" TextWrapping="Wrap" />
<controls:MarkdownTextBlock Margin="0,2,0,0" FontSize="12" MarkdownText="{Binding Source={x:Static resources:Strings.Menu_Mods_Misc_CompatibilitySettings_Description}, Converter={StaticResource StringFormatConverter}, ConverterParameter='https://devblogs.microsoft.com/directx/demystifying-full-screen-optimizations/'}" Foreground="{DynamicResource TextFillColorTertiaryBrush}" TextWrapping="Wrap" />
</StackPanel>
</ui:CardAction>
</Grid>
<TextBlock Text="{x:Static resources:Strings.Common_Presets}" FontSize="20" FontWeight="Medium" Margin="0,16,0,0" />

View File

@ -1,8 +1,6 @@
using System.Collections.ObjectModel;
using System.Windows.Input;
using Bloxstrap.Resources;
using Microsoft.Win32;
using CommunityToolkit.Mvvm.Input;
@ -12,7 +10,9 @@ namespace Bloxstrap.UI.ViewModels.Settings
public class IntegrationsViewModel : NotifyPropertyChangedViewModel
{
public ICommand AddIntegrationCommand => new RelayCommand(AddIntegration);
public ICommand DeleteIntegrationCommand => new RelayCommand(DeleteIntegration);
public ICommand BrowseIntegrationLocationCommand => new RelayCommand(BrowseIntegrationLocation);
private void AddIntegration()

View File

@ -3,9 +3,14 @@ using System.Windows.Input;
using Microsoft.Win32;
using Windows.Win32;
using Windows.Win32.UI.Shell;
using Windows.Win32.Foundation;
using CommunityToolkit.Mvvm.Input;
using Bloxstrap.Models.SettingTasks;
using Bloxstrap.AppData;
namespace Bloxstrap.UI.ViewModels.Settings
{
@ -59,6 +64,8 @@ namespace Bloxstrap.UI.ViewModels.Settings
public ICommand ManageCustomFontCommand => new RelayCommand(ManageCustomFont);
public ICommand OpenCompatSettingsCommand => new RelayCommand(OpenCompatSettings);
public ModPresetTask OldDeathSoundTask { get; } = new("OldDeathSound", @"content\sounds\ouch.ogg", "Sounds.OldDeath.ogg");
public ModPresetTask OldAvatarBackgroundTask { get; } = new("OldAvatarBackground", @"ExtraContent\places\Mobile.rbxl", "OldAvatarBackground.rbxl");
@ -95,5 +102,16 @@ namespace Bloxstrap.UI.ViewModels.Settings
});
public FontModPresetTask TextFontTask { get; } = new();
private void OpenCompatSettings()
{
string path = new RobloxPlayerData().ExecutablePath;
if (File.Exists(path))
PInvoke.SHObjectProperties(HWND.Null, SHOP_TYPE.SHOP_FILEPATH, path, "Compatibility");
else
Frontend.ShowMessageBox(Strings.Common_RobloxNotInstalled, MessageBoxImage.Error);
}
}
}