This commit is contained in:
Helio 2022-04-19 15:02:35 +02:00
parent 0a0943b223
commit 803cd30070
4 changed files with 22 additions and 5 deletions

View file

@ -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++;
}
}
}

View file

@ -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<Dictionary<string, string>>(File.ReadAllText(AppSettings.Extended));
else WriteLine("File missing");
else { WriteLine("File missing"); checker = false; }
if (File.Exists(AppSettings.Common)) common_dict = JsonConvert.DeserializeObject<Dictionary<string, string>>(File.ReadAllText(AppSettings.Common));
else WriteLine("File missing");
else { WriteLine("File missing"); checker = false; }
return checker;
}
static private void uniquire() {
init();