diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 73e4cef744b2..7a4387a02f9f 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -4524,6 +4524,7 @@ STR_6214 :Skyscraper B STR_6215 :Construction STR_6216 :Operation STR_6217 :Ride / track availability +STR_6218 :Highlight vandalism and vomit ############# # Scenarios # diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 3647464b8f4c..1dcad864874c 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -114,6 +114,7 @@ typedef enum { DDIDX_PATH_HEIGHTS = 12, // 13 is a separator DDIDX_VIEW_CLIPPING = 14, + DDIDX_HIGHLIGHT_PATH_ISSUES = 15, TOP_TOOLBAR_VIEW_MENU_COUNT } TOP_TOOLBAR_VIEW_MENU_DDIDX; @@ -3174,6 +3175,7 @@ static void top_toolbar_init_view_menu(rct_window* w, rct_widget* widget) { gDropdownItemsFormat[12] = STR_TOGGLE_OPTION; gDropdownItemsFormat[13] = DROPDOWN_SEPARATOR; gDropdownItemsFormat[DDIDX_VIEW_CLIPPING] = STR_TOGGLE_OPTION; + gDropdownItemsFormat[DDIDX_HIGHLIGHT_PATH_ISSUES] = STR_TOGGLE_OPTION; gDropdownItemsArgs[0] = STR_UNDERGROUND_VIEW; gDropdownItemsArgs[1] = STR_REMOVE_BASE_LAND; @@ -3187,6 +3189,7 @@ static void top_toolbar_init_view_menu(rct_window* w, rct_widget* widget) { gDropdownItemsArgs[11] = STR_HEIGHT_MARKS_ON_RIDE_TRACKS; gDropdownItemsArgs[12] = STR_HEIGHT_MARKS_ON_PATHS; gDropdownItemsArgs[DDIDX_VIEW_CLIPPING] = STR_VIEW_CLIPPING_MENU; + gDropdownItemsArgs[DDIDX_HIGHLIGHT_PATH_ISSUES] = STR_HIGHLIGHT_PATH_ISSUES_MENU; window_dropdown_show_text( w->x + widget->left, @@ -3223,6 +3226,8 @@ static void top_toolbar_init_view_menu(rct_window* w, rct_widget* widget) { dropdown_set_checked(12, true); if (mainViewport->flags & VIEWPORT_FLAG_PAINT_CLIP_TO_HEIGHT) dropdown_set_checked(DDIDX_VIEW_CLIPPING, true); + if (mainViewport->flags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) + dropdown_set_checked(DDIDX_HIGHLIGHT_PATH_ISSUES, true); gDropdownDefaultIndex = DDIDX_UNDERGROUND_INSIDE; } @@ -3277,6 +3282,9 @@ static void top_toolbar_view_menu_dropdown(sint16 dropdownIndex) w->viewport->flags ^= VIEWPORT_FLAG_PAINT_CLIP_TO_HEIGHT; } break; + case DDIDX_HIGHLIGHT_PATH_ISSUES: + w->viewport->flags ^= VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES; + break; default: return; } diff --git a/src/openrct2/drawing/Rain.cpp b/src/openrct2/drawing/Rain.cpp index 4bf172241231..8fffae261d08 100644 --- a/src/openrct2/drawing/Rain.cpp +++ b/src/openrct2/drawing/Rain.cpp @@ -19,6 +19,7 @@ #include "../world/Climate.h" #include "Drawing.h" #include "../config/Config.h" +#include "../interface/Viewport.h" #include "IDrawingEngine.h" #include "Rain.h" @@ -177,7 +178,7 @@ void DrawRain(rct_drawpixelinfo * dpi, IRainDrawer * rainDrawer) { // Get rain draw function and draw rain uint32 rainType = gClimateCurrent.RainLevel; - if (rainType != RAIN_LEVEL_NONE && !gTrackDesignSaveMode) + if (rainType != RAIN_LEVEL_NONE && !gTrackDesignSaveMode && !(gCurrentViewportFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) { DrawRainAnimation(dpi, rainDrawer, rainType); } diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 259920e6775c..41745dea2353 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -903,7 +903,8 @@ static void viewport_paint_column(rct_drawpixelinfo * dpi, uint32 viewFlags) if (gConfigGeneral.render_weather_gloom && !gTrackDesignSaveMode && - !(viewFlags & VIEWPORT_FLAG_INVISIBLE_SPRITES) + !(viewFlags & VIEWPORT_FLAG_INVISIBLE_SPRITES) && + !(viewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) ) { viewport_paint_weather_gloom(dpi); } diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 7a04a679d7bb..ba8db02441fc 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -41,6 +41,7 @@ enum { VIEWPORT_FLAG_15 = (1 << 15), VIEWPORT_FLAG_SEETHROUGH_PATHS = (1 << 16), VIEWPORT_FLAG_PAINT_CLIP_TO_HEIGHT = (1 << 17), + VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES = (1 << 18), }; enum { diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 2d0ece605ed5..9cb99d0183f9 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -3874,6 +3874,8 @@ enum { STR_CHEAT_GROUP_OPERATION = 6216, STR_CHEAT_GROUP_AVAILABILITY = 6217, + STR_HIGHLIGHT_PATH_ISSUES_MENU = 6218, + // Have to include resource strings (from scenarios and objects) for the time being now that language is partially working STR_COUNT = 32768 }; diff --git a/src/openrct2/paint/sprite/Sprite.cpp b/src/openrct2/paint/sprite/Sprite.cpp index 537ea4474588..c4a55195e084 100644 --- a/src/openrct2/paint/sprite/Sprite.cpp +++ b/src/openrct2/paint/sprite/Sprite.cpp @@ -37,7 +37,12 @@ void sprite_paint_setup(paint_session * session, const uint16 eax, const uint16 if (gTrackDesignSaveMode) return; - if (gCurrentViewportFlags & VIEWPORT_FLAG_INVISIBLE_SPRITES) return; + if (gCurrentViewportFlags & VIEWPORT_FLAG_INVISIBLE_SPRITES) + { + return; + } + + bool highlightPathIssues = (gCurrentViewportFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES); dpi = session->Unk140E9A8; if (dpi->zoom_level > 2) return; @@ -46,6 +51,22 @@ void sprite_paint_setup(paint_session * session, const uint16 eax, const uint16 for (rct_sprite* spr = get_sprite(sprite_idx); sprite_idx != SPRITE_INDEX_NULL; sprite_idx = spr->unknown.next_in_quadrant) { spr = get_sprite(sprite_idx); + if (highlightPathIssues) + { + if (spr->unknown.sprite_identifier == SPRITE_IDENTIFIER_PEEP) + { + rct_peep * peep = (rct_peep*)spr; + if (!(peep->type == PEEP_TYPE_STAFF && peep->staff_type == STAFF_TYPE_HANDYMAN)) + { + continue; + } + } + else if (spr->unknown.sprite_identifier != SPRITE_IDENTIFIER_LITTER) + { + continue; + } + } + // Only paint sprites that are below the clip height. // Here converting from land/path/etc height scale to pixel height scale. // Note: peeps/scenery on slopes will be above the base diff --git a/src/openrct2/paint/tile_element/Banner.cpp b/src/openrct2/paint/tile_element/Banner.cpp index a4c5da743976..b54e44d7fd29 100644 --- a/src/openrct2/paint/tile_element/Banner.cpp +++ b/src/openrct2/paint/tile_element/Banner.cpp @@ -44,7 +44,7 @@ void banner_paint(paint_session * session, uint8 direction, sint32 height, rct_t session->InteractionType = VIEWPORT_INTERACTION_ITEM_BANNER; - if (dpi->zoom_level > 1 || gTrackDesignSaveMode) return; + if (dpi->zoom_level > 1 || gTrackDesignSaveMode || (gCurrentViewportFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) return; height -= 16; diff --git a/src/openrct2/paint/tile_element/Entrance.cpp b/src/openrct2/paint/tile_element/Entrance.cpp index 159b836d9459..7c49e9b14210 100644 --- a/src/openrct2/paint/tile_element/Entrance.cpp +++ b/src/openrct2/paint/tile_element/Entrance.cpp @@ -37,7 +37,7 @@ static void ride_entrance_exit_paint(paint_session * session, uint8 direction, s uint8 is_exit = tile_element->properties.entrance.type == ENTRANCE_TYPE_RIDE_EXIT; - if (gTrackDesignSaveMode) { + if (gTrackDesignSaveMode || (gCurrentViewportFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) { if (tile_element->properties.entrance.ride_index != gTrackDesignSaveRideIndex) return; } @@ -98,6 +98,7 @@ static void ride_entrance_exit_paint(paint_session * session, uint8 direction, s else{ image_id |= style->sprite_index + direction; } + // Format modified to stop repeated code // Each entrance is split into 2 images for drawing @@ -186,7 +187,7 @@ static void ride_entrance_exit_paint(paint_session * session, uint8 direction, s * rct2: 0x006658ED */ static void park_entrance_paint(paint_session * session, uint8 direction, sint32 height, rct_tile_element* tile_element){ - if (gTrackDesignSaveMode) + if (gTrackDesignSaveMode || (gCurrentViewportFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) return; #ifdef __ENABLE_LIGHTFX__ diff --git a/src/openrct2/paint/tile_element/Fence.cpp b/src/openrct2/paint/tile_element/Fence.cpp index 4fc0b2b43d65..4b004fa16e43 100644 --- a/src/openrct2/paint/tile_element/Fence.cpp +++ b/src/openrct2/paint/tile_element/Fence.cpp @@ -165,7 +165,7 @@ void fence_paint(paint_session * session, uint8 direction, sint32 height, rct_ti paint_util_set_general_support_height(session, height, 0x20); uint32 dword_141F710 = 0; - if (gTrackDesignSaveMode) { + if (gTrackDesignSaveMode || (gCurrentViewportFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) { if (!track_design_save_contains_tile_element(tile_element)) { dword_141F710 = 0x21700000; } diff --git a/src/openrct2/paint/tile_element/LargeScenery.cpp b/src/openrct2/paint/tile_element/LargeScenery.cpp index c88db99876c6..06c3495a84e7 100644 --- a/src/openrct2/paint/tile_element/LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/LargeScenery.cpp @@ -187,6 +187,10 @@ static constexpr const boundbox s98E3C4[] = { */ void large_scenery_paint(paint_session * session, uint8 direction, uint16 height, rct_tile_element * tileElement) { + if (gCurrentViewportFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) + { + return; + } session->InteractionType = VIEWPORT_INTERACTION_ITEM_LARGE_SCENERY; uint32 sequenceNum = scenery_large_get_sequence(tileElement); rct_scenery_entry *entry = get_large_scenery_entry(scenery_large_get_type(tileElement)); diff --git a/src/openrct2/paint/tile_element/Path.cpp b/src/openrct2/paint/tile_element/Path.cpp index b07f2ecc3672..40102f4d3a14 100644 --- a/src/openrct2/paint/tile_element/Path.cpp +++ b/src/openrct2/paint/tile_element/Path.cpp @@ -603,6 +603,12 @@ static void sub_6A3F61(paint_session * session, rct_tile_element * tile_element, if (dpi->zoom_level <= 1) { if (!gTrackDesignSaveMode) { if (footpath_element_has_path_scenery(tile_element)) { + if ((gCurrentViewportFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) && + !(tile_element->flags & TILE_ELEMENT_FLAG_BROKEN)) + { + return; + } + session->InteractionType = VIEWPORT_INTERACTION_ITEM_FOOTPATH_ITEM; if (sceneryImageFlags != 0) { session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; @@ -697,6 +703,11 @@ void path_paint(paint_session * session, uint8 direction, uint16 height, rct_til } } + if (gCurrentViewportFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) + { + imageFlags = 0x21700000; + } + if (footpath_element_path_scenery_is_ghost(tile_element)) { sceneryImageFlags = CONSTRUCTION_MARKER; } diff --git a/src/openrct2/paint/tile_element/SmallScenery.cpp b/src/openrct2/paint/tile_element/SmallScenery.cpp index 84edbec9eb13..94d275142bf2 100644 --- a/src/openrct2/paint/tile_element/SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/SmallScenery.cpp @@ -44,6 +44,10 @@ static constexpr const LocationXY16 lengths[] = { * rct2: 0x006DFF47 */ void scenery_paint(paint_session * session, uint8 direction, sint32 height, rct_tile_element* tileElement) { + if (gCurrentViewportFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) + { + return; + } //RCT2_CALLPROC_X(0x6DFF47, 0, 0, direction, height, (sint32)tileElement, 0, 0); return; session->InteractionType = VIEWPORT_INTERACTION_ITEM_SCENERY; LocationXYZ16 boxlength; diff --git a/src/openrct2/paint/tile_element/Surface.cpp b/src/openrct2/paint/tile_element/Surface.cpp index bfe4c2c03b1f..eae9a146a26e 100644 --- a/src/openrct2/paint/tile_element/Surface.cpp +++ b/src/openrct2/paint/tile_element/Surface.cpp @@ -1352,7 +1352,7 @@ void surface_paint(paint_session * session, uint8 direction, uint16 height, rct_ const uint16 localHeight = height + 16; const uint16 waterHeight = map_get_water_height(tileElement) * 16; - if (!gTrackDesignSaveMode) + if (!gTrackDesignSaveMode && !(gCurrentViewportFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) { session->Unk141E9DC = waterHeight; diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 1be9426f9150..d3909b12985f 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -2143,7 +2143,8 @@ void track_paint(paint_session * session, uint8 direction, sint32 height, rct_ti rct_drawpixelinfo * dpi = session->Unk140E9A8; - if (!gTrackDesignSaveMode || rideIndex == gTrackDesignSaveRideIndex) + if ((!gTrackDesignSaveMode || rideIndex == gTrackDesignSaveRideIndex) && + !(gCurrentViewportFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) { sint32 trackType = track_element_get_type(tileElement); sint32 trackSequence = tile_element_get_track_sequence(tileElement);