record and replay debug magic map

This commit is contained in:
2024-08-27 16:03:32 -05:00
committed by Celtic Minstrel
parent 315abd7d73
commit 42f66cf2d8
3 changed files with 22 additions and 12 deletions

View File

@@ -1861,6 +1861,24 @@ void debug_kill() {
print_buf(); print_buf();
} }
void debug_magic_map() {
if(recording){
record_action("debug_magic_map", "");
}
if(overall_mode == MODE_OUTDOORS) {
for(short i = 0; i < univ.out.max_dim; i++)
for(short j = 0; j < univ.out.max_dim; j++)
make_explored(i,j);
} else {
for(short i = 0; i < univ.town->max_dim; i++)
for(short j = 0; j < univ.town->max_dim; j++)
make_explored(i,j);
}
clear_map();
add_string_to_buf("Debug: Magic Map.");
print_buf();
}
bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
bool are_done = false; bool are_done = false;
location pass_point; // TODO: This isn't needed location pass_point; // TODO: This isn't needed
@@ -2139,18 +2157,7 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
case 'Q': case 'Q':
if(!univ.debug_mode) break; if(!univ.debug_mode) break;
if(overall_mode == MODE_OUTDOORS) { debug_magic_map();
for(short i = 0; i < univ.out.max_dim; i++)
for(short j = 0; j < univ.out.max_dim; j++)
make_explored(i,j);
} else {
for(short i = 0; i < univ.town->max_dim; i++)
for(short j = 0; j < univ.town->max_dim; j++)
make_explored(i,j);
}
clear_map();
add_string_to_buf("Debug: Magic Map.");
print_buf();
break; break;
case 'R': case 'R':

View File

@@ -76,5 +76,6 @@ void debug_print_location();
void debug_step_through(); void debug_step_through();
void debug_leave_town(); void debug_leave_town();
void debug_kill(); void debug_kill();
void debug_magic_map();
#endif #endif

View File

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