From b653e0d525dae752554bfc837346a8f369f06005 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sat, 24 Aug 2024 18:40:55 -0500 Subject: [PATCH] make map behavior all the same --- src/game/boe.actions.cpp | 17 ++--------------- src/game/boe.actions.hpp | 1 - src/game/boe.main.cpp | 6 +++--- src/game/boe.town.cpp | 11 +++++++++-- src/game/boe.town.hpp | 2 +- 5 files changed, 15 insertions(+), 22 deletions(-) diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index 77d71b7d..c68123d2 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -1178,8 +1178,7 @@ bool handle_action(const sf::Event& event, cFramerateLimiter& fps_limiter) { break; case TOOLBAR_SCROLL: case TOOLBAR_MAP: - if(overall_mode == MODE_OUTDOORS || overall_mode == MODE_TOWN) - display_map(); + display_map(); break; case TOOLBAR_BAG: case TOOLBAR_HAND: @@ -2077,8 +2076,7 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){ show_dialog_action("help-debug"); break; case 'a': // Show automap - if(overall_mode == MODE_TOWN || overall_mode == MODE_OUTDOORS) - display_map(); + display_map(); break; case 'u': // Use space @@ -3310,15 +3308,4 @@ 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(false); - 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 d7d2fbd5..f945200c 100644 --- a/src/game/boe.actions.hpp +++ b/src/game/boe.actions.hpp @@ -58,6 +58,5 @@ 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 932643b1..8453ecf0 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -385,8 +385,8 @@ static void replay_next_action() { tip_of_day(); }else if(t == "showWelcome"){ showWelcome(); - }else if(t == "handle_menu_automap"){ - handle_menu_automap(); + }else if(t == "display_map"){ + display_map(); }else if(t == "handle_help_toc"){ handle_help_toc(); }else if(t == "menu_give_help"){ @@ -824,7 +824,7 @@ void handle_menu_choice(eMenu item_hit) { queue_fake_event(dummyEvent); break; case eMenu::ACTIONS_AUTOMAP: - handle_menu_automap(); + display_map(); break; case eMenu::HELP_TOC: handle_help_toc(); diff --git a/src/game/boe.town.cpp b/src/game/boe.town.cpp index ebff489e..04a7c7ce 100644 --- a/src/game/boe.town.cpp +++ b/src/game/boe.town.cpp @@ -41,6 +41,7 @@ extern sf::RenderWindow mainPtr; extern short store_current_pc,current_ground; extern eGameMode store_pre_shop_mode,store_pre_talk_mode; extern std::queue special_queue; +extern bool prime_time(); extern bool map_visible; extern sf::RenderWindow mini_map; @@ -1542,11 +1543,17 @@ bool is_door(location destination) { } -void display_map(bool record) { - if(record && recording){ +void display_map() { + if(recording){ record_action("display_map", ""); } + if(!prime_time()) { + ASB("Finish what you're doing first."); + print_buf(); + return; + } + // Show the automap if it's not already visible if(map_visible) return; give_help(62,0); diff --git a/src/game/boe.town.hpp b/src/game/boe.town.hpp index 19cfc1da..66795f4d 100644 --- a/src/game/boe.town.hpp +++ b/src/game/boe.town.hpp @@ -29,6 +29,6 @@ bool does_location_have_special(cOutdoors& sector, location loc, eTerSpec type); void clear_map(); void draw_map(bool need_refresh); bool is_door(location destination); -void display_map(bool record = true); +void display_map(); void check_done(); bool quadrant_legal(short i, short j) ;