diff --git a/OWTrack/MainForm.cs b/OWTrack/MainForm.cs index b4ef381..9b7f113 100644 --- a/OWTrack/MainForm.cs +++ b/OWTrack/MainForm.cs @@ -86,7 +86,7 @@ namespace OWTrack { try { - using (StreamReader st = new StreamReader(Paths.SAVES)) + using (StreamReader st = new StreamReader(Paths.GetSaves())) { string line = st.ReadLine(); if (line.Contains("Overwatch.exe")) diff --git a/OWTrack/Tracker.cs b/OWTrack/Tracker.cs index f8a2c5d..8be3fc4 100644 --- a/OWTrack/Tracker.cs +++ b/OWTrack/Tracker.cs @@ -25,6 +25,7 @@ using System.IO; using System.Windows.Forms; using System.Collections.Generic; + namespace OWTrack { class Tracker @@ -114,7 +115,7 @@ namespace OWTrack } } } - + foreach (var file in paths) { MessageBox.Show(file); } if (paths.Count > 1) { //TODO: ask about correct path diff --git a/OWTrack/saveManeger.cs b/OWTrack/saveManeger.cs index 84f2045..347bb6c 100644 --- a/OWTrack/saveManeger.cs +++ b/OWTrack/saveManeger.cs @@ -28,11 +28,14 @@ using System.Threading.Tasks; namespace OWTrack { - static class Paths + public static class Paths { private static string curDir = Directory.GetCurrentDirectory(); - public static string SAVES = curDir + "/saves/data.json"; - public static string JSON = curDir + "/data.json"; + private static string SAVES = curDir + "/saves/data.json"; + private static string JSON = curDir + "/data.json"; + public static string GetJSON() { return JSON; } + public static string GetSaves() { return SAVES; } + public static string GetCurrentDir() { return curDir; } } class saveManeger @@ -45,7 +48,7 @@ namespace OWTrack { try { - return JsonConvert.DeserializeObject(File.ReadAllText(Paths.SAVES)); + return JsonConvert.DeserializeObject(File.ReadAllText(Paths.GetSaves())); } catch (Exception e) { @@ -74,7 +77,7 @@ namespace OWTrack { try { - File.WriteAllText(Paths.SAVES, JsonConvert.SerializeObject(tracker)); + File.WriteAllText(Paths.GetSaves(), JsonConvert.SerializeObject(tracker)); return true; } catch (Exception) @@ -91,7 +94,7 @@ namespace OWTrack { try { - if (File.Exists(Paths.SAVES)) + if (File.Exists(Paths.GetSaves())) { return true; }