From 3d071cec53a92ccb6a1121ae775ba0b3db2ad6e6 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 1 Aug 2020 13:44:06 +0200 Subject: [PATCH] Implement OpenURL for macOS --- src/openrct2-ui/UiContext.macOS.mm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/openrct2-ui/UiContext.macOS.mm b/src/openrct2-ui/UiContext.macOS.mm index 01b5e703f6..7d77883072 100644 --- a/src/openrct2-ui/UiContext.macOS.mm +++ b/src/openrct2-ui/UiContext.macOS.mm @@ -19,9 +19,12 @@ # undef interface # undef abstract +# include # import +# include # include # include +# include namespace OpenRCT2::Ui { @@ -70,6 +73,10 @@ namespace OpenRCT2::Ui void OpenURL(const std::string& url) override { + CFURLRef urlRef = CFURLCreateWithBytes( + nullptr, reinterpret_cast(url.c_str()), url.length(), kCFStringEncodingUTF8, nullptr); + LSOpenCFURLRef(urlRef, 0); + CFRelease(urlRef); } std::string ShowFileDialog(SDL_Window* window, const FileDialogDesc& desc) override