record and replay debug leaving town

This commit is contained in:
2024-08-27 15:54:32 -05:00
committed by Celtic Minstrel
parent 6c9b5f4a6c
commit 7182e86e08
3 changed files with 22 additions and 12 deletions

View File

@@ -1825,6 +1825,24 @@ void debug_step_through() {
print_buf();
}
void debug_leave_town() {
if(recording){
record_action("debug_leave_town", "");
}
if(overall_mode == MODE_OUTDOORS){
add_string_to_buf("Debug - Leave Town: You're not in town!");
print_buf();
return;
}
univ.party.end_split(0);
overall_mode = MODE_OUTDOORS;
position_party(univ.party.outdoor_corner.x,univ.party.outdoor_corner.y,univ.party.out_loc.x,univ.party.out_loc.y);
clear_map();
add_string_to_buf("Debug: Reunite party and leave town.");
print_buf();
redraw_screen(REFRESH_ALL);
}
bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
bool are_done = false;
location pass_point; // TODO: This isn't needed
@@ -2020,18 +2038,7 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
case 'B':
if(!univ.debug_mode) break;
if(overall_mode == MODE_OUTDOORS){
add_string_to_buf("Debug - Leave Town: You're not in town!");
print_buf();
break;
}
univ.party.end_split(0);
overall_mode = MODE_OUTDOORS;
position_party(univ.party.outdoor_corner.x,univ.party.outdoor_corner.y,univ.party.out_loc.x,univ.party.out_loc.y);
clear_map();
add_string_to_buf("Debug: Reunite party and leave town.");
print_buf();
redraw_screen(REFRESH_ALL);
debug_leave_town();
break;
case 'C':

View File

@@ -74,5 +74,6 @@ void toggle_debug_mode();
void debug_give_item();
void debug_print_location();
void debug_step_through();
void debug_leave_town();
#endif

View File

@@ -487,6 +487,8 @@ static void replay_next_action() {
debug_print_location();
}else if(t == "debug_step_through"){
debug_step_through();
}else if(t == "debug_leave_town"){
debug_leave_town();
}
// TODO some of these actions shouldn't call advance_time(). They should return