From 52175ef6425de3f0fbe83c59d7a22bf6f040f16e Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Fri, 26 Aug 2016 18:11:44 -0400 Subject: [PATCH] fixed weird coloring issues and added confirm key to trade menu --- Program.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Program.cs b/Program.cs index fd03a31..6fbac53 100644 --- a/Program.cs +++ b/Program.cs @@ -364,8 +364,7 @@ public static class Program var colorAccept = ConsoleColor.Green; var colorDeny = ConsoleColor.Red; var colorIgnore = ConsoleColor.Gray; - - var colorBackground = Console.BackgroundColor; + var colorSelected = ConsoleColor.Yellow; var confirm = false; do @@ -399,16 +398,7 @@ public static class Program throw new ArgumentOutOfRangeException(); } - if (t == selected) - { - Console.BackgroundColor = itemColor; - Console.ForegroundColor = colorBackground; - } - else - { - Console.ForegroundColor = itemColor; - Console.BackgroundColor = colorBackground; - } + Console.ForegroundColor = t == selected ? colorSelected : itemColor; Console.WriteLine($" [{t}] [{tradeActions[t]}] {trades[t].Description}"); } @@ -432,14 +422,19 @@ public static class Program case ConsoleKey.I: tradeActions[selected] = TradeAction.Ignore; break; + case ConsoleKey.Enter: + confirm = true; + break; case ConsoleKey.Escape: case ConsoleKey.Q: + Console.ResetColor(); Console.WriteLine("Quitting..."); return; default: break; } } while (!confirm); + Console.ResetColor(); }