From 76f2d45f4531529fb63e0e1eafddd5586e9fc561 Mon Sep 17 00:00:00 2001 From: Jeddunk Date: Tue, 19 Jan 2021 13:23:31 +0100 Subject: [PATCH] Added UI elements for global options. Bigger minimal size for main window. --- GoldbergGUI.Core/ViewModels/MainViewModel.cs | 36 ++++++++++++++++++++ GoldbergGUI.WPF/GoldbergGUI.WPF.csproj | 16 +++++++++ GoldbergGUI.WPF/MainWindow.xaml | 2 +- GoldbergGUI.WPF/Views/MainView.xaml | 30 +++++++++++++++- 4 files changed, 82 insertions(+), 2 deletions(-) diff --git a/GoldbergGUI.Core/ViewModels/MainViewModel.cs b/GoldbergGUI.Core/ViewModels/MainViewModel.cs index 8248d5e..d5058c0 100644 --- a/GoldbergGUI.Core/ViewModels/MainViewModel.cs +++ b/GoldbergGUI.Core/ViewModels/MainViewModel.cs @@ -264,6 +264,26 @@ namespace GoldbergGUI.Core.ViewModels } } + public class GlobalHelp + { + public static string Header => + "Information\n"; + + public static string TextPreLink => + "Usually these settings are saved under"; + + public static string Link => "%APPDATA%\\Goldberg SteamEmu Saves\\settings"; + + public static string TextPostLink => + ", which makes these " + + "available for every game that uses the Goldberg Emulator. However, if you want to set specific settings " + + "for certain games (e.g. different language), you can remove the \"Global\" checkmark next to the option " + + "and then change it. If you want to remove that setting, just empty the field while \"Global\" is " + + "unchecked. (Not implemented yet!)"; + } + + public static GlobalHelp G => new GlobalHelp(); + // COMMANDS // public IMvxCommand OpenFileCommand => new MvxAsyncCommand(OpenFile); @@ -503,6 +523,22 @@ namespace GoldbergGUI.Core.ViewModels } }); + public IMvxCommand OpenGlobalSettingsFolderCommand => new MvxCommand(OpenGlobalSettingsFolder); + + private void OpenGlobalSettingsFolder() + { + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + StatusText = "Can't open folder (Windows only)! Ready."; + return; + } + + var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), + "Goldberg SteamEmu Saves", "settings"); + var start = Process.Start("explorer.exe", path); + start?.Dispose(); + } + // OTHER METHODS // private void ResetForm() diff --git a/GoldbergGUI.WPF/GoldbergGUI.WPF.csproj b/GoldbergGUI.WPF/GoldbergGUI.WPF.csproj index 81eaa19..eb4287b 100644 --- a/GoldbergGUI.WPF/GoldbergGUI.WPF.csproj +++ b/GoldbergGUI.WPF/GoldbergGUI.WPF.csproj @@ -20,4 +20,20 @@ + + + + + + + + + + + + + + + + diff --git a/GoldbergGUI.WPF/MainWindow.xaml b/GoldbergGUI.WPF/MainWindow.xaml index 313c271..4d57311 100644 --- a/GoldbergGUI.WPF/MainWindow.xaml +++ b/GoldbergGUI.WPF/MainWindow.xaml @@ -5,6 +5,6 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" - Title="GoldbergGUI" MinHeight="500" MinWidth="600" Background="#FFF0F0F0"> + Title="GoldbergGUI" MinHeight="600" MinWidth="800" Background="#FFF0F0F0"> \ No newline at end of file diff --git a/GoldbergGUI.WPF/Views/MainView.xaml b/GoldbergGUI.WPF/Views/MainView.xaml index 6f2ce2d..eff2105 100644 --- a/GoldbergGUI.WPF/Views/MainView.xaml +++ b/GoldbergGUI.WPF/Views/MainView.xaml @@ -96,20 +96,48 @@ + + +