diff --git a/contributors.md b/contributors.md index 9af5276289..e091a8a6a2 100644 --- a/contributors.md +++ b/contributors.md @@ -104,6 +104,7 @@ The following people are not part of the development team, but have been contrib * (telk5093) * Ethan Smith (ethanhs) - Refactor MAX_PATH * Robert Lewicki (rlewicki) +* Liam Parker (elInfidel) * Tyler Ruckinger (TyPR124) * Justin Gottula (jgottula) * Seongsik Park (pss9205) diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 81f46e46ca..95360993af 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include // clang-format off @@ -244,10 +245,10 @@ static void window_clear_scenery_paint(rct_window* w, rct_drawpixelinfo* dpi) } // Draw cost amount - x = (window_clear_scenery_widgets[WIDX_PREVIEW].left + window_clear_scenery_widgets[WIDX_PREVIEW].right) / 2 + w->x; - y = window_clear_scenery_widgets[WIDX_PREVIEW].bottom + w->y + 5 + 27; - if (gClearSceneryCost != MONEY32_UNDEFINED && gClearSceneryCost != 0) + if (gClearSceneryCost != MONEY32_UNDEFINED && gClearSceneryCost != 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { + x = (window_clear_scenery_widgets[WIDX_PREVIEW].left + window_clear_scenery_widgets[WIDX_PREVIEW].right) / 2 + w->x; + y = window_clear_scenery_widgets[WIDX_PREVIEW].bottom + w->y + 5 + 27; gfx_draw_string_centred(dpi, STR_COST_AMOUNT, x, y, COLOUR_BLACK, &gClearSceneryCost); } } diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index 83bf68207b..93dc64cc39 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -360,35 +360,39 @@ static void window_land_paint(rct_window* w, rct_drawpixelinfo* dpi) x = w->x + (previewWidget->left + previewWidget->right) / 2; y = w->y + previewWidget->bottom + 5; - // Draw raise cost amount - if (gLandToolRaiseCost != MONEY32_UNDEFINED && gLandToolRaiseCost != 0) - gfx_draw_string_centred(dpi, STR_RAISE_COST_AMOUNT, x, y, COLOUR_BLACK, &gLandToolRaiseCost); - y += 10; - - // Draw lower cost amount - if (gLandToolLowerCost != MONEY32_UNDEFINED && gLandToolLowerCost != 0) - gfx_draw_string_centred(dpi, STR_LOWER_COST_AMOUNT, x, y, COLOUR_BLACK, &gLandToolLowerCost); - y += 50; - - // Draw paint price - numTiles = gLandToolSize * gLandToolSize; - price = 0; - if (gLandToolTerrainSurface != 255) + if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) { - auto& objManager = GetContext()->GetObjectManager(); - const auto surfaceObj = static_cast( - objManager.GetLoadedObject(OBJECT_TYPE_TERRAIN_SURFACE, gLandToolTerrainSurface)); - if (surfaceObj != nullptr) + // Draw raise cost amount + if (gLandToolRaiseCost != MONEY32_UNDEFINED && gLandToolRaiseCost != 0) + gfx_draw_string_centred(dpi, STR_RAISE_COST_AMOUNT, x, y, COLOUR_BLACK, &gLandToolRaiseCost); + y += 10; + + // Draw lower cost amount + if (gLandToolLowerCost != MONEY32_UNDEFINED && gLandToolLowerCost != 0) + gfx_draw_string_centred(dpi, STR_LOWER_COST_AMOUNT, x, y, COLOUR_BLACK, &gLandToolLowerCost); + y += 50; + + // Draw paint price + numTiles = gLandToolSize * gLandToolSize; + price = 0; + if (gLandToolTerrainSurface != 255) { - price += numTiles * surfaceObj->Price; + auto& objManager = GetContext()->GetObjectManager(); + const auto surfaceObj = static_cast( + objManager.GetLoadedObject(OBJECT_TYPE_TERRAIN_SURFACE, gLandToolTerrainSurface)); + if (surfaceObj != nullptr) + { + price += numTiles * surfaceObj->Price; + } + } + + if (gLandToolTerrainEdge != 255) + price += numTiles * 100; + + if (price != 0) + { + set_format_arg(0, money32, price); + gfx_draw_string_centred(dpi, STR_COST_AMOUNT, x, y, COLOUR_BLACK, gCommonFormatArgs); } } - if (gLandToolTerrainEdge != 255) - price += numTiles * 100; - - if (price != 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) - { - set_format_arg(0, money32, price); - gfx_draw_string_centred(dpi, STR_COST_AMOUNT, x, y, COLOUR_BLACK, gCommonFormatArgs); - } } diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index 1e3f5c9473..ff97ba56c3 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -281,10 +281,10 @@ static void window_land_rights_paint(rct_window* w, rct_drawpixelinfo* dpi) } // Draw cost amount - x = (window_land_rights_widgets[WIDX_PREVIEW].left + window_land_rights_widgets[WIDX_PREVIEW].right) / 2 + w->x; - y = window_land_rights_widgets[WIDX_PREVIEW].bottom + w->y + 32; - if (_landRightsCost != MONEY32_UNDEFINED && _landRightsCost != 0) + if (_landRightsCost != MONEY32_UNDEFINED && _landRightsCost != 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { + x = (window_land_rights_widgets[WIDX_PREVIEW].left + window_land_rights_widgets[WIDX_PREVIEW].right) / 2 + w->x; + y = window_land_rights_widgets[WIDX_PREVIEW].bottom + w->y + 32; gfx_draw_string_centred(dpi, STR_COST_AMOUNT, x, y, COLOUR_BLACK, &_landRightsCost); } } diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index afe55d8305..779bfab5bf 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -14,6 +14,7 @@ #include #include #include +#include // clang-format off enum WINDOW_WATER_WIDGET_IDX { @@ -220,14 +221,17 @@ static void window_water_paint(rct_window* w, rct_drawpixelinfo* dpi) gfx_draw_string_centred(dpi, STR_LAND_TOOL_SIZE_VALUE, x, y - 2, COLOUR_BLACK, &gLandToolSize); } - // Draw raise cost amount - x = (window_water_widgets[WIDX_PREVIEW].left + window_water_widgets[WIDX_PREVIEW].right) / 2 + w->x; - y = window_water_widgets[WIDX_PREVIEW].bottom + w->y + 5; - if (gWaterToolRaiseCost != MONEY32_UNDEFINED && gWaterToolRaiseCost != 0) - gfx_draw_string_centred(dpi, STR_RAISE_COST_AMOUNT, x, y, COLOUR_BLACK, &gWaterToolRaiseCost); - y += 10; + if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) + { + // Draw raise cost amount + x = (window_water_widgets[WIDX_PREVIEW].left + window_water_widgets[WIDX_PREVIEW].right) / 2 + w->x; + y = window_water_widgets[WIDX_PREVIEW].bottom + w->y + 5; + if (gWaterToolRaiseCost != MONEY32_UNDEFINED && gWaterToolRaiseCost != 0) + gfx_draw_string_centred(dpi, STR_RAISE_COST_AMOUNT, x, y, COLOUR_BLACK, &gWaterToolRaiseCost); + y += 10; - // Draw lower cost amount - if (gWaterToolLowerCost != MONEY32_UNDEFINED && gWaterToolLowerCost != 0) - gfx_draw_string_centred(dpi, STR_LOWER_COST_AMOUNT, x, y, COLOUR_BLACK, &gWaterToolLowerCost); + // Draw lower cost amount + if (gWaterToolLowerCost != MONEY32_UNDEFINED && gWaterToolLowerCost != 0) + gfx_draw_string_centred(dpi, STR_LOWER_COST_AMOUNT, x, y, COLOUR_BLACK, &gWaterToolLowerCost); + } }