diff --git a/src/main.rs b/src/main.rs index 4a37d64..de6c39e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -131,6 +131,9 @@ fn main() -> Result<()> { })?; if event::poll(std::time::Duration::from_millis(FRAME_LENGTH))? { if let event::Event::Key(key) = event::read()? { + if key.kind == KeyEventKind::Press && key.code == KeyCode::Char('v') { + game.messages.insert(0, format!("You are playing version '{}'.", env!("GIT_HASH")).to_string()); + } if key.kind == KeyEventKind::Press && key.code == KeyCode::Char('q') { break; } @@ -187,7 +190,6 @@ fn main() -> Result<()> { text += format!("\nYou gained {} experience.", game.get_player().get_experience()).as_str(); text += format!("\nYou collected {} gold.", game.get_player().get_gold()).as_str(); text += format!("\nYou played {} seconds.", playtime.as_secs()).as_str(); - text += format!("\nYou played game version '{}'.", env!("GIT_HASH")).as_str(); let paragraph = Paragraph::new(text).block(block).wrap(Wrap { trim: true }); frame.render_widget(paragraph, area); });