Skip to content

Commit

Permalink
Fix #18653: Negative ratings multipliers do not appear in Vehicle tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Gymnasiast committed Nov 24, 2022
1 parent eeb28e5 commit 4281914
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
3 changes: 3 additions & 0 deletions data/language/en-GB.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3635,6 +3635,9 @@ STR_6529 :Invalid colour scheme parameter!
STR_6530 :User Created Expansion Set
STR_6531 :The Time Machine
STR_6532 :Katy’s Dreamworld
STR_6533 :{WINDOW_COLOUR_2}Excitement Factor: {BLACK}-{COMMA16}%
STR_6534 :{WINDOW_COLOUR_2}Intensity Factor: {BLACK}-{COMMA16}%
STR_6535 :{WINDOW_COLOUR_2}Nausea Factor: {BLACK}-{COMMA16}%

#############
# Scenarios #
Expand Down
1 change: 1 addition & 0 deletions distribution/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
- Fix: [#18459] ‘Highlight path issues’ hides fences for paths with additions.
- Fix: [#18606] JSON objects do not take priority over the DAT files they supersede.
- Fix: [#18620] [Plugin] Crash when reading widget properties from windows that have both static and tab widgets.
- Fix: [#18653] Negative ratings multipliers do not appear in Vehicle tab

0.4.2 (2022-10-05)
------------------------------------------------------------------------
Expand Down
21 changes: 12 additions & 9 deletions src/openrct2-ui/windows/Ride.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2890,17 +2890,18 @@ static void WindowRideVehiclePaint(rct_window* w, rct_drawpixelinfo* dpi)
DrawTextBasic(dpi, screenCoords, STR_CAPACITY, ft);

// Excitement Factor
if (rideEntry->excitement_multiplier > 0)
if (rideEntry->excitement_multiplier != 0)
{
screenCoords.y += LIST_ROW_HEIGHT;

ft = Formatter();
ft.Add<int16_t>(rideEntry->excitement_multiplier);
DrawTextBasic(dpi, screenCoords, STR_EXCITEMENT_FACTOR, ft);
ft.Add<int16_t>(abs(rideEntry->excitement_multiplier));
StringId stringId = rideEntry->excitement_multiplier > 0 ? STR_EXCITEMENT_FACTOR : STR_EXCITEMENT_FACTOR_NEGATIVE;
DrawTextBasic(dpi, screenCoords, stringId, ft);
}

// Intensity Factor
if (rideEntry->intensity_multiplier > 0)
if (rideEntry->intensity_multiplier != 0)
{
int32_t lineHeight = font_get_line_height(FontStyle::Medium);
if (lineHeight != 10)
Expand All @@ -2909,21 +2910,23 @@ static void WindowRideVehiclePaint(rct_window* w, rct_drawpixelinfo* dpi)
screenCoords.y += LIST_ROW_HEIGHT;

ft = Formatter();
ft.Add<int16_t>(rideEntry->intensity_multiplier);
DrawTextBasic(dpi, screenCoords, STR_INTENSITY_FACTOR, ft);
ft.Add<int16_t>(abs(rideEntry->intensity_multiplier));
StringId stringId = rideEntry->intensity_multiplier > 0 ? STR_INTENSITY_FACTOR : STR_INTENSITY_FACTOR_NEGATIVE;
DrawTextBasic(dpi, screenCoords, stringId, ft);

if (lineHeight != 10)
screenCoords.x -= 150;
}

// Nausea Factor
if (rideEntry->nausea_multiplier > 0)
if (rideEntry->nausea_multiplier != 0)
{
screenCoords.y += LIST_ROW_HEIGHT;

ft = Formatter();
ft.Add<int16_t>(rideEntry->nausea_multiplier);
DrawTextBasic(dpi, screenCoords, STR_NAUSEA_FACTOR, ft);
ft.Add<int16_t>(abs(rideEntry->nausea_multiplier));
StringId stringId = rideEntry->nausea_multiplier > 0 ? STR_NAUSEA_FACTOR : STR_NAUSEA_FACTOR_NEGATIVE;
DrawTextBasic(dpi, screenCoords, stringId, ft);
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/openrct2/localisation/StringIds.h
Original file line number Diff line number Diff line change
Expand Up @@ -3921,6 +3921,11 @@ enum : uint16_t
STR_SCENARIO_CATEGORY_UCES = 6530,
STR_UCES_TM = 6531,
STR_UCES_KD = 6532,

STR_EXCITEMENT_FACTOR_NEGATIVE = 6533,
STR_INTENSITY_FACTOR_NEGATIVE = 6534,
STR_NAUSEA_FACTOR_NEGATIVE = 6535,

// 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
};

0 comments on commit 4281914

Please sign in to comment.