record and replay debug ghost mode

This commit is contained in:
2024-08-27 16:51:41 -05:00
committed by Celtic Minstrel
parent b0433fe1c8
commit dc45c4b8c3
3 changed files with 18 additions and 8 deletions

View File

@@ -1937,6 +1937,20 @@ void debug_fly() {
put_pc_screen();
}
void debug_ghost_mode() {
if(recording){
record_action("debug_ghost_mode", "");
}
if(univ.ghost_mode){
univ.ghost_mode = false;
ASB("Debug: Ghost mode OFF.");
}else{
univ.ghost_mode = true;
ASB("Debug:Ghost mode ON.");
}
print_buf();
}
bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
bool are_done = false;
location pass_point; // TODO: This isn't needed
@@ -2152,14 +2166,7 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
case 'G':
if(!univ.debug_mode) break;
if(univ.ghost_mode){
univ.ghost_mode = false;
ASB("Debug: Ghost mode OFF.");
}else{
univ.ghost_mode = true;
ASB("Debug:Ghost mode ON.");
}
print_buf();
debug_ghost_mode();
break;
case 'H':

View File

@@ -82,5 +82,6 @@ void debug_refresh_stores();
void debug_clean_up();
void debug_stealth_detect_life_firewalk();
void debug_fly();
void debug_ghost_mode();
#endif

View File

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