diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 852197ac50..621dd2852a 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3697,6 +3697,8 @@ STR_6591 :Staff member is currently fixing a ride and can’t be fired. STR_6592 :Staff member is currently inspecting a ride and can’t be fired. STR_6593 :Remove park fences STR_6594 :Tile Inspector: Toggle wall slope +STR_6595 :{WINDOW_COLOUR_2}Author: {BLACK}{STRING} +STR_6596 :{WINDOW_COLOUR_2}Authors: {BLACK}{STRING} ############# # Scenarios # diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 58cdfc5188..dadcb10c58 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -6,6 +6,7 @@ - Feature: [OpenMusic#46] Added Mystic ride music style. - Feature: [OpenMusic#50] Added Rock style 4 ride music. - Feature: [#20825] Made setting the game speed a game action. +- Feature: [#20830] Display author field on scenery window. - Feature: [#20853] [Plugin] Add “BaseTileElement.owner” which is saved in the park file. - Change: [#20790] Default ride price set to free if park charges for entry. - Change: [#20880] Restore removed default coaster colours. diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 9f1b45c4d4..fb22f35fe1 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -422,12 +422,12 @@ public: else { const auto& listWidget = widgets[WIDX_SCENERY_LIST]; - const auto nonListHeight = height - listWidget.height() + 2; + const auto nonListHeight = height - listWidget.height() + 12; const auto numRows = static_cast(CountRows()); const auto maxContentHeight = numRows * SCENERY_BUTTON_HEIGHT; const auto maxWindowHeight = maxContentHeight + nonListHeight; - const auto windowHeight = std::clamp(maxWindowHeight, _actualMinHeight, 463); + const auto windowHeight = std::clamp(maxWindowHeight, _actualMinHeight, 473); min_height = windowHeight; max_height = windowHeight; @@ -743,7 +743,7 @@ public: ResizeFrameWithPage(); widgets[WIDX_SCENERY_LIST].right = windowWidth - 26; - widgets[WIDX_SCENERY_LIST].bottom = height - 14; + widgets[WIDX_SCENERY_LIST].bottom = height - 24; widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].left = windowWidth - 25; widgets[WIDX_SCENERY_REPAINT_SCENERY_BUTTON].left = windowWidth - 25; @@ -793,7 +793,29 @@ public: auto ft = Formatter(); ft.Add(name); - DrawTextEllipsised(dpi, { windowPos.x + 3, windowPos.y + height - 13 }, width - 19, STR_BLACK_STRING, ft); + DrawTextEllipsised(dpi, { windowPos.x + 3, windowPos.y + height - 23 }, width - 19, STR_BLACK_STRING, ft); + + auto sceneryObjectType = GetObjectTypeFromSceneryType(selectedSceneryEntry.SceneryType); + auto& objManager = GetContext()->GetObjectManager(); + auto sceneryObject = objManager.GetLoadedObject(sceneryObjectType, selectedSceneryEntry.EntryIndex); + if (sceneryObject != nullptr && sceneryObject->GetAuthors().size() > 0) + { + std::string authorsString; + const auto& authors = sceneryObject->GetAuthors(); + for (size_t i = 0; i < authors.size(); ++i) + { + if (i > 0) + { + authorsString.append(", "); + } + authorsString.append(authors[i]); + } + ft = Formatter(); + ft.Add(authorsString.c_str()); + DrawTextEllipsised( + dpi, windowPos + ScreenCoordsXY{ 3, height - 13 }, width - 19, + (sceneryObject->GetAuthors().size() == 1 ? STR_SCENERY_AUTHOR : STR_SCENERY_AUTHOR_PLURAL), ft); + } } void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 264aa43b31..defa2ed155 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -4004,6 +4004,9 @@ enum : uint16_t STR_SHORTCUT_TOGGLE_WALL_SLOPE = 6594, + STR_SCENERY_AUTHOR = 6595, + STR_SCENERY_AUTHOR_PLURAL = 6596, + // 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 };