diff options
| author | AShifter <[email protected]> | 2017-11-25 08:59:48 -0700 |
|---|---|---|
| committer | AShifter <[email protected]> | 2017-11-25 08:59:48 -0700 |
| commit | c81573594f509177214bbc9b64427c8aabdc30a6 (patch) | |
| tree | 0f16be1fffc1e1557adafbd1baa9ff7aa16a3381 /shiftos.main | |
| parent | 90b1bdca5f8f2bf634a0b83ed9b623843ada5661 (diff) | |
| download | shiftos-rewind-c81573594f509177214bbc9b64427c8aabdc30a6.tar.gz shiftos-rewind-c81573594f509177214bbc9b64427c8aabdc30a6.tar.bz2 shiftos-rewind-c81573594f509177214bbc9b64427c8aabdc30a6.zip | |
Add SaveSystem, FullScreen Terminal and stuff
Git had a horrible seizure and removed our repo but Alex-TIMEHACK helped
us get it back.
Diffstat (limited to 'shiftos.main')
| -rw-r--r-- | shiftos.main/shiftos/apps/terminal.cs | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/shiftos.main/shiftos/apps/terminal.cs b/shiftos.main/shiftos/apps/terminal.cs index f7307cb..04bd6d2 100644 --- a/shiftos.main/shiftos/apps/terminal.cs +++ b/shiftos.main/shiftos/apps/terminal.cs @@ -5,6 +5,8 @@ using ShiftOS.Main.Terminal; using System.Linq; using System.Collections.Generic; using System.Drawing.Text; +using System.IO; +using ShiftOS.Main.Properties; namespace ShiftOS.Main.ShiftOS.Apps { @@ -19,7 +21,7 @@ namespace ShiftOS.Main.ShiftOS.Apps public string InputReturnText = ""; public Stack<string> c = TerminalBackend.commandBuffer; private PrivateFontCollection fontCollection = new PrivateFontCollection(); - + // The below variables makes the terminal... a terminal! string OldText = ""; @@ -33,10 +35,8 @@ namespace ShiftOS.Main.ShiftOS.Apps TerminalBackend.trm.Add(this); - fontCollection.AddFontFile(SaveSystem.fontDir + "\\termFont.ttf"); - - termmain.Font = new System.Drawing.Font(fontCollection.Families[0], 12F, System.Drawing.FontStyle.Regular); + Setup(); } void Print() @@ -144,5 +144,27 @@ namespace ShiftOS.Main.ShiftOS.Apps termmain.AppendText(c.Pop()); } } - } + public void Setup() + { + if (!Directory.Exists(SaveSystem.gameDir)) Directory.CreateDirectory(SaveSystem.gameDir); + if (!Directory.Exists(SaveSystem.fontDir)) Directory.CreateDirectory(SaveSystem.fontDir); + if (!Directory.Exists(SaveSystem.dataDir)) Directory.CreateDirectory(SaveSystem.dataDir); + if (!File.Exists(SaveSystem.fontDir + "\\termFont.ttf")) File.WriteAllBytes(SaveSystem.fontDir + "\\termFont.ttf", Resources.UbuntuMono_R); + if (!File.Exists(SaveSystem.dataDir + "\\userCodePoints.whoa")) + { + using (var fobj = File.OpenWrite(SaveSystem.dataDir + "\\userCodePoints.whoa")) + { + Whoa.Whoa.SerialiseObject(fobj, SaveSystem.User.codePoints); + } + } + if (!Directory.Exists(SaveSystem.baseGameDir)) Directory.CreateDirectory(SaveSystem.baseGameDir); + if (!Directory.Exists(SaveSystem.desktopDir)) Directory.CreateDirectory(SaveSystem.desktopDir); + if (!Directory.Exists(SaveSystem.docDir)) Directory.CreateDirectory(SaveSystem.docDir); + if (!Directory.Exists(SaveSystem.downloadsDir)) Directory.CreateDirectory(SaveSystem.downloadsDir); + if (!Directory.Exists(SaveSystem.musicDir)) Directory.CreateDirectory(SaveSystem.musicDir); + if (!Directory.Exists(SaveSystem.picDir)) Directory.CreateDirectory(SaveSystem.picDir); + fontCollection.AddFontFile(SaveSystem.fontDir + "\\termFont.ttf"); + termmain.Font = new System.Drawing.Font(fontCollection.Families[0], 12F, System.Drawing.FontStyle.Regular); + } + } } |
