Fix #6383: macOS deprecation errors when compiling.

This commit is contained in:
Aaron van Geffen 2017-10-06 01:46:23 +02:00 committed by Michael Steenbeek
parent 4224193d68
commit 0217734c4e
2 changed files with 4 additions and 2 deletions

View File

@ -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)
------------------------------------------------------------------------

View File

@ -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;