logs + events refactor

This commit is contained in:
Llywelwyn 2023-07-10 13:09:01 +01:00
parent 4f899d329e
commit c10eda695a
7 changed files with 85 additions and 4 deletions

View file

@ -214,6 +214,9 @@ impl GameState for State {
}
RunState::AwaitingInput => {
new_runstate = player_input(self, ctx);
if new_runstate != RunState::AwaitingInput {
gamelog::record_event("Turn", 1);
}
}
RunState::PlayerTurn => {
self.run_systems();
@ -432,6 +435,7 @@ fn main() -> rltk::BError {
gs.ecs.insert(player_entity);
gamelog::clear_log();
gamelog::clear_events();
gamelog::Logger::new()
.append("Welcome!")
.colour(rltk::CYAN)