From 0217734c4ef4b83e2e68f8c239c03bf37e43637d Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Fri, 6 Oct 2017 01:46:23 +0200 Subject: [PATCH] Fix #6383: macOS deprecation errors when compiling. --- distribution/changelog.txt | 1 + src/openrct2-ui/UiContext.macOS.mm | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index f282604f71..535e564f8c 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -36,6 +36,7 @@ - Improved: [#6186] Transparent menu items now draw properly in OpenGL mode. - Improved: [#6218] Speed up game start up time by saving scenario index to file. - Improved: Load/save window now refreshes list if native file dialog is closed/cancelled. +- Technical: [#6384] On macOS, address NSFileHandlingPanel deprecation by using NSModalResponse instead. 0.1.1 (2017-08-09) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/UiContext.macOS.mm b/src/openrct2-ui/UiContext.macOS.mm index 1de0b0684f..d5a9929ff0 100644 --- a/src/openrct2-ui/UiContext.macOS.mm +++ b/src/openrct2-ui/UiContext.macOS.mm @@ -102,7 +102,8 @@ namespace OpenRCT2 { namespace Ui panel.title = [NSString stringWithUTF8String:desc.Title.c_str()]; panel.allowedFileTypes = extensions; panel.directoryURL = [NSURL fileURLWithPath:directory]; - if ([panel runModal] == NSFileHandlingPanelCancelButton){ + if ([panel runModal] == NSModalResponseCancel) + { return std::string(); } else { return panel.URL.path.UTF8String; @@ -118,7 +119,7 @@ namespace OpenRCT2 { namespace Ui panel.canChooseFiles = false; panel.canChooseDirectories = true; panel.allowsMultipleSelection = false; - if ([panel runModal] == NSFileHandlingPanelOKButton) + if ([panel runModal] == NSModalResponseOK) { NSString *selectedPath = panel.URL.path; const char *path = selectedPath.UTF8String;