From 545da27201d41bae3ff1ed5b78dd185facf73f0d Mon Sep 17 00:00:00 2001 From: Broxzier Date: Mon, 26 Sep 2016 23:47:56 +0200 Subject: [PATCH] Add clamp button for corrupt elements --- data/language/en-GB.txt | 2 ++ src/localisation/string_ids.h | 2 ++ src/windows/tile_inspector.c | 10 +++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 8dbb33341d..cb5b84a4f4 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -4281,6 +4281,8 @@ STR_5969 :Right STR_5970 :{WINDOW_COLOUR_2}Entrance ID: {BLACK}{COMMA16} STR_5971 :{WINDOW_COLOUR_2}Exit ID: {BLACK}{COMMA16} STR_5972 :{WINDOW_COLOUR_2}Ride ID: {BLACK}{COMMA16} +STR_5973 :Clamp to next +STR_5974 :{SMALLFONT}{BLACK}Changes the base- and clearance height so that it's at the same as the next element on the current tile. Doing this makes it easier to build on this tile. ############# # Scenarios # diff --git a/src/localisation/string_ids.h b/src/localisation/string_ids.h index 9f89986556..11157c808d 100644 --- a/src/localisation/string_ids.h +++ b/src/localisation/string_ids.h @@ -3621,6 +3621,8 @@ enum { STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID = 5970, STR_TILE_INSPECTOR_ENTRANCE_EXIT_ID = 5971, STR_TILE_INSPECTOR_ENTRANCE_RIDE_ID = 5972, + STR_TILE_INSPECTOR_CLAMP_TO_NEXT = 5973, + STR_TILE_INSPECTOR_CLAMP_TO_NEXT_TIP = 5974, // 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/tile_inspector.c b/src/windows/tile_inspector.c index 86c19ec38d..ae928d87a8 100644 --- a/src/windows/tile_inspector.c +++ b/src/windows/tile_inspector.c @@ -375,7 +375,7 @@ static rct_widget windowTileInspectorWidgetsBanner[] = { }; #define COR_GBPB PADDING_BOTTOM // Corrupt element group box properties bottom -#define COR_GBPT (COR_GBPB + 16 + 1 * 21) // Corrupt element group box properties top +#define COR_GBPT (COR_GBPB + 16 + 2 * 21) // Corrupt element group box properties top #define COR_GBDB (COR_GBPT + GROUPBOX_PADDING) // Corrupt element group box info bottom #define COR_GBDT (COR_GBDB + 20 + 0 * 11) // Corrupt element group box info top static rct_widget windowTileInspectorWidgetsCorrupt[] = { @@ -383,6 +383,7 @@ static rct_widget windowTileInspectorWidgetsCorrupt[] = { { WWT_SPINNER, 1, GBS(WH - COR_GBPT, 1, 0), STR_NONE, STR_NONE }, // WIDX_CORRUPT_SPINNER_HEIGHT { WWT_DROPDOWN_BUTTON, 1, GBSI(WH - COR_GBPT, 1, 0), STR_NUMERIC_UP, STR_NONE }, // WIDX_CORRUPT_SPINNER_HEIGHT_INCREASE { WWT_DROPDOWN_BUTTON, 1, GBSD(WH - COR_GBPT, 1, 0), STR_NUMERIC_DOWN, STR_NONE }, // WIDX_CORRUPT_SPINNER_HEIGHT_DECREASE + { WWT_CLOSEBOX, 1, GBB(WH - SUR_GBPT, 0, 1), STR_TILE_INSPECTOR_CLAMP_TO_NEXT, STR_TILE_INSPECTOR_CLAMP_TO_NEXT_TIP }, // WIDX_CORRUPT_BUTTON_CLAMP { WIDGETS_END }, }; @@ -1223,6 +1224,11 @@ static void window_tile_inspector_mouseup(rct_window *w, int widgetIndex) { map_invalidate_tile_full(windowTileInspectorTileX << 5, windowTileInspectorTileY << 5); widget_invalidate(w, WIDX_FENCE_SPINNER_HEIGHT); break; + case WIDX_CORRUPT_BUTTON_CLAMP: + if (!map_element_is_last_for_tile(mapElement)) { + mapElement->base_height = mapElement->clearance_height = (mapElement + 1)->base_height; + } + break; } // switch widget index break; } // switch page @@ -1548,6 +1554,8 @@ static void window_tile_inspector_invalidate(rct_window *w) { w->widgets[WIDX_CORRUPT_SPINNER_HEIGHT_INCREASE].bottom = GBBT(propertiesAnchor, 0) + 8; w->widgets[WIDX_CORRUPT_SPINNER_HEIGHT_DECREASE].top = GBBB(propertiesAnchor, 0) - 8; w->widgets[WIDX_CORRUPT_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4; + w->widgets[WIDX_CORRUPT_BUTTON_CLAMP].top = GBBT(propertiesAnchor, 1); + w->widgets[WIDX_CORRUPT_BUTTON_CLAMP].bottom = GBBB(propertiesAnchor, 1); break; } }