record and replay toggling debug mode
This commit is contained in:
@@ -1761,6 +1761,20 @@ static void give_help_and_record(short help1, short help2) {
|
||||
give_help(help1, help2);
|
||||
}
|
||||
|
||||
void toggle_debug_mode() {
|
||||
if(recording){
|
||||
record_action("toggle_debug_mode", "");
|
||||
}
|
||||
if(univ.debug_mode) {
|
||||
univ.debug_mode = false;
|
||||
ASB("Debug mode OFF.");
|
||||
} else {
|
||||
univ.debug_mode = true;
|
||||
ASB("Debug 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
|
||||
@@ -1929,14 +1943,7 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
|
||||
|
||||
|
||||
case 'D':
|
||||
if(univ.debug_mode) {
|
||||
univ.debug_mode = false;
|
||||
ASB("Debug mode OFF.");
|
||||
} else {
|
||||
univ.debug_mode = true;
|
||||
ASB("Debug mode ON.");
|
||||
}
|
||||
print_buf();
|
||||
toggle_debug_mode();
|
||||
break;
|
||||
case 'z':
|
||||
show_inventory();
|
||||
|
@@ -70,5 +70,6 @@ void handle_bash_pick(location destination, bool& did_something, bool& need_redr
|
||||
void handle_use_space_select(bool& need_reprint);
|
||||
void handle_use_space(location destination, bool& did_something, bool& need_redraw);
|
||||
void show_inventory();
|
||||
void toggle_debug_mode();
|
||||
|
||||
#endif
|
||||
|
@@ -479,6 +479,8 @@ static void replay_next_action() {
|
||||
short help1 = boost::lexical_cast<short>(info["help1"]);
|
||||
short help2 = boost::lexical_cast<short>(info["help2"]);
|
||||
give_help(help1, help2);
|
||||
}else if(t == "toggle_debug_mode"){
|
||||
toggle_debug_mode();
|
||||
}
|
||||
|
||||
// TODO some of these actions shouldn't call advance_time(). They should return
|
||||
|
Reference in New Issue
Block a user