record and replay renaming PCs

This commit is contained in:
2024-08-24 12:59:57 -05:00
committed by Celtic Minstrel
parent ad9ad3dc3c
commit 4834d9b135
3 changed files with 15 additions and 6 deletions

View File

@@ -3275,3 +3275,14 @@ void handle_new_pc_graphic() {
pick_pc_graphic(choice,1,nullptr);
draw_terrain();
}
void handle_rename_pc() {
if(recording){
record_action("handle_rename_pc", "");
}
short choice = char_select_pc(1,"Rename who?");
if(choice < 6)
pick_pc_name(choice,nullptr);
put_pc_screen();
put_item_screen(stat_window);
}

View File

@@ -56,5 +56,6 @@ void handle_drop_item(location destination, bool& need_redraw);
void handle_give_item(short item_hit, bool& did_something, bool& need_redraw);
void show_dialog_action(std::string xml_file);
void handle_new_pc_graphic();
void handle_rename_pc();
#endif

View File

@@ -346,6 +346,8 @@ static void replay_next_action() {
do_abort();
}else if(t == "handle_new_pc_graphic"){
handle_new_pc_graphic();
}else if(t == "handle_rename_pc"){
handle_rename_pc();
}
// TODO some of these actions shouldn't call advance_time(). They should return
@@ -682,12 +684,7 @@ void handle_menu_choice(eMenu item_hit) {
case eMenu::OPTIONS_RENAME_PC:
// TODO record and replay
choice = char_select_pc(1,"Rename who?");
if(choice < 6)
pick_pc_name(choice,nullptr);
put_pc_screen();
put_item_screen(stat_window);
handle_rename_pc();
break;