diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-12-14 09:54:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-14 09:54:12 +0100 |
commit | 3a9284b562d6dcfc339322999767168e12220895 (patch) | |
tree | 64dceffa4f39d80cade86f773e6bd95c368f6167 | |
parent | 3740ec25f7dd4febba89f771972f7f29321cca43 (diff) | |
parent | 5152afa70c8f07f63e9f9d9c2ff386ee6437ca1e (diff) |
Merge pull request #34338 from Catchawink/master
Fixed an issue with capturing audio from microphones in macOS.
-rwxr-xr-x | misc/dist/osx_template.app/Contents/Info.plist | 4 | ||||
-rwxr-xr-x | misc/dist/osx_tools.app/Contents/Info.plist | 4 | ||||
-rw-r--r-- | platform/osx/export/export.cpp | 9 |
3 files changed, 17 insertions, 0 deletions
diff --git a/misc/dist/osx_template.app/Contents/Info.plist b/misc/dist/osx_template.app/Contents/Info.plist index eee787bdaf..696c825594 100755 --- a/misc/dist/osx_template.app/Contents/Info.plist +++ b/misc/dist/osx_template.app/Contents/Info.plist @@ -24,6 +24,10 @@ <string>$signature</string> <key>CFBundleVersion</key> <string>$version</string> + <key>NSMicrophoneUsageDescription</key> + <string>$microphone_usage_description</string> + <key>NSCameraUsageDescription</key> + <string>$camera_usage_description</string> <key>NSHumanReadableCopyright</key> <string>$copyright</string> <key>LSMinimumSystemVersion</key> diff --git a/misc/dist/osx_tools.app/Contents/Info.plist b/misc/dist/osx_tools.app/Contents/Info.plist index bb22f1807c..4b1e8ebbf3 100755 --- a/misc/dist/osx_tools.app/Contents/Info.plist +++ b/misc/dist/osx_tools.app/Contents/Info.plist @@ -24,6 +24,10 @@ <string>godot</string> <key>CFBundleVersion</key> <string>3.2</string> + <key>NSMicrophoneUsageDescription</key> + <string>Microphone access is required to capture audio.</string> + <key>NSCameraUsageDescription</key> + <string>Camera access is required to capture video.</string> <key>NSRequiresAquaSystemAppearance</key> <false /> <key>NSHumanReadableCopyright</key> diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 9226aea369..590858b558 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -130,6 +130,9 @@ void EditorExportPlatformOSX::get_export_options(List<ExportOption> *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/version"), "1.0")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/copyright"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "display/high_res"), false)); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/camera_usage_description", PROPERTY_HINT_PLACEHOLDER_TEXT, "Provide a message if you need to use the camera"), "")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/microphone_usage_description", PROPERTY_HINT_PLACEHOLDER_TEXT, "Provide a message if you need to use the microphone"), "")); + #ifdef OSX_ENABLED r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "codesign/enable"), false)); @@ -342,6 +345,12 @@ void EditorExportPlatformOSX::_fix_plist(const Ref<EditorExportPreset> &p_preset strnew += lines[i].replace("$copyright", p_preset->get("application/copyright")) + "\n"; } else if (lines[i].find("$highres") != -1) { strnew += lines[i].replace("$highres", p_preset->get("display/high_res") ? "<true/>" : "<false/>") + "\n"; + } else if (lines[i].find("$camera_usage_description") != -1) { + String description = p_preset->get("privacy/camera_usage_description"); + strnew += lines[i].replace("$camera_usage_description", description) + "\n"; + } else if (lines[i].find("$microphone_usage_description") != -1) { + String description = p_preset->get("privacy/microphone_usage_description"); + strnew += lines[i].replace("$microphone_usage_description", description) + "\n"; } else { strnew += lines[i] + "\n"; } |