From 7b12feef44adfcafd46d651adcd3e8fe11cb8523 Mon Sep 17 00:00:00 2001 From: lempamo Date: Sat, 22 Jul 2017 15:35:30 -0400 Subject: more achievement things --- TimeHACK.Engine/SaveSystem.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'TimeHACK.Engine') diff --git a/TimeHACK.Engine/SaveSystem.cs b/TimeHACK.Engine/SaveSystem.cs index cd8bb2f..41bb9d0 100644 --- a/TimeHACK.Engine/SaveSystem.cs +++ b/TimeHACK.Engine/SaveSystem.cs @@ -27,6 +27,14 @@ namespace TimeHACK.Engine } } + public static string DataDirectory + { + get + { + return Path.Combine(GameDirectory, "Data"); + } + } + public static string AllProfilesDirectory { get @@ -221,6 +229,17 @@ namespace TimeHACK.Engine File.WriteAllText(Path.Combine(ProfileDirectory, ProfileFile), json); } + public static byte[] GetAchievements() + { + byte[] byt = new byte[] { 0, 0 }; + if (DevMode) File.WriteAllBytes(Path.Combine(DataDirectory, "achieved.thack"), byt); + + if (File.Exists(Path.Combine(DataDirectory, "achieved.thack"))) byt = File.ReadAllBytes(Path.Combine(DataDirectory, "achieved.thack")); + else File.WriteAllBytes(Path.Combine(DataDirectory, "achieved.thack"), byt); + + return byt; + } + public static void SetTheme() { switch (CurrentSave.ThemeName) -- cgit v1.2.3