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

Add y-axis labels and guides to park rating chart.

This commit is contained in:
Aaron van Geffen
2020-03-07 13:58:02 +01:00
parent 9c5f1248d5
commit 7be46934ea
3 changed files with 19 additions and 8 deletions

View File

@@ -3673,6 +3673,7 @@ STR_6356 :{SMALLFONT}{BLACK}Spawns ducks if park contains water
STR_6357 :{SMALLFONT}{BLACK}Removes all ducks from the map
STR_6358 :Page {UINT16}
STR_6359 :{POP16}{POP16}Page {UINT16}
STR_6360 :{SMALLFONT}{BLACK}{UINT16}
#############
# Scenarios #

View File

@@ -1040,15 +1040,12 @@ static void window_park_rating_invalidate(rct_window* w)
*/
static void window_park_rating_paint(rct_window* w, rct_drawpixelinfo* dpi)
{
int32_t x, y;
rct_widget* widget;
window_draw_widgets(w, dpi);
window_park_draw_tab_images(dpi, w);
x = w->windowPos.x;
y = w->windowPos.y;
widget = &window_park_rating_widgets[WIDX_PAGE_BACKGROUND];
int32_t x = w->windowPos.x;
int32_t y = w->windowPos.y;
rct_widget* widget = &window_park_rating_widgets[WIDX_PAGE_BACKGROUND];
// Current value
gfx_draw_string_left(dpi, STR_PARK_RATING_LABEL, &gParkRating, COLOUR_BLACK, x + widget->left + 3, y + widget->top + 2);
@@ -1058,9 +1055,20 @@ static void window_park_rating_paint(rct_window* w, rct_drawpixelinfo* dpi)
dpi, x + widget->left + 4, y + widget->top + 15, x + widget->right - 4, y + widget->bottom - 4, w->colours[1],
INSET_RECT_F_30);
// Y axis labels
x = x + widget->left + 23;
y = y + widget->top + 23;
for (int i = 5; i >= 0; i--)
{
uint16_t axisValue = i * 200;
gfx_draw_string_right(dpi, STR_GRAPH_AXIS_LABEL, &axisValue, COLOUR_BLACK, x + 10, y);
gfx_fill_rect_inset(dpi, x + 15, y + 5, x + w->width - 28, y + 5, w->colours[2], INSET_RECT_FLAG_BORDER_INSET);
y += 20;
}
// Graph
x += widget->left + 22;
y += widget->top + 26;
x = w->windowPos.x + widget->left + 47;
y = w->windowPos.y + widget->top + 26;
graph_draw_uint8_t(dpi, gParkRatingHistory, 32, x, y);
}

View File

@@ -3904,6 +3904,8 @@ enum
STR_PAGE_X = 6358,
STR_ARG_4_PAGE_X = 6359,
STR_GRAPH_AXIS_LABEL = 6360,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
STR_COUNT = 32768
};