1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Display object author info in ride selection window (#20952)

Co-authored-by: Aaron van Geffen <aaron@aaronweb.net>
This commit is contained in:
Fredrik Tegnell
2024-07-08 22:17:05 +02:00
committed by GitHub
parent 7f281a269d
commit 940c348fa6
4 changed files with 32 additions and 0 deletions

View File

@@ -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 #

View File

@@ -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.

View File

@@ -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,

View File

@@ -39,6 +39,7 @@
#include <openrct2/world/Park.h>
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<money64>(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<RideObject*>(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<StringId>(authorStringId);
ft.Add<const char*>(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)