Index: ps/trunk/source/main.cpp =================================================================== --- ps/trunk/source/main.cpp +++ ps/trunk/source/main.cpp @@ -177,6 +177,23 @@ QuitEngine(); break; + case SDL_DROPFILE: + { + char* dropped_filedir = ev->ev.drop.file; + const Paths paths(g_args); + CModInstaller installer(paths.UserData() / "mods", paths.Cache()); + installer.Install(std::string(dropped_filedir), g_ScriptContext, true); + SDL_free(dropped_filedir); + if (installer.GetInstalledMods().empty()) + LOGERROR("Failed to install mod %s", dropped_filedir); + else + { + LOGMESSAGE("Installed mod %s", installer.GetInstalledMods().front()); + RestartEngine(); + } + break; + } + case SDL_HOTKEYPRESS: std::string hotkey = static_cast(ev->ev.user.data1); if (hotkey == "exit") Index: ps/trunk/source/tools/dist/build-osx-bundle.py =================================================================== --- ps/trunk/source/tools/dist/build-osx-bundle.py +++ ps/trunk/source/tools/dist/build-osx-bundle.py @@ -107,6 +107,27 @@ 'LSHasLocalizedDisplayName': True, 'LSMinimumSystemVersion': BUNDLE_MIN_OSX_VERSION, 'NSHumanReadableCopyright': f'Copyright © {datetime.datetime.now().year} Wildfire Games', + 'UTExportedTypeDeclarations': [{ + 'UTTypeIdentifier': BUNDLE_IDENTIFIER, + 'UTTypeTagSpecification': { + 'public.filename-extension': ["pyromod"], + }, + 'UTTypeConformsTo': ['public.zip-archive'], + 'UTTypeDescription': '0 A.D. Zipped Mod', + 'UTTypeIconFile': '0ad' + }], + 'CFBundleDocumentTypes': [{ + 'CFBundleTypeExtensions': ['pyromod'], + 'CFBundleTypeRole': 'Editor', + 'CFBundleTypeIconFile': '0ad', + 'LSHandlerRank': 'Owner' + }, + { + 'CFBundleTypeExtensions': ['zip'], + 'CFBundleTypeRole': 'Viewer', + 'CFBundleTypeIconFile': '0ad', + 'LSHandlerRank': 'Alternate' + }], }, f) if args.dev: