diff --git a/data/language/english_uk.txt b/data/language/english_uk.txt index 650bbed9ba..9dea1d3bdf 100644 --- a/data/language/english_uk.txt +++ b/data/language/english_uk.txt @@ -3902,6 +3902,8 @@ STR_5560 :{SMALLFONT}{BLACK}Sets the inspection time to 'Every 10 minutes' on STR_5561 :Failed to load language file STR_5562 :WARNING! STR_5563 :This feature is currently unstable, take extra caution. +STR_5564 :Insert Corrupt Element +STR_5565 :{SMALLFONT}{BLACK}Inserts a corrupt map element at top of tile. This will hide any element above the corrupt element. ##################### # Rides/attractions # diff --git a/src/localisation/string_ids.h b/src/localisation/string_ids.h index f928c3591a..42619e6b09 100644 --- a/src/localisation/string_ids.h +++ b/src/localisation/string_ids.h @@ -2151,6 +2151,9 @@ enum { STR_WARNING_IN_CAPS = 5562, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE = 5563, + STR_INSERT_CORRUPT = 5564, + STR_INSERT_CORRUPT_TIP = 5565, + // 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/windows/guest.c b/src/windows/guest.c index f0e18f6739..5a28c7e974 100644 --- a/src/windows/guest.c +++ b/src/windows/guest.c @@ -1184,7 +1184,7 @@ void window_guest_overview_tool_down(rct_window* w, int widgetIndex, int x, int window_error_open(0x785,-1); return; } - + if (!map_can_construct_at(tile_x, tile_y, dest_z / 8, (dest_z / 8) + 1, 15)){ if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, uint16) != 0x3A5 ){ if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, uint16) != 0x49B){ diff --git a/src/windows/tile_inspector.c b/src/windows/tile_inspector.c index 72a8b71993..354188e13b 100644 --- a/src/windows/tile_inspector.c +++ b/src/windows/tile_inspector.c @@ -31,6 +31,7 @@ enum WINDOW_TILE_INSPECTOR_WIDGET_IDX { WIDX_BACKGROUND, WIDX_TITLE, WIDX_CLOSE, + WIDX_CORRUPT, WIDX_CONTENT_PANEL, WIDX_SCROLL }; @@ -44,6 +45,7 @@ rct_widget window_tile_inspector_widgets[] = { { WWT_FRAME, 0, 0, WW - 1, 0, WH - 1, 0x0FFFFFFFF, STR_NONE }, // panel / background { WWT_CAPTION, 0, 1, WW - 2, 1, 14, STR_TILE_INSPECTOR_TITLE, STR_WINDOW_TITLE_TIP }, // title bar { WWT_CLOSEBOX, 0, WW - 13, WW - 3, 2, 13, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP }, // close x button + { WWT_CLOSEBOX, 1, WW - 150, WW - 3, 18, 39, STR_INSERT_CORRUPT, STR_INSERT_CORRUPT_TIP }, { WWT_RESIZE, 1, 0, WW - 1, 43, WH - 1, 0x0FFFFFFFF, STR_NONE }, // content panel { WWT_SCROLL, 1, 3, WW - 3, 65, WH - 30, 2, STR_NONE }, // scroll area { WIDGETS_END }, @@ -116,6 +118,7 @@ void window_tile_inspector_open() ); window->widgets = window_tile_inspector_widgets; window->enabled_widgets = (1 << WIDX_CLOSE); + window->disabled_widgets = (1 << WIDX_CORRUPT); window_init_scroll_widgets(window); window->colours[0] = 7; @@ -137,12 +140,29 @@ static void window_tile_inspector_close(rct_window *w) tool_cancel(); } +void corrupt_element(int x, int y) { + rct_map_element* mapElement; + mapElement = map_get_first_element_at(x, y); + + while (!map_element_is_last_for_tile(mapElement++)); + mapElement--; + + mapElement = map_element_insert(x, y, mapElement->base_height, 0); + mapElement->type = (8 << 2); +} + static void window_tile_inspector_mouseup(rct_window *w, int widgetIndex) { switch (widgetIndex) { case WIDX_CLOSE: window_close(w); break; + case WIDX_CORRUPT: + corrupt_element(window_tile_inspector_tile_x, window_tile_inspector_tile_y); + window_tile_inspector_item_count++; + w->scrolls[0].v_top = 0; + window_invalidate(w); + break; } } @@ -209,6 +229,9 @@ static void window_tile_inspector_tool_down(rct_window* w, int widgetIndex, int window_tile_inspector_item_count = numItems; + w->enabled_widgets |= (1 << WIDX_CORRUPT); + w->disabled_widgets &= ~(1ULL << WIDX_CORRUPT); + w->scrolls[0].v_top = 0; window_invalidate(w); }