mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-09-22 22:48:08 +03:00
Windows: Open folder chooser only if current folder has no ALD files
This commit is contained in:
@@ -40,6 +40,15 @@ static int CALLBACK select_game_callback(HWND hwnd, UINT uMsg, LPARAM lParam, LP
|
||||
return 0;
|
||||
}
|
||||
|
||||
boolean current_folder_has_ald(void) {
|
||||
WIN32_FIND_DATA find_data;
|
||||
HANDLE hFind = FindFirstFile("*.ALD", &find_data);
|
||||
if (hFind == INVALID_HANDLE_VALUE)
|
||||
return FALSE;
|
||||
FindClose(hFind);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
boolean select_game_folder(void) {
|
||||
char title[256];
|
||||
LoadString(GetModuleHandle(NULL), IDS_CHOOSE_GAME_FOLDER, title, sizeof(title));
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
struct inputstring_param;
|
||||
struct inputnum_param;
|
||||
|
||||
boolean current_folder_has_ald(void);
|
||||
boolean select_game_folder(void);
|
||||
boolean input_string(struct inputstring_param *p);
|
||||
boolean input_number(struct inputnum_param *p);
|
||||
|
||||
+1
-1
@@ -486,7 +486,7 @@ int main(int argc, char **argv) {
|
||||
chdir(argv[2]);
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
if (argc == 1) {
|
||||
if (argc == 1 && !current_folder_has_ald()) {
|
||||
if (!select_game_folder())
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user