diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 101ec19b276e..37b2f31260dc 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.4.13 (in development) ------------------------------------------------------------------------ +- Feature: [#19596] Allow for playing back a replay without camera movement or alert box. - Feature: [#20831] The ride selection window now shows object authors if debugging tools are active. - Feature: [#20832] The ride music tab now shows a track listing for the current music style. - Feature: [#22172] [Plugin] Expose ride satisfaction ratings to the plugin API. diff --git a/src/openrct2/OpenRCT2.cpp b/src/openrct2/OpenRCT2.cpp index 5e3167006e72..e96f4917f901 100644 --- a/src/openrct2/OpenRCT2.cpp +++ b/src/openrct2/OpenRCT2.cpp @@ -28,3 +28,5 @@ uint32_t gCurrentDrawCount = 0; uint8_t gScreenFlags; uint32_t gScreenAge; PromptMode gSavePromptMode; + +bool gSilentReplays = false; diff --git a/src/openrct2/OpenRCT2.h b/src/openrct2/OpenRCT2.h index 25fa529c6344..be3e94aae1b2 100644 --- a/src/openrct2/OpenRCT2.h +++ b/src/openrct2/OpenRCT2.h @@ -48,6 +48,7 @@ extern bool gOpenRCT2NoGraphics; extern bool gOpenRCT2ShowChangelog; extern bool gOpenRCT2SilentBreakpad; extern u8string gSilentRecordingName; +extern bool gSilentReplays; #ifndef DISABLE_NETWORK extern int32_t gNetworkStart; diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index cb3d5f05fbf0..3c1a24c26f78 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -184,7 +184,10 @@ namespace OpenRCT2 #ifndef DISABLE_NETWORK // If the network is disabled we will only get a dummy hash which will cause // false positives during replay. - CheckState(); + if (!gSilentReplays) + { + CheckState(); + } #endif ReplayCommands(); @@ -870,7 +873,7 @@ namespace OpenRCT2 } // Focus camera on event. - if (isPositionValid && !result.Position.IsNull()) + if (!gSilentReplays && isPositionValid && !result.Position.IsNull()) { auto* mainWindow = WindowGetMain(); if (mainWindow != nullptr) diff --git a/src/openrct2/command_line/RootCommands.cpp b/src/openrct2/command_line/RootCommands.cpp index 36642024e30b..c3ceddc57d15 100644 --- a/src/openrct2/command_line/RootCommands.cpp +++ b/src/openrct2/command_line/RootCommands.cpp @@ -56,6 +56,7 @@ static bool _all = false; static bool _about = false; static bool _verbose = false; static bool _headless = false; +static bool _silentReplays = false; static u8string _password = {}; static u8string _userDataPath = {}; static u8string _openrct2DataPath = {}; @@ -73,6 +74,7 @@ static constexpr CommandLineOptionDefinition StandardOptions[] { CMDLINE_TYPE_SWITCH, &_about, NAC, "about", "show information about " OPENRCT2_NAME }, { CMDLINE_TYPE_SWITCH, &_verbose, NAC, "verbose", "log verbose messages" }, { CMDLINE_TYPE_SWITCH, &_headless, NAC, "headless", "run " OPENRCT2_NAME " headless" IMPLIES_SILENT_BREAKPAD }, + { CMDLINE_TYPE_SWITCH, &_silentReplays, NAC, "silent-replays", "use unobtrusive replays" }, #ifndef DISABLE_NETWORK { CMDLINE_TYPE_INTEGER, &_port, NAC, "port", "port to use for hosting or joining a server" }, { CMDLINE_TYPE_STRING, &_address, NAC, "address", "address to listen on when hosting a server" }, @@ -224,6 +226,11 @@ exitcode_t CommandLine::HandleCommandDefault() gCustomPassword = _password; } + if (_silentReplays) + { + gSilentReplays = _silentReplays; + } + return result; } diff --git a/src/openrct2/paint/Painter.cpp b/src/openrct2/paint/Painter.cpp index 9120a14ec1e2..17e134388745 100644 --- a/src/openrct2/paint/Painter.cpp +++ b/src/openrct2/paint/Painter.cpp @@ -65,7 +65,7 @@ void Painter::Paint(IDrawingEngine& de) auto* replayManager = GetContext()->GetReplayManager(); const char* text = nullptr; - if (replayManager->IsReplaying()) + if (replayManager->IsReplaying() && !gSilentReplays) text = "Replaying..."; else if (replayManager->ShouldDisplayNotice()) text = "Recording...";