From 0f62e9e9c9d5a11d057247d8be05f81a8c23dea0 Mon Sep 17 00:00:00 2001 From: glax Date: Thu, 18 Jan 2024 00:21:51 +0100 Subject: [PATCH] Fix setup --- OpenCS2hock/Setup.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/OpenCS2hock/Setup.cs b/OpenCS2hock/Setup.cs index 89f81ad..e312eb4 100644 --- a/OpenCS2hock/Setup.cs +++ b/OpenCS2hock/Setup.cs @@ -121,7 +121,7 @@ public static class Setup "https://api.shocklink.net"); string apiKey = QueryString("OpenShock API-Key:",""); Console.WriteLine("Shocker IDs associated with this API:"); - List shockerIds = GetShockerIds(c.Shockers); + List shockerIds = AddShockerIds(); IntensityRange intensityRange = GetIntensityRange(); DurationRange durationRange = GetDurationRange(); @@ -186,6 +186,24 @@ public static class Setup return new DurationRange(min, max); } + private static List AddShockerIds() + { + List ids = new(); + bool addAnother = true; + while (ids.Count < 1 || addAnother) + { + string id = QueryString("Shocker ID:", ""); + while (id.Length < 1) + id = QueryString("Shocker ID:", ""); + + ids.Add(id); + + Console.WriteLine("Add another ID? (Y/N):"); + addAnother = Console.ReadKey().Key == ConsoleKey.Y; + } + return ids; + } + private static List GetShockerIds(List shockers) { List allShockerIds = new();