Change logic of restart-game confirmation
This commit is contained in:
@@ -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>
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user