aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 1c9a29a..ec8bc7a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -182,7 +182,6 @@ impl GUI {
GUIResult::Quit => {
self.message_log
.log_message(String::from("Press any key to quit."));
- self.screen.getch();
return false;
}
GUIResult::SwitchElement => match self.input_source {
@@ -236,7 +235,6 @@ impl GUI {
self.message_log.log_error(String::from(
"Error: external and internal game states disagree. Press any key to quit.",
));
- self.screen.getch();
return false;
} else {
self.message_log.log_error(format!(
@@ -250,7 +248,10 @@ impl GUI {
self.board_gui.update(&game, pos_vec);
self.game_log.update(&game);
if let Some(w) = win {
- self.message_log.log_message(format!("{}", w));
+ self.message_log.log_message(format!(
+ "Game over: {}\nPress any key to quit.",
+ w
+ ));
return false;
}
}
@@ -368,6 +369,7 @@ fn main() {
loop {
let inp = gui.query_input(&game, call_proc, p1_white, &engine);
if !gui.handle_input(&mut game, call_proc, p1_white, inp) {
+ gui.screen.getch();
break;
}
}