From a56a3fb804377bda6966ba3fd9a7d30965847462 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Tue, 17 Mar 2020 21:38:15 +0100 Subject: [PATCH] Fix #6766: Changelog window won't open (#10954) --- distribution/changelog.txt | 1 + src/openrct2/platform/Platform.Win32.cpp | 12 +++++++++--- src/openrct2/platform/Platform.macOS.mm | 10 +++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index e2ea7048fd..1af1094577 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -11,6 +11,7 @@ - Change: [#1164] Use available translations for shortcut key bindings. - Fix: [#2485] Hide Vertical Faces not applied to the edges of water. - Fix: [#5249] No collision detection when building ride entrance at heights > 85.5m. +- Fix: [#6766] Changelog window doesn't open on some platforms. - Fix: [#7784] Vehicle tab takes 1st car colour instead of tab_vehicle's colour. - Fix: [#7854] Cannot build a custom spiral roller coaster design. - Fix: [#7854] Empty entries in spiral roller coaster designs list. diff --git a/src/openrct2/platform/Platform.Win32.cpp b/src/openrct2/platform/Platform.Win32.cpp index 9161f970cf..d8a0edb222 100644 --- a/src/openrct2/platform/Platform.Win32.cpp +++ b/src/openrct2/platform/Platform.Win32.cpp @@ -136,6 +136,13 @@ namespace Platform } } + static std::string GetCurrentExecutableDirectory() + { + auto exePath = GetCurrentExecutablePath(); + auto exeDirectory = Path::GetDirectory(exePath); + return exeDirectory; + } + std::string GetInstallPath() { auto path = std::string(gCustomOpenrctDataPath); @@ -145,8 +152,7 @@ namespace Platform } else { - auto exePath = GetCurrentExecutablePath(); - auto exeDirectory = Path::GetDirectory(exePath); + auto exeDirectory = GetCurrentExecutableDirectory(); path = Path::Combine(exeDirectory, "data"); } return path; @@ -159,7 +165,7 @@ namespace Platform std::string GetDocsPath() { - return std::string(); + return GetCurrentExecutableDirectory(); } static SYSTEMTIME TimeToSystemTime(std::time_t timestamp) diff --git a/src/openrct2/platform/Platform.macOS.mm b/src/openrct2/platform/Platform.macOS.mm index 225dff23da..efe493541c 100644 --- a/src/openrct2/platform/Platform.macOS.mm +++ b/src/openrct2/platform/Platform.macOS.mm @@ -42,11 +42,6 @@ namespace Platform } } - std::string GetDocsPath() - { - return std::string(); - } - static std::string GetBundlePath() { @autoreleasepool { @@ -63,6 +58,11 @@ namespace Platform } } + std::string GetDocsPath() + { + return GetBundlePath(); + } + std::string GetInstallPath() { auto path = std::string(gCustomOpenrctDataPath);