Close #11209: Show a warning when the user is running OpenRCT2 in Wine (#11395)

This commit is contained in:
ifimfree authored and GitHub committed 2020-04-23 19:12:54 +02:00
1 parent 092b9c0086
commit aaaae16d15
7 files changed
+35

No files matched your search

+1
View File
@@ -3681,6 +3681,7 @@ STR_6364 :{RED}{COMMA16} person has died in an accident on {STRINGID}
STR_6365 :Ride casualties
STR_6366 :Stuck or stalled vehicles
STR_6367 :{WINDOW_COLOUR_2}Animation frame:
STR_6368 :For compatibility reasons, it is not recommended to run OpenRCT2 with Wine. OpenRCT2 has native support for macOS, Linux, FreeBSD and OpenBSD.
#############
# Scenarios #
+1
View File
@@ -3,6 +3,7 @@
- Feature: [#9029] Open doors with the tile inspector.
- Feature: [#11231] Change shortcut window list order to be more intuitive, and split it into logical sections.
- Feature: [#11306] Path additions are now kept when replacing the path.
- Change: [#11209] Warn when user is running OpenRCT2 through Wine.
- Change: [#11358] Switch copy and paste button positions in tile inspector.
- Fix: [#1148] Research funding dropdown not shown in finances window.
- Fix: [#6119] Advertising campaign for ride window not updated properly (original bug).
+14
View File
@@ -52,6 +52,7 @@
#include "object/ObjectRepository.h"
#include "paint/Painter.h"
#include "platform/Crash.h"
#include "platform/Platform2.h"
#include "platform/platform.h"
#include "ride/TrackDesignRepository.h"
#include "scenario/Scenario.h"
@@ -389,6 +390,19 @@ namespace OpenRCT2
}
}
if (Platform::IsRunningInWine())
{
std::string wineWarning = _localisationService->GetString(STR_WINE_NOT_RECOMMENDED);
if (gOpenRCT2Headless)
{
Console::Error::WriteLine(wineWarning.c_str());
}
else
{
_uiContext->ShowMessageBox(wineWarning);
}
}
if (!gOpenRCT2Headless)
{
_uiContext->CreateWindow();
+2
View File
@@ -3918,6 +3918,8 @@ enum
STR_TILE_INSPECTOR_WALL_ANIMATION_FRAME = 6367,
STR_WINE_NOT_RECOMMENDED = 6368,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
/* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings
};
+5
View File
@@ -99,6 +99,11 @@ namespace Platform
}
return isSupported;
}
bool IsRunningInWine()
{
return false;
}
} // namespace Platform
#endif
+11
View File
@@ -241,6 +241,17 @@ namespace Platform
return result;
}
bool IsRunningInWine()
{
HMODULE ntdllMod = GetModuleHandleW(L"ntdll.dll");
if (ntdllMod && GetProcAddress(ntdllMod, "wine_get_version"))
{
return true;
}
return false;
}
/**
* Checks if the current version of Windows supports ANSI colour codes.
* From Windows 10, build 10586 ANSI escape colour codes can be used on stdout.
+1
View File
@@ -45,6 +45,7 @@ namespace Platform
bool IsOSVersionAtLeast(uint32_t major, uint32_t minor, uint32_t build);
#endif
bool IsRunningInWine();
bool IsColourTerminalSupported();
bool HandleSpecialCommandLineArgument(const char* argument);
uintptr_t StrDecompToPrecomp(utf8* input);