From c8c008b3c52f307c6094924de37e246fb67be453 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sat, 24 Aug 2024 15:01:10 -0500 Subject: [PATCH] record and replay opening the map through the menu --- src/game/boe.actions.cpp | 11 +++++++++++ src/game/boe.actions.hpp | 1 + src/game/boe.main.cpp | 9 +++------ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index 00082779..a4b403b7 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -3310,4 +3310,15 @@ void handle_rename_pc() { pick_pc_name(choice,nullptr); put_pc_screen(); put_item_screen(stat_window); +} + +void handle_menu_automap() { + if(recording){ + record_action("handle_menu_automap", ""); + } + if(!prime_time()) { + ASB("Finish what you're doing first."); + print_buf(); + } else display_map(); + set_cursor(sword_curs); } \ No newline at end of file diff --git a/src/game/boe.actions.hpp b/src/game/boe.actions.hpp index f945200c..d7d2fbd5 100644 --- a/src/game/boe.actions.hpp +++ b/src/game/boe.actions.hpp @@ -58,5 +58,6 @@ void handle_give_item(short item_hit, bool& did_something, bool& need_redraw); void show_dialog_action(std::string xml_file); void handle_new_pc_graphic(); void handle_rename_pc(); +void handle_menu_automap(); #endif diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index 166a5dfa..6b6163b0 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -383,6 +383,8 @@ static void replay_next_action() { tip_of_day(); }else if(t == "showWelcome"){ showWelcome(); + }else if(t == "handle_menu_automap"){ + handle_menu_automap(); } // TODO some of these actions shouldn't call advance_time(). They should return @@ -794,12 +796,7 @@ void handle_menu_choice(eMenu item_hit) { queue_fake_event(dummyEvent); break; case eMenu::ACTIONS_AUTOMAP: - // TODO record and replay - if(!prime_time()) { - ASB("Finish what you're doing first."); - print_buf(); - } else display_map(); - set_cursor(sword_curs); + handle_menu_automap(); break; case eMenu::HELP_TOC: // TODO record and replay