diff --git a/Knossos.NET/ViewModels/GlobalSettingsViewModel.cs b/Knossos.NET/ViewModels/GlobalSettingsViewModel.cs index 54019739..fe8f7046 100644 --- a/Knossos.NET/ViewModels/GlobalSettingsViewModel.cs +++ b/Knossos.NET/ViewModels/GlobalSettingsViewModel.cs @@ -62,6 +62,8 @@ public partial class GlobalSettingsViewModel : ViewModelBase internal bool isAVX2 = false; [ObservableProperty] internal bool displaySettingsWarning = true; + [ObservableProperty] + internal bool expandKnossosSettings = false; /* Knossos Settings */ [ObservableProperty] @@ -1571,5 +1573,13 @@ internal void ToggleDeveloperOptions() } } + /// + /// Expand Knossos settings section + /// + public void ExpandKnossosSection() + { + ExpandKnossosSettings = true; + } + } } diff --git a/Knossos.NET/ViewModels/Windows/MainWindowViewModel.cs b/Knossos.NET/ViewModels/Windows/MainWindowViewModel.cs index 7c75cd57..3d30c099 100644 --- a/Knossos.NET/ViewModels/Windows/MainWindowViewModel.cs +++ b/Knossos.NET/ViewModels/Windows/MainWindowViewModel.cs @@ -260,6 +260,27 @@ private void FillMenuItemsNormalMode(int defaultSelectedIndex) })); } + /// + /// Click on a menu button by code, it needs the button name + /// + /// + public void ClickOnMenuButton(string buttonName) + { + Dispatcher.UIThread.Invoke(new Action(() => { + if (MenuItems != null) + { + foreach (var item in MenuItems) + { + if (item.label.ToLower() == buttonName.ToLower()) + { + SelectedMenuItem = item; + break; + } + } + } + })); + } + /// /// When the user clicks a sidebar menu item this code is called /// diff --git a/Knossos.NET/ViewModels/Windows/QuickSetupViewModel.cs b/Knossos.NET/ViewModels/Windows/QuickSetupViewModel.cs index 9f28b63f..2bf701f5 100644 --- a/Knossos.NET/ViewModels/Windows/QuickSetupViewModel.cs +++ b/Knossos.NET/ViewModels/Windows/QuickSetupViewModel.cs @@ -2,6 +2,7 @@ using Avalonia.Threading; using CommunityToolkit.Mvvm.ComponentModel; using Knossos.NET.Models; +using Knossos.NET.Views; using System.Threading.Tasks; namespace Knossos.NET.ViewModels @@ -215,6 +216,18 @@ public void DownloadLatestStable() UpdateBuildInstallButton(); } } - } + } + + public void ClickSettingsButton() + { + MainWindowViewModel.Instance?.ClickOnMenuButton("Settings"); + MainWindowViewModel.Instance?.GlobalSettingsView?.ExpandKnossosSection(); + } + + public void ClickEngineButton() + { + MainWindowViewModel.Instance?.ClickOnMenuButton("Engine"); + } + } } diff --git a/Knossos.NET/Views/GlobalSettingsView.axaml b/Knossos.NET/Views/GlobalSettingsView.axaml index 1d726a6c..d20f8217 100644 --- a/Knossos.NET/Views/GlobalSettingsView.axaml +++ b/Knossos.NET/Views/GlobalSettingsView.axaml @@ -21,7 +21,7 @@ - + KnossosNET is running in portable mode @@ -62,6 +63,7 @@ Go to the "Engine" tab, select "Stable Builds" and download the newest stable, it should be always the top one on the list. Engine build detected! Keep in mind that some mods may download and run on different versions of the FSO engine. This is because some mods cannot run on newer builds or they require a specific FSO build version. You can always change the FSO build used by a mod by opening the "Mod Settings" on the mod card, but keep in mind not all mods can run on all engine builds. @@ -71,8 +73,9 @@ Freespace 2 Retail (Optional) In order to have access to Freespace 1 and 2 content and visual improvements you need to install Freespace 2 Retail in KnossosNET. If you do not install Freespace 2 Retail, then any content that needs the full Freespace 2 retail files will not be displayed on the "Explore" tab. - If you do not have the retail FS2 installed into KnossosNET you can still play total conversion mods, which are mods that are completely standalone and do not depend on any of the Freespace content. - To install Freespace 2 go to the "Settings" tab and open the "FS2 Retail Installer" button under the "KnossosNET Settings" section. Then follow the instructions there. If you already have FS2 installed this button is not available. + If you do not have the retail FS2 installed into KnossosNET you can still play total conversion mods, which are mods that are completely standalone and do not depend on any of the Freespace content. + To install Freespace 2 go to the "Settings" tab and open the "FS2 Retail Installer" button under the "KnossosNET Settings" section. Then follow the instructions there. If you already have FS2 installed this button is not available. + This step is optional and you can continue at any time.