diff --git a/cce/App.cs b/cce/App.cs index d843760..35c77dd 100644 --- a/cce/App.cs +++ b/cce/App.cs @@ -16,8 +16,17 @@ namespace cce { // Finish Settings screen, make it interactable bool saved = false; byte reset = 0; + (int, int) since = (0,0); while (true) { Title = Title + " >>> Settings"; + if (since.Item1 >= 4) { + saved = false; + since.Item1 = 0; + } + if (since.Item2 >= 4) { + reset = 0; + since.Item2 = 0; + } Clear(); AppSettings.Screen(saved, reset); ConsoleKeyInfo cki; @@ -43,6 +52,8 @@ namespace cce { default: break; } + since.Item1++; + since.Item2++; } } } diff --git a/cce/Transcoder.cs b/cce/Transcoder.cs index f734035..800d3a7 100644 --- a/cce/Transcoder.cs +++ b/cce/Transcoder.cs @@ -119,7 +119,11 @@ namespace cce { if (sentence.Length >= 120) { BufferWidth = sentence.Length * 2; WindowWidth = sentence.Length + 20; } Clear(); CursorVisible = false; - if (extended_dict == null || common_dict == null) init(); + var checker = init(); + if (!checker) { + WriteLine("Unable to load dictionaries"); + return; + } var cleaned = new char[sentence.Length]; var symbols = new char[sentence.Length]; var writeout = new char[sentence.Length]; @@ -224,13 +228,15 @@ namespace cce { } return String.Join("", encoded); } - static private void init() { - if (common_dict != null && extended_dict != null) return; + static internal bool init() { + if (common_dict != null && extended_dict != null) return true; + var checker = true; WriteLine("[Loading Dictionary]"); if (File.Exists(AppSettings.Extended)) extended_dict = JsonConvert.DeserializeObject>(File.ReadAllText(AppSettings.Extended)); - else WriteLine("File missing"); + else { WriteLine("File missing"); checker = false; } if (File.Exists(AppSettings.Common)) common_dict = JsonConvert.DeserializeObject>(File.ReadAllText(AppSettings.Common)); - else WriteLine("File missing"); + else { WriteLine("File missing"); checker = false; } + return checker; } static private void uniquire() { init(); diff --git a/cce/necessary files/common_dict.json b/cce/necessary files/common.json similarity index 100% rename from cce/necessary files/common_dict.json rename to cce/necessary files/common.json diff --git a/cce/necessary files/extended_dict.json b/cce/necessary files/extended.json similarity index 100% rename from cce/necessary files/extended_dict.json rename to cce/necessary files/extended.json