all platforms load party from command line
This commit is contained in:
@@ -215,7 +215,30 @@ static void init_ui() {
|
|||||||
init_buttons();
|
init_buttons();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void process_args(int argc, char* argv[]) {
|
||||||
|
// Command line usage:
|
||||||
|
// "Blades of Exile" # basic launch
|
||||||
|
// "Blades of Exile" <save file> # launch and load save file
|
||||||
|
|
||||||
|
if (argc > 1) {
|
||||||
|
if(!load_party(argv[1], univ)) {
|
||||||
|
std::cout << "Failed to load save file: " << argv[1] << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!finished_init) {
|
||||||
|
ae_loading = true;
|
||||||
|
overall_mode = MODE_STARTUP;
|
||||||
|
} else finish_load_party();
|
||||||
|
if(overall_mode != MODE_STARTUP)
|
||||||
|
end_startup();
|
||||||
|
if(overall_mode != MODE_STARTUP)
|
||||||
|
post_load();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void init_boe(int argc, char* argv[]) {
|
void init_boe(int argc, char* argv[]) {
|
||||||
|
process_args(argc, argv);
|
||||||
set_up_apple_events(argc, argv);
|
set_up_apple_events(argc, argv);
|
||||||
init_directories(argv[0]);
|
init_directories(argv[0]);
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
@@ -318,19 +318,6 @@ LRESULT CALLBACK menuProc(HWND handle, UINT message, WPARAM wParam, LPARAM lPara
|
|||||||
#include "boe.actions.hpp"
|
#include "boe.actions.hpp"
|
||||||
#include "boe.fileio.hpp"
|
#include "boe.fileio.hpp"
|
||||||
|
|
||||||
extern bool ae_loading, finished_init;
|
|
||||||
void set_up_apple_events(int argc, char* argv[]) {
|
void set_up_apple_events(int argc, char* argv[]) {
|
||||||
if(argc > 1) {
|
|
||||||
if(!load_party(argv[1], univ))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(!finished_init) {
|
|
||||||
ae_loading = true;
|
|
||||||
overall_mode = MODE_STARTUP;
|
|
||||||
} else finish_load_party();
|
|
||||||
if(overall_mode != MODE_STARTUP)
|
|
||||||
end_startup();
|
|
||||||
if(overall_mode != MODE_STARTUP)
|
|
||||||
post_load();
|
|
||||||
}
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user