diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 33072a3ca3..8e6ff86cbd 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.4.24 (in development) ------------------------------------------------------------------------ - Feature: [#24411] Vanilla scenarios now also have previews in the scenario selection window. +- Feature: [#24662] Add optional screenshot argument for Z coord. - Improved: [#22684] The limit of 2000 animated tile elements has been removed. - Improved: [#23228] Landscape edge doors now animate opening and closing and play a sound. - Improved: [#24026] Notification settings have been made into a tab of the Recent Messages window. diff --git a/src/openrct2/command_line/ScreenshotCommands.cpp b/src/openrct2/command_line/ScreenshotCommands.cpp index b473a6296b..97823125c6 100644 --- a/src/openrct2/command_line/ScreenshotCommands.cpp +++ b/src/openrct2/command_line/ScreenshotCommands.cpp @@ -35,7 +35,7 @@ static exitcode_t HandleScreenshot(CommandLineArgEnumerator *argEnumerator); const CommandLineCommand CommandLine::kScreenshotCommands[] { // Main commands - DefineCommand("", " [ ]", kScreenshotOptionsDef, HandleScreenshot), + DefineCommand("", " [ [] ]", kScreenshotOptionsDef, HandleScreenshot), DefineCommand("", " giant ", kScreenshotOptionsDef, HandleScreenshot), kCommandTableEnd }; diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index 07f21cfec6..ad3d6840d4 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -438,9 +438,9 @@ int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOpti } bool giantScreenshot = (argc == 5) && String::iequals(argv[2], "giant"); - if (argc != 4 && argc != 8 && !giantScreenshot) + if (argc != 4 && argc != 8 && argc != 9 && !giantScreenshot) { - std::printf("Usage: openrct2 screenshot [ ]\n"); + std::printf("Usage: openrct2 screenshot [ [] ]\n"); std::printf("Usage: openrct2 screenshot giant \n"); return -1; } @@ -488,8 +488,9 @@ int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOpti int32_t customY = 0; int32_t customZoom = 0; int32_t customRotation = 0; - if (argc == 8) + if (argc >= 8) { + int32_t argOffset = argc == 8 ? 0 : 1; customLocation = true; if (argv[4][0] == 'c') centreMapX = true; @@ -501,8 +502,8 @@ int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOpti else customY = std::atoi(argv[5]); - customZoom = std::atoi(argv[6]); - customRotation = std::atoi(argv[7]) & 3; + customZoom = std::atoi(argv[6 + argOffset]); + customRotation = std::atoi(argv[7 + argOffset]) & 3; } const auto& mapSize = getGameState().mapSize; @@ -525,6 +526,8 @@ int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOpti customY = (mapSize.y / 2) * 32 + 16; int32_t z = TileElementHeight({ customX, customY }); + if (argc == 9) + z = std::atoi(argv[6]); CoordsXYZ coords3d = { customX, customY, z }; auto coords2d = Translate3DTo2DWithZ(customRotation, coords3d);