mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 21:43:06 +01:00
Introduce widget::midX and widget::midY helper functions
This commit is contained in:
@@ -620,23 +620,20 @@ static void window_footpath_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
|
||||
// Draw construction image
|
||||
screenCoords = w->windowPos
|
||||
+ ScreenCoordsXY{ (window_footpath_widgets[WIDX_CONSTRUCT].left + window_footpath_widgets[WIDX_CONSTRUCT].right)
|
||||
/ 2,
|
||||
+ ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(),
|
||||
window_footpath_widgets[WIDX_CONSTRUCT].bottom - 60 };
|
||||
gfx_draw_sprite(dpi, image, screenCoords, 0);
|
||||
|
||||
// Draw build this... label
|
||||
screenCoords = w->windowPos
|
||||
+ ScreenCoordsXY{ (window_footpath_widgets[WIDX_CONSTRUCT].left + window_footpath_widgets[WIDX_CONSTRUCT].right)
|
||||
/ 2,
|
||||
+ ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(),
|
||||
window_footpath_widgets[WIDX_CONSTRUCT].bottom - 23 };
|
||||
gfx_draw_string_centred(dpi, STR_BUILD_THIS, screenCoords, COLOUR_BLACK, nullptr);
|
||||
}
|
||||
|
||||
// Draw cost
|
||||
screenCoords = w->windowPos
|
||||
+ ScreenCoordsXY{ (window_footpath_widgets[WIDX_CONSTRUCT].left + window_footpath_widgets[WIDX_CONSTRUCT].right) / 2,
|
||||
window_footpath_widgets[WIDX_CONSTRUCT].bottom - 12 };
|
||||
+ ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(), window_footpath_widgets[WIDX_CONSTRUCT].bottom - 12 };
|
||||
if (_window_footpath_cost != MONEY32_UNDEFINED)
|
||||
{
|
||||
if (!(gParkFlags & PARK_FLAGS_NO_MONEY))
|
||||
|
||||
Reference in New Issue
Block a user