Add button to open ClientAppSettings.json

This commit is contained in:
pizzaboxer 2023-05-01 21:57:46 +01:00
parent e6bfac46fe
commit c04dba8d73
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
2 changed files with 101 additions and 78 deletions

View File

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.IO;
using System.Windows.Input; using System.Windows.Input;
using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Input;
@ -16,8 +17,10 @@ namespace Bloxstrap.ViewModels
public void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); public void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
public ICommand OpenModsFolderCommand => new RelayCommand(OpenModsFolder); public ICommand OpenModsFolderCommand => new RelayCommand(OpenModsFolder);
public ICommand OpenClientSettingsCommand => new RelayCommand(OpenClientSettings);
private void OpenModsFolder() => Process.Start("explorer.exe", Directories.Modifications); private void OpenModsFolder() => Process.Start("explorer.exe", Directories.Modifications);
private void OpenClientSettings() => Utilities.OpenWebsite(Path.Combine(Directories.Modifications, "ClientSettings\\ClientAppSettings.json"));
public bool OldDeathSoundEnabled public bool OldDeathSoundEnabled
{ {

View File

@ -13,11 +13,15 @@
<TextBlock Text="Manage and apply file mods to the Roblox game client." FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" /> <TextBlock Text="Manage and apply file mods to the Roblox game client." FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
<Grid Margin="0,16,0,0"> <Grid Margin="0,16,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<ui:CardAction Grid.Column="0" x:Name="OpenModFolderCardAction" Margin="0,0,4,0" Padding="16,13,16,12" Icon="Folder24" Command="{Binding OpenModsFolderCommand}" IsEnabled="{Binding Source={x:Static models:GlobalViewModel.IsNotFirstRun}, Mode=OneTime}"> <ui:CardAction Grid.Row="0" Grid.Column="0" x:Name="OpenModFolderCardAction" Margin="0,0,4,0" Padding="16,13,16,12" Icon="Folder24" Command="{Binding OpenModsFolderCommand}" IsEnabled="{Binding Source={x:Static models:GlobalViewModel.IsNotFirstRun}, Mode=OneTime}">
<StackPanel> <StackPanel>
<TextBlock FontSize="14" Text="Open Mods Folder"> <TextBlock FontSize="14" Text="Open Mods Folder">
<!--this is so fucking stupid the disabled state of the cardaction doesnt change the header text colour--> <!--this is so fucking stupid the disabled state of the cardaction doesnt change the header text colour-->
@ -45,12 +49,40 @@
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
</ui:CardAction> </ui:CardAction>
<ui:CardAction Grid.Column="1" Margin="4,0,0,0" Padding="16,13,16,12" Icon="BookQuestionMark24" Command="models:GlobalViewModel.OpenWebpageCommand" CommandParameter="https://github.com/pizzaboxer/bloxstrap/wiki/Adding-custom-mods"> <ui:CardAction Grid.Row="1" Grid.ColumnSpan="2" Margin="0,8,0,0" Padding="16,13,16,12" Icon="BookQuestionMark24" Command="models:GlobalViewModel.OpenWebpageCommand" CommandParameter="https://github.com/pizzaboxer/bloxstrap/wiki/Adding-custom-mods">
<StackPanel> <StackPanel>
<TextBlock FontSize="14" Text="Help" /> <TextBlock FontSize="14" Text="Help" />
<TextBlock Margin="0,2,0,0" FontSize="12" Text="See info about managing and creating mods." Padding="0,0,16,0" Foreground="{DynamicResource TextFillColorTertiaryBrush}" /> <TextBlock Margin="0,2,0,0" FontSize="12" Text="See info about managing and creating mods." Padding="0,0,16,0" Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
</StackPanel> </StackPanel>
</ui:CardAction> </ui:CardAction>
<ui:CardAction x:Name="OpenClientSettingsCardAction" Grid.Row="0" Grid.Column="1" Margin="4,0,0,0" Padding="16,13,16,12" Icon="DocumentEdit24" Command="{Binding OpenClientSettingsCommand}" IsEnabled="{Binding Source={x:Static models:GlobalViewModel.IsNotFirstRun}, Mode=OneTime}">
<StackPanel>
<TextBlock FontSize="14" Text="Edit FastFlags">
<!--this is so fucking stupid the disabled state of the cardaction doesnt change the header text colour-->
<TextBlock.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=OpenModFolderCardAction, Path=IsEnabled, Mode=OneTime}" Value="False">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Margin="0,2,0,0" FontSize="12" Foreground="{DynamicResource TextFillColorTertiaryBrush}">
<TextBlock.Style>
<Style>
<Setter Property="TextBlock.Text" Value="Open and edit ClientAppSettings.json."/>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=OpenModFolderCardAction, Path=IsEnabled, Mode=OneTime}" Value="False">
<Setter Property="TextBlock.Text" Value="Bloxstrap must first be installed." />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel>
</ui:CardAction>
</Grid> </Grid>
<TextBlock Text="Presets" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" /> <TextBlock Text="Presets" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
@ -94,19 +126,8 @@
</ui:CardControl> </ui:CardControl>
</Grid> </Grid>
<TextBlock Text="FastFlags" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" /> <TextBlock Text="FastFlag Presets" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
<Grid> <ui:CardControl Margin="0,8,0,0" Padding="16,13,16,12">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ui:CardControl Grid.Row="0" Margin="0,8,0,0" Padding="16,13,16,12">
<ui:CardControl.Header> <ui:CardControl.Header>
<StackPanel> <StackPanel>
<TextBlock FontSize="14" Text="Framerate limit" /> <TextBlock FontSize="14" Text="Framerate limit" />
@ -115,7 +136,7 @@
</ui:CardControl.Header> </ui:CardControl.Header>
<ui:TextBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" Text="{Binding FramerateLimit, Mode=TwoWay}" PreviewTextInput="ValidateInt32" /> <ui:TextBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" Text="{Binding FramerateLimit, Mode=TwoWay}" PreviewTextInput="ValidateInt32" />
</ui:CardControl> </ui:CardControl>
<ui:CardControl Grid.Row="1" Margin="0,8,0,0" Padding="16,13,16,12"> <ui:CardControl Margin="0,8,0,0" Padding="16,13,16,12">
<ui:CardControl.Header> <ui:CardControl.Header>
<StackPanel> <StackPanel>
<TextBlock FontSize="14" Text="Rendering mode" /> <TextBlock FontSize="14" Text="Rendering mode" />
@ -124,7 +145,7 @@
</ui:CardControl.Header> </ui:CardControl.Header>
<ComboBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" ItemsSource="{Binding RenderingModes.Keys, Mode=OneTime}" Text="{Binding SelectedRenderingMode, Mode=TwoWay}" /> <ComboBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" ItemsSource="{Binding RenderingModes.Keys, Mode=OneTime}" Text="{Binding SelectedRenderingMode, Mode=TwoWay}" />
</ui:CardControl> </ui:CardControl>
<ui:CardControl Grid.Row="2" Margin="0,8,0,0" Padding="16,13,16,12"> <ui:CardControl Margin="0,8,0,0" Padding="16,13,16,12">
<ui:CardControl.Header> <ui:CardControl.Header>
<StackPanel> <StackPanel>
<TextBlock FontSize="14" Text="Use exclusive fullscreen" /> <TextBlock FontSize="14" Text="Use exclusive fullscreen" />
@ -133,7 +154,7 @@
</ui:CardControl.Header> </ui:CardControl.Header>
<ui:ToggleSwitch IsChecked="{Binding ExclusiveFullscreenEnabled, Mode=TwoWay}" /> <ui:ToggleSwitch IsChecked="{Binding ExclusiveFullscreenEnabled, Mode=TwoWay}" />
</ui:CardControl> </ui:CardControl>
<ui:CardControl Grid.Row="3" Margin="0,8,0,0" Padding="16,13,16,12"> <ui:CardControl Margin="0,8,0,0" Padding="16,13,16,12">
<ui:CardControl.Header> <ui:CardControl.Header>
<StackPanel> <StackPanel>
<TextBlock FontSize="14" Text="Use alternate graphics quality selector" /> <TextBlock FontSize="14" Text="Use alternate graphics quality selector" />
@ -142,7 +163,7 @@
</ui:CardControl.Header> </ui:CardControl.Header>
<ui:ToggleSwitch IsChecked="{Binding AlternateGraphicsSelectorEnabled, Mode=TwoWay}" /> <ui:ToggleSwitch IsChecked="{Binding AlternateGraphicsSelectorEnabled, Mode=TwoWay}" />
</ui:CardControl> </ui:CardControl>
<ui:CardControl Grid.Row="4" Margin="0,8,0,0" Padding="16,13,16,12"> <ui:CardControl Margin="0,8,0,0" Padding="16,13,16,12">
<ui:CardControl.Header> <ui:CardControl.Header>
<StackPanel> <StackPanel>
<TextBlock FontSize="14" Text="In-game menu version" /> <TextBlock FontSize="14" Text="In-game menu version" />
@ -151,7 +172,7 @@
</ui:CardControl.Header> </ui:CardControl.Header>
<ComboBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" ItemsSource="{Binding IGMenuVersions.Keys, Mode=OneTime}" Text="{Binding SelectedIGMenuVersion, Mode=TwoWay}" /> <ComboBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" ItemsSource="{Binding IGMenuVersions.Keys, Mode=OneTime}" Text="{Binding SelectedIGMenuVersion, Mode=TwoWay}" />
</ui:CardControl> </ui:CardControl>
<ui:CardControl Grid.Row="5" Margin="0,8,0,0" Padding="16,13,16,12"> <ui:CardControl Margin="0,8,0,0" Padding="16,13,16,12">
<ui:CardControl.Header> <ui:CardControl.Header>
<StackPanel> <StackPanel>
<TextBlock FontSize="14" Text="Lighting technology" /> <TextBlock FontSize="14" Text="Lighting technology" />
@ -160,7 +181,7 @@
</ui:CardControl.Header> </ui:CardControl.Header>
<ComboBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" ItemsSource="{Binding LightingTechnologies.Keys, Mode=OneTime}" Text="{Binding SelectedLightingTechnology, Mode=TwoWay}" /> <ComboBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" ItemsSource="{Binding LightingTechnologies.Keys, Mode=OneTime}" Text="{Binding SelectedLightingTechnology, Mode=TwoWay}" />
</ui:CardControl> </ui:CardControl>
<ui:CardControl Grid.Row="6" Margin="0,8,0,0" Padding="16,13,16,12"> <ui:CardControl Margin="0,8,0,0" Padding="16,13,16,12">
<ui:CardControl.Header> <ui:CardControl.Header>
<StackPanel> <StackPanel>
<TextBlock FontSize="14" Text="Use mobile interface in desktop app" /> <TextBlock FontSize="14" Text="Use mobile interface in desktop app" />
@ -169,7 +190,6 @@
</ui:CardControl.Header> </ui:CardControl.Header>
<ui:ToggleSwitch IsChecked="{Binding MobileLuaAppInterfaceEnabled, Mode=TwoWay}" /> <ui:ToggleSwitch IsChecked="{Binding MobileLuaAppInterfaceEnabled, Mode=TwoWay}" />
</ui:CardControl> </ui:CardControl>
</Grid>
<StackPanel x:Name="MiscellaneousOptions"> <StackPanel x:Name="MiscellaneousOptions">
<TextBlock Text="Miscellaneous" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" /> <TextBlock Text="Miscellaneous" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />