record and replay new party menu item

This commit is contained in:
2024-08-23 21:52:01 -05:00
committed by Celtic Minstrel
parent a7c1d757be
commit 4fcb0ba417
3 changed files with 24 additions and 14 deletions

View File

@@ -2650,6 +2650,26 @@ void drop_pc() {
}
}
void new_party() {
if(recording){
record_action("new_party", "");
}
if(overall_mode != MODE_STARTUP) {
std::string choice = cChoiceDlog("restart-game",{"okay","cancel"}).show();
if(choice == "cancel")
return;
for(short i = 0; i < 6; i++)
univ.party[i].main_status = eMainStatus::ABSENT;
party_in_memory = false;
reload_startup();
overall_mode = MODE_STARTUP;
draw_startup(0);
}
start_new_game();
draw_startup(0);
menu_activate();
}
void handle_death() {
std::string choice;

View File

@@ -25,6 +25,7 @@ void increase_age();
void handle_hunting();
void switch_pc(short which);
void drop_pc();
void new_party();
void handle_death();
void start_new_game(bool force = false);
location get_cur_direction(location the_point);

View File

@@ -338,6 +338,8 @@ static void replay_next_action() {
show_dialog_action(next_action.GetText());
}else if(t == "drop_pc"){
drop_pc();
}else if(t == "new_party"){
new_party();
}
advance_time(did_something, need_redraw, need_reprint);
@@ -651,20 +653,7 @@ void handle_menu_choice(eMenu item_hit) {
do_save(1);
break;
case eMenu::FILE_NEW:
if(overall_mode != MODE_STARTUP) {
std::string choice = cChoiceDlog("restart-game",{"okay","cancel"}).show();
if(choice == "cancel")
return;
for(short i = 0; i < 6; i++)
univ.party[i].main_status = eMainStatus::ABSENT;
party_in_memory = false;
reload_startup();
overall_mode = MODE_STARTUP;
draw_startup(0);
}
start_new_game();
draw_startup(0);
menu_activate();
new_party();
break;
case eMenu::FILE_ABORT:
if(overall_mode != MODE_STARTUP) {