Several little fixes

- Save As not working when not in a scenario
- Recuperation trait not selectable
- (Mac) Reverse domain applied as file extension
- (Windows) File extension not auto-appended
- (Windows) Dialogs sometimes fell behind main window after exiting sub-dialog
This commit is contained in:
2015-01-07 17:20:49 -05:00
parent 3b1d083575
commit 38f398caa5
5 changed files with 14 additions and 6 deletions

View File

@@ -2180,7 +2180,7 @@ void post_load() {
//mode; // 0 - normal 1 - save as //mode; // 0 - normal 1 - save as
void do_save(short mode) { void do_save(short mode) {
if(overall_mode > MODE_TOWN) { if(overall_mode > MODE_TOWN && overall_mode != MODE_STARTUP) {
add_string_to_buf("Save: Only while outdoors, or in "); add_string_to_buf("Save: Only while outdoors, or in ");
add_string_to_buf(" town and not looking/casting. "); add_string_to_buf(" town and not looking/casting. ");
print_buf(); print_buf();

View File

@@ -269,7 +269,7 @@ static bool pick_race_select_led(cDialog& me, std::string item_hit, bool losing,
display_traits_graphics(me); display_traits_graphics(me);
abil_str = 22 + hit * 2; abil_str = 22 + hit * 2;
} else if(item_hit.substr(0,4) == "good") { } else if(item_hit.substr(0,4) == "good") {
int hit = item_hit[4] - '1'; int hit = boost::lexical_cast<int>(item_hit.substr(4)) - 1;
eTrait trait = eTrait(hit); eTrait trait = eTrait(hit);
if(store_trait_mode != 1) if(store_trait_mode != 1)
pc->traits[trait] = !pc->traits[trait]; pc->traits[trait] = !pc->traits[trait];

View File

@@ -890,6 +890,13 @@ bool load_party_v2(fs::path file_to_load, cUniverse& univ, bool town_restore, bo
bool save_party(fs::path dest_file, const cUniverse& univ) { bool save_party(fs::path dest_file, const cUniverse& univ) {
if(!fs::exists(tempDir)) fs::create_directories(tempDir); if(!fs::exists(tempDir)) fs::create_directories(tempDir);
// Make sure it has the proper file extension
std::string fname = dest_file.filename().string();
size_t dot = fname.find_last_of('.');
if(dot == std::string::npos || fname.substr(dot) != ".exg")
fname += ".exg";
dest_file = dest_file.parent_path()/fname;
bool in_scen = univ.party.scen_name != ""; bool in_scen = univ.party.scen_name != "";
bool in_town = univ.town.num < 200; bool in_town = univ.town.num < 200;
bool save_maps = !univ.party.stuff_done[306][0]; bool save_maps = !univ.party.stuff_done[306][0];

View File

@@ -207,25 +207,25 @@ extern sf::RenderWindow mainPtr;
void init_fileio(){ void init_fileio(){
dlg_get_scen = [NSOpenPanel openPanel]; dlg_get_scen = [NSOpenPanel openPanel];
[dlg_get_scen setAllowedFileTypes: [NSArray arrayWithObjects: @"com.spidweb.bladesofexile.scenario", @"exs", @"boes", nil]]; [dlg_get_scen setAllowedFileTypes: [NSArray arrayWithObjects: @"exs", @"boes", nil]];
[dlg_get_scen setMessage: @"Select a scenario to edit:"]; [dlg_get_scen setMessage: @"Select a scenario to edit:"];
[dlg_get_scen setTitle: @"Load Scenario"]; [dlg_get_scen setTitle: @"Load Scenario"];
[dlg_get_scen retain]; [dlg_get_scen retain];
dlg_get_game = [NSOpenPanel openPanel]; dlg_get_game = [NSOpenPanel openPanel];
[dlg_get_game setAllowedFileTypes: [NSArray arrayWithObjects: @"com.spidweb.bladesofexile.savegame", @"com.spidweb.bladesofexile.oldmacsave", @"com.spidweb.bladesofexile.oldwinsave", @"exg", @"boe", @"SAV", @"mac", nil]]; [dlg_get_game setAllowedFileTypes: [NSArray arrayWithObjects: @"exg", @"boe", @"SAV", @"mac", nil]];
[dlg_get_game setMessage: @"Select a saved game to resume:"]; [dlg_get_game setMessage: @"Select a saved game to resume:"];
[dlg_get_game setTitle: @"Load Game"]; [dlg_get_game setTitle: @"Load Game"];
[dlg_get_game retain]; [dlg_get_game retain];
dlg_put_scen = [NSSavePanel savePanel]; dlg_put_scen = [NSSavePanel savePanel];
[dlg_put_scen setAllowedFileTypes: [NSArray arrayWithObjects: @"com.spidweb.bladesofexile.scenario", @"boes", nil]]; [dlg_put_scen setAllowedFileTypes: [NSArray arrayWithObjects: @"boes", nil]];
[dlg_put_scen setMessage: @"Select a location to save the scenario:"]; [dlg_put_scen setMessage: @"Select a location to save the scenario:"];
[dlg_put_scen setTitle: @"Save Scenario"]; [dlg_put_scen setTitle: @"Save Scenario"];
[dlg_put_scen retain]; [dlg_put_scen retain];
dlg_put_game = [NSSavePanel savePanel]; dlg_put_game = [NSSavePanel savePanel];
[dlg_put_game setAllowedFileTypes: [NSArray arrayWithObjects: @"com.spidweb.bladesofexile.savegame", @"exg", nil]]; [dlg_put_game setAllowedFileTypes: [NSArray arrayWithObjects: @"exg", nil]];
[dlg_put_game setMessage: @"Select a location to save your game:"]; [dlg_put_game setMessage: @"Select a location to save your game:"];
[dlg_put_game setTitle: @"Save Game"]; [dlg_put_game setTitle: @"Save Game"];
[dlg_put_game retain]; [dlg_put_game retain];

View File

@@ -231,6 +231,7 @@ ModalSession::ModalSession(sf::Window& win, sf::Window& p) : parent(&p) {
ModalSession::~ModalSession() { ModalSession::~ModalSession() {
HWND win_handle = (HWND)session; HWND win_handle = (HWND)session;
EnableWindow(parent->getSystemHandle(), true); EnableWindow(parent->getSystemHandle(), true);
makeFrontWindow(parent);
RedrawWindow(parent->getSystemHandle(), NULL, NULL, RDW_NOCHILDREN | RDW_UPDATENOW); RedrawWindow(parent->getSystemHandle(), NULL, NULL, RDW_NOCHILDREN | RDW_UPDATENOW);
} }