From cb480376d874c23bc9eef449109b68e7f7d9968e Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon, 14 Jun 2021 14:21:41 +0300 Subject: [PATCH] Add LSApplicationCategoryType to the template and export dialog. --- misc/dist/osx_template.app/Contents/Info.plist | 2 ++ misc/dist/osx_tools.app/Contents/Info.plist | 2 ++ platform/osx/export/export.cpp | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/misc/dist/osx_template.app/Contents/Info.plist b/misc/dist/osx_template.app/Contents/Info.plist index aad24935d02..8e221df9469 100644 --- a/misc/dist/osx_template.app/Contents/Info.plist +++ b/misc/dist/osx_template.app/Contents/Info.plist @@ -36,6 +36,8 @@ NSPrincipalClass NSApplication + LSApplicationCategoryType + public.app-category.$app_category LSMinimumSystemVersion 10.12 LSMinimumSystemVersionByArchitecture diff --git a/misc/dist/osx_tools.app/Contents/Info.plist b/misc/dist/osx_tools.app/Contents/Info.plist index 1c682f339fc..8e70d4c2035 100644 --- a/misc/dist/osx_tools.app/Contents/Info.plist +++ b/misc/dist/osx_tools.app/Contents/Info.plist @@ -38,6 +38,8 @@ NSPrincipalClass NSApplication + LSApplicationCategoryType + public.app-category.developer-tools LSMinimumSystemVersion 10.12 LSMinimumSystemVersionByArchitecture diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 8cd7afe5a7d..f52853ca9ed 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -147,6 +147,7 @@ void EditorExportPlatformOSX::get_export_options(List *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/icon", PROPERTY_HINT_FILE, "*.png,*.icns"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/bundle_identifier", PROPERTY_HINT_PLACEHOLDER_TEXT, "com.example.game"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/signature"), "")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/app_category", PROPERTY_HINT_ENUM, "Business,Developer-tools,Education,Entertainment,Finance,Games,Action-games,Adventure-games,Arcade-games,Board-games,Card-games,Casino-games,Dice-games,Educational-games,Family-games,Kids-games,Music-games,Puzzle-games,Racing-games,Role-playing-games,Simulation-games,Sports-games,Strategy-games,Trivia-games,Word-games,Graphics-design,Healthcare-fitness,Lifestyle,Medical,Music,News,Photography,Productivity,Reference,Social-networking,Sports,Travel,Utilities,Video,Weather"), "Games")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/short_version"), "1.0")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/version"), "1.0")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/copyright"), "")); @@ -386,6 +387,9 @@ void EditorExportPlatformOSX::_fix_plist(const Ref &p_preset strnew += lines[i].replace("$version", p_preset->get("application/version")) + "\n"; } else if (lines[i].find("$signature") != -1) { strnew += lines[i].replace("$signature", p_preset->get("application/signature")) + "\n"; + } else if (lines[i].find("$app_category") != -1) { + String cat = p_preset->get("application/app_category"); + strnew += lines[i].replace("$app_category", cat.to_lower()) + "\n"; } else if (lines[i].find("$copyright") != -1) { strnew += lines[i].replace("$copyright", p_preset->get("application/copyright")) + "\n"; } else if (lines[i].find("$highres") != -1) {