confirm before killing

This commit is contained in:
2025-02-10 19:26:51 -06:00
committed by Celtic Minstrel
parent a6a886be2b
commit d2fb94b6c6
2 changed files with 21 additions and 6 deletions

View File

@@ -0,0 +1,12 @@
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
<dialog defbtn='no'>
<pict type='dlog' num='7' top='6' left='6'/>
<text top='6' left='48' width='249' height='67'>
You are about to kill your entire party.<br/>
<br/>
Are you sure you want to do this?
</text>
<button name='no' type='regular' def-key='n' top='84' left='239'>No</button>
<button name='yes' type='regular' def-key='y' top='84' left='172'>Yes</button>
</dialog>

View File

@@ -2085,13 +2085,16 @@ void debug_kill_party() {
if(recording){
record_action("debug_kill_party", "");
}
for(short i = 0; i < 6; i++) {
if(univ.party[i].is_alive())
kill_pc(univ.party[i],eMainStatus::ABSENT);
std::string confirm = cChoiceDlog("kill-party-confirm",{"yes","no"}).show();
if(confirm == "yes"){
for(short i = 0; i < 6; i++) {
if(univ.party[i].is_alive())
kill_pc(univ.party[i],eMainStatus::ABSENT);
}
draw_terrain();
add_string_to_buf("Debug: Kill the party.");
advance_time(false, true, true);
}
draw_terrain();
add_string_to_buf("Debug: Kill the party.");
advance_time(false, true, true);
}
void debug_magic_map() {