1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

[macOS] Improve file association handling, and allow URL schema handling.

This commit is contained in:
bruvzg
2022-07-07 10:57:22 +03:00
parent 8ec6c075bd
commit 238ac2fdd5
7 changed files with 63 additions and 34 deletions

View File

@@ -621,11 +621,18 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
/* argument parsing and main creation */
List<String> args;
List<String> main_args;
List<String> platform_args = OS::get_singleton()->get_cmdline_platform_args();
// Add command line arguments.
for (int i = 0; i < argc; i++) {
args.push_back(String::utf8(argv[i]));
}
// Add arguments received from macOS LaunchService (URL schemas, file associations).
for (const String &arg : platform_args) {
args.push_back(arg);
}
List<String>::Element *I = args.front();
while (I) {