This commit is contained in:
Assistant 2019-06-27 07:11:40 -07:00
parent c9893cfe06
commit 8c4ecc5b81
4 changed files with 55 additions and 3 deletions

View file

@ -41,6 +41,9 @@
<setting name="UpgradeRequired" serializeAs="String">
<value>True</value>
</setting>
<setting name="LastTab" serializeAs="String">
<value />
</setting>
</ModAssistant.Properties.Settings>
<ModAssistant.Settings1>
<setting name="InstallFolder" serializeAs="String">

View file

@ -60,8 +60,6 @@ namespace ModAssistant
return;
}
Main.Content = Intro.Instance;
List<string> 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<string> 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)

View file

@ -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;
}
}
}
}

View file

@ -32,5 +32,8 @@
<Setting Name="UpgradeRequired" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="LastTab" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>