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"?>
<dialog defbtn='cancel'>
<pict type='dlog' num='23' top='9' left='9'/>
<text top='6' left='53' width='249' height='31'>
Starting over will unload the current party without saving.
<text name='warning' top='6' left='53' width='249' height='31'>
{{action}} will discard any unsaved progress.
Are you sure you want to do this?
</text>
<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){
record_action("new_party", "");
}
if(overall_mode != MODE_STARTUP) {
std::string choice = cChoiceDlog("restart-game",{"okay","cancel"}).show();
if(party_in_memory) {
cChoiceDlog confirm("restart-game",{"okay","cancel"});
(confirm.operator->())->getControl("warning").replaceText("{{action}}", "Starting over");
std::string choice = confirm.show();
if(choice == "cancel")
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();
overall_mode = MODE_STARTUP;
draw_startup(0);