diff --git a/ShiftOS.WinForms/FakeSetupScreen.cs b/ShiftOS.WinForms/FakeSetupScreen.cs index d0b04fb..dd93a55 100644 --- a/ShiftOS.WinForms/FakeSetupScreen.cs +++ b/ShiftOS.WinForms/FakeSetupScreen.cs @@ -348,6 +348,7 @@ So make sure your password is secure enough that it can't be guessed, but easy f ShiftOS.Objects.ShiftFS.Utils.Delete(Paths.GetPath("user.dat")); System.IO.File.WriteAllText(Paths.SaveFile, ShiftOS.Objects.ShiftFS.Utils.ExportMount(0)); SaveSystem.NewSave(); + this.CanClose = true; this.Close(); } } diff --git a/ShiftOS.WinForms/Oobe.cs b/ShiftOS.WinForms/Oobe.cs index 8eef34a..8ff1b53 100644 --- a/ShiftOS.WinForms/Oobe.cs +++ b/ShiftOS.WinForms/Oobe.cs @@ -199,6 +199,8 @@ namespace ShiftOS.WinForms TextType("I have been installing ShiftOS on your system in the background as I was talking with you. Before I can set you free, I need to give you a tutorial on how to use the system."); Thread.Sleep(500); TextType("I will reboot your system in Tutorial Mode now. Complete the tutorial, and you shall be on your way."); + + Thread.Sleep(3000); SaveSystem.CurrentSave = MySave; SaveSystem.CurrentSave.StoryPosition = 1; Utils.WriteAllText(Paths.GetPath("user.dat"), JsonConvert.SerializeObject(new @@ -207,18 +209,10 @@ namespace ShiftOS.WinForms password = MySave.Password })); Shiftorium.Silent = true; - SaveSystem.SaveGame(); - - Thread.Sleep(3000); - try { - TutorialManager.StartTutorial(); - } catch (Exception e) { - TextType("An error has occoured while starting the tutorial"); - TextType(e.ToString()); - } - //this.Close(); // This has been commented out because the form closes when the error appears. Uncomment this if no more errors appear + SaveSystem.SaveGame(); //Yknow, just incase it crashes. + this.Invoke(new Action(this.Close)); } - catch(Exception e) + catch (Exception e) { TextType("I have experienced an error."); TextType(e.ToString()); diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index 0e20da8..63cdcfa 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -99,7 +99,7 @@ namespace ShiftOS.WinForms }; time.Tick += (o, a) => { - if (SaveSystem.CurrentSave != null) + if (SaveSystem.CurrentSave != null && TutorialManager.IsInTutorial == false) { lbtime.Text = Applications.Terminal.GetTime(); lbtime.Left = desktoppanel.Width - lbtime.Width - LoadedSkin.DesktopPanelClockFromRight.X; diff --git a/ShiftOS_TheReturn/SaveSystem.cs b/ShiftOS_TheReturn/SaveSystem.cs index 2e9f9c1..6ab6b1b 100644 --- a/ShiftOS_TheReturn/SaveSystem.cs +++ b/ShiftOS_TheReturn/SaveSystem.cs @@ -176,24 +176,27 @@ namespace ShiftOS.Engine Console.WriteLine(" ...{DONE}."); } - Story.Start(); - - Thread.Sleep(50); Console.WriteLine("{SYSTEM_INITIATED}"); TerminalBackend.InStory = false; + TerminalBackend.PrefixEnabled = true; Shiftorium.LogOrphanedUpgrades = true; Desktop.InvokeOnWorkerThread(new Action(() => Desktop.PopulateAppLauncher())); - GameReady?.Invoke(); if (CurrentSave.StoryPosition == 1) { Desktop.InvokeOnWorkerThread(new Action(() => { TutorialManager.StartTutorial(); + })); + while(TutorialManager.IsInTutorial == true) { } + GameReady?.Invoke(); + } + else + { + GameReady?.Invoke(); } - })); thread.IsBackground = true; thread.Start(); diff --git a/ShiftOS_TheReturn/Shiftorium.cs b/ShiftOS_TheReturn/Shiftorium.cs index 1b09818..06a189f 100644 --- a/ShiftOS_TheReturn/Shiftorium.cs +++ b/ShiftOS_TheReturn/Shiftorium.cs @@ -122,11 +122,14 @@ namespace ShiftOS.Engine return true; } + public static bool IsInitiated { get; private set; } public static void Init() { - try + if (IsInitiated == false) { + IsInitiated = true; + //Let the crash handler deal with this one... var dict = GetDefaults(); foreach (var itm in dict) { @@ -136,9 +139,7 @@ namespace ShiftOS.Engine } } } - catch - { - } + } public static int GetCPValue(string id)