diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index cd8918f90a..58b80d0d58 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3717,6 +3717,8 @@ STR_6642 :{STRING} ({COMMA32} / {COMMA32}) STR_6643 :{STRING} ({COMMA32} / {COMMA32} KiB) STR_6644 :Touch enhancements STR_6645 :Makes some UI elements bigger so they are easier to click or tap. +STR_6646 :Author: {STRING} +STR_6647 :Authors: {STRING} ############# # Scenarios # diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 610638bbe4..f6b303ae4e 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.4.13 (in development) ------------------------------------------------------------------------ +- 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. - Feature: [#22213] [Plugin] Allow plugins to focus on textboxes in custom windows. diff --git a/src/openrct2-ui/UiStringIds.h b/src/openrct2-ui/UiStringIds.h index e2982019e5..e87a8275c8 100644 --- a/src/openrct2-ui/UiStringIds.h +++ b/src/openrct2-ui/UiStringIds.h @@ -1325,6 +1325,8 @@ namespace OpenRCT2 STR_ARG_6_STRINGID = 868, STR_ARRIVING_AT = 1103, STR_AVERAGE_SPEED = 1347, + STR_AUTHOR_STRING = 6646, + STR_AUTHORS_STRING = 6647, STR_BLOCK_SECTIONS = 3110, STR_BUILT_LAST_YEAR = 1854, STR_BUILT_THIS_YEAR = 1853, diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index c7513e4da7..2922e09710 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -39,6 +39,7 @@ #include using namespace OpenRCT2::TrackMetaData; + namespace OpenRCT2::Ui::Windows { static constexpr StringId WindowTitle = STR_NONE; @@ -971,6 +972,32 @@ static Widget window_new_ride_widgets[] = { ft.Add(price); DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ textWidth, 51 }, stringId, ft, { TextAlignment::RIGHT }); } + + // Draw object author(s) if debugging tools are active + if (Config::Get().general.DebuggingTools) + { + auto rideObject = static_cast(rideEntry->obj); + auto repoItem = ObjectRepositoryFindObjectByEntry(&(rideObject->GetObjectEntry())); + + StringId authorStringId = repoItem->Authors.size() > 1 ? STR_AUTHORS_STRING : STR_AUTHOR_STRING; + + std::string authorsString; + for (auto& author : repoItem->Authors) + { + if (!authorsString.empty()) + authorsString.append(", "); + + authorsString.append(author); + } + + ft = Formatter(); + ft.Add(authorStringId); + ft.Add(authorsString.c_str()); + + DrawTextEllipsised( + dpi, screenPos + ScreenCoordsXY{ textWidth, 0 }, WindowWidth - 2, STR_WINDOW_COLOUR_2_STRINGID, ft, + { TextAlignment::RIGHT }); + } } void DrawTabImage(DrawPixelInfo& dpi, NewRideTabId tab, int32_t spriteIndex)