From df647e5024e498905400e89f6762849fe17da03c Mon Sep 17 00:00:00 2001 From: FloppyDiskDrive Date: Wed, 22 Nov 2017 20:06:58 -0600 Subject: [PATCH] yay things again --- ShiftOS.Engine/SaveSystem/SaveSystem.cs | 20 ++++++++++++++++++++ ShiftOS.Main/ShiftOS/Apps/Terminal.cs | 4 ++-- ShiftOS.Main/Terminal/TerminalBackend.cs | 4 ++-- 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 ShiftOS.Engine/SaveSystem/SaveSystem.cs diff --git a/ShiftOS.Engine/SaveSystem/SaveSystem.cs b/ShiftOS.Engine/SaveSystem/SaveSystem.cs new file mode 100644 index 0000000..f9c740c --- /dev/null +++ b/ShiftOS.Engine/SaveSystem/SaveSystem.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.IO; + +namespace ShiftOS.Engine.SaveSystem +{ + public static class SaveSystem + { + public static string dataDir + { + get + { + return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "ShiftOS-Rewind"); + } + } + } +} diff --git a/ShiftOS.Main/ShiftOS/Apps/Terminal.cs b/ShiftOS.Main/ShiftOS/Apps/Terminal.cs index cf20bd9..c4bfe83 100644 --- a/ShiftOS.Main/ShiftOS/Apps/Terminal.cs +++ b/ShiftOS.Main/ShiftOS/Apps/Terminal.cs @@ -16,7 +16,7 @@ namespace ShiftOS.Main.ShiftOS.Apps public bool RunningCommand = false; public bool WaitingResponse = false; public string InputReturnText = ""; - public List c = TerminalBackend.commandBuffer; + public Stack c = TerminalBackend.commandBuffer; // The below variables makes the terminal... a terminal! string OldText = ""; @@ -133,7 +133,7 @@ namespace ShiftOS.Main.ShiftOS.Apps else if (e.KeyCode == Keys.Up) { if (c.Count == 0) return; - termmain.AppendText(c.Last()); + termmain.AppendText(c.Pop()); } } } diff --git a/ShiftOS.Main/Terminal/TerminalBackend.cs b/ShiftOS.Main/Terminal/TerminalBackend.cs index d275244..c264714 100644 --- a/ShiftOS.Main/Terminal/TerminalBackend.cs +++ b/ShiftOS.Main/Terminal/TerminalBackend.cs @@ -17,7 +17,7 @@ namespace ShiftOS.Main.Terminal public static List trm = new List(); public static int trmTopID = 0; - public static List commandBuffer = new List(); + public static Stack commandBuffer = new Stack(); /// /// Runs a terminal command. /// @@ -41,7 +41,7 @@ namespace ShiftOS.Main.Terminal Array.Find(trm.ToArray(), w => w.TerminalID == TermID).termmain.AppendText("\n"); instance.Run(theParams); complete = true; - commandBuffer.Add(command); + commandBuffer.Push(command); return; } }