fixed weird coloring issues and added confirm key to trade menu

This commit is contained in:
Carson McManus 2016-08-26 18:11:44 -04:00
parent f6b11f4975
commit 52175ef642

View file

@ -364,8 +364,7 @@ public static class Program
var colorAccept = ConsoleColor.Green; var colorAccept = ConsoleColor.Green;
var colorDeny = ConsoleColor.Red; var colorDeny = ConsoleColor.Red;
var colorIgnore = ConsoleColor.Gray; var colorIgnore = ConsoleColor.Gray;
var colorSelected = ConsoleColor.Yellow;
var colorBackground = Console.BackgroundColor;
var confirm = false; var confirm = false;
do do
@ -399,16 +398,7 @@ public static class Program
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
} }
if (t == selected) Console.ForegroundColor = t == selected ? colorSelected : itemColor;
{
Console.BackgroundColor = itemColor;
Console.ForegroundColor = colorBackground;
}
else
{
Console.ForegroundColor = itemColor;
Console.BackgroundColor = colorBackground;
}
Console.WriteLine($" [{t}] [{tradeActions[t]}] {trades[t].Description}"); Console.WriteLine($" [{t}] [{tradeActions[t]}] {trades[t].Description}");
} }
@ -432,14 +422,19 @@ public static class Program
case ConsoleKey.I: case ConsoleKey.I:
tradeActions[selected] = TradeAction.Ignore; tradeActions[selected] = TradeAction.Ignore;
break; break;
case ConsoleKey.Enter:
confirm = true;
break;
case ConsoleKey.Escape: case ConsoleKey.Escape:
case ConsoleKey.Q: case ConsoleKey.Q:
Console.ResetColor();
Console.WriteLine("Quitting..."); Console.WriteLine("Quitting...");
return; return;
default: default:
break; break;
} }
} while (!confirm); } while (!confirm);
Console.ResetColor();
} }