more understandable prompt to save
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<dialog defbtn='save'>
|
<dialog defbtn='save'>
|
||||||
<button name='save' type='regular' top='43' left='240'>Save</button>
|
<button name='save' type='regular' top='43' left='240'>OK</button>
|
||||||
<button name='cancel' type='regular' def-key='esc' top='43' left='175'>Cancel</button>
|
<button name='cancel' type='regular' def-key='esc' top='43' left='175'>Cancel</button>
|
||||||
<button name='revert' type='regular' top='43' left='109'>Don't</button>
|
<button name='revert' type='regular' top='43' left='109'></button>
|
||||||
<pict type='dlog' num='16' top='6' left='6'/>
|
<pict type='dlog' num='16' top='6' left='6'/>
|
||||||
<text top='6' left='49' width='256' height='32'>
|
<text top='6' left='49' width='256' height='32'>
|
||||||
Save changes to your scenario before launching it?
|
Your scenario will be saved before launching.
|
||||||
</text>
|
</text>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|||||||
@@ -2661,12 +2661,16 @@ void start_dialogue_editing(short restoring) {
|
|||||||
redraw_screen();
|
redraw_screen();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool save_check(std::string which_dlog) {
|
bool save_check(std::string which_dlog, bool allow_no) {
|
||||||
std::string choice;
|
std::string choice;
|
||||||
|
|
||||||
if(!change_made)
|
if(!change_made)
|
||||||
return true;
|
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")
|
if(choice == "revert")
|
||||||
return true;
|
return true;
|
||||||
else if(choice == "cancel")
|
else if(choice == "cancel")
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ void update_mouse_spot(location the_point);
|
|||||||
bool monst_on_space(location loc,short m_num);
|
bool monst_on_space(location loc,short m_num);
|
||||||
void place_edit_special(location loc);
|
void place_edit_special(location loc);
|
||||||
void set_special(location spot_hit);
|
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
|
/// Represents the action of adding a new town to the end of the list
|
||||||
class aNewTown : public cAction {
|
class aNewTown : public cAction {
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ void launch_scenario() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Prompt to save first
|
// Prompt to save first
|
||||||
if(!save_check("save-before-launch")) return;
|
if(!save_check("save-before-launch", false)) return;
|
||||||
|
|
||||||
fs::path game_binary;
|
fs::path game_binary;
|
||||||
#ifdef SFML_SYSTEM_MACOS
|
#ifdef SFML_SYSTEM_MACOS
|
||||||
|
|||||||
Reference in New Issue
Block a user