more understandable prompt to save

This commit is contained in:
2025-01-11 20:12:01 -06:00
committed by Celtic Minstrel
parent bf08f03b52
commit 11767f553d
4 changed files with 11 additions and 7 deletions

View File

@@ -2661,12 +2661,16 @@ void start_dialogue_editing(short restoring) {
redraw_screen();
}
bool save_check(std::string which_dlog) {
bool save_check(std::string which_dlog, bool allow_no) {
std::string choice;
if(!change_made)
return true;
choice = cChoiceDlog(which_dlog, {"save","revert","cancel"}).show();
cChoiceDlog dlog(which_dlog, {"save","revert","cancel"});
if(!allow_no){
dlog->getControl("revert").hide();
}
choice = dlog.show();
if(choice == "revert")
return true;
else if(choice == "cancel")

View File

@@ -44,7 +44,7 @@ void update_mouse_spot(location the_point);
bool monst_on_space(location loc,short m_num);
void place_edit_special(location loc);
void set_special(location spot_hit);
bool save_check(std::string which_dlog);
bool save_check(std::string which_dlog, bool allow_no = true);
/// Represents the action of adding a new town to the end of the list
class aNewTown : public cAction {

View File

@@ -108,7 +108,7 @@ void launch_scenario() {
}
// Prompt to save first
if(!save_check("save-before-launch")) return;
if(!save_check("save-before-launch", false)) return;
fs::path game_binary;
#ifdef SFML_SYSTEM_MACOS