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

@@ -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) {
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_town = univ.town.num < 200;
bool save_maps = !univ.party.stuff_done[306][0];

View File

@@ -207,25 +207,25 @@ extern sf::RenderWindow mainPtr;
void init_fileio(){
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 setTitle: @"Load Scenario"];
[dlg_get_scen retain];
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 setTitle: @"Load Game"];
[dlg_get_game retain];
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 setTitle: @"Save Scenario"];
[dlg_put_scen retain];
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 setTitle: @"Save Game"];
[dlg_put_game retain];

View File

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