diff --git a/ModAssistant/App.config b/ModAssistant/App.config index 8d86c3b..b281c7c 100644 --- a/ModAssistant/App.config +++ b/ModAssistant/App.config @@ -41,6 +41,9 @@ True + + + diff --git a/ModAssistant/MainWindow.xaml.cs b/ModAssistant/MainWindow.xaml.cs index 8c1ee59..2ca9375 100644 --- a/ModAssistant/MainWindow.xaml.cs +++ b/ModAssistant/MainWindow.xaml.cs @@ -60,8 +60,6 @@ namespace ModAssistant return; } - Main.Content = Intro.Instance; - List versions; string json = string.Empty; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Utils.Constants.BeatModsAPIUrl + "version"); @@ -94,6 +92,34 @@ namespace ModAssistant { MainWindow.Instance.ModsButton.IsEnabled = true; } + + if (!Properties.Settings.Default.Agreed || String.IsNullOrEmpty(Properties.Settings.Default.LastTab)) + { + Main.Content = Intro.Instance; + } + else + { + switch (Properties.Settings.Default.LastTab) + { + case "Intro": + Main.Content = Intro.Instance; + break; + case "Mods": + Mods.Instance.LoadMods(); + ModsOpened = true; + Main.Content = Mods.Instance; + break; + case "About": + Main.Content = About.Instance; + break; + case "Options": + Main.Content = Options.Instance; + break; + default: + Main.Content = Intro.Instance; + break; + } + } } private string GetGameVersion(List versions) @@ -122,6 +148,8 @@ namespace ModAssistant private void ModsButton_Click(object sender, RoutedEventArgs e) { Main.Content = Mods.Instance; + Properties.Settings.Default.LastTab = "Mods"; + Properties.Settings.Default.Save(); if (!ModsOpened) { @@ -140,16 +168,22 @@ namespace ModAssistant private void IntroButton_Click(object sender, RoutedEventArgs e) { Main.Content = Intro.Instance; + Properties.Settings.Default.LastTab = "Intro"; + Properties.Settings.Default.Save(); } private void AboutButton_Click(object sender, RoutedEventArgs e) { Main.Content = About.Instance; + Properties.Settings.Default.LastTab = "About"; + Properties.Settings.Default.Save(); } private void OptionsButton_Click(object sender, RoutedEventArgs e) { Main.Content = Options.Instance; + Properties.Settings.Default.LastTab = "Options"; + Properties.Settings.Default.Save(); } private void InstallButton_Click(object sender, RoutedEventArgs e) diff --git a/ModAssistant/Properties/Settings.Designer.cs b/ModAssistant/Properties/Settings.Designer.cs index 33cb83f..7fd2b22 100644 --- a/ModAssistant/Properties/Settings.Designer.cs +++ b/ModAssistant/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace ModAssistant.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.1.0.0")] public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -142,5 +142,17 @@ namespace ModAssistant.Properties { this["UpgradeRequired"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string LastTab { + get { + return ((string)(this["LastTab"])); + } + set { + this["LastTab"] = value; + } + } } } diff --git a/ModAssistant/Properties/Settings.settings b/ModAssistant/Properties/Settings.settings index ab282ed..fb36c01 100644 --- a/ModAssistant/Properties/Settings.settings +++ b/ModAssistant/Properties/Settings.settings @@ -32,5 +32,8 @@ True + + + \ No newline at end of file