Skip to content

Commit

Permalink
Clear recent messages when starting new seed
Browse files Browse the repository at this point in the history
  • Loading branch information
timoschwarzer committed Nov 10, 2024
1 parent 2552d24 commit bfa839e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions projects/Core/messages/message_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ namespace core::messages {
}
}

void MessageController::clear_recent_messages() {
m_recent_messages.clear();
}

void MessageController::clear_central() {
m_central_display.clear();
m_recent_display.clear();
Expand Down
1 change: 1 addition & 0 deletions projects/Core/messages/message_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace core::messages {
// Handles showing / hiding the given messagebox based on info provided.
message_handle_ptr_t queue(std::shared_ptr<api::messages::MessageBox> message, IndependentMessageInfo info);
void queue_central(MessageInfo info, bool add_to_recent = false);
void clear_recent_messages();
void show_recent_messages();
void update(float delta_time);
void clear_central();
Expand Down
2 changes: 2 additions & 0 deletions projects/Randomizer/randomizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ namespace randomizer {
});

auto on_after_new_game_initialized = core::api::game::event_bus().register_handler(GameEvent::NewGameInitialized, EventTiming::After, [](auto, auto) {
core::message_controller().clear_recent_messages();

queue_input_unlocked_callback([]() {
randomizer_seed.grant(core::api::uber_states::UberState(UberStateGroup::RandoEvents, 0), 0);
randomizer_seed.grant(core::api::uber_states::UberState(UberStateGroup::RandoEvents, 1), 0);
Expand Down

0 comments on commit bfa839e

Please sign in to comment.