record and replay debug stepthrough mode

This commit is contained in:
2024-08-27 15:48:50 -05:00
committed by Celtic Minstrel
parent 46f930c353
commit 6c9b5f4a6c
3 changed files with 18 additions and 8 deletions

View File

@@ -1811,6 +1811,20 @@ void debug_print_location() {
print_buf();
}
void debug_step_through() {
if(recording){
record_action("debug_step_through", "");
}
if(univ.node_step_through) {
univ.node_step_through = false;
add_string_to_buf("Debug: Step-through disabled");
} else {
univ.node_step_through = true;
add_string_to_buf("Debug: Step-through enabled");
}
print_buf();
}
bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
bool are_done = false;
location pass_point; // TODO: This isn't needed
@@ -2186,14 +2200,7 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
break;
case '!':
if(!univ.debug_mode) break;
if(univ.node_step_through) {
univ.node_step_through = false;
add_string_to_buf("Debug: Step-through disabled");
} else {
univ.node_step_through = true;
add_string_to_buf("Debug: Step-through enabled");
}
print_buf();
debug_step_through();
break;
case '/':
if(!univ.debug_mode) break;

View File

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

View File

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