Change logic of restart-game confirmation

This commit is contained in:
2025-03-22 09:23:09 -05:00
parent c0d66124a4
commit c3f459e254
2 changed files with 13 additions and 7 deletions

View File

@@ -3,8 +3,8 @@
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?> <?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
<dialog defbtn='cancel'> <dialog defbtn='cancel'>
<pict type='dlog' num='23' top='9' left='9'/> <pict type='dlog' num='23' top='9' left='9'/>
<text top='6' left='53' width='249' height='31'> <text name='warning' top='6' left='53' width='249' height='31'>
Starting over will unload the current party without saving. {{action}} will discard any unsaved progress.
Are you sure you want to do this? Are you sure you want to do this?
</text> </text>
<button name='cancel' type='regular' def-key='esc' top='45' left='244'>Cancel</button> <button name='cancel' type='regular' def-key='esc' top='45' left='244'>Cancel</button>

View File

@@ -3504,13 +3504,19 @@ void new_party() {
if(recording){ if(recording){
record_action("new_party", ""); record_action("new_party", "");
} }
if(overall_mode != MODE_STARTUP) { if(party_in_memory) {
std::string choice = cChoiceDlog("restart-game",{"okay","cancel"}).show(); cChoiceDlog confirm("restart-game",{"okay","cancel"});
(confirm.operator->())->getControl("warning").replaceText("{{action}}", "Starting over");
std::string choice = confirm.show();
if(choice == "cancel") if(choice == "cancel")
return; return;
for(short i = 0; i < 6; i++) }
univ.party[i].main_status = eMainStatus::ABSENT;
party_in_memory = false; for(short i = 0; i < 6; i++)
univ.party[i].main_status = eMainStatus::ABSENT;
party_in_memory = false;
if(overall_mode != MODE_STARTUP){
reload_startup(); reload_startup();
overall_mode = MODE_STARTUP; overall_mode = MODE_STARTUP;
draw_startup(0); draw_startup(0);