New debug command ":turn [N]" to change turn number to N...
...(or next one if unspecified) Also change ToD, which is the main use of this.
This commit is contained in:
parent
f45c82fac4
commit
3b3d26fd4d
1 changed files with 15 additions and 1 deletions
|
@ -2369,6 +2369,7 @@ class console_handler : public map_command_handler<console_handler>, private cha
|
|||
void do_nosaves();
|
||||
void do_next_level();
|
||||
void do_choose_level();
|
||||
void do_turn();
|
||||
void do_debug();
|
||||
void do_nodebug();
|
||||
void do_lua();
|
||||
|
@ -2452,10 +2453,11 @@ class console_handler : public map_command_handler<console_handler>, private cha
|
|||
_("Disable autosaves."));
|
||||
register_command("next_level", &console_handler::do_next_level,
|
||||
_("Advance to the next scenario, or scenario identified by 'id'"), _("<id>"), "D");
|
||||
register_alias("next_level", "n");
|
||||
register_command("choose_level", &console_handler::do_choose_level,
|
||||
_("Choose next scenario"), "", "D");
|
||||
register_alias("choose_level", "cl");
|
||||
register_command("turn", &console_handler::do_turn,
|
||||
_("Change turn number (and time of day)"), _("[turn]"), "D");
|
||||
register_command("debug", &console_handler::do_debug,
|
||||
_("Turn debug mode on."));
|
||||
register_command("nodebug", &console_handler::do_nodebug,
|
||||
|
@ -3172,6 +3174,18 @@ void console_handler::do_choose_level() {
|
|||
}
|
||||
}
|
||||
|
||||
void console_handler::do_turn()
|
||||
{
|
||||
if (!get_data().empty()) {
|
||||
int turn = lexical_cast_default<int>(get_data(), 1);
|
||||
resources::tod_manager->set_turn(turn);
|
||||
} else {
|
||||
resources::tod_manager->next_turn();
|
||||
}
|
||||
menu_handler_.gui_->new_turn();
|
||||
menu_handler_.gui_->redraw_everything();
|
||||
}
|
||||
|
||||
void console_handler::do_debug() {
|
||||
if (network::nconnections() == 0) {
|
||||
print(get_cmd(), _("Debug mode activated!"));
|
||||
|
|
Loading…
Add table
Reference in a new issue