From d9cf1c8fae03a6e39552f9ea3ac60f74c143e1f4 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 31 Jul 2024 16:40:56 -0500 Subject: [PATCH] record and replay switching active PC --- src/game/boe.actions.cpp | 7 ++++++- src/game/boe.main.cpp | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index 2d24905a..5317dada 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -40,6 +40,7 @@ #include "tools/prefs.hpp" #include "gfx/render_shapes.hpp" #include "tools/enum_map.hpp" +#include rectangle item_screen_button_rects[9] = { {125,10,141,28},{125,40,141,58},{125,68,141,86},{125,98,141,116},{125,126,141,144},{125,156,141,174}, @@ -721,7 +722,11 @@ static void handle_bash_pick(location destination, bool& did_something, bool& ne put_item_screen(stat_window); } -static void handle_switch_pc(short which_pc, bool& need_redraw, bool& need_reprint) { +void handle_switch_pc(short which_pc, bool& need_redraw, bool& need_reprint) { + if(recording){ + record_action("handle_switch_pc", std::to_string(which_pc)); + } + cPlayer& pc = univ.party[which_pc]; if(!prime_time() && overall_mode != MODE_SHOPPING && overall_mode != MODE_TALKING) add_string_to_buf("Set active: Finish what you're doing first."); diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index e811ed3d..69d02e09 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -118,6 +118,7 @@ static void init_boe(int, char*[]); static void showWelcome(); void handle_startup_button_click(eStartButton btn); +void handle_switch_pc(short which_pc, bool& need_redraw, bool& need_reprint); #ifdef __APPLE__ eMenuChoice menuChoice=eMenuChoice::MENU_CHOICE_NONE; @@ -272,6 +273,11 @@ void replay_next_action() { std::istringstream sstr(next_action.GetText()); sstr >> l; handle_move(l, did_something, need_redraw, need_reprint); + }else if(t == "handle_switch_pc"){ + short which_pc; + std::istringstream sstr(next_action.GetText()); + sstr >> which_pc; + handle_switch_pc(which_pc, need_redraw, need_reprint); } advance_time(did_something, need_redraw, need_reprint);