2016-05-04 19:24:41 +02:00
|
|
|
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
2015-06-01 03:33:56 +02:00
|
|
|
/*****************************************************************************
|
2016-05-04 19:24:41 +02:00
|
|
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
|
|
|
*
|
|
|
|
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
|
|
|
|
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
|
|
|
|
*
|
|
|
|
* OpenRCT2 is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* A full copy of the GNU General Public License can be found in licence.txt
|
|
|
|
*****************************************************************************/
|
|
|
|
#pragma endregion
|
2015-06-01 03:33:56 +02:00
|
|
|
|
2017-02-06 17:43:29 +01:00
|
|
|
#include "../common.h"
|
|
|
|
#include "../OpenRCT2.h"
|
|
|
|
#include "../core/Guard.hpp"
|
2017-01-15 13:53:19 +01:00
|
|
|
#include "../game.h"
|
2016-07-06 19:26:14 +02:00
|
|
|
#include "../input.h"
|
2016-01-30 15:00:41 +01:00
|
|
|
#include "../interface/themes.h"
|
2016-06-05 22:07:11 +02:00
|
|
|
#include "../interface/viewport.h"
|
2015-06-01 03:33:56 +02:00
|
|
|
#include "../interface/widget.h"
|
|
|
|
#include "../interface/window.h"
|
2016-06-05 22:07:11 +02:00
|
|
|
#include "../localisation/localisation.h"
|
|
|
|
#include "../ride/track.h"
|
2016-01-01 19:29:41 +01:00
|
|
|
#include "../sprites.h"
|
2016-06-05 22:07:11 +02:00
|
|
|
#include "../world/footpath.h"
|
|
|
|
#include "../world/map.h"
|
|
|
|
#include "../world/scenery.h"
|
2017-01-15 13:53:19 +01:00
|
|
|
#include "../world/tile_inspector.h"
|
2017-02-06 17:43:29 +01:00
|
|
|
#include "dropdown.h"
|
|
|
|
#include "error.h"
|
|
|
|
#include "tile_inspector.h"
|
2015-06-01 03:33:56 +02:00
|
|
|
|
2016-09-18 20:47:35 +02:00
|
|
|
static const rct_string_id terrainTypeStringIds[] = {
|
2016-07-14 14:07:49 +02:00
|
|
|
STR_TILE_INSPECTOR_TERRAIN_GRASS,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_SAND,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_DIRT,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_ROCK,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_MARTIAN,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_CHECKERBOARD,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_GRASS_CLUMPS,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_ICE,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_GRID_RED,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_GRID_YELLOW,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_GRID_BLUE,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_GRID_GREEN,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_SAND_DARK,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_SAND_LIGHT,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_CHECKERBOARD_INVERTED,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_UNDERGROUND_VIEW,
|
|
|
|
};
|
|
|
|
|
2016-09-18 20:47:35 +02:00
|
|
|
static const rct_string_id terrainEdgeTypeStringIds[] = {
|
2016-07-14 14:07:49 +02:00
|
|
|
STR_TILE_INSPECTOR_TERRAIN_EDGE_ROCK,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_EDGE_WOOD_RED,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_EDGE_WOOD_BLACK,
|
|
|
|
STR_TILE_INSPECTOR_TERRAIN_EDGE_ICE,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2016-09-18 20:47:35 +02:00
|
|
|
static const rct_string_id entranceTypeStringIds[] = {
|
2016-07-14 14:07:49 +02:00
|
|
|
STR_TILE_INSPECTOR_ENTRANCE_TYPE_RIDE_ENTRANCE,
|
|
|
|
STR_TILE_INSPECTOR_ENTRANCE_TYPE_RIDE_EXIT,
|
|
|
|
STR_TILE_INSPECTOR_ENTRANCE_TYPE_PARK_ENTRANC,
|
|
|
|
};
|
|
|
|
|
2016-09-18 23:59:23 +02:00
|
|
|
static const rct_string_id parkEntrancePartStringIds[] = {
|
|
|
|
STR_TILE_INSPECTOR_ENTRANCE_MIDDLE,
|
|
|
|
STR_TILE_INSPECTOR_ENTRANCE_LEFT,
|
|
|
|
STR_TILE_INSPECTOR_ENTRANCE_RIGHT
|
|
|
|
};
|
|
|
|
|
2016-10-01 22:57:09 +02:00
|
|
|
static const rct_string_id fenceSlopeStringIds[] = {
|
|
|
|
STR_TILE_INSPECTOR_FENCE_FLAT,
|
|
|
|
STR_TILE_INSPECTOR_FENCE_SLOPED_LEFT,
|
|
|
|
STR_TILE_INSPECTOR_FENCE_SLOPED_RIGHT
|
|
|
|
};
|
|
|
|
|
2015-06-01 03:33:56 +02:00
|
|
|
enum WINDOW_TILE_INSPECTOR_WIDGET_IDX {
|
|
|
|
WIDX_BACKGROUND,
|
|
|
|
WIDX_TITLE,
|
|
|
|
WIDX_CLOSE,
|
2015-12-28 23:11:36 +01:00
|
|
|
WIDX_LIST,
|
2016-06-05 00:45:13 +02:00
|
|
|
WIDX_SPINNER_X,
|
|
|
|
WIDX_SPINNER_X_INCREASE,
|
|
|
|
WIDX_SPINNER_X_DECREASE,
|
|
|
|
WIDX_SPINNER_Y,
|
|
|
|
WIDX_SPINNER_Y_INCREASE,
|
|
|
|
WIDX_SPINNER_Y_DECREASE,
|
2016-06-11 19:39:51 +02:00
|
|
|
WIDX_BUTTON_CORRUPT,
|
|
|
|
WIDX_BUTTON_REMOVE,
|
|
|
|
WIDX_BUTTON_MOVE_DOWN,
|
|
|
|
WIDX_BUTTON_MOVE_UP,
|
|
|
|
WIDX_BUTTON_ROTATE,
|
|
|
|
WIDX_BUTTON_SORT,
|
2016-10-23 20:40:23 +02:00
|
|
|
WIDX_BUTTON_COPY,
|
|
|
|
WIDX_BUTTON_PASTE,
|
2016-01-01 20:06:00 +01:00
|
|
|
WIDX_COLUMN_TYPE,
|
|
|
|
WIDX_COLUMN_BASEHEIGHT,
|
|
|
|
WIDX_COLUMN_CLEARANCEHEIGHT,
|
|
|
|
WIDX_COLUMN_GHOSTFLAG,
|
|
|
|
WIDX_COLUMN_BROKENFLAG,
|
|
|
|
WIDX_COLUMN_LASTFLAG,
|
2016-05-31 20:13:26 +02:00
|
|
|
WIDX_GROUPBOX_DETAILS,
|
|
|
|
WIDX_GROUPBOX_PROPERTIES,
|
2016-05-29 16:12:53 +02:00
|
|
|
|
2016-05-31 20:13:26 +02:00
|
|
|
PAGE_WIDGETS,
|
2016-05-29 16:12:53 +02:00
|
|
|
|
|
|
|
// Surface
|
2016-09-18 15:52:03 +02:00
|
|
|
WIDX_SURFACE_SPINNER_HEIGHT = PAGE_WIDGETS,
|
|
|
|
WIDX_SURFACE_SPINNER_HEIGHT_INCREASE,
|
|
|
|
WIDX_SURFACE_SPINNER_HEIGHT_DECREASE,
|
|
|
|
WIDX_SURFACE_BUTTON_REMOVE_FENCES,
|
2016-05-29 16:12:53 +02:00
|
|
|
WIDX_SURFACE_BUTTON_RESTORE_FENCES,
|
2016-09-18 14:30:34 +02:00
|
|
|
WIDX_SURFACE_CHECK_CORNER_N,
|
|
|
|
WIDX_SURFACE_CHECK_CORNER_E,
|
|
|
|
WIDX_SURFACE_CHECK_CORNER_S,
|
|
|
|
WIDX_SURFACE_CHECK_CORNER_W,
|
|
|
|
WIDX_SURFACE_CHECK_DIAGONAL,
|
2016-05-29 16:12:53 +02:00
|
|
|
|
|
|
|
// Path
|
2016-06-01 22:31:10 +02:00
|
|
|
WIDX_PATH_SPINNER_HEIGHT = PAGE_WIDGETS,
|
|
|
|
WIDX_PATH_SPINNER_HEIGHT_INCREASE,
|
|
|
|
WIDX_PATH_SPINNER_HEIGHT_DECREASE,
|
2017-02-05 17:33:21 +01:00
|
|
|
WIDX_PATH_CHECK_SLOPED,
|
2016-09-11 23:02:34 +02:00
|
|
|
WIDX_PATH_CHECK_EDGE_NE, // Note: This is NOT named after the world orientation, but after the way
|
2016-06-01 22:31:10 +02:00
|
|
|
WIDX_PATH_CHECK_EDGE_E, // it looks in the window (top corner is north). Their order is important,
|
|
|
|
WIDX_PATH_CHECK_EDGE_SE, // as this is the same order paths use for their corners / edges.
|
2016-09-11 23:02:34 +02:00
|
|
|
WIDX_PATH_CHECK_EDGE_S, // N
|
|
|
|
WIDX_PATH_CHECK_EDGE_SW, // NW-------NE
|
|
|
|
WIDX_PATH_CHECK_EDGE_W, // W ------------- E
|
|
|
|
WIDX_PATH_CHECK_EDGE_NW, // SW-------SE
|
|
|
|
WIDX_PATH_CHECK_EDGE_N, // S
|
2016-05-29 16:12:53 +02:00
|
|
|
|
2016-05-31 20:13:26 +02:00
|
|
|
// Track
|
2016-06-05 12:50:42 +02:00
|
|
|
WIDX_TRACK_CHECK_APPLY_TO_ALL = PAGE_WIDGETS,
|
2016-06-05 22:07:11 +02:00
|
|
|
WIDX_TRACK_SPINNER_HEIGHT,
|
|
|
|
WIDX_TRACK_SPINNER_HEIGHT_INCREASE,
|
|
|
|
WIDX_TRACK_SPINNER_HEIGHT_DECREASE,
|
|
|
|
WIDX_TRACK_CHECK_CHAIN_LIFT,
|
2016-05-29 16:12:53 +02:00
|
|
|
|
2016-05-31 20:13:26 +02:00
|
|
|
// Scenery
|
2016-09-18 10:29:48 +02:00
|
|
|
WIDX_SCENERY_SPINNER_HEIGHT = PAGE_WIDGETS,
|
|
|
|
WIDX_SCENERY_SPINNER_HEIGHT_INCREASE,
|
|
|
|
WIDX_SCENERY_SPINNER_HEIGHT_DECREASE,
|
|
|
|
WIDX_SCENERY_CHECK_QUARTER_N,
|
|
|
|
WIDX_SCENERY_CHECK_QUARTER_E,
|
|
|
|
WIDX_SCENERY_CHECK_QUARTER_S,
|
|
|
|
WIDX_SCENERY_CHECK_QUARTER_W,
|
|
|
|
WIDX_SCENERY_CHECK_COLLISION_N,
|
|
|
|
WIDX_SCENERY_CHECK_COLLISION_E,
|
|
|
|
WIDX_SCENERY_CHECK_COLLISION_S,
|
|
|
|
WIDX_SCENERY_CHECK_COLLISION_W,
|
2016-05-29 16:12:53 +02:00
|
|
|
|
2016-05-31 20:13:26 +02:00
|
|
|
// Entrance
|
2016-09-18 22:52:27 +02:00
|
|
|
WIDX_ENTRANCE_SPINNER_HEIGHT = PAGE_WIDGETS,
|
|
|
|
WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE,
|
|
|
|
WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE,
|
2016-05-29 16:12:53 +02:00
|
|
|
|
2016-05-31 20:13:26 +02:00
|
|
|
// Fence
|
2016-09-11 23:02:34 +02:00
|
|
|
WIDX_FENCE_SPINNER_HEIGHT = PAGE_WIDGETS,
|
|
|
|
WIDX_FENCE_SPINNER_HEIGHT_INCREASE,
|
|
|
|
WIDX_FENCE_SPINNER_HEIGHT_DECREASE,
|
2016-10-01 22:57:09 +02:00
|
|
|
WIDX_FENCE_DROPDOWN_SLOPE,
|
|
|
|
WIDX_FENCE_DROPDOWN_SLOPE_BUTTON,
|
2016-05-29 16:12:53 +02:00
|
|
|
|
2016-05-31 20:13:26 +02:00
|
|
|
// Large
|
2016-09-26 23:31:41 +02:00
|
|
|
WIDX_LARGE_SCENERY_SPINNER_HEIGHT = PAGE_WIDGETS,
|
|
|
|
WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE,
|
|
|
|
WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE,
|
2016-05-29 16:12:53 +02:00
|
|
|
|
2016-05-31 20:13:26 +02:00
|
|
|
// Banner
|
2016-09-26 23:31:41 +02:00
|
|
|
WIDX_BANNER_SPINNER_HEIGHT = PAGE_WIDGETS,
|
|
|
|
WIDX_BANNER_SPINNER_HEIGHT_INCREASE,
|
|
|
|
WIDX_BANNER_SPINNER_HEIGHT_DECREASE,
|
2016-10-05 00:21:23 +02:00
|
|
|
WIDX_BANNER_CHECK_BLOCK_NE,
|
|
|
|
WIDX_BANNER_CHECK_BLOCK_SE,
|
|
|
|
WIDX_BANNER_CHECK_BLOCK_SW,
|
|
|
|
WIDX_BANNER_CHECK_BLOCK_NW,
|
2016-05-29 16:12:53 +02:00
|
|
|
|
2016-05-31 20:13:26 +02:00
|
|
|
// Corrupt
|
2016-09-26 23:31:41 +02:00
|
|
|
WIDX_CORRUPT_SPINNER_HEIGHT = PAGE_WIDGETS,
|
|
|
|
WIDX_CORRUPT_SPINNER_HEIGHT_INCREASE,
|
|
|
|
WIDX_CORRUPT_SPINNER_HEIGHT_DECREASE,
|
|
|
|
WIDX_CORRUPT_BUTTON_CLAMP,
|
2015-06-01 03:33:56 +02:00
|
|
|
};
|
|
|
|
|
2016-10-01 23:23:47 +02:00
|
|
|
// Window sizes
|
2016-01-01 19:29:41 +01:00
|
|
|
#define WW 400
|
2016-06-05 22:07:11 +02:00
|
|
|
#define WH 280
|
2015-12-28 23:11:36 +01:00
|
|
|
#define MIN_WW WW
|
2016-01-01 19:29:41 +01:00
|
|
|
#define MAX_WW WW
|
2016-06-05 22:07:11 +02:00
|
|
|
#define MIN_WH 240
|
2015-06-01 03:33:56 +02:00
|
|
|
#define MAX_WH 800
|
|
|
|
|
2016-10-01 23:23:47 +02:00
|
|
|
// Button space for top buttons
|
2016-05-30 00:35:50 +02:00
|
|
|
#define BW (WW - 5) // Button's right side
|
|
|
|
#define BX (BW - 23) // Button's left side
|
|
|
|
#define BY 17 // Button's Top
|
|
|
|
#define BH (BY + 23) // Button's Bottom
|
2016-01-01 19:29:41 +01:00
|
|
|
#define BS 24
|
2015-12-28 23:11:36 +01:00
|
|
|
|
2016-05-30 00:35:50 +02:00
|
|
|
// Column offsets for the table headers
|
|
|
|
#define COL_X_TYPE 3 // Type
|
|
|
|
#define COL_X_BH (COL_X_TYPE + 300) // Base height
|
|
|
|
#define COL_X_CH (COL_X_BH + 20) // Clearance height
|
|
|
|
#define COL_X_GF (COL_X_CH + 20) // Ghost flag
|
|
|
|
#define COL_X_BF (COL_X_GF + 12) // Broken flag
|
|
|
|
#define COL_X_LF (COL_X_BF + 12) // Last for tile flag
|
2015-12-29 23:19:01 +01:00
|
|
|
|
2016-10-01 23:23:47 +02:00
|
|
|
#define PADDING_BOTTOM 15
|
|
|
|
#define GROUPBOX_PADDING 6
|
|
|
|
#define HORIZONTAL_GROUPBOX_PADDING 5
|
|
|
|
#define VERTICAL_GROUPBOX_PADDING 4
|
|
|
|
#define LIST_ITEM_HEIGHT 11
|
|
|
|
#define BUTTONW 130
|
|
|
|
#define BUTTONH 17
|
|
|
|
|
|
|
|
// Calculates the .left, .right, .top and .bottom for buttons in a group box.
|
|
|
|
// Buttons are used as reference points for all other widgets in the group boxes.
|
|
|
|
#define GBBL(col) (12 + col * (BUTTONW + HORIZONTAL_GROUPBOX_PADDING))
|
|
|
|
#define GBBR(col) (GBBL(col) + BUTTONW)
|
|
|
|
#define GBBT(GROUPTOP, row) ((GROUPTOP) + 14 + row * (BUTTONH + VERTICAL_GROUPBOX_PADDING))
|
|
|
|
#define GBBB(GROUPTOP, row) (GBBT((GROUPTOP), row) + BUTTONH)
|
|
|
|
#define GBB(GROUPTOP, col, row) GBBL(col), GBBR(col), GBBT((GROUPTOP), row), GBBB((GROUPTOP), row)
|
|
|
|
#define GBBF(GROUPTOP, col, row)GBBL(col), WW - 10, GBBT((GROUPTOP), row), GBBB((GROUPTOP), row) // Full width
|
|
|
|
|
|
|
|
// Spinners and dropdowns use the buttons as a reference
|
|
|
|
#define GBS(GBT, col, row) GBBL(col), GBBR(col), GBBT(GBT, row) + 3, GBBB(GBT, row) - 3 // Group box spinner / dropdown field
|
|
|
|
#define GBSI(GBT, col, row) GBBR(col) - 11, GBBR(col) - 1, GBBT(GBT, row) + 4, GBBT(GBT, row) + 8 // Group box spinner increase
|
|
|
|
#define GBSD(GBT, col, row) GBBR(col) - 11, GBBR(col) - 1, GBBB(GBT, row) - 8, GBBB(GBT, row) - 4 // Group box spinner decrease
|
|
|
|
#define GBDB(GBT, col, row) GBBR(col) - 11, GBBR(col) - 1, GBBT(GBT, row) + 4, GBBB(GBT, row) - 4 // Group box dropdown button
|
|
|
|
|
|
|
|
// Checkbox - given topleft corner
|
|
|
|
#define CHK(x, y) x, x + 13, y + 2, y + 15
|
|
|
|
|
2016-05-29 16:12:53 +02:00
|
|
|
#define MAIN_TILE_INSPECTOR_WIDGETS \
|
|
|
|
{ WWT_FRAME, 0, 0, WW - 1, 0, WH - 1, 0xFFFFFFFF, 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_SCROLL, 1, 3, WW - 4, 57, WH - PADDING_BOTTOM, 2, STR_NONE }, /* Element list */ \
|
2016-06-05 00:45:13 +02:00
|
|
|
{ WWT_SPINNER, 1, 20, 61, 23, 34, STR_NONE, STR_NONE }, /* Spinner for X */ \
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, 51, 60, 24, 28, STR_NUMERIC_UP, STR_NONE }, /* increase X */ \
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, 51, 60, 29, 33, STR_NUMERIC_DOWN, STR_NONE }, /* decrease X */ \
|
|
|
|
{ WWT_SPINNER, 1, 77, 118, 23, 34, STR_NONE, STR_NONE }, /* Spinner for Y */ \
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, 108, 117, 24, 28, STR_NUMERIC_UP, STR_NONE }, /* increase Y */ \
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, 108, 117, 29, 33, STR_NUMERIC_DOWN, STR_NONE }, /* decrease Y */ \
|
2016-05-29 16:12:53 +02:00
|
|
|
/* Buttons */ \
|
|
|
|
{ WWT_FLATBTN, 1, BX, BW, BY, BH, SPR_MAP, STR_INSERT_CORRUPT_TIP }, /* Insert corrupt button */ \
|
|
|
|
{ WWT_FLATBTN, 1, BX - BS * 1, BW - BS * 1, BY, BH, SPR_DEMOLISH, STR_REMOVE_SELECTED_ELEMENT_TIP }, /* Remove button */ \
|
|
|
|
{ WWT_CLOSEBOX, 1, BX - BS * 2, BW - BS * 2, BY, BY + 11, STR_UP, STR_MOVE_SELECTED_ELEMENT_UP_TIP }, /* Move down */ \
|
|
|
|
{ WWT_CLOSEBOX, 1, BX - BS * 2, BW - BS * 2, BH - 11, BH, STR_DOWN, STR_MOVE_SELECTED_ELEMENT_DOWN_TIP }, /* Move up */ \
|
|
|
|
{ WWT_FLATBTN, 1, BX - BS * 3, BW - BS * 3, BY, BH, SPR_ROTATE_ARROW, STR_ROTATE_SELECTED_ELEMENT_TIP }, /* Rotate button */ \
|
2016-06-11 19:39:51 +02:00
|
|
|
{ WWT_FLATBTN, 1, BX - BS * 4, BW - BS * 4, BY, BH, SPR_G2_SORT, STR_TILE_INSPECTOR_SORT_TIP }, /* Sort button */ \
|
2016-11-09 20:34:00 +01:00
|
|
|
{ WWT_FLATBTN, 1, BX - BS * 5, BW - BS * 5, BY, BH, SPR_G2_COPY, STR_TILE_INSPECTOR_COPY_TIP }, /* Copy button */ \
|
|
|
|
{ WWT_FLATBTN, 1, BX - BS * 6, BW - BS * 6, BY, BH, SPR_G2_PASTE, STR_TILE_INSPECTOR_PASTE_TIP }, /* Paste button */ \
|
2016-05-29 16:12:53 +02:00
|
|
|
/* Column headers */ \
|
|
|
|
{ WWT_13, 1, COL_X_TYPE, COL_X_BH - 1, 42, 42 + 13, STR_NONE, STR_NONE }, /* Type */ \
|
|
|
|
{ WWT_13, 1, COL_X_BH, COL_X_CH - 1, 42, 42 + 13, STR_NONE, STR_TILE_INSPECTOR_BASE_HEIGHT }, /* Base height */ \
|
|
|
|
{ WWT_13, 1, COL_X_CH, COL_X_GF - 1, 42, 42 + 13, STR_NONE, STR_TILE_INSPECTOR_CLEARANCE_HEIGHT }, /* Clearance height */ \
|
|
|
|
{ WWT_13, 1, COL_X_GF, COL_X_BF - 1, 42, 42 + 13, STR_NONE, STR_TILE_INSPECTOR_FLAG_GHOST }, /* Ghost flag */ \
|
|
|
|
{ WWT_13, 1, COL_X_BF, COL_X_LF - 1, 42, 42 + 13, STR_NONE, STR_TILE_INSPECTOR_FLAG_BROKEN }, /* Broken flag */ \
|
2016-05-31 20:13:26 +02:00
|
|
|
{ WWT_13, 1, COL_X_LF, WW - 3, 42, 42 + 13, STR_NONE, STR_TILE_INSPECTOR_FLAG_LAST }, /* Last of tile flag */ \
|
|
|
|
{ WWT_GROUPBOX, 1, 6, WW - 6, -1, -1, STR_NONE, STR_NONE }, /* Details group box */ \
|
|
|
|
{ WWT_GROUPBOX, 1, 6, WW - 6, -1, -1, STR_TILE_INSPECTOR_GROUPBOX_PROPERTIES, STR_NONE } /* Properties group box */
|
2016-05-29 16:12:53 +02:00
|
|
|
|
2016-09-18 20:47:35 +02:00
|
|
|
static rct_widget windowTileInspectorWidgets[] = {
|
2016-05-29 16:12:53 +02:00
|
|
|
MAIN_TILE_INSPECTOR_WIDGETS,
|
|
|
|
{ WIDGETS_END },
|
|
|
|
};
|
|
|
|
|
2016-05-31 20:13:26 +02:00
|
|
|
// Group boxes .top and .bottom for a given window height offsets from the bottom
|
2016-05-29 16:12:53 +02:00
|
|
|
#define SUR_GBPB PADDING_BOTTOM // Surface group box properties bottom
|
2016-09-18 15:52:03 +02:00
|
|
|
#define SUR_GBPT (SUR_GBPB + 16 + 4 * 21) // Surface group box properties top
|
2016-05-29 16:12:53 +02:00
|
|
|
#define SUR_GBDB (SUR_GBPT + GROUPBOX_PADDING) // Surface group box details bottom
|
2016-06-05 12:50:42 +02:00
|
|
|
#define SUR_GBDT (SUR_GBDB + 20 + 4 * 11) // Surface group box details top
|
2016-09-18 20:47:35 +02:00
|
|
|
static rct_widget windowTileInspectorWidgetsSurface[] = {
|
2016-05-29 16:12:53 +02:00
|
|
|
MAIN_TILE_INSPECTOR_WIDGETS,
|
2016-09-18 15:52:03 +02:00
|
|
|
{ WWT_SPINNER, 1, GBS(WH - SUR_GBPT, 1, 0), STR_NONE, STR_NONE }, // WIDX_SURFACE_SPINNER_HEIGHT
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSI(WH - SUR_GBPT, 1, 0), STR_NUMERIC_UP, STR_NONE }, // WIDX_SURFACE_SPINNER_HEIGHT_INCREASE
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSD(WH - SUR_GBPT, 1, 0), STR_NUMERIC_DOWN, STR_NONE }, // WIDX_SURFACE_SPINNER_HEIGHT_DECREASE
|
|
|
|
{ WWT_CLOSEBOX, 1, GBB(WH - SUR_GBPT, 0, 1), STR_TILE_INSPECTOR_SURFACE_REMOVE_FENCES, STR_NONE }, // WIDX_SURFACE_BUTTON_REMOVE_FENCES
|
|
|
|
{ WWT_CLOSEBOX, 1, GBB(WH - SUR_GBPT, 1, 1), STR_TILE_INSPECTOR_SURFACE_RESTORE_FENCES, STR_NONE }, // WIDX_SURFACE_BUTTON_RESTORE_FENCES
|
2016-09-18 14:30:34 +02:00
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 1, GBBT(WH - SUR_GBPT, 2) + 7 * 0), STR_NONE, STR_NONE }, // WIDX_SURFACE_CHECK_CORNER_N
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 2, GBBT(WH - SUR_GBPT, 2) + 7 * 1), STR_NONE, STR_NONE }, // WIDX_SURFACE_CHECK_CORNER_E
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 1, GBBT(WH - SUR_GBPT, 2) + 7 * 2), STR_NONE, STR_NONE }, // WIDX_SURFACE_CHECK_CORNER_S
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 0, GBBT(WH - SUR_GBPT, 2) + 7 * 1), STR_NONE, STR_NONE }, // WIDX_SURFACE_CHECK_CORNER_W
|
2016-09-18 15:52:03 +02:00
|
|
|
{ WWT_CHECKBOX, 1, GBBF(WH - SUR_GBPT, 0, 4), STR_TILE_INSPECTOR_SURFACE_DIAGONAL, STR_NONE }, // WIDX_SURFACE_CHECK_DIAGONAL
|
2016-05-29 16:12:53 +02:00
|
|
|
{ WIDGETS_END },
|
|
|
|
};
|
|
|
|
|
|
|
|
#define PAT_GBPB PADDING_BOTTOM // Path group box properties bottom
|
2017-02-05 17:33:21 +01:00
|
|
|
#define PAT_GBPT (PAT_GBPB + 16 + 4 * 21) // Path group box properties top
|
2016-05-29 16:12:53 +02:00
|
|
|
#define PAT_GBDB (PAT_GBPT + GROUPBOX_PADDING) // Path group box info bottom
|
2016-09-12 22:47:58 +02:00
|
|
|
#define PAT_GBDT (PAT_GBDB + 20 + 2 * 11) // Path group box info top
|
2016-09-18 20:47:35 +02:00
|
|
|
static rct_widget windowTileInspectorWidgetsPath[] = {
|
2016-05-29 16:12:53 +02:00
|
|
|
MAIN_TILE_INSPECTOR_WIDGETS,
|
2016-06-01 22:31:10 +02:00
|
|
|
{ WWT_SPINNER, 1, GBS(WH - PAT_GBPT, 1, 0), STR_NONE, STR_NONE }, // WIDX_PATH_SPINNER_HEIGHT
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSI(WH - PAT_GBPT, 1, 0), STR_NUMERIC_UP, STR_NONE }, // WIDX_PATH_SPINNER_HEIGHT_INCREASE
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSD(WH - PAT_GBPT, 1, 0), STR_NUMERIC_DOWN, STR_NONE }, // WIDX_PATH_SPINNER_HEIGHT_DECREASE
|
2017-02-05 17:33:21 +01:00
|
|
|
{ WWT_CHECKBOX, 1, GBBF(WH - PAT_GBPT, 0, 1), STR_TILE_INSPECTOR_PATH_SLOPED, STR_NONE }, // WIDX_PATH_CHECK_SLOPED
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 3, GBBT(WH - PAT_GBPT, 2) + 7 * 1), STR_NONE, STR_NONE }, // WIDX_PATH_CHECK_EDGE_NE
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 4, GBBT(WH - PAT_GBPT, 2) + 7 * 2), STR_NONE, STR_NONE }, // WIDX_PATH_CHECK_EDGE_E
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 3, GBBT(WH - PAT_GBPT, 2) + 7 * 3), STR_NONE, STR_NONE }, // WIDX_PATH_CHECK_EDGE_SE
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 2, GBBT(WH - PAT_GBPT, 2) + 7 * 4), STR_NONE, STR_NONE }, // WIDX_PATH_CHECK_EDGE_S
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 1, GBBT(WH - PAT_GBPT, 2) + 7 * 3), STR_NONE, STR_NONE }, // WIDX_PATH_CHECK_EDGE_SW
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 0, GBBT(WH - PAT_GBPT, 2) + 7 * 2), STR_NONE, STR_NONE }, // WIDX_PATH_CHECK_EDGE_W
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 1, GBBT(WH - PAT_GBPT, 2) + 7 * 1), STR_NONE, STR_NONE }, // WIDX_PATH_CHECK_EDGE_NW
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 2, GBBT(WH - PAT_GBPT, 2) + 7 * 0), STR_NONE, STR_NONE }, // WIDX_PATH_CHECK_EDGE_N
|
2016-05-29 16:12:53 +02:00
|
|
|
{ WIDGETS_END },
|
|
|
|
};
|
|
|
|
|
2016-06-05 23:35:41 +02:00
|
|
|
#define TRA_GBPB PADDING_BOTTOM // Track group box properties bottom
|
|
|
|
#define TRA_GBPT (TRA_GBPB + 16 + 3 * 21) // Track group box properties top
|
|
|
|
#define TRA_GBDB (TRA_GBPT + GROUPBOX_PADDING) // Track group box info bottom
|
|
|
|
#define TRA_GBDT (TRA_GBDB + 20 + 5 * 11) // Track group box info top
|
2016-09-18 20:47:35 +02:00
|
|
|
static rct_widget windowTileInspectorWidgetsTrack[] = {
|
2016-05-29 16:12:53 +02:00
|
|
|
MAIN_TILE_INSPECTOR_WIDGETS,
|
2016-06-05 22:07:11 +02:00
|
|
|
{ WWT_CHECKBOX, 1, GBBF(WH - TRA_GBPT, 0, 0), STR_TILE_INSPECTOR_TRACK_ENTIRE_TRACK_PIECE, STR_NONE }, // WIDX_TRACK_CHECK_APPLY_TO_ALL
|
2016-09-18 10:29:48 +02:00
|
|
|
{ WWT_SPINNER, 1, GBS(WH - TRA_GBPT, 1, 1), STR_NONE, STR_NONE }, // WIDX_TRACK_SPINNER_HEIGHT
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSI(WH - TRA_GBPT, 1, 1), STR_NUMERIC_UP, STR_NONE }, // WIDX_TRACK_SPINNER_HEIGHT_INCREASE
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSD(WH - TRA_GBPT, 1, 1), STR_NUMERIC_DOWN, STR_NONE }, // WIDX_TRACK_SPINNER_HEIGHT_DECREASE
|
2016-06-05 22:07:11 +02:00
|
|
|
{ WWT_CHECKBOX, 1, GBBF(WH - TRA_GBPT, 0, 2), STR_TILE_INSPECTOR_TRACK_CHAIN_LIFT, STR_NONE }, // WIDX_TRACK_CHECK_CHAIN_LIFT
|
2016-05-29 16:12:53 +02:00
|
|
|
{ WIDGETS_END },
|
|
|
|
};
|
|
|
|
|
2016-06-05 23:35:41 +02:00
|
|
|
#define SCE_GBPB PADDING_BOTTOM // Scenery group box properties bottom
|
2016-09-18 10:29:48 +02:00
|
|
|
#define SCE_GBPT (SCE_GBPB + 16 + 4 * 21) // Scenery group box properties top
|
2016-06-05 23:35:41 +02:00
|
|
|
#define SCE_GBDB (SCE_GBPT + GROUPBOX_PADDING) // Scenery group box info bottom
|
2016-09-18 10:29:48 +02:00
|
|
|
#define SCE_GBDT (SCE_GBDB + 20 + 3 * 11) // Scenery group box info top
|
2016-09-18 20:47:35 +02:00
|
|
|
static rct_widget windowTileInspectorWidgetsScenery[] = {
|
2016-05-29 16:12:53 +02:00
|
|
|
MAIN_TILE_INSPECTOR_WIDGETS,
|
2016-09-18 10:29:48 +02:00
|
|
|
{ WWT_SPINNER, 1, GBS(WH - SCE_GBPT, 1, 0), STR_NONE, STR_NONE }, // WIDX_SCENERY_SPINNER_HEIGHT
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSI(WH - SCE_GBPT, 1, 0), STR_NUMERIC_UP, STR_NONE }, // WIDX_SCENERY_SPINNER_HEIGHT_INCREASE
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSD(WH - SCE_GBPT, 1, 0), STR_NUMERIC_DOWN, STR_NONE }, // WIDX_SCENERY_SPINNER_HEIGHT_DECREASE
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 1, GBBT(WH - SCE_GBPT, 1) + 7 * 0), STR_NONE, STR_NONE }, // WIDX_SCENERY_CHECK_QUARTER_N
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 2, GBBT(WH - SCE_GBPT, 1) + 7 * 1), STR_NONE, STR_NONE }, // WIDX_SCENERY_CHECK_QUARTER_E
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 1, GBBT(WH - SCE_GBPT, 1) + 7 * 2), STR_NONE, STR_NONE }, // WIDX_SCENERY_CHECK_QUARTER_S
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 0, GBBT(WH - SCE_GBPT, 1) + 7 * 1), STR_NONE, STR_NONE }, // WIDX_SCENERY_CHECK_QUARTER_W
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 1, GBBT(WH - SCE_GBPT, 2) + 7 * 0), STR_NONE, STR_NONE }, // WIDX_SCENERY_CHECK_COLLISION_N
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 2, GBBT(WH - SCE_GBPT, 2) + 7 * 1), STR_NONE, STR_NONE }, // WIDX_SCENERY_CHECK_COLLISION_E
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 1, GBBT(WH - SCE_GBPT, 2) + 7 * 2), STR_NONE, STR_NONE }, // WIDX_SCENERY_CHECK_COLLISION_S
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 0, GBBT(WH - SCE_GBPT, 2) + 7 * 1), STR_NONE, STR_NONE }, // WIDX_SCENERY_CHECK_COLLISION_W
|
2016-05-29 16:12:53 +02:00
|
|
|
{ WIDGETS_END },
|
|
|
|
};
|
|
|
|
|
2016-06-05 23:35:41 +02:00
|
|
|
#define ENT_GBPB PADDING_BOTTOM // Entrance group box properties bottom
|
2016-09-18 22:52:27 +02:00
|
|
|
#define ENT_GBPT (ENT_GBPB + 16 + 1 * 21) // Entrance group box properties top
|
2016-06-05 23:35:41 +02:00
|
|
|
#define ENT_GBDB (ENT_GBPT + GROUPBOX_PADDING) // Entrance group box info bottom
|
2016-09-18 23:59:23 +02:00
|
|
|
#define ENT_GBDT (ENT_GBDB + 20 + 3 * 11) // Entrance group box info top
|
2016-09-18 20:47:35 +02:00
|
|
|
static rct_widget windowTileInspectorWidgetsEntrance[] = {
|
2016-05-29 16:12:53 +02:00
|
|
|
MAIN_TILE_INSPECTOR_WIDGETS,
|
2016-09-18 22:52:27 +02:00
|
|
|
{ WWT_SPINNER, 1, GBS(WH - ENT_GBPT, 1, 0), STR_NONE, STR_NONE }, // WIDX_ENTRANCE_SPINNER_HEIGHT
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSI(WH - ENT_GBPT, 1, 0), STR_NUMERIC_UP, STR_NONE }, // WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSD(WH - ENT_GBPT, 1, 0), STR_NUMERIC_DOWN, STR_NONE }, // WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE
|
2015-06-01 03:33:56 +02:00
|
|
|
{ WIDGETS_END },
|
|
|
|
};
|
|
|
|
|
2016-06-05 23:35:41 +02:00
|
|
|
#define FEN_GBPB PADDING_BOTTOM // Fence group box properties bottom
|
2016-10-01 22:57:09 +02:00
|
|
|
#define FEN_GBPT (FEN_GBPB + 16 + 2 * 21) // Fence group box properties top
|
2016-06-05 23:35:41 +02:00
|
|
|
#define FEN_GBDB (FEN_GBPT + GROUPBOX_PADDING) // Fence group box info bottom
|
2016-10-02 16:50:48 +02:00
|
|
|
#define FEN_GBDT (FEN_GBDB + 20 + 2 * 11) // Fence group box info top
|
2016-09-18 20:47:35 +02:00
|
|
|
static rct_widget windowTileInspectorWidgetsFence[] = {
|
2016-05-29 16:12:53 +02:00
|
|
|
MAIN_TILE_INSPECTOR_WIDGETS,
|
2016-09-11 23:02:34 +02:00
|
|
|
{ WWT_SPINNER, 1, GBS(WH - FEN_GBPT, 1, 0), STR_NONE, STR_NONE }, // WIDX_FENCE_SPINNER_HEIGHT
|
2016-10-01 22:57:09 +02:00
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSI(WH - FEN_GBPT, 1, 0), STR_NUMERIC_UP, STR_NONE }, // WIDX_FENCE_SPINNER_HEIGHT_INCREASE
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSD(WH - FEN_GBPT, 1, 0), STR_NUMERIC_DOWN, STR_NONE }, // WIDX_FENCE_SPINNER_HEIGHT_DECREASE
|
|
|
|
{ WWT_DROPDOWN, 1, GBS(WH - FEN_GBPT, 1, 1), STR_NONE, STR_NONE }, // WIDX_FENCE_DROPDOWN_SLOPE
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBDB(WH - FEN_GBPT, 1, 1), STR_DROPDOWN_GLYPH, STR_NONE }, // WIDX_FENCE_DROPDOWN_SLOPE_BUTTON
|
2016-05-29 16:12:53 +02:00
|
|
|
{ WIDGETS_END },
|
|
|
|
};
|
|
|
|
|
2016-06-05 23:35:41 +02:00
|
|
|
#define LAR_GBPB PADDING_BOTTOM // Large scenery group box properties bottom
|
2016-09-26 23:31:41 +02:00
|
|
|
#define LAR_GBPT (LAR_GBPB + 16 + 1 * 21) // Large scenery group box properties top
|
2016-06-05 23:35:41 +02:00
|
|
|
#define LAR_GBDB (LAR_GBPT + GROUPBOX_PADDING) // Large scenery group box info bottom
|
2016-10-02 22:15:54 +02:00
|
|
|
#define LAR_GBDT (LAR_GBDB + 20 + 3 * 11) // Large scenery group box info top
|
2016-09-18 20:47:35 +02:00
|
|
|
static rct_widget windowTileInspectorWidgetsLargeScenery[] = {
|
2016-05-29 16:12:53 +02:00
|
|
|
MAIN_TILE_INSPECTOR_WIDGETS,
|
2016-09-26 23:31:41 +02:00
|
|
|
{ WWT_SPINNER, 1, GBS(WH - LAR_GBPT, 1, 0), STR_NONE, STR_NONE }, // WIDX_LARGE_SCENERY_SPINNER_HEIGHT
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSI(WH - LAR_GBPT, 1, 0), STR_NUMERIC_UP, STR_NONE }, // WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSD(WH - LAR_GBPT, 1, 0), STR_NUMERIC_DOWN, STR_NONE }, // WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE
|
2016-05-29 16:12:53 +02:00
|
|
|
{ WIDGETS_END },
|
|
|
|
};
|
|
|
|
|
2016-06-05 23:35:41 +02:00
|
|
|
#define BAN_GBPB PADDING_BOTTOM // Banner group box properties bottom
|
2016-10-05 00:21:23 +02:00
|
|
|
#define BAN_GBPT (BAN_GBPB + 16 + 3 * 21) // Banner group box properties top
|
2016-06-05 23:35:41 +02:00
|
|
|
#define BAN_GBDB (BAN_GBPT + GROUPBOX_PADDING) // Banner group box info bottom
|
2016-10-05 00:01:09 +02:00
|
|
|
#define BAN_GBDT (BAN_GBDB + 20 + 1 * 11) // Banner group box info top
|
2016-09-18 20:47:35 +02:00
|
|
|
static rct_widget windowTileInspectorWidgetsBanner[] = {
|
2016-05-29 16:12:53 +02:00
|
|
|
MAIN_TILE_INSPECTOR_WIDGETS,
|
2016-09-26 23:31:41 +02:00
|
|
|
{ WWT_SPINNER, 1, GBS(WH - BAN_GBPT, 1, 0), STR_NONE, STR_NONE }, // WIDX_BANNER_SPINNER_HEIGHT
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSI(WH - BAN_GBPT, 1, 0), STR_NUMERIC_UP, STR_NONE }, // WIDX_BANNER_SPINNER_HEIGHT_INCREASE
|
|
|
|
{ WWT_DROPDOWN_BUTTON, 1, GBSD(WH - BAN_GBPT, 1, 0), STR_NUMERIC_DOWN, STR_NONE }, // WIDX_BANNER_SPINNER_HEIGHT_DECREASE
|
2016-10-05 00:21:23 +02:00
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 3, GBBT(WH - BAN_GBPT, 1) + 7 * 1), STR_NONE, STR_NONE }, // WIDX_BANNER_CHECK_BLOCK_NE
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 3, GBBT(WH - BAN_GBPT, 1) + 7 * 3), STR_NONE, STR_NONE }, // WIDX_BANNER_CHECK_BLOCK_SE
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 1, GBBT(WH - BAN_GBPT, 1) + 7 * 3), STR_NONE, STR_NONE }, // WIDX_BANNER_CHECK_BLOCK_SW
|
|
|
|
{ WWT_CHECKBOX, 1, CHK(GBBL(1) + 14 * 1, GBBT(WH - BAN_GBPT, 1) + 7 * 1), STR_NONE, STR_NONE }, // WIDX_BANNER_CHECK_BLOCK_NW
|
|
|
|
|
2016-05-29 16:12:53 +02:00
|
|
|
{ WIDGETS_END },
|
|
|
|
};
|
|
|
|
|
2016-06-05 23:35:41 +02:00
|
|
|
#define COR_GBPB PADDING_BOTTOM // Corrupt element group box properties bottom
|
2016-09-26 23:47:56 +02:00
|
|
|
#define COR_GBPT (COR_GBPB + 16 + 2 * 21) // Corrupt element group box properties top
|
2016-06-05 23:35:41 +02:00
|
|
|
#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
|
2016-09-18 20:47:35 +02:00
|
|
|
static rct_widget windowTileInspectorWidgetsCorrupt[] = {
|
2016-05-29 16:12:53 +02:00
|
|
|
MAIN_TILE_INSPECTOR_WIDGETS,
|
2016-09-26 23:31:41 +02:00
|
|
|
{ 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
|
2016-09-26 23:47:56 +02:00
|
|
|
{ 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
|
2016-05-29 16:12:53 +02:00
|
|
|
{ WIDGETS_END },
|
|
|
|
};
|
|
|
|
|
2016-09-18 20:47:35 +02:00
|
|
|
static rct_widget *tileInspectorWidgets[] = {
|
|
|
|
windowTileInspectorWidgets,
|
|
|
|
windowTileInspectorWidgetsSurface,
|
|
|
|
windowTileInspectorWidgetsPath,
|
|
|
|
windowTileInspectorWidgetsTrack,
|
|
|
|
windowTileInspectorWidgetsScenery,
|
|
|
|
windowTileInspectorWidgetsEntrance,
|
|
|
|
windowTileInspectorWidgetsFence,
|
|
|
|
windowTileInspectorWidgetsLargeScenery,
|
|
|
|
windowTileInspectorWidgetsBanner,
|
|
|
|
windowTileInspectorWidgetsCorrupt,
|
2016-05-29 16:12:53 +02:00
|
|
|
};
|
|
|
|
|
2016-05-31 20:13:26 +02:00
|
|
|
static struct {
|
|
|
|
// Offsets from the bottom of the window
|
2016-09-18 20:47:35 +02:00
|
|
|
sint16 detailsTopOffset, detailsBottomOffset;
|
2016-05-31 20:13:26 +02:00
|
|
|
sint16 properties_top_offset, properties_bottom_offset;
|
|
|
|
// String to be displayed in the details groupbox
|
|
|
|
rct_string_id string_idx;
|
2016-09-18 20:47:35 +02:00
|
|
|
} pageGroupBoxSettings[] = {
|
2016-05-31 20:13:26 +02:00
|
|
|
{ SUR_GBDT, SUR_GBDB, SUR_GBPT, SUR_GBPB, STR_TILE_INSPECTOR_GROUPBOX_SURFACE_INFO },
|
|
|
|
{ PAT_GBDT, PAT_GBDB, PAT_GBPT, PAT_GBPB, STR_TILE_INSPECTOR_GROUPBOX_PATH_INFO },
|
|
|
|
{ TRA_GBDT, TRA_GBDB, TRA_GBPT, TRA_GBPB, STR_TILE_INSPECTOR_GROUPBOX_TRACK_INFO },
|
|
|
|
{ SCE_GBDT, SCE_GBDB, SCE_GBPT, SCE_GBPB, STR_TILE_INSPECTOR_GROUPBOX_SCENERY_INFO },
|
|
|
|
{ ENT_GBDT, ENT_GBDB, ENT_GBPT, ENT_GBPB, STR_TILE_INSPECTOR_GROUPBOX_ENTRANCE_INFO },
|
|
|
|
{ FEN_GBDT, FEN_GBDB, FEN_GBPT, FEN_GBPB, STR_TILE_INSPECTOR_GROUPBOX_FENCE_INFO },
|
|
|
|
{ LAR_GBDT, LAR_GBDB, LAR_GBPT, LAR_GBPB, STR_TILE_INSPECTOR_GROUPBOX_LARGE_SCENERY_INFO },
|
|
|
|
{ BAN_GBDT, BAN_GBDB, BAN_GBPT, BAN_GBPB, STR_TILE_INSPECTOR_GROUPBOX_BANNER_INFO },
|
|
|
|
{ COR_GBDT, COR_GBDB, COR_GBPT, COR_GBPB, STR_TILE_INSPECTOR_GROUPBOX_CORRUPT_INFO }
|
2016-05-29 16:12:53 +02:00
|
|
|
};
|
|
|
|
|
2017-01-23 17:39:24 +01:00
|
|
|
uint32 windowTileInspectorTileX;
|
|
|
|
uint32 windowTileInspectorTileY;
|
|
|
|
sint32 windowTileInspectorElementCount = 0;
|
2016-09-18 20:47:35 +02:00
|
|
|
static sint16 windowTileInspectorHighlightedIndex = -1;
|
2016-10-09 15:14:56 +02:00
|
|
|
static bool windowTileInspectorTileSelected = false;
|
2017-01-12 19:20:22 +01:00
|
|
|
static sint32 windowTileInspectorToolMouseX = 0;
|
|
|
|
static sint32 windowTileInspectorToolMouseY = 0;
|
|
|
|
static sint32 windowTileInspectorToolMapX = 0;
|
|
|
|
static sint32 windowTileInspectorToolMapY = 0;
|
2016-09-18 20:47:35 +02:00
|
|
|
static bool windowTileInspectorApplyToAll = false;
|
2016-10-23 20:40:23 +02:00
|
|
|
static bool windowTileInspectorElementCopied = false;
|
|
|
|
static rct_map_element tileInspectorCopiedElement;
|
2016-09-18 20:47:35 +02:00
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_tile_inspector_mouseup(rct_window *w, sint32 widgetIndex);
|
2015-07-10 02:39:16 +02:00
|
|
|
static void window_tile_inspector_resize(rct_window *w);
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_tile_inspector_mousedown(sint32 widgetIndex, rct_window *w, rct_widget* widget);
|
2016-07-06 19:33:12 +02:00
|
|
|
static void window_tile_inspector_update(rct_window *w);
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_tile_inspector_dropdown(rct_window *w, sint32 widgetIndex, sint32 dropdownIndex);
|
|
|
|
static void window_tile_inspector_tool_update(rct_window* w, sint32 widgetIndex, sint32 x, sint32 y);
|
|
|
|
static void window_tile_inspector_update_selected_tile(rct_window *w, sint32 x, sint32 y);
|
|
|
|
static void window_tile_inspector_tool_down(rct_window* w, sint32 widgetIndex, sint32 x, sint32 y);
|
|
|
|
static void window_tile_inspector_tool_drag(rct_window* w, sint32 widgetIndex, sint32 x, sint32 y);
|
|
|
|
static void window_tile_inspector_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
|
|
|
static void window_tile_inspector_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
|
|
|
static void window_tile_inspector_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
2015-07-10 02:39:16 +02:00
|
|
|
static void window_tile_inspector_invalidate(rct_window *w);
|
|
|
|
static void window_tile_inspector_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_tile_inspector_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
2015-12-28 23:11:36 +01:00
|
|
|
|
2016-09-18 20:47:35 +02:00
|
|
|
static rct_window_event_list windowTileInspectorEvents = {
|
2016-07-06 19:26:14 +02:00
|
|
|
NULL,
|
2015-06-01 03:33:56 +02:00
|
|
|
window_tile_inspector_mouseup,
|
|
|
|
window_tile_inspector_resize,
|
2016-10-01 22:57:09 +02:00
|
|
|
window_tile_inspector_mousedown,
|
|
|
|
window_tile_inspector_dropdown,
|
2015-07-10 02:39:16 +02:00
|
|
|
NULL,
|
2016-07-06 19:33:12 +02:00
|
|
|
window_tile_inspector_update,
|
2015-07-10 02:39:16 +02:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2015-06-01 03:33:56 +02:00
|
|
|
window_tile_inspector_tool_update,
|
|
|
|
window_tile_inspector_tool_down,
|
2017-01-09 20:30:42 +01:00
|
|
|
window_tile_inspector_tool_drag,
|
2015-07-10 02:39:16 +02:00
|
|
|
NULL,
|
2016-07-06 19:26:14 +02:00
|
|
|
NULL,
|
2015-07-10 02:39:16 +02:00
|
|
|
NULL,
|
2015-06-01 03:33:56 +02:00
|
|
|
window_tile_inspector_scrollgetsize,
|
2015-12-28 23:11:36 +01:00
|
|
|
window_tile_inspector_scrollmousedown,
|
2015-07-10 02:39:16 +02:00
|
|
|
NULL,
|
2015-06-01 03:33:56 +02:00
|
|
|
window_tile_inspector_scrollmouseover,
|
2015-07-10 02:39:16 +02:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2015-06-01 03:33:56 +02:00
|
|
|
window_tile_inspector_invalidate,
|
|
|
|
window_tile_inspector_paint,
|
|
|
|
window_tile_inspector_scrollpaint
|
|
|
|
};
|
|
|
|
|
2016-09-18 20:47:35 +02:00
|
|
|
static uint64 windowTileInspectorEnabledWidgets[] = {
|
2016-06-11 19:39:51 +02:00
|
|
|
(1ULL << WIDX_CLOSE) | (1ULL << WIDX_BUTTON_CORRUPT),
|
2016-10-23 20:40:23 +02:00
|
|
|
(1ULL << WIDX_CLOSE) | (1ULL << WIDX_BUTTON_CORRUPT) | (1ULL << WIDX_BUTTON_REMOVE) | (1ULL << WIDX_BUTTON_ROTATE) | (1ULL << WIDX_BUTTON_COPY) | (1ULL << WIDX_SURFACE_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_SURFACE_SPINNER_HEIGHT_DECREASE) | (1ULL << WIDX_SURFACE_BUTTON_REMOVE_FENCES) | (1ULL << WIDX_SURFACE_BUTTON_RESTORE_FENCES) | (1ULL << WIDX_SURFACE_CHECK_CORNER_N) | (1ULL << WIDX_SURFACE_CHECK_CORNER_E) | (1ULL << WIDX_SURFACE_CHECK_CORNER_S) | (1ULL << WIDX_SURFACE_CHECK_CORNER_W) | (1ULL << WIDX_SURFACE_CHECK_DIAGONAL),
|
2017-02-05 17:33:21 +01:00
|
|
|
(1ULL << WIDX_CLOSE) | (1ULL << WIDX_BUTTON_CORRUPT) | (1ULL << WIDX_BUTTON_REMOVE) | (1ULL << WIDX_BUTTON_ROTATE) | (1ULL << WIDX_BUTTON_COPY) | (1ULL << WIDX_PATH_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_PATH_SPINNER_HEIGHT_DECREASE) | (1ULL << WIDX_PATH_CHECK_SLOPED) | (1ULL << WIDX_PATH_CHECK_EDGE_N) | (1ULL << WIDX_PATH_CHECK_EDGE_NE) | (1ULL << WIDX_PATH_CHECK_EDGE_E) | (1ULL << WIDX_PATH_CHECK_EDGE_SE) | (1ULL << WIDX_PATH_CHECK_EDGE_S) | (1ULL << WIDX_PATH_CHECK_EDGE_SW) | (1ULL << WIDX_PATH_CHECK_EDGE_W) | (1ULL << WIDX_PATH_CHECK_EDGE_NW),
|
2016-10-23 20:40:23 +02:00
|
|
|
(1ULL << WIDX_CLOSE) | (1ULL << WIDX_BUTTON_CORRUPT) | (1ULL << WIDX_BUTTON_REMOVE) | (1ULL << WIDX_BUTTON_ROTATE) | (1ULL << WIDX_BUTTON_COPY) | (1ULL << WIDX_TRACK_CHECK_APPLY_TO_ALL) | (1ULL << WIDX_TRACK_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_TRACK_SPINNER_HEIGHT_DECREASE) | (1ULL << WIDX_TRACK_CHECK_CHAIN_LIFT),
|
|
|
|
(1ULL << WIDX_CLOSE) | (1ULL << WIDX_BUTTON_CORRUPT) | (1ULL << WIDX_BUTTON_REMOVE) | (1ULL << WIDX_BUTTON_ROTATE) | (1ULL << WIDX_BUTTON_COPY) | (1ULL << WIDX_SCENERY_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_SCENERY_SPINNER_HEIGHT_DECREASE) | (1ULL << WIDX_SCENERY_CHECK_QUARTER_N) | (1ULL << WIDX_SCENERY_CHECK_QUARTER_E) | (1ULL << WIDX_SCENERY_CHECK_QUARTER_S) | (1ULL << WIDX_SCENERY_CHECK_QUARTER_W) | (1ULL << WIDX_SCENERY_CHECK_COLLISION_N) | (1ULL << WIDX_SCENERY_CHECK_COLLISION_E) | (1ULL << WIDX_SCENERY_CHECK_COLLISION_S) | (1ULL << WIDX_SCENERY_CHECK_COLLISION_W),
|
|
|
|
(1ULL << WIDX_CLOSE) | (1ULL << WIDX_BUTTON_CORRUPT) | (1ULL << WIDX_BUTTON_REMOVE) | (1ULL << WIDX_BUTTON_ROTATE) | (1ULL << WIDX_BUTTON_COPY) | (1ULL << WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE),
|
|
|
|
(1ULL << WIDX_CLOSE) | (1ULL << WIDX_BUTTON_CORRUPT) | (1ULL << WIDX_BUTTON_REMOVE) | (1ULL << WIDX_BUTTON_ROTATE) | (1ULL << WIDX_BUTTON_COPY) | (1ULL << WIDX_FENCE_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_FENCE_SPINNER_HEIGHT_DECREASE) | (1ULL << WIDX_FENCE_DROPDOWN_SLOPE) | (1ULL << WIDX_FENCE_DROPDOWN_SLOPE_BUTTON),
|
|
|
|
(1ULL << WIDX_CLOSE) | (1ULL << WIDX_BUTTON_CORRUPT) | (1ULL << WIDX_BUTTON_REMOVE) | (1ULL << WIDX_BUTTON_COPY) | (1ULL << WIDX_LARGE_SCENERY_SPINNER_HEIGHT) | (1ULL << WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE),
|
|
|
|
(1ULL << WIDX_CLOSE) | (1ULL << WIDX_BUTTON_CORRUPT) | (1ULL << WIDX_BUTTON_REMOVE) | (1ULL << WIDX_BUTTON_ROTATE) | (1ULL << WIDX_BUTTON_COPY) | (1ULL << WIDX_BANNER_SPINNER_HEIGHT) | (1ULL << WIDX_BANNER_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_BANNER_SPINNER_HEIGHT_DECREASE) | (1ULL << WIDX_BANNER_CHECK_BLOCK_NE) | (1ULL << WIDX_BANNER_CHECK_BLOCK_SE) | (1ULL << WIDX_BANNER_CHECK_BLOCK_SW) | (1ULL << WIDX_BANNER_CHECK_BLOCK_NW),
|
|
|
|
(1ULL << WIDX_CLOSE) | (1ULL << WIDX_BUTTON_CORRUPT) | (1ULL << WIDX_BUTTON_REMOVE) | (1ULL << WIDX_BUTTON_COPY) | (1ULL << WIDX_CORRUPT_SPINNER_HEIGHT) | (1ULL << WIDX_CORRUPT_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_CORRUPT_SPINNER_HEIGHT_DECREASE) | (1ULL << WIDX_CORRUPT_BUTTON_CLAMP),
|
2016-05-29 16:12:53 +02:00
|
|
|
};
|
|
|
|
|
2016-09-18 20:47:35 +02:00
|
|
|
static uint64 windowTileInspectorDisabledWidgets[] = {
|
2016-10-23 20:40:23 +02:00
|
|
|
(1ULL << WIDX_BUTTON_CORRUPT) | (1ULL << WIDX_BUTTON_MOVE_UP) | (1ULL << WIDX_BUTTON_MOVE_DOWN) | (1ULL << WIDX_BUTTON_REMOVE) | (1ULL << WIDX_BUTTON_ROTATE) | (1ULL << WIDX_BUTTON_COPY),
|
2016-05-29 16:12:53 +02:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
2016-06-11 19:39:51 +02:00
|
|
|
(1ULL << WIDX_BUTTON_ROTATE),
|
2016-05-29 16:12:53 +02:00
|
|
|
0,
|
2016-06-11 19:39:51 +02:00
|
|
|
(1ULL << WIDX_BUTTON_ROTATE),
|
2016-05-29 16:12:53 +02:00
|
|
|
};
|
|
|
|
|
2016-11-01 23:43:39 +01:00
|
|
|
void window_tile_inspector_open()
|
|
|
|
{
|
2015-06-01 03:33:56 +02:00
|
|
|
rct_window* window;
|
|
|
|
|
|
|
|
// Check if window is already open
|
|
|
|
window = window_bring_to_front_by_class(WC_TILE_INSPECTOR);
|
|
|
|
if (window != NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
window = window_create(
|
|
|
|
0,
|
|
|
|
29,
|
|
|
|
WW,
|
|
|
|
WH,
|
2016-09-18 20:47:35 +02:00
|
|
|
&windowTileInspectorEvents,
|
2015-06-01 03:33:56 +02:00
|
|
|
WC_TILE_INSPECTOR,
|
2015-06-13 23:16:14 +02:00
|
|
|
WF_RESIZABLE
|
2015-06-01 03:33:56 +02:00
|
|
|
);
|
2017-01-26 19:06:49 +01:00
|
|
|
window_tile_inspector_set_page(window, TILE_INSPECTOR_PAGE_DEFAULT);
|
2015-06-01 03:33:56 +02:00
|
|
|
|
|
|
|
window_init_scroll_widgets(window);
|
2015-12-28 23:11:36 +01:00
|
|
|
window->min_width = MIN_WW;
|
2015-06-01 03:33:56 +02:00
|
|
|
window->min_height = MIN_WH;
|
2015-12-28 23:11:36 +01:00
|
|
|
window->max_width = MAX_WW;
|
2015-06-01 03:33:56 +02:00
|
|
|
window->max_height = MAX_WH;
|
2015-12-28 23:11:36 +01:00
|
|
|
window->selected_list_item = -1;
|
2015-06-01 03:33:56 +02:00
|
|
|
|
2016-10-09 15:14:56 +02:00
|
|
|
windowTileInspectorTileSelected = false;
|
2015-06-01 03:33:56 +02:00
|
|
|
|
2015-06-13 17:05:56 +02:00
|
|
|
tool_set(window, WIDX_BACKGROUND, 12);
|
2016-06-05 00:45:13 +02:00
|
|
|
window_tile_inspector_auto_set_buttons(window);
|
|
|
|
}
|
|
|
|
|
2016-11-01 23:43:39 +01:00
|
|
|
void window_tile_inspector_clear_clipboard()
|
|
|
|
{
|
2016-10-30 21:15:31 +01:00
|
|
|
windowTileInspectorElementCopied = false;
|
|
|
|
}
|
|
|
|
|
2016-11-01 23:43:39 +01:00
|
|
|
static rct_map_element* window_tile_inspector_get_selected_element(rct_window *w)
|
|
|
|
{
|
2017-02-06 17:43:29 +01:00
|
|
|
openrct2_assert(w->selected_list_item >= 0 && w->selected_list_item < windowTileInspectorElementCount,
|
|
|
|
"Selected list item out of range");
|
2016-10-02 19:23:04 +02:00
|
|
|
return map_get_first_element_at(windowTileInspectorTileX, windowTileInspectorTileY) + w->selected_list_item;
|
|
|
|
}
|
|
|
|
|
2016-11-01 23:43:39 +01:00
|
|
|
static void window_tile_inspector_load_tile(rct_window* w)
|
|
|
|
{
|
2016-09-18 20:47:35 +02:00
|
|
|
rct_map_element *element = map_get_first_element_at(windowTileInspectorTileX, windowTileInspectorTileY);
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 numItems = 0;
|
2016-09-18 16:07:07 +02:00
|
|
|
do {
|
2016-06-05 00:45:13 +02:00
|
|
|
numItems++;
|
|
|
|
} while (!map_element_is_last_for_tile(element++));
|
|
|
|
|
2016-09-18 20:47:35 +02:00
|
|
|
windowTileInspectorElementCount = numItems;
|
2016-06-05 00:45:13 +02:00
|
|
|
|
|
|
|
// Set default page
|
2017-01-26 19:06:49 +01:00
|
|
|
window_tile_inspector_set_page(w, TILE_INSPECTOR_PAGE_DEFAULT);
|
2016-06-11 19:39:51 +02:00
|
|
|
|
2016-06-05 00:45:13 +02:00
|
|
|
// undo selection and buttons affecting it
|
|
|
|
w->selected_list_item = -1;
|
2016-06-11 19:39:51 +02:00
|
|
|
window_tile_inspector_auto_set_buttons(w);
|
2016-06-05 00:45:13 +02:00
|
|
|
|
|
|
|
w->scrolls[0].v_top = 0;
|
|
|
|
window_invalidate(w);
|
2015-06-01 03:33:56 +02:00
|
|
|
}
|
|
|
|
|
2017-01-23 17:08:16 +01:00
|
|
|
static void window_tile_inspector_insert_corrupt_element(sint32 element_index)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2017-02-06 17:43:29 +01:00
|
|
|
openrct2_assert(element_index > 0 && element_index < windowTileInspectorElementCount,
|
|
|
|
"element_index out of range");
|
2017-01-15 13:53:19 +01:00
|
|
|
game_do_command(
|
2017-01-23 21:04:28 +01:00
|
|
|
TILE_INSPECTOR_ANY_INSERT_CORRUPT,
|
2017-01-15 13:53:19 +01:00
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
2017-01-23 17:08:16 +01:00
|
|
|
element_index,
|
2017-01-15 13:53:19 +01:00
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
0,
|
|
|
|
0
|
|
|
|
);
|
2015-11-07 11:04:57 +01:00
|
|
|
}
|
|
|
|
|
2017-01-23 17:39:24 +01:00
|
|
|
static void window_tile_inspector_remove_element(sint32 element_index)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2017-02-06 17:43:29 +01:00
|
|
|
openrct2_assert(element_index > 0 && element_index < windowTileInspectorElementCount,
|
|
|
|
"element_index out of range");
|
2017-01-23 17:08:16 +01:00
|
|
|
game_do_command(
|
2017-01-23 21:04:28 +01:00
|
|
|
TILE_INSPECTOR_ANY_REMOVE,
|
2017-01-23 17:08:16 +01:00
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
2017-01-23 17:39:24 +01:00
|
|
|
element_index,
|
2017-01-23 17:08:16 +01:00
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
0,
|
|
|
|
0
|
|
|
|
);
|
2015-12-29 15:43:49 +01:00
|
|
|
}
|
|
|
|
|
2017-01-23 23:38:02 +01:00
|
|
|
static void window_tile_inspector_rotate_element(sint32 element_index)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2017-02-06 17:43:29 +01:00
|
|
|
openrct2_assert(element_index > 0 && element_index < windowTileInspectorElementCount,
|
|
|
|
"element_index out of range");
|
2017-01-23 23:38:02 +01:00
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_ANY_ROTATE,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
|
|
|
element_index,
|
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
0,
|
|
|
|
0
|
|
|
|
);
|
2016-04-17 00:35:11 +02:00
|
|
|
}
|
|
|
|
|
2015-12-28 23:11:36 +01:00
|
|
|
// Swap element with its parent
|
2016-11-01 23:43:39 +01:00
|
|
|
static void window_tile_inspector_swap_elements(sint16 first, sint16 second)
|
|
|
|
{
|
2017-02-06 17:43:29 +01:00
|
|
|
openrct2_assert(first > 0 && first < windowTileInspectorElementCount,
|
|
|
|
"first out of range");
|
|
|
|
openrct2_assert(second > 0 && second < windowTileInspectorElementCount,
|
|
|
|
"second out of range");
|
2017-01-23 21:04:28 +01:00
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_ANY_SWAP,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
|
|
|
first,
|
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
second,
|
|
|
|
0
|
|
|
|
);
|
2015-12-21 00:52:42 +01:00
|
|
|
}
|
|
|
|
|
2016-11-01 23:43:39 +01:00
|
|
|
static void window_tile_inspector_sort_elements(rct_window *w)
|
|
|
|
{
|
2017-02-06 17:43:29 +01:00
|
|
|
openrct2_assert(windowTileInspectorTileSelected, "No tile selected");
|
2017-01-25 13:42:04 +01:00
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_ANY_SORT,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
|
|
|
0,
|
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
0,
|
|
|
|
0
|
|
|
|
);
|
2016-06-11 19:39:51 +02:00
|
|
|
}
|
|
|
|
|
2016-11-01 23:43:39 +01:00
|
|
|
static void window_tile_inspector_copy_element(rct_window *w)
|
|
|
|
{
|
2016-10-23 20:40:23 +02:00
|
|
|
// Copy value, in case the element gets moved
|
|
|
|
tileInspectorCopiedElement = *window_tile_inspector_get_selected_element(w);
|
|
|
|
windowTileInspectorElementCopied = true;
|
|
|
|
}
|
|
|
|
|
2016-11-01 23:43:39 +01:00
|
|
|
static void window_tile_inspector_paste_element(rct_window *w)
|
|
|
|
{
|
2017-01-24 00:16:43 +01:00
|
|
|
// Construct the data to send using the surface's properties
|
2017-01-24 00:40:39 +01:00
|
|
|
sint32 data[2];
|
|
|
|
memcpy(&data[0], &tileInspectorCopiedElement, 8);
|
2017-01-24 23:33:33 +01:00
|
|
|
assert_struct_size(data, sizeof(tileInspectorCopiedElement));
|
2016-10-23 20:40:23 +02:00
|
|
|
|
2017-01-24 00:16:43 +01:00
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_ANY_PASTE,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
2017-01-24 00:40:39 +01:00
|
|
|
data[0],
|
2017-01-24 00:16:43 +01:00
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
2017-01-24 00:40:39 +01:00
|
|
|
data[1],
|
2017-01-24 00:16:43 +01:00
|
|
|
0
|
|
|
|
);
|
2016-10-23 20:40:23 +02:00
|
|
|
}
|
|
|
|
|
2017-02-07 01:06:50 +01:00
|
|
|
static void window_tile_inspector_base_height_offset(sint16 element_index, sint8 height_offset)
|
2017-01-25 14:22:33 +01:00
|
|
|
{
|
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_ANY_BASE_HEIGHT_OFFSET,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
|
|
|
element_index,
|
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
2017-02-07 01:06:50 +01:00
|
|
|
height_offset,
|
2017-01-25 14:22:33 +01:00
|
|
|
0
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-01-27 13:30:09 +01:00
|
|
|
static void window_tile_inspector_surface_show_park_fences(bool show_fences)
|
|
|
|
{
|
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_SURFACE_SHOW_PARK_FENCES,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
|
|
|
show_fences,
|
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
0,
|
|
|
|
0
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-01-27 14:02:17 +01:00
|
|
|
static void window_tile_inspector_surface_toggle_corner(sint32 cornerIndex)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2017-01-27 14:02:17 +01:00
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_SURFACE_TOGGLE_CORNER,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
|
|
|
cornerIndex,
|
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
0,
|
|
|
|
0
|
|
|
|
);
|
2016-10-09 00:00:36 +02:00
|
|
|
}
|
|
|
|
|
2017-01-27 14:19:23 +01:00
|
|
|
static void window_tile_inspector_surface_toggle_diagonal()
|
|
|
|
{
|
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_SURFACE_TOGGLE_DIAGONAL,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
|
|
|
0,
|
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
0,
|
|
|
|
0
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-02-06 14:51:45 +01:00
|
|
|
static void window_tile_inspector_path_set_sloped(sint32 element_index, bool sloped)
|
|
|
|
{
|
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_PATH_SET_SLOPE,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
|
|
|
element_index,
|
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
sloped,
|
|
|
|
0
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-01-27 19:12:25 +01:00
|
|
|
static void window_tile_inspector_path_toggle_edge(sint32 element_index, sint32 corner_index)
|
|
|
|
{
|
2017-02-06 17:43:29 +01:00
|
|
|
openrct2_assert(element_index > 0 && element_index < windowTileInspectorElementCount,
|
|
|
|
"element_index out of range");
|
|
|
|
openrct2_assert(corner_index >= 0 && corner_index < 8, "corner_index out of range");
|
2017-01-27 19:12:25 +01:00
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_PATH_TOGGLE_EDGE,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
|
|
|
element_index,
|
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
corner_index,
|
|
|
|
0
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-02-02 20:06:27 +01:00
|
|
|
static void window_tile_inspector_fence_set_slope(sint32 element_index, sint32 slope_value)
|
|
|
|
{
|
|
|
|
// Make sure only the correct bits are set
|
2017-02-06 17:43:29 +01:00
|
|
|
openrct2_assert((slope_value & 0xC0) == slope_value, "slope_value doesn't match its mask");
|
2017-02-02 20:06:27 +01:00
|
|
|
|
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_FENCE_SET_SLOPE,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
|
|
|
element_index,
|
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
slope_value,
|
|
|
|
0
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-02-07 01:06:50 +01:00
|
|
|
static void window_tile_inspector_track_block_height_offset(sint32 element_index, sint8 height_offset)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2017-02-07 01:06:50 +01:00
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_TRACK_BASE_HEIGHT_OFFSET,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
|
|
|
element_index,
|
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
height_offset,
|
|
|
|
0
|
|
|
|
);
|
2016-09-10 22:37:47 +02:00
|
|
|
}
|
|
|
|
|
2017-02-07 01:06:50 +01:00
|
|
|
static void window_tile_inspector_track_block_set_lift(sint32 element_index, bool entire_track_block, bool chain)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2017-02-07 01:06:50 +01:00
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_TRACK_SET_CHAIN,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
|
|
|
element_index,
|
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
entire_track_block,
|
|
|
|
chain
|
|
|
|
);
|
2016-09-11 23:02:34 +02:00
|
|
|
}
|
|
|
|
|
2017-02-07 15:07:31 +01:00
|
|
|
static void window_tile_inspector_quarter_tile_set(sint32 element_index, const sint32 quarter_index)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2017-02-07 15:07:31 +01:00
|
|
|
// quarter_index is widget index relative to WIDX_SCENERY_CHECK_QUARTER_N, so a value from 0-3
|
|
|
|
openrct2_assert(quarter_index >= 0 && quarter_index < 4, "quarter_index out of range");
|
2016-09-18 10:29:48 +02:00
|
|
|
|
2017-02-07 15:07:31 +01:00
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_SCENERY_SET_QUARTER_LOCATION,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
|
|
|
element_index,
|
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
quarter_index - get_current_rotation() & 3,
|
|
|
|
0
|
|
|
|
);
|
2016-09-18 10:29:48 +02:00
|
|
|
}
|
|
|
|
|
2017-02-07 15:25:42 +01:00
|
|
|
static void window_tile_inspector_toggle_quadrant_collosion(sint32 element_index, const sint32 quadrant_index)
|
|
|
|
{
|
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_SCENERY_SET_QUARTER_COLLISION,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
|
|
|
element_index,
|
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
(quadrant_index + 2 - get_current_rotation()) & 3,
|
|
|
|
0
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-02-07 15:39:07 +01:00
|
|
|
static void window_tile_inspector_clamp_corrupt(sint32 element_index)
|
|
|
|
{
|
|
|
|
game_do_command(
|
|
|
|
TILE_INSPECTOR_CORRUPT_CLAMP,
|
|
|
|
GAME_COMMAND_FLAG_APPLY,
|
|
|
|
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
|
|
|
element_index,
|
|
|
|
GAME_COMMAND_MODIFY_TILE,
|
|
|
|
0,
|
|
|
|
0
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_tile_inspector_mouseup(rct_window *w, sint32 widgetIndex)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2015-06-01 03:33:56 +02:00
|
|
|
switch (widgetIndex) {
|
|
|
|
case WIDX_CLOSE:
|
2016-07-06 19:26:14 +02:00
|
|
|
tool_cancel();
|
2015-06-01 03:33:56 +02:00
|
|
|
window_close(w);
|
|
|
|
break;
|
2016-06-05 00:45:13 +02:00
|
|
|
case WIDX_SPINNER_X_INCREASE:
|
2016-09-18 20:47:35 +02:00
|
|
|
windowTileInspectorTileX = min(windowTileInspectorTileX + 1, 255);
|
2016-06-05 00:45:13 +02:00
|
|
|
window_tile_inspector_load_tile(w);
|
|
|
|
window_tile_inspector_auto_set_buttons(w);
|
|
|
|
break;
|
|
|
|
case WIDX_SPINNER_X_DECREASE:
|
2016-09-18 20:47:35 +02:00
|
|
|
windowTileInspectorTileX = max(windowTileInspectorTileX - 1, 0);
|
2016-06-05 00:45:13 +02:00
|
|
|
window_tile_inspector_load_tile(w);
|
|
|
|
window_tile_inspector_auto_set_buttons(w);
|
|
|
|
break;
|
|
|
|
case WIDX_SPINNER_Y_INCREASE:
|
2016-09-18 20:47:35 +02:00
|
|
|
windowTileInspectorTileY = min(windowTileInspectorTileY + 1, 255);
|
2016-06-05 00:45:13 +02:00
|
|
|
window_tile_inspector_load_tile(w);
|
|
|
|
window_tile_inspector_auto_set_buttons(w);
|
|
|
|
break;
|
|
|
|
case WIDX_SPINNER_Y_DECREASE:
|
2016-09-18 20:47:35 +02:00
|
|
|
windowTileInspectorTileY = max(windowTileInspectorTileY - 1, 0);
|
2016-06-05 00:45:13 +02:00
|
|
|
window_tile_inspector_load_tile(w);
|
|
|
|
window_tile_inspector_auto_set_buttons(w);
|
|
|
|
break;
|
2016-06-11 19:39:51 +02:00
|
|
|
case WIDX_BUTTON_CORRUPT:
|
2017-01-23 17:08:16 +01:00
|
|
|
window_tile_inspector_insert_corrupt_element(w->selected_list_item);
|
2015-11-07 11:04:57 +01:00
|
|
|
break;
|
2016-06-11 19:39:51 +02:00
|
|
|
case WIDX_BUTTON_REMOVE:
|
2016-09-18 20:47:35 +02:00
|
|
|
window_tile_inspector_remove_element(w->selected_list_item);
|
2015-12-28 23:11:36 +01:00
|
|
|
break;
|
2016-06-11 19:39:51 +02:00
|
|
|
case WIDX_BUTTON_ROTATE:
|
2016-09-18 20:47:35 +02:00
|
|
|
window_tile_inspector_rotate_element(w->selected_list_item);
|
2016-04-17 00:35:11 +02:00
|
|
|
break;
|
2016-06-11 19:39:51 +02:00
|
|
|
case WIDX_BUTTON_SORT:
|
2016-09-18 20:47:35 +02:00
|
|
|
window_tile_inspector_sort_elements(w);
|
2016-06-11 19:39:51 +02:00
|
|
|
break;
|
2016-10-23 20:40:23 +02:00
|
|
|
case WIDX_BUTTON_COPY:
|
|
|
|
window_tile_inspector_copy_element(w);
|
2016-10-31 22:58:52 +01:00
|
|
|
window_tile_inspector_auto_set_buttons(w);
|
|
|
|
window_invalidate(w);
|
2016-10-23 20:40:23 +02:00
|
|
|
break;
|
|
|
|
case WIDX_BUTTON_PASTE:
|
|
|
|
window_tile_inspector_paste_element(w);
|
|
|
|
break;
|
2016-06-11 19:39:51 +02:00
|
|
|
case WIDX_BUTTON_MOVE_DOWN:
|
2016-09-18 20:47:35 +02:00
|
|
|
window_tile_inspector_swap_elements(w->selected_list_item, w->selected_list_item + 1);
|
2015-12-28 23:11:36 +01:00
|
|
|
break;
|
2016-06-11 19:39:51 +02:00
|
|
|
case WIDX_BUTTON_MOVE_UP:
|
2016-09-18 20:47:35 +02:00
|
|
|
window_tile_inspector_swap_elements(w->selected_list_item - 1, w->selected_list_item);
|
2015-12-21 00:52:42 +01:00
|
|
|
break;
|
2015-06-01 03:33:56 +02:00
|
|
|
}
|
2016-05-29 16:12:53 +02:00
|
|
|
|
2016-10-05 00:32:04 +02:00
|
|
|
// Only element-specific widgets from now on
|
2017-01-26 19:06:49 +01:00
|
|
|
if (w->page == TILE_INSPECTOR_PAGE_DEFAULT) {
|
2016-10-05 00:32:04 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-09-18 10:29:48 +02:00
|
|
|
// Get the selected map element
|
2016-10-02 19:23:04 +02:00
|
|
|
rct_map_element *const mapElement = window_tile_inspector_get_selected_element(w);
|
2016-05-29 16:12:53 +02:00
|
|
|
|
|
|
|
// Page widgets
|
|
|
|
switch (w->page) {
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_SURFACE:
|
2016-05-29 16:12:53 +02:00
|
|
|
switch (widgetIndex) {
|
2016-09-18 15:52:03 +02:00
|
|
|
case WIDX_SURFACE_SPINNER_HEIGHT_INCREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, 1);
|
2016-09-18 15:52:03 +02:00
|
|
|
break;
|
|
|
|
case WIDX_SURFACE_SPINNER_HEIGHT_DECREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, -1);
|
2016-09-18 15:52:03 +02:00
|
|
|
break;
|
2016-05-29 16:12:53 +02:00
|
|
|
case WIDX_SURFACE_BUTTON_REMOVE_FENCES:
|
2017-01-27 13:30:09 +01:00
|
|
|
window_tile_inspector_surface_show_park_fences(false);
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
|
|
|
case WIDX_SURFACE_BUTTON_RESTORE_FENCES:
|
2017-01-27 13:30:09 +01:00
|
|
|
window_tile_inspector_surface_show_park_fences(true);
|
2016-05-30 00:35:50 +02:00
|
|
|
break;
|
2016-09-18 14:30:34 +02:00
|
|
|
case WIDX_SURFACE_CHECK_CORNER_N:
|
|
|
|
case WIDX_SURFACE_CHECK_CORNER_E:
|
|
|
|
case WIDX_SURFACE_CHECK_CORNER_S:
|
|
|
|
case WIDX_SURFACE_CHECK_CORNER_W:
|
2017-01-27 14:02:17 +01:00
|
|
|
window_tile_inspector_surface_toggle_corner(((widgetIndex - WIDX_SURFACE_CHECK_CORNER_N) + 2 - get_current_rotation()) & 3);
|
2016-09-18 14:30:34 +02:00
|
|
|
break;
|
|
|
|
case WIDX_SURFACE_CHECK_DIAGONAL:
|
2017-01-27 14:19:23 +01:00
|
|
|
window_tile_inspector_surface_toggle_diagonal();
|
2016-09-18 14:30:34 +02:00
|
|
|
break;
|
2016-05-30 00:35:50 +02:00
|
|
|
} // switch widgetindex
|
|
|
|
break;
|
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_PATH:
|
2016-05-30 00:35:50 +02:00
|
|
|
switch (widgetIndex) {
|
2016-06-01 22:31:10 +02:00
|
|
|
case WIDX_PATH_SPINNER_HEIGHT_INCREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, 1);
|
2016-05-30 00:35:50 +02:00
|
|
|
break;
|
2016-06-01 22:31:10 +02:00
|
|
|
case WIDX_PATH_SPINNER_HEIGHT_DECREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, -1);
|
2016-05-30 00:35:50 +02:00
|
|
|
break;
|
2017-02-05 17:33:21 +01:00
|
|
|
case WIDX_PATH_CHECK_SLOPED:
|
2017-02-06 14:51:45 +01:00
|
|
|
window_tile_inspector_path_set_sloped(w->selected_list_item, !footpath_element_is_sloped(mapElement));
|
2017-02-05 17:33:21 +01:00
|
|
|
break;
|
2016-06-01 22:31:10 +02:00
|
|
|
case WIDX_PATH_CHECK_EDGE_E:
|
|
|
|
case WIDX_PATH_CHECK_EDGE_S:
|
|
|
|
case WIDX_PATH_CHECK_EDGE_W:
|
|
|
|
case WIDX_PATH_CHECK_EDGE_N:
|
2017-01-27 19:12:25 +01:00
|
|
|
{
|
|
|
|
// 0 = east/right, 1 = south/bottom, 2 = west/left, 3 = north/top
|
|
|
|
const sint32 eswn = (widgetIndex - WIDX_PATH_CHECK_EDGE_E) / 2;
|
|
|
|
// Transform to world orientation
|
|
|
|
const sint32 index = (4 + eswn - get_current_rotation()) & 3;
|
|
|
|
window_tile_inspector_path_toggle_edge(w->selected_list_item, index + 4); // The corners are stored in the 4 most significant bits, hence the + 4
|
2016-05-30 00:35:50 +02:00
|
|
|
break;
|
2017-01-27 19:12:25 +01:00
|
|
|
}
|
2016-06-01 22:31:10 +02:00
|
|
|
case WIDX_PATH_CHECK_EDGE_NE:
|
|
|
|
case WIDX_PATH_CHECK_EDGE_SE:
|
|
|
|
case WIDX_PATH_CHECK_EDGE_SW:
|
|
|
|
case WIDX_PATH_CHECK_EDGE_NW:
|
2017-01-27 19:12:25 +01:00
|
|
|
{
|
|
|
|
// 0 = NE, 1 = SE, 2 = SW, 3 = NW
|
|
|
|
const sint32 neseswnw = (widgetIndex - WIDX_PATH_CHECK_EDGE_NE) / 2;
|
|
|
|
// Transform to world orientation
|
|
|
|
const sint32 index = (4 + neseswnw - get_current_rotation()) & 3;
|
|
|
|
window_tile_inspector_path_toggle_edge(w->selected_list_item, index);
|
2016-05-30 00:35:50 +02:00
|
|
|
break;
|
2017-01-27 19:12:25 +01:00
|
|
|
}
|
2016-06-05 22:07:11 +02:00
|
|
|
} // switch widget index
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
2016-05-30 00:35:50 +02:00
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_TRACK:
|
2016-06-05 22:07:11 +02:00
|
|
|
switch (widgetIndex) {
|
|
|
|
case WIDX_TRACK_CHECK_APPLY_TO_ALL:
|
2016-09-18 20:47:35 +02:00
|
|
|
windowTileInspectorApplyToAll ^= 1;
|
2016-06-05 22:07:11 +02:00
|
|
|
widget_invalidate(w, widgetIndex);
|
|
|
|
break;
|
|
|
|
case WIDX_TRACK_SPINNER_HEIGHT_INCREASE:
|
2016-09-10 22:37:47 +02:00
|
|
|
if (widget_is_pressed(w, WIDX_TRACK_CHECK_APPLY_TO_ALL)) {
|
2017-02-07 01:06:50 +01:00
|
|
|
window_tile_inspector_track_block_height_offset(w->selected_list_item, 1);
|
2016-09-10 22:37:47 +02:00
|
|
|
}
|
|
|
|
else {
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, 1);
|
2016-09-10 22:37:47 +02:00
|
|
|
}
|
2016-06-05 22:07:11 +02:00
|
|
|
break;
|
|
|
|
case WIDX_TRACK_SPINNER_HEIGHT_DECREASE:
|
2016-09-10 22:37:47 +02:00
|
|
|
if (widget_is_pressed(w, WIDX_TRACK_CHECK_APPLY_TO_ALL)) {
|
2017-02-07 01:06:50 +01:00
|
|
|
window_tile_inspector_track_block_height_offset(w->selected_list_item, -1);
|
2016-09-10 22:37:47 +02:00
|
|
|
}
|
|
|
|
else {
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, -1);
|
2016-09-10 22:37:47 +02:00
|
|
|
}
|
2016-06-05 22:07:11 +02:00
|
|
|
break;
|
|
|
|
case WIDX_TRACK_CHECK_CHAIN_LIFT:
|
2017-02-07 01:06:50 +01:00
|
|
|
{
|
|
|
|
bool entire_track_block = widget_is_pressed(w, WIDX_TRACK_CHECK_APPLY_TO_ALL);
|
|
|
|
bool new_lift = !track_element_is_lift_hill(mapElement);
|
|
|
|
window_tile_inspector_track_block_set_lift(w->selected_list_item, entire_track_block, new_lift);
|
2016-06-05 22:07:11 +02:00
|
|
|
break;
|
2017-02-07 01:06:50 +01:00
|
|
|
}
|
2016-06-05 22:07:11 +02:00
|
|
|
} // switch widget index
|
|
|
|
break;
|
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_SCENERY:
|
2016-09-18 10:29:48 +02:00
|
|
|
switch (widgetIndex) {
|
|
|
|
case WIDX_SCENERY_SPINNER_HEIGHT_INCREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, 1);
|
2016-09-18 10:29:48 +02:00
|
|
|
break;
|
|
|
|
case WIDX_SCENERY_SPINNER_HEIGHT_DECREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, -1);
|
2016-09-18 10:29:48 +02:00
|
|
|
break;
|
|
|
|
case WIDX_SCENERY_CHECK_QUARTER_N:
|
|
|
|
case WIDX_SCENERY_CHECK_QUARTER_E:
|
|
|
|
case WIDX_SCENERY_CHECK_QUARTER_S:
|
|
|
|
case WIDX_SCENERY_CHECK_QUARTER_W:
|
2017-02-07 15:07:31 +01:00
|
|
|
window_tile_inspector_quarter_tile_set(w->selected_list_item, widgetIndex - WIDX_SCENERY_CHECK_QUARTER_N);
|
2016-09-18 10:29:48 +02:00
|
|
|
break;
|
|
|
|
case WIDX_SCENERY_CHECK_COLLISION_N:
|
|
|
|
case WIDX_SCENERY_CHECK_COLLISION_E:
|
|
|
|
case WIDX_SCENERY_CHECK_COLLISION_S:
|
|
|
|
case WIDX_SCENERY_CHECK_COLLISION_W:
|
2017-02-07 15:25:42 +01:00
|
|
|
window_tile_inspector_toggle_quadrant_collosion(w->selected_list_item, widgetIndex - WIDX_SCENERY_CHECK_COLLISION_N);
|
2016-09-18 10:29:48 +02:00
|
|
|
break;
|
2016-09-26 23:31:41 +02:00
|
|
|
} // switch widget index
|
2016-09-18 10:29:48 +02:00
|
|
|
break;
|
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_ENTRANCE:
|
2016-09-18 22:52:27 +02:00
|
|
|
switch (widgetIndex) {
|
|
|
|
case WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, 1);
|
2016-09-18 22:52:27 +02:00
|
|
|
break;
|
|
|
|
case WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, -1);
|
2016-09-18 22:52:27 +02:00
|
|
|
break;
|
|
|
|
} // switch widget index
|
2016-09-10 22:37:47 +02:00
|
|
|
break;
|
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_FENCE:
|
2016-09-10 22:37:47 +02:00
|
|
|
switch (widgetIndex) {
|
2016-09-11 23:02:34 +02:00
|
|
|
case WIDX_FENCE_SPINNER_HEIGHT_INCREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, 1);
|
2016-09-11 23:02:34 +02:00
|
|
|
break;
|
|
|
|
case WIDX_FENCE_SPINNER_HEIGHT_DECREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, -1);
|
2016-09-10 22:37:47 +02:00
|
|
|
break;
|
|
|
|
} // switch widget index
|
|
|
|
break;
|
2016-09-26 23:31:41 +02:00
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_LARGE_SCENERY:
|
2016-09-26 23:31:41 +02:00
|
|
|
switch (widgetIndex) {
|
|
|
|
case WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, 1);
|
2016-09-26 23:31:41 +02:00
|
|
|
break;
|
|
|
|
case WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, -1);
|
2016-09-26 23:31:41 +02:00
|
|
|
break;
|
|
|
|
} // switch widget index
|
|
|
|
break;
|
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_BANNER:
|
2016-09-26 23:31:41 +02:00
|
|
|
switch (widgetIndex) {
|
|
|
|
case WIDX_BANNER_SPINNER_HEIGHT_INCREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, 1);
|
2016-09-26 23:31:41 +02:00
|
|
|
break;
|
|
|
|
case WIDX_BANNER_SPINNER_HEIGHT_DECREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, -1);
|
2016-09-26 23:31:41 +02:00
|
|
|
break;
|
2016-10-05 00:21:23 +02:00
|
|
|
case WIDX_BANNER_CHECK_BLOCK_NE:
|
|
|
|
case WIDX_BANNER_CHECK_BLOCK_SE:
|
|
|
|
case WIDX_BANNER_CHECK_BLOCK_SW:
|
|
|
|
case WIDX_BANNER_CHECK_BLOCK_NW:
|
|
|
|
mapElement->properties.banner.flags ^= 1 << ((widgetIndex - WIDX_BANNER_CHECK_BLOCK_NE - get_current_rotation()) & 3);
|
|
|
|
map_invalidate_tile_full(windowTileInspectorTileX << 5, windowTileInspectorTileY << 5);
|
|
|
|
widget_invalidate(w, widgetIndex);
|
|
|
|
break;
|
2016-09-26 23:31:41 +02:00
|
|
|
} // switch widget index
|
|
|
|
break;
|
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_CORRUPT:
|
2016-09-26 23:31:41 +02:00
|
|
|
switch (widgetIndex) {
|
|
|
|
case WIDX_CORRUPT_SPINNER_HEIGHT_INCREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, 1);
|
2016-09-26 23:31:41 +02:00
|
|
|
break;
|
|
|
|
case WIDX_CORRUPT_SPINNER_HEIGHT_DECREASE:
|
2017-01-25 14:22:33 +01:00
|
|
|
window_tile_inspector_base_height_offset(w->selected_list_item, -1);
|
2016-09-26 23:31:41 +02:00
|
|
|
break;
|
2016-09-26 23:47:56 +02:00
|
|
|
case WIDX_CORRUPT_BUTTON_CLAMP:
|
2017-02-07 15:39:07 +01:00
|
|
|
window_tile_inspector_clamp_corrupt(w->selected_list_item);
|
2016-09-26 23:47:56 +02:00
|
|
|
break;
|
2016-09-26 23:31:41 +02:00
|
|
|
} // switch widget index
|
2016-05-30 00:35:50 +02:00
|
|
|
break;
|
|
|
|
} // switch page
|
2015-06-01 03:33:56 +02:00
|
|
|
}
|
|
|
|
|
2016-11-01 23:43:39 +01:00
|
|
|
static void window_tile_inspector_resize(rct_window *w)
|
|
|
|
{
|
2015-06-01 03:33:56 +02:00
|
|
|
w->min_width = WW;
|
|
|
|
w->min_height = MIN_WH;
|
|
|
|
if (w->width < w->min_width) {
|
|
|
|
window_invalidate(w);
|
|
|
|
w->width = w->min_width;
|
|
|
|
}
|
|
|
|
if (w->height < w->min_height) {
|
|
|
|
window_invalidate(w);
|
|
|
|
w->height = w->min_height;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_tile_inspector_mousedown(sint32 widgetIndex, rct_window *w, rct_widget* widget)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2016-10-01 22:57:09 +02:00
|
|
|
switch (w->page) {
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_FENCE:
|
2016-10-01 22:57:09 +02:00
|
|
|
switch (widgetIndex) {
|
|
|
|
case WIDX_FENCE_DROPDOWN_SLOPE_BUTTON:
|
|
|
|
// Use dropdown instead of dropdown button
|
|
|
|
widget--;
|
|
|
|
|
|
|
|
// Fill dropdown list
|
|
|
|
gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL;
|
|
|
|
gDropdownItemsFormat[1] = STR_DROPDOWN_MENU_LABEL;
|
|
|
|
gDropdownItemsFormat[2] = STR_DROPDOWN_MENU_LABEL;
|
|
|
|
gDropdownItemsArgs[0] = STR_TILE_INSPECTOR_FENCE_FLAT;
|
|
|
|
gDropdownItemsArgs[1] = STR_TILE_INSPECTOR_FENCE_SLOPED_LEFT;
|
|
|
|
gDropdownItemsArgs[2] = STR_TILE_INSPECTOR_FENCE_SLOPED_RIGHT;
|
|
|
|
window_dropdown_show_text_custom_width(
|
|
|
|
w->x + widget->left,
|
|
|
|
w->y + widget->top,
|
|
|
|
widget->bottom - widget->top + 1,
|
|
|
|
w->colours[1],
|
|
|
|
DROPDOWN_FLAG_STAY_OPEN,
|
|
|
|
3,
|
|
|
|
widget->right - widget->left - 3
|
|
|
|
);
|
|
|
|
|
|
|
|
// Set current value as checked
|
2016-10-02 19:23:04 +02:00
|
|
|
rct_map_element *const mapElement = window_tile_inspector_get_selected_element(w);
|
2016-10-01 22:57:09 +02:00
|
|
|
dropdown_set_checked((mapElement->type & 0xC0) >> 6, true);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-01 23:43:39 +01:00
|
|
|
static void window_tile_inspector_update(rct_window *w)
|
|
|
|
{
|
2015-12-28 23:11:36 +01:00
|
|
|
// Check if the mouse is hovering over the list
|
2016-05-30 00:35:50 +02:00
|
|
|
if (!widget_is_highlighted(w, WIDX_LIST)) {
|
2016-09-18 20:47:35 +02:00
|
|
|
windowTileInspectorHighlightedIndex = -1;
|
2015-12-28 23:11:36 +01:00
|
|
|
widget_invalidate(w, WIDX_LIST);
|
|
|
|
}
|
2016-07-06 19:26:14 +02:00
|
|
|
|
2016-09-18 16:07:07 +02:00
|
|
|
if (gCurrentToolWidget.window_classification != WC_TILE_INSPECTOR)
|
2016-07-06 19:26:14 +02:00
|
|
|
window_close(w);
|
2015-12-28 23:11:36 +01:00
|
|
|
}
|
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_tile_inspector_dropdown(rct_window *w, sint32 widgetIndex, sint32 dropdownIndex)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2016-10-01 22:57:09 +02:00
|
|
|
if (dropdownIndex == -1) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get selected element
|
2016-10-02 19:23:04 +02:00
|
|
|
rct_map_element *const mapElement = window_tile_inspector_get_selected_element(w);
|
2016-10-01 22:57:09 +02:00
|
|
|
|
|
|
|
switch (w->page) {
|
2017-02-06 17:43:29 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_FENCE:
|
|
|
|
openrct2_assert(map_element_get_type(mapElement) == MAP_ELEMENT_TYPE_FENCE, "Element is not a fence");
|
2016-10-01 22:57:09 +02:00
|
|
|
|
|
|
|
switch (widgetIndex) {
|
|
|
|
case WIDX_FENCE_DROPDOWN_SLOPE_BUTTON:
|
2017-02-02 20:06:27 +01:00
|
|
|
window_tile_inspector_fence_set_slope(w->selected_list_item, dropdownIndex << 6);
|
2016-10-01 22:57:09 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_tile_inspector_tool_update(rct_window* w, sint32 widgetIndex, sint32 x, sint32 y)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2015-06-01 03:33:56 +02:00
|
|
|
map_invalidate_selection_rect();
|
2016-10-16 22:56:44 +02:00
|
|
|
|
2016-06-05 00:45:13 +02:00
|
|
|
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE;
|
2015-06-01 03:33:56 +02:00
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
sint16 mapX = x;
|
|
|
|
sint16 mapY = y;
|
|
|
|
sint32 direction;
|
2015-07-13 22:43:54 +02:00
|
|
|
screen_pos_to_map_pos(&mapX, &mapY, &direction);
|
2017-01-12 19:20:22 +01:00
|
|
|
if (mapX != MAP_LOCATION_NULL) {
|
2016-10-16 22:56:44 +02:00
|
|
|
gMapSelectPositionA.x = gMapSelectPositionB.x = mapX;
|
|
|
|
gMapSelectPositionA.y = gMapSelectPositionB.y = mapY;
|
|
|
|
}
|
|
|
|
else if (windowTileInspectorTileSelected){
|
2016-09-18 20:47:35 +02:00
|
|
|
gMapSelectPositionA.x = gMapSelectPositionB.x = windowTileInspectorTileX << 5;
|
|
|
|
gMapSelectPositionA.y = gMapSelectPositionB.y = windowTileInspectorTileY << 5;
|
2016-06-05 00:45:13 +02:00
|
|
|
}
|
|
|
|
else {
|
2016-10-16 22:56:44 +02:00
|
|
|
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
|
2015-06-01 03:33:56 +02:00
|
|
|
}
|
|
|
|
|
2016-05-14 01:54:13 +02:00
|
|
|
gMapSelectType = MAP_SELECT_TYPE_FULL;
|
2015-06-01 03:33:56 +02:00
|
|
|
map_invalidate_selection_rect();
|
|
|
|
}
|
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_tile_inspector_update_selected_tile(rct_window *w, sint32 x, sint32 y)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2017-02-02 21:28:18 +01:00
|
|
|
// Mouse hasn't moved
|
2017-01-09 20:30:42 +01:00
|
|
|
if (x == windowTileInspectorToolMouseX && y == windowTileInspectorToolMouseY) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
windowTileInspectorToolMouseX = x;
|
|
|
|
windowTileInspectorToolMouseY = y;
|
|
|
|
|
2017-01-13 20:28:02 +01:00
|
|
|
sint16 mapX = x;
|
|
|
|
sint16 mapY = y;
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 direction;
|
2015-07-10 02:39:16 +02:00
|
|
|
screen_pos_to_map_pos(&mapX, &mapY, &direction);
|
2017-01-12 19:20:22 +01:00
|
|
|
if (mapX == MAP_LOCATION_NULL) {
|
2015-06-01 03:33:56 +02:00
|
|
|
return;
|
|
|
|
}
|
2017-02-02 21:28:18 +01:00
|
|
|
|
|
|
|
// Tile is already selected
|
|
|
|
if (windowTileInspectorTileSelected && mapX == windowTileInspectorToolMapX && mapY == windowTileInspectorToolMapY) {
|
2017-01-09 20:30:42 +01:00
|
|
|
return;
|
|
|
|
}
|
2015-06-01 03:33:56 +02:00
|
|
|
|
2016-10-09 15:14:56 +02:00
|
|
|
windowTileInspectorTileSelected = true;
|
2017-02-02 21:28:18 +01:00
|
|
|
windowTileInspectorToolMapX = mapX;
|
|
|
|
windowTileInspectorToolMapY = mapY;
|
2016-09-18 20:47:35 +02:00
|
|
|
windowTileInspectorTileX = mapX >> 5;
|
|
|
|
windowTileInspectorTileY = mapY >> 5;
|
2015-06-01 03:33:56 +02:00
|
|
|
|
2016-06-05 00:45:13 +02:00
|
|
|
window_tile_inspector_load_tile(w);
|
|
|
|
window_tile_inspector_auto_set_buttons(w);
|
2015-06-01 03:33:56 +02:00
|
|
|
}
|
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_tile_inspector_tool_down(rct_window* w, sint32 widgetIndex, sint32 x, sint32 y)
|
2017-01-09 20:30:42 +01:00
|
|
|
{
|
|
|
|
window_tile_inspector_update_selected_tile(w, x, y);
|
|
|
|
}
|
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_tile_inspector_tool_drag(rct_window* w, sint32 widgetIndex, sint32 x, sint32 y)
|
2017-01-09 20:30:42 +01:00
|
|
|
{
|
|
|
|
window_tile_inspector_update_selected_tile(w, x, y);
|
|
|
|
}
|
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_tile_inspector_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2015-07-10 02:39:16 +02:00
|
|
|
*width = WW - 30;
|
2016-09-18 20:47:35 +02:00
|
|
|
*height = windowTileInspectorElementCount * LIST_ITEM_HEIGHT;
|
2015-12-28 23:11:36 +01:00
|
|
|
}
|
|
|
|
|
2017-01-15 13:53:19 +01:00
|
|
|
void window_tile_inspector_set_page(rct_window *w, const tile_inspector_page page)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2016-06-11 19:39:51 +02:00
|
|
|
w->page = page;
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets = tileInspectorWidgets[page];
|
|
|
|
w->enabled_widgets = windowTileInspectorEnabledWidgets[page];
|
|
|
|
w->disabled_widgets = windowTileInspectorDisabledWidgets[page];
|
2016-06-11 19:39:51 +02:00
|
|
|
}
|
|
|
|
|
2017-01-15 13:53:19 +01:00
|
|
|
void window_tile_inspector_auto_set_buttons(rct_window *w)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2016-06-05 00:45:13 +02:00
|
|
|
// X and Y spinners
|
2016-10-09 15:14:56 +02:00
|
|
|
widget_set_enabled(w, WIDX_SPINNER_X_INCREASE, (windowTileInspectorTileSelected && (windowTileInspectorTileX < 255)));
|
|
|
|
widget_set_enabled(w, WIDX_SPINNER_X_DECREASE, (windowTileInspectorTileSelected && (windowTileInspectorTileX > 0)));
|
|
|
|
widget_set_enabled(w, WIDX_SPINNER_Y_INCREASE, (windowTileInspectorTileSelected && (windowTileInspectorTileY < 255)));
|
|
|
|
widget_set_enabled(w, WIDX_SPINNER_Y_DECREASE, (windowTileInspectorTileSelected && (windowTileInspectorTileY > 0)));
|
2016-06-05 00:45:13 +02:00
|
|
|
|
2016-06-11 19:39:51 +02:00
|
|
|
// Sort buttons
|
2016-10-09 15:14:56 +02:00
|
|
|
widget_set_enabled(w, WIDX_BUTTON_SORT, (windowTileInspectorTileSelected && windowTileInspectorElementCount > 1));
|
2016-04-17 00:55:56 +02:00
|
|
|
|
2015-12-29 17:55:35 +01:00
|
|
|
// Move Up button
|
2016-06-11 19:39:51 +02:00
|
|
|
widget_set_enabled(w, WIDX_BUTTON_MOVE_UP, (w->selected_list_item > 0));
|
|
|
|
widget_invalidate(w, WIDX_BUTTON_MOVE_UP);
|
2015-12-28 23:11:36 +01:00
|
|
|
|
2015-12-29 17:55:35 +01:00
|
|
|
// Move Down button
|
2016-09-18 20:47:35 +02:00
|
|
|
widget_set_enabled(w, WIDX_BUTTON_MOVE_DOWN, (w->selected_list_item != -1 && w->selected_list_item < windowTileInspectorElementCount - 1));
|
2016-06-11 19:39:51 +02:00
|
|
|
widget_invalidate(w, WIDX_BUTTON_MOVE_DOWN);
|
2016-10-02 19:23:04 +02:00
|
|
|
|
2016-10-23 20:40:23 +02:00
|
|
|
// Copy button
|
|
|
|
widget_set_enabled(w, WIDX_BUTTON_COPY, w->selected_list_item >= 0);
|
|
|
|
widget_invalidate(w, WIDX_BUTTON_COPY);
|
|
|
|
|
|
|
|
// Paste button
|
|
|
|
widget_set_enabled(w, WIDX_BUTTON_PASTE, windowTileInspectorTileSelected && windowTileInspectorElementCopied);
|
|
|
|
widget_invalidate(w, WIDX_BUTTON_PASTE);
|
|
|
|
|
2016-10-02 19:23:04 +02:00
|
|
|
// Page widgets
|
|
|
|
switch (w->page) {
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_FENCE: {
|
2016-10-02 19:23:04 +02:00
|
|
|
const rct_map_element *const mapElement = window_tile_inspector_get_selected_element(w);
|
|
|
|
const uint8 fenceType = mapElement->properties.fence.type;
|
|
|
|
const rct_wall_scenery_entry wallEntry = get_wall_entry(fenceType)->wall;
|
|
|
|
const bool canBeSloped = !(wallEntry.flags & WALL_SCENERY_CANT_BUILD_ON_SLOPE);
|
2016-10-23 20:40:23 +02:00
|
|
|
// Fence slope dropdown
|
2016-10-02 19:23:04 +02:00
|
|
|
widget_set_enabled(w, WIDX_FENCE_DROPDOWN_SLOPE, canBeSloped);
|
|
|
|
widget_invalidate(w, WIDX_FENCE_DROPDOWN_SLOPE);
|
|
|
|
widget_set_enabled(w, WIDX_FENCE_DROPDOWN_SLOPE_BUTTON, canBeSloped);
|
|
|
|
widget_invalidate(w, WIDX_FENCE_DROPDOWN_SLOPE_BUTTON);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} // switch page
|
2015-12-28 23:11:36 +01:00
|
|
|
}
|
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_tile_inspector_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2016-06-11 19:39:51 +02:00
|
|
|
// Because the list items are displayed in reverse order, subtract the calculated index from the amount of elements
|
2016-09-18 20:47:35 +02:00
|
|
|
const sint16 index = windowTileInspectorElementCount - (y - 1) / LIST_ITEM_HEIGHT - 1;
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 page;
|
2016-09-18 20:47:35 +02:00
|
|
|
if (index < 0 || index >= windowTileInspectorElementCount) {
|
2016-05-29 16:12:53 +02:00
|
|
|
w->selected_list_item = -1;
|
2016-06-11 19:39:51 +02:00
|
|
|
page = 0;
|
2016-05-29 16:12:53 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
w->selected_list_item = index;
|
|
|
|
|
2016-06-11 19:39:51 +02:00
|
|
|
// Get type of selected map element to select the correct page
|
2016-10-02 19:23:04 +02:00
|
|
|
rct_map_element *const mapElement = window_tile_inspector_get_selected_element(w);
|
2016-06-11 19:39:51 +02:00
|
|
|
page = (min(map_element_get_type(mapElement), MAP_ELEMENT_TYPE_CORRUPT) >> 2) + 1;
|
2016-05-29 16:12:53 +02:00
|
|
|
}
|
|
|
|
|
2016-06-11 19:39:51 +02:00
|
|
|
window_tile_inspector_set_page(w, page);
|
2015-12-28 23:11:36 +01:00
|
|
|
|
2015-12-29 17:55:35 +01:00
|
|
|
// Enable/disable buttons
|
|
|
|
window_tile_inspector_auto_set_buttons(w);
|
2016-05-29 16:12:53 +02:00
|
|
|
window_invalidate(w);
|
2015-06-01 03:33:56 +02:00
|
|
|
}
|
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_tile_inspector_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2016-09-18 20:47:35 +02:00
|
|
|
sint16 index = windowTileInspectorElementCount - (y - 1) / LIST_ITEM_HEIGHT - 1;
|
|
|
|
if (index < 0 || index >= windowTileInspectorElementCount)
|
|
|
|
windowTileInspectorHighlightedIndex = -1;
|
2015-12-28 23:11:36 +01:00
|
|
|
else
|
2016-09-18 20:47:35 +02:00
|
|
|
windowTileInspectorHighlightedIndex = index;
|
2015-12-28 23:11:36 +01:00
|
|
|
|
|
|
|
widget_invalidate(w, WIDX_LIST);
|
2015-06-01 03:33:56 +02:00
|
|
|
}
|
|
|
|
|
2016-11-01 23:43:39 +01:00
|
|
|
static void window_tile_inspector_invalidate(rct_window *w)
|
|
|
|
{
|
2016-01-30 15:00:41 +01:00
|
|
|
colour_scheme_update(w);
|
|
|
|
|
2016-05-29 16:12:53 +02:00
|
|
|
w->widgets[WIDX_BACKGROUND].bottom = w->height - 1;
|
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
if (w->page == TILE_INSPECTOR_PAGE_DEFAULT) {
|
2016-05-31 20:13:26 +02:00
|
|
|
w->widgets[WIDX_GROUPBOX_DETAILS].type = WWT_EMPTY;
|
|
|
|
w->widgets[WIDX_GROUPBOX_PROPERTIES].type = WWT_EMPTY;
|
|
|
|
w->widgets[WIDX_LIST].bottom = w->height - PADDING_BOTTOM;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
w->widgets[WIDX_GROUPBOX_DETAILS].type = WWT_GROUPBOX;
|
|
|
|
w->widgets[WIDX_GROUPBOX_PROPERTIES].type = WWT_GROUPBOX;
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_GROUPBOX_DETAILS].image = pageGroupBoxSettings[w->page - 1].string_idx;
|
|
|
|
w->widgets[WIDX_GROUPBOX_DETAILS].top = w->height - pageGroupBoxSettings[w->page - 1].detailsTopOffset;
|
|
|
|
w->widgets[WIDX_GROUPBOX_DETAILS].bottom = w->height - pageGroupBoxSettings[w->page - 1].detailsBottomOffset;
|
|
|
|
w->widgets[WIDX_GROUPBOX_PROPERTIES].top = w->height - pageGroupBoxSettings[w->page - 1].properties_top_offset;
|
|
|
|
w->widgets[WIDX_GROUPBOX_PROPERTIES].bottom = w->height - pageGroupBoxSettings[w->page - 1].properties_bottom_offset;
|
2016-05-31 20:13:26 +02:00
|
|
|
w->widgets[WIDX_LIST].bottom = w->widgets[WIDX_GROUPBOX_DETAILS].top - GROUPBOX_PADDING;
|
|
|
|
}
|
|
|
|
|
2016-09-18 14:30:34 +02:00
|
|
|
// Only page-specific widgets related to the map element will be
|
2017-01-26 19:06:49 +01:00
|
|
|
if (w->page == TILE_INSPECTOR_PAGE_DEFAULT) {
|
2016-09-18 14:30:34 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-05-31 20:13:26 +02:00
|
|
|
// Using a switch, because I don't think giving each page their own callbacks is
|
2016-10-09 00:04:26 +02:00
|
|
|
// needed here, as only the mouseup and invalidate functions are different.
|
2017-01-04 22:17:08 +01:00
|
|
|
const sint32 propertiesAnchor = w->widgets[WIDX_GROUPBOX_PROPERTIES].top;
|
2016-10-02 19:23:04 +02:00
|
|
|
rct_map_element *const mapElement = window_tile_inspector_get_selected_element(w);
|
2016-09-18 14:30:34 +02:00
|
|
|
|
2016-05-29 16:12:53 +02:00
|
|
|
switch (w->page) {
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_SURFACE:
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_SURFACE_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3;
|
|
|
|
w->widgets[WIDX_SURFACE_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3;
|
|
|
|
w->widgets[WIDX_SURFACE_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4;
|
|
|
|
w->widgets[WIDX_SURFACE_SPINNER_HEIGHT_INCREASE].bottom = GBBT(propertiesAnchor, 0) + 8;
|
|
|
|
w->widgets[WIDX_SURFACE_SPINNER_HEIGHT_DECREASE].top = GBBB(propertiesAnchor, 0) - 8;
|
|
|
|
w->widgets[WIDX_SURFACE_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4;
|
|
|
|
w->widgets[WIDX_SURFACE_BUTTON_REMOVE_FENCES].top = GBBT(propertiesAnchor, 1);
|
|
|
|
w->widgets[WIDX_SURFACE_BUTTON_REMOVE_FENCES].bottom = GBBB(propertiesAnchor, 1);
|
|
|
|
w->widgets[WIDX_SURFACE_BUTTON_RESTORE_FENCES].top = GBBT(propertiesAnchor, 1);
|
|
|
|
w->widgets[WIDX_SURFACE_BUTTON_RESTORE_FENCES].bottom = GBBB(propertiesAnchor, 1);
|
|
|
|
w->widgets[WIDX_SURFACE_CHECK_CORNER_N].top = GBBT(propertiesAnchor, 2) + 7 * 0;
|
2016-09-18 14:30:34 +02:00
|
|
|
w->widgets[WIDX_SURFACE_CHECK_CORNER_N].bottom = w->widgets[WIDX_SURFACE_CHECK_CORNER_N].top + 13;
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_SURFACE_CHECK_CORNER_E].top = GBBT(propertiesAnchor, 2) + 7 * 1;
|
2016-09-18 14:30:34 +02:00
|
|
|
w->widgets[WIDX_SURFACE_CHECK_CORNER_E].bottom = w->widgets[WIDX_SURFACE_CHECK_CORNER_E].top + 13;
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_SURFACE_CHECK_CORNER_S].top = GBBT(propertiesAnchor, 2) + 7 * 2;
|
2016-09-18 14:30:34 +02:00
|
|
|
w->widgets[WIDX_SURFACE_CHECK_CORNER_S].bottom = w->widgets[WIDX_SURFACE_CHECK_CORNER_S].top + 13;
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_SURFACE_CHECK_CORNER_W].top = GBBT(propertiesAnchor, 2) + 7 * 1;
|
2016-09-18 14:30:34 +02:00
|
|
|
w->widgets[WIDX_SURFACE_CHECK_CORNER_W].bottom = w->widgets[WIDX_SURFACE_CHECK_CORNER_W].top + 13;
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_SURFACE_CHECK_DIAGONAL].top = GBBT(propertiesAnchor, 3) + 7 * 1;
|
2016-09-18 15:52:03 +02:00
|
|
|
w->widgets[WIDX_SURFACE_CHECK_DIAGONAL].bottom = w->widgets[WIDX_SURFACE_CHECK_DIAGONAL].top + 13;
|
2016-10-02 22:26:49 +02:00
|
|
|
widget_set_checkbox_value(w, WIDX_SURFACE_CHECK_CORNER_N, mapElement->properties.surface.slope & (1 << ((2 - get_current_rotation()) & 3)));
|
|
|
|
widget_set_checkbox_value(w, WIDX_SURFACE_CHECK_CORNER_E, mapElement->properties.surface.slope & (1 << ((3 - get_current_rotation()) & 3)));
|
|
|
|
widget_set_checkbox_value(w, WIDX_SURFACE_CHECK_CORNER_S, mapElement->properties.surface.slope & (1 << ((0 - get_current_rotation()) & 3)));
|
|
|
|
widget_set_checkbox_value(w, WIDX_SURFACE_CHECK_CORNER_W, mapElement->properties.surface.slope & (1 << ((1 - get_current_rotation()) & 3)));
|
2016-09-18 14:30:34 +02:00
|
|
|
widget_set_checkbox_value(w, WIDX_SURFACE_CHECK_DIAGONAL, mapElement->properties.surface.slope & 0x10);
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_PATH:
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_PATH_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3;
|
|
|
|
w->widgets[WIDX_PATH_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3;
|
|
|
|
w->widgets[WIDX_PATH_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4;
|
|
|
|
w->widgets[WIDX_PATH_SPINNER_HEIGHT_INCREASE].bottom = GBBT(propertiesAnchor, 0) + 8;
|
|
|
|
w->widgets[WIDX_PATH_SPINNER_HEIGHT_DECREASE].top = GBBB(propertiesAnchor, 0) - 8;
|
|
|
|
w->widgets[WIDX_PATH_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4;
|
2017-02-05 17:33:21 +01:00
|
|
|
w->widgets[WIDX_PATH_CHECK_SLOPED].top = GBBT(propertiesAnchor, 1) + 2;
|
|
|
|
w->widgets[WIDX_PATH_CHECK_SLOPED].bottom = GBBT(propertiesAnchor, 1) + 15;
|
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_N].top = GBBT(propertiesAnchor, 2) + 7 * 0;
|
2016-06-01 22:31:10 +02:00
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_N].bottom = w->widgets[WIDX_PATH_CHECK_EDGE_N].top + 13;
|
2017-02-05 17:33:21 +01:00
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_NE].top = GBBT(propertiesAnchor, 2) + 7 * 1;
|
2016-06-01 22:31:10 +02:00
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_NE].bottom = w->widgets[WIDX_PATH_CHECK_EDGE_NE].top + 13;
|
2017-02-05 17:33:21 +01:00
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_E].top = GBBT(propertiesAnchor, 2) + 7 * 2;
|
2016-06-01 22:31:10 +02:00
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_E].bottom = w->widgets[WIDX_PATH_CHECK_EDGE_E].top + 13;
|
2017-02-05 17:33:21 +01:00
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_SE].top = GBBT(propertiesAnchor, 2) + 7 * 3;
|
2016-06-01 22:31:10 +02:00
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_SE].bottom = w->widgets[WIDX_PATH_CHECK_EDGE_SE].top + 13;
|
2017-02-05 17:33:21 +01:00
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_S].top = GBBT(propertiesAnchor, 2) + 7 * 4;
|
2016-06-01 22:31:10 +02:00
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_S].bottom = w->widgets[WIDX_PATH_CHECK_EDGE_S].top + 13;
|
2017-02-05 17:33:21 +01:00
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_SW].top = GBBT(propertiesAnchor, 2) + 7 * 3;
|
2016-06-01 22:31:10 +02:00
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_SW].bottom = w->widgets[WIDX_PATH_CHECK_EDGE_SW].top + 13;
|
2017-02-05 17:33:21 +01:00
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_W].top = GBBT(propertiesAnchor, 2) + 7 * 2;
|
2016-06-01 22:31:10 +02:00
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_W].bottom = w->widgets[WIDX_PATH_CHECK_EDGE_W].top + 13;
|
2017-02-05 17:33:21 +01:00
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_NW].top = GBBT(propertiesAnchor, 2) + 7 * 1;
|
2016-06-01 22:31:10 +02:00
|
|
|
w->widgets[WIDX_PATH_CHECK_EDGE_NW].bottom = w->widgets[WIDX_PATH_CHECK_EDGE_NW].top + 13;
|
2017-02-05 17:33:21 +01:00
|
|
|
widget_set_checkbox_value(w, WIDX_PATH_CHECK_SLOPED, footpath_element_is_sloped(mapElement));
|
2016-10-02 22:26:49 +02:00
|
|
|
widget_set_checkbox_value(w, WIDX_PATH_CHECK_EDGE_NE, mapElement->properties.path.edges & (1 << ((0 - get_current_rotation()) & 3)));
|
|
|
|
widget_set_checkbox_value(w, WIDX_PATH_CHECK_EDGE_SE, mapElement->properties.path.edges & (1 << ((1 - get_current_rotation()) & 3)));
|
|
|
|
widget_set_checkbox_value(w, WIDX_PATH_CHECK_EDGE_SW, mapElement->properties.path.edges & (1 << ((2 - get_current_rotation()) & 3)));
|
|
|
|
widget_set_checkbox_value(w, WIDX_PATH_CHECK_EDGE_NW, mapElement->properties.path.edges & (1 << ((3 - get_current_rotation()) & 3)));
|
2016-10-08 22:46:04 +02:00
|
|
|
widget_set_checkbox_value(w, WIDX_PATH_CHECK_EDGE_E, mapElement->properties.path.edges & (1 << (4 + ((0 - get_current_rotation()) & 3))));
|
|
|
|
widget_set_checkbox_value(w, WIDX_PATH_CHECK_EDGE_S, mapElement->properties.path.edges & (1 << (4 + ((1 - get_current_rotation()) & 3))));
|
|
|
|
widget_set_checkbox_value(w, WIDX_PATH_CHECK_EDGE_W, mapElement->properties.path.edges & (1 << (4 + ((2 - get_current_rotation()) & 3))));
|
|
|
|
widget_set_checkbox_value(w, WIDX_PATH_CHECK_EDGE_N, mapElement->properties.path.edges & (1 << (4 + ((3 - get_current_rotation()) & 3))));
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_TRACK:
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_TRACK_CHECK_APPLY_TO_ALL].top = GBBT(propertiesAnchor, 0);
|
|
|
|
w->widgets[WIDX_TRACK_CHECK_APPLY_TO_ALL].bottom = GBBB(propertiesAnchor, 0);
|
|
|
|
w->widgets[WIDX_TRACK_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 1) + 3;
|
|
|
|
w->widgets[WIDX_TRACK_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 1) - 3;
|
|
|
|
w->widgets[WIDX_TRACK_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 1) + 4;
|
|
|
|
w->widgets[WIDX_TRACK_SPINNER_HEIGHT_INCREASE].bottom = GBBT(propertiesAnchor, 1) + 8;
|
|
|
|
w->widgets[WIDX_TRACK_SPINNER_HEIGHT_DECREASE].top = GBBB(propertiesAnchor, 1) - 8;
|
|
|
|
w->widgets[WIDX_TRACK_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 1) - 4;
|
|
|
|
w->widgets[WIDX_TRACK_CHECK_CHAIN_LIFT].top = GBBT(propertiesAnchor, 2);
|
|
|
|
w->widgets[WIDX_TRACK_CHECK_CHAIN_LIFT].bottom = GBBB(propertiesAnchor, 2);
|
|
|
|
widget_set_checkbox_value(w, WIDX_TRACK_CHECK_APPLY_TO_ALL, windowTileInspectorApplyToAll);
|
2016-06-05 22:07:11 +02:00
|
|
|
widget_set_checkbox_value(w, WIDX_TRACK_CHECK_CHAIN_LIFT, track_element_is_lift_hill(mapElement));
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_SCENERY: {
|
2016-09-18 10:29:48 +02:00
|
|
|
// Raise / Lower
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_SCENERY_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3;
|
|
|
|
w->widgets[WIDX_SCENERY_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3;
|
|
|
|
w->widgets[WIDX_SCENERY_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4;
|
|
|
|
w->widgets[WIDX_SCENERY_SPINNER_HEIGHT_INCREASE].bottom = GBBT(propertiesAnchor, 0) + 8;
|
|
|
|
w->widgets[WIDX_SCENERY_SPINNER_HEIGHT_DECREASE].top = GBBB(propertiesAnchor, 0) - 8;
|
|
|
|
w->widgets[WIDX_SCENERY_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4;
|
2016-09-18 10:29:48 +02:00
|
|
|
|
|
|
|
// Quadrant checkboxes
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_QUARTER_N].top = GBBT(propertiesAnchor, 1) - 5 + 7 * 0;
|
2016-09-18 10:29:48 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_QUARTER_N].bottom = w->widgets[WIDX_SCENERY_CHECK_QUARTER_N].top + 13;
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_QUARTER_E].top = GBBT(propertiesAnchor, 1) - 5 + 7 * 1;
|
2016-09-18 10:29:48 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_QUARTER_E].bottom = w->widgets[WIDX_SCENERY_CHECK_QUARTER_E].top + 13;
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_QUARTER_S].top = GBBT(propertiesAnchor, 1) - 5 + 7 * 2;
|
2016-09-18 10:29:48 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_QUARTER_S].bottom = w->widgets[WIDX_SCENERY_CHECK_QUARTER_S].top + 13;
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_QUARTER_W].top = GBBT(propertiesAnchor, 1) - 5 + 7 * 1;
|
2016-09-18 10:29:48 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_QUARTER_W].bottom = w->widgets[WIDX_SCENERY_CHECK_QUARTER_W].top + 13;
|
|
|
|
// This gets the relative rotation, by subtracting the camera's rotation, and wrapping it between 0-3 inclusive
|
2016-10-02 22:26:49 +02:00
|
|
|
bool N = (mapElement->type & MAP_ELEMENT_QUADRANT_MASK) == ((0 - get_current_rotation()) & 3) << 6;
|
|
|
|
bool E = (mapElement->type & MAP_ELEMENT_QUADRANT_MASK) == ((1 - get_current_rotation()) & 3) << 6;
|
|
|
|
bool S = (mapElement->type & MAP_ELEMENT_QUADRANT_MASK) == ((2 - get_current_rotation()) & 3) << 6;
|
|
|
|
bool W = (mapElement->type & MAP_ELEMENT_QUADRANT_MASK) == ((3 - get_current_rotation()) & 3) << 6;
|
2016-09-18 10:29:48 +02:00
|
|
|
widget_set_checkbox_value(w, WIDX_SCENERY_CHECK_QUARTER_N, N);
|
|
|
|
widget_set_checkbox_value(w, WIDX_SCENERY_CHECK_QUARTER_E, E);
|
|
|
|
widget_set_checkbox_value(w, WIDX_SCENERY_CHECK_QUARTER_S, S);
|
|
|
|
widget_set_checkbox_value(w, WIDX_SCENERY_CHECK_QUARTER_W, W);
|
|
|
|
|
|
|
|
// Collision checkboxes
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_COLLISION_N].top = GBBT(propertiesAnchor, 2) + 5 + 7 * 0;
|
2016-09-18 10:29:48 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_COLLISION_N].bottom = w->widgets[WIDX_SCENERY_CHECK_COLLISION_N].top + 13;
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_COLLISION_E].top = GBBT(propertiesAnchor, 2) + 5 + 7 * 1;
|
2016-09-18 10:29:48 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_COLLISION_E].bottom = w->widgets[WIDX_SCENERY_CHECK_COLLISION_E].top + 13;
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_COLLISION_S].top = GBBT(propertiesAnchor, 2) + 5 + 7 * 2;
|
2016-09-18 10:29:48 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_COLLISION_S].bottom = w->widgets[WIDX_SCENERY_CHECK_COLLISION_S].top + 13;
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_COLLISION_W].top = GBBT(propertiesAnchor, 2) + 5 + 7 * 1;
|
2016-09-18 10:29:48 +02:00
|
|
|
w->widgets[WIDX_SCENERY_CHECK_COLLISION_W].bottom = w->widgets[WIDX_SCENERY_CHECK_COLLISION_W].top + 13;
|
2016-10-02 22:26:49 +02:00
|
|
|
N = mapElement->flags & (1 << ((2 - get_current_rotation()) & 3));
|
|
|
|
E = mapElement->flags & (1 << ((3 - get_current_rotation()) & 3));
|
|
|
|
S = mapElement->flags & (1 << ((0 - get_current_rotation()) & 3));
|
|
|
|
W = mapElement->flags & (1 << ((1 - get_current_rotation()) & 3));
|
2016-09-18 10:29:48 +02:00
|
|
|
widget_set_checkbox_value(w, WIDX_SCENERY_CHECK_COLLISION_N, N);
|
|
|
|
widget_set_checkbox_value(w, WIDX_SCENERY_CHECK_COLLISION_E, E);
|
|
|
|
widget_set_checkbox_value(w, WIDX_SCENERY_CHECK_COLLISION_S, S);
|
|
|
|
widget_set_checkbox_value(w, WIDX_SCENERY_CHECK_COLLISION_W, W);
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
2016-09-18 10:29:48 +02:00
|
|
|
}
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_ENTRANCE:
|
2016-09-18 22:52:27 +02:00
|
|
|
w->widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3;
|
|
|
|
w->widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3;
|
|
|
|
w->widgets[WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4;
|
|
|
|
w->widgets[WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE].bottom = GBBT(propertiesAnchor, 0) + 8;
|
|
|
|
w->widgets[WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE].top = GBBB(propertiesAnchor, 0) - 8;
|
|
|
|
w->widgets[WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4;
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_FENCE:
|
2016-09-18 20:47:35 +02:00
|
|
|
w->widgets[WIDX_FENCE_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3;
|
|
|
|
w->widgets[WIDX_FENCE_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3;
|
|
|
|
w->widgets[WIDX_FENCE_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4;
|
|
|
|
w->widgets[WIDX_FENCE_SPINNER_HEIGHT_INCREASE].bottom = GBBT(propertiesAnchor, 0) + 8;
|
|
|
|
w->widgets[WIDX_FENCE_SPINNER_HEIGHT_DECREASE].top = GBBB(propertiesAnchor, 0) - 8;
|
|
|
|
w->widgets[WIDX_FENCE_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4;
|
2016-10-01 22:57:09 +02:00
|
|
|
w->widgets[WIDX_FENCE_DROPDOWN_SLOPE].top = GBBT(propertiesAnchor, 1) + 3;
|
|
|
|
w->widgets[WIDX_FENCE_DROPDOWN_SLOPE].bottom = GBBB(propertiesAnchor, 1) - 3;
|
|
|
|
w->widgets[WIDX_FENCE_DROPDOWN_SLOPE].text = fenceSlopeStringIds[(mapElement->type & 0xC0) >> 6];
|
|
|
|
w->widgets[WIDX_FENCE_DROPDOWN_SLOPE_BUTTON].top = GBBT(propertiesAnchor, 1) + 4;
|
|
|
|
w->widgets[WIDX_FENCE_DROPDOWN_SLOPE_BUTTON].bottom = GBBB(propertiesAnchor, 1) - 4;
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_LARGE_SCENERY:
|
2016-09-26 23:31:41 +02:00
|
|
|
w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3;
|
|
|
|
w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3;
|
|
|
|
w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4;
|
|
|
|
w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE].bottom = GBBT(propertiesAnchor, 0) + 8;
|
|
|
|
w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE].top = GBBB(propertiesAnchor, 0) - 8;
|
|
|
|
w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4;
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_BANNER:
|
2016-09-26 23:31:41 +02:00
|
|
|
w->widgets[WIDX_BANNER_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3;
|
|
|
|
w->widgets[WIDX_BANNER_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3;
|
|
|
|
w->widgets[WIDX_BANNER_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4;
|
|
|
|
w->widgets[WIDX_BANNER_SPINNER_HEIGHT_INCREASE].bottom = GBBT(propertiesAnchor, 0) + 8;
|
|
|
|
w->widgets[WIDX_BANNER_SPINNER_HEIGHT_DECREASE].top = GBBB(propertiesAnchor, 0) - 8;
|
|
|
|
w->widgets[WIDX_BANNER_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4;
|
2016-10-05 00:21:23 +02:00
|
|
|
widget_set_checkbox_value(w, WIDX_BANNER_CHECK_BLOCK_NE, !(mapElement->properties.banner.flags & (1 << ((0 - get_current_rotation()) & 3))));
|
|
|
|
widget_set_checkbox_value(w, WIDX_BANNER_CHECK_BLOCK_SE, !(mapElement->properties.banner.flags & (1 << ((1 - get_current_rotation()) & 3))));
|
|
|
|
widget_set_checkbox_value(w, WIDX_BANNER_CHECK_BLOCK_SW, !(mapElement->properties.banner.flags & (1 << ((2 - get_current_rotation()) & 3))));
|
|
|
|
widget_set_checkbox_value(w, WIDX_BANNER_CHECK_BLOCK_NW, !(mapElement->properties.banner.flags & (1 << ((3 - get_current_rotation()) & 3))));
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_CORRUPT:
|
2016-09-26 23:31:41 +02:00
|
|
|
w->widgets[WIDX_CORRUPT_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3;
|
|
|
|
w->widgets[WIDX_CORRUPT_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3;
|
|
|
|
w->widgets[WIDX_CORRUPT_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4;
|
|
|
|
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;
|
2016-09-26 23:47:56 +02:00
|
|
|
w->widgets[WIDX_CORRUPT_BUTTON_CLAMP].top = GBBT(propertiesAnchor, 1);
|
|
|
|
w->widgets[WIDX_CORRUPT_BUTTON_CLAMP].bottom = GBBB(propertiesAnchor, 1);
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
|
|
|
}
|
2015-06-01 03:33:56 +02:00
|
|
|
}
|
|
|
|
|
2016-11-01 23:43:39 +01:00
|
|
|
static void window_tile_inspector_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|
|
|
{
|
2015-06-01 03:33:56 +02:00
|
|
|
window_draw_widgets(w, dpi);
|
|
|
|
|
2016-01-01 20:06:00 +01:00
|
|
|
// Set medium font size
|
2016-04-26 00:00:58 +02:00
|
|
|
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
|
2016-01-01 20:06:00 +01:00
|
|
|
|
|
|
|
// Draw column headers
|
|
|
|
rct_widget *widget;
|
2016-09-18 16:07:07 +02:00
|
|
|
if ((widget = &w->widgets[WIDX_COLUMN_TYPE])->type != WWT_EMPTY) {
|
2016-05-15 23:03:53 +02:00
|
|
|
gfx_draw_string_left_clipped(dpi, STR_TILE_INSPECTOR_ELEMENT_TYPE, gCommonFormatArgs, w->colours[1], w->x + widget->left + 1, w->y + widget->top + 1, widget->right - widget->left);
|
2016-01-01 20:06:00 +01:00
|
|
|
}
|
2016-05-30 00:35:50 +02:00
|
|
|
if ((widget = &w->widgets[WIDX_COLUMN_BASEHEIGHT])->type != WWT_EMPTY) {
|
2016-05-15 23:03:53 +02:00
|
|
|
gfx_draw_string_left_clipped(dpi, STR_TILE_INSPECTOR_BASE_HEIGHT_SHORT, gCommonFormatArgs, w->colours[1], w->x + widget->left + 1, w->y + widget->top + 1, widget->right - widget->left);
|
2016-01-01 20:06:00 +01:00
|
|
|
}
|
2016-05-30 00:35:50 +02:00
|
|
|
if ((widget = &w->widgets[WIDX_COLUMN_CLEARANCEHEIGHT])->type != WWT_EMPTY) {
|
2016-05-15 23:03:53 +02:00
|
|
|
gfx_draw_string_left_clipped(dpi, STR_TILE_INSPECTOR_CLEARANGE_HEIGHT_SHORT, gCommonFormatArgs, w->colours[1], w->x + widget->left + 1, w->y + widget->top + 1, widget->right - widget->left);
|
2016-01-01 20:06:00 +01:00
|
|
|
}
|
2016-05-30 00:35:50 +02:00
|
|
|
if ((widget = &w->widgets[WIDX_COLUMN_GHOSTFLAG])->type != WWT_EMPTY) {
|
2016-05-15 23:03:53 +02:00
|
|
|
gfx_draw_string_left_clipped(dpi, STR_TILE_INSPECTOR_FLAG_GHOST_SHORT, gCommonFormatArgs, w->colours[1], w->x + widget->left + 1, w->y + widget->top + 1, widget->right - widget->left);
|
2016-01-01 20:06:00 +01:00
|
|
|
}
|
2016-05-30 00:35:50 +02:00
|
|
|
if ((widget = &w->widgets[WIDX_COLUMN_BROKENFLAG])->type != WWT_EMPTY) {
|
2016-05-15 23:03:53 +02:00
|
|
|
gfx_draw_string_left_clipped(dpi, STR_TILE_INSPECTOR_FLAG_BROKEN_SHORT, gCommonFormatArgs, w->colours[1], w->x + widget->left + 1, w->y + widget->top + 1, widget->right - widget->left);
|
2016-01-01 20:06:00 +01:00
|
|
|
}
|
2016-05-30 00:35:50 +02:00
|
|
|
if ((widget = &w->widgets[WIDX_COLUMN_LASTFLAG])->type != WWT_EMPTY) {
|
2016-05-15 23:03:53 +02:00
|
|
|
gfx_draw_string_left_clipped(dpi, STR_TILE_INSPECTOR_FLAG_LAST_SHORT, gCommonFormatArgs, w->colours[1], w->x + widget->left + 1, w->y + widget->top + 1, widget->right - widget->left);
|
2016-01-01 20:06:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Draw coordinates
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string(dpi, "X:", COLOUR_DARK_GREEN, w->x + 6, w->y + 24);
|
|
|
|
gfx_draw_string(dpi, "Y:", COLOUR_DARK_GREEN, w->x + 64, w->y + 24);
|
2016-10-09 15:14:56 +02:00
|
|
|
if (windowTileInspectorTileSelected) {
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_right(dpi, STR_FORMAT_INTEGER, &windowTileInspectorTileX, COLOUR_DARK_GREEN, w->x + 48, w->y + 24);
|
|
|
|
gfx_draw_string_right(dpi, STR_FORMAT_INTEGER, &windowTileInspectorTileY, COLOUR_DARK_GREEN, w->x + 105, w->y + 24);
|
2015-06-01 03:33:56 +02:00
|
|
|
}
|
2016-10-09 15:14:56 +02:00
|
|
|
else {
|
2017-02-02 21:28:18 +01:00
|
|
|
gfx_draw_string(dpi, "-", COLOUR_DARK_GREEN, w->x + 48 - 7, w->y + 24);
|
|
|
|
gfx_draw_string(dpi, "-", COLOUR_DARK_GREEN, w->x + 105 - 7, w->y + 24);
|
2016-10-09 15:14:56 +02:00
|
|
|
}
|
2016-05-29 16:12:53 +02:00
|
|
|
|
2016-09-18 16:07:07 +02:00
|
|
|
if (w->selected_list_item != -1) {
|
2016-09-11 23:02:34 +02:00
|
|
|
// X and Y of first element in detail box
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 x = w->x + w->widgets[WIDX_GROUPBOX_DETAILS].left + 7;
|
|
|
|
sint32 y = w->y + w->widgets[WIDX_GROUPBOX_DETAILS].top + 14;
|
2016-09-11 23:02:34 +02:00
|
|
|
|
2016-05-29 16:12:53 +02:00
|
|
|
// Get map element
|
2016-10-02 22:15:54 +02:00
|
|
|
rct_map_element *const mapElement = window_tile_inspector_get_selected_element(w);
|
2016-05-29 16:12:53 +02:00
|
|
|
|
2016-06-05 22:07:11 +02:00
|
|
|
switch (w->page) {
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_SURFACE: {
|
2016-09-18 14:30:34 +02:00
|
|
|
// Details
|
|
|
|
// Terrain texture name
|
2016-09-18 20:47:35 +02:00
|
|
|
rct_string_id terrainNameId = terrainTypeStringIds[map_element_get_terrain(mapElement)];
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_SURFACE_TERAIN, &terrainNameId, COLOUR_DARK_GREEN, x, y);
|
2016-09-18 14:30:34 +02:00
|
|
|
|
|
|
|
// Edge texture name
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 idx = map_element_get_terrain_edge(mapElement);
|
2016-11-04 22:12:34 +01:00
|
|
|
openrct2_assert(idx < countof(terrainEdgeTypeStringIds), "Tried accessing invalid entry %d in terrainEdgeTypeStringIds", idx);
|
2016-09-18 20:47:35 +02:00
|
|
|
rct_string_id terrainEdgeNameId = terrainEdgeTypeStringIds[map_element_get_terrain_edge(mapElement)];
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_SURFACE_EDGE, &terrainEdgeNameId, COLOUR_DARK_GREEN, x, y + 11);
|
2016-09-18 14:30:34 +02:00
|
|
|
|
|
|
|
// Land ownership
|
2016-09-18 20:47:35 +02:00
|
|
|
rct_string_id landOwnership;
|
|
|
|
if (mapElement->properties.surface.ownership & OWNERSHIP_OWNED) landOwnership = STR_LAND_OWNED;
|
|
|
|
else if (mapElement->properties.surface.ownership & OWNERSHIP_AVAILABLE) landOwnership = STR_LAND_SALE;
|
|
|
|
else if (mapElement->properties.surface.ownership & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED) landOwnership = STR_CONSTRUCTION_RIGHTS_OWNED;
|
|
|
|
else if (mapElement->properties.surface.ownership & OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE) landOwnership = STR_CONSTRUCTION_RIGHTS_SALE;
|
|
|
|
else landOwnership = STR_TILE_INSPECTOR_LAND_NOT_OWNED_AND_NOT_AVAILABLE;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_SURFACE_OWNERSHIP, &landOwnership, COLOUR_DARK_GREEN, x, y + 22);
|
2016-09-18 14:30:34 +02:00
|
|
|
|
|
|
|
// Water level
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 waterLevel = mapElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_SURFACE_WATER_LEVEL, &waterLevel, COLOUR_DARK_GREEN, x, y + 33);
|
2016-09-18 14:30:34 +02:00
|
|
|
|
|
|
|
// Properties
|
2016-09-18 15:52:03 +02:00
|
|
|
// Raise / lower label
|
|
|
|
x = w->x + w->widgets[WIDX_GROUPBOX_DETAILS].left + 7;
|
|
|
|
y = w->y + w->widgets[WIDX_SURFACE_SPINNER_HEIGHT].top;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, NULL, COLOUR_DARK_GREEN, x, y);
|
2016-09-18 15:52:03 +02:00
|
|
|
|
|
|
|
// Current base height
|
|
|
|
x = w->x + w->widgets[WIDX_SURFACE_SPINNER_HEIGHT].left + 3;
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 baseHeight = mapElement->base_height;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_FORMAT_INTEGER, &baseHeight, COLOUR_DARK_GREEN, x, y);
|
2016-09-18 15:52:03 +02:00
|
|
|
|
2016-09-18 14:30:34 +02:00
|
|
|
// Raised corners
|
|
|
|
x = w->x + w->widgets[WIDX_GROUPBOX_DETAILS].left + 7;
|
|
|
|
y = w->y + w->widgets[WIDX_SURFACE_CHECK_CORNER_E].top;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_SURFACE_CORNERS, NULL, COLOUR_DARK_GREEN, x, y);
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
|
|
|
}
|
2016-05-30 00:35:50 +02:00
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_PATH: {
|
2016-09-12 22:47:58 +02:00
|
|
|
// Details
|
|
|
|
// Path name
|
2016-09-18 20:47:35 +02:00
|
|
|
rct_string_id pathNameId = get_footpath_entry(footpath_element_get_type(mapElement))->string_idx;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_PATH_NAME, &pathNameId, COLOUR_DARK_GREEN, x, y);
|
2016-09-12 22:47:58 +02:00
|
|
|
|
|
|
|
// Path addition
|
2016-05-30 00:35:50 +02:00
|
|
|
if (footpath_element_has_path_scenery(mapElement)) {
|
|
|
|
const uint8 pathAdditionType = footpath_element_get_path_scenery_index(mapElement);
|
2016-09-18 20:47:35 +02:00
|
|
|
rct_string_id additionNameId = get_footpath_item_entry(pathAdditionType)->name;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_PATH_ADDITIONS, &additionNameId, COLOUR_DARK_GREEN, x, y + 11);
|
2016-05-30 00:35:50 +02:00
|
|
|
}
|
|
|
|
else
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_PATH_ADDITIONS_NONE, NULL, COLOUR_DARK_GREEN, x, y + 11);
|
2016-05-30 00:35:50 +02:00
|
|
|
|
2016-09-12 22:47:58 +02:00
|
|
|
// Properties
|
2016-06-01 22:31:10 +02:00
|
|
|
// Raise / lower label
|
2016-05-31 20:13:26 +02:00
|
|
|
x = w->x + w->widgets[WIDX_GROUPBOX_DETAILS].left + 7;
|
2016-06-01 22:31:10 +02:00
|
|
|
y = w->y + w->widgets[WIDX_PATH_SPINNER_HEIGHT].top;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, NULL, COLOUR_DARK_GREEN, x, y);
|
2016-06-01 22:31:10 +02:00
|
|
|
|
|
|
|
// Current base height
|
|
|
|
x = w->x + w->widgets[WIDX_PATH_SPINNER_HEIGHT].left + 3;
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 baseHeight = mapElement->base_height;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_FORMAT_INTEGER, &baseHeight, COLOUR_DARK_GREEN, x, y);
|
2016-06-01 22:31:10 +02:00
|
|
|
|
|
|
|
// Path connections
|
2016-05-31 20:13:26 +02:00
|
|
|
x = w->x + w->widgets[WIDX_GROUPBOX_DETAILS].left + 7;
|
2016-06-01 22:31:10 +02:00
|
|
|
y = w->y + w->widgets[WIDX_PATH_CHECK_EDGE_W].top;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_PATH_CONECTED_EDGES, NULL, COLOUR_DARK_GREEN, x, y);
|
2016-05-30 00:35:50 +02:00
|
|
|
break;
|
|
|
|
}
|
2016-06-05 22:07:11 +02:00
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_TRACK: {
|
2016-06-05 22:07:11 +02:00
|
|
|
// Details
|
2016-06-05 23:33:34 +02:00
|
|
|
// Ride
|
2016-09-18 20:47:35 +02:00
|
|
|
sint16 rideId = mapElement->properties.track.ride_index;
|
|
|
|
rct_ride *ride = get_ride(rideId);
|
|
|
|
rct_string_id rideType = STR_RIDE_NAME_SPIRAL_ROLLER_COASTER + ride->type;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_TRACK_RIDE_TYPE, &rideType, COLOUR_DARK_GREEN, x, y);
|
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_TRACK_RIDE_ID, &rideId, COLOUR_DARK_GREEN, x, y + 11);
|
2016-06-05 23:11:01 +02:00
|
|
|
set_format_arg(0, rct_string_id, ride->name);
|
|
|
|
set_format_arg(0 + sizeof(rct_string_id), uint32, ride->name_arguments);
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_TRACK_RIDE_NAME, gCommonFormatArgs, COLOUR_DARK_GREEN, x, y + 22);
|
2016-06-05 23:33:34 +02:00
|
|
|
// Track
|
2016-09-18 20:47:35 +02:00
|
|
|
sint16 trackType = mapElement->properties.track.type;
|
|
|
|
sint16 sequenceNumber = mapElement->properties.track.sequence & 0x0F;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_TRACK_PIECE_ID, &trackType, COLOUR_DARK_GREEN, x, y + 33);
|
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_TRACK_SEQUENCE, &sequenceNumber, COLOUR_DARK_GREEN, x, y + 44);
|
2016-06-05 22:07:11 +02:00
|
|
|
|
|
|
|
// Properties
|
|
|
|
// Raise / lower label
|
|
|
|
y = w->y + w->widgets[WIDX_TRACK_SPINNER_HEIGHT].top;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, NULL, COLOUR_DARK_GREEN, x, y);
|
2016-06-05 22:07:11 +02:00
|
|
|
|
|
|
|
// Current base height
|
|
|
|
x = w->x + w->widgets[WIDX_TRACK_SPINNER_HEIGHT].left + 3;
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 baseHeight = mapElement->base_height;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_FORMAT_INTEGER, &baseHeight, COLOUR_DARK_GREEN, x, y);
|
2016-09-11 23:02:34 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_SCENERY: {
|
2016-09-18 10:29:48 +02:00
|
|
|
// Details
|
|
|
|
// Age
|
2016-09-18 14:30:34 +02:00
|
|
|
sint16 age = mapElement->properties.scenery.age;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_SCENERY_AGE, &age, COLOUR_DARK_GREEN, x, y);
|
2016-09-18 10:29:48 +02:00
|
|
|
|
|
|
|
// Quadrant value
|
|
|
|
if (!(get_small_scenery_entry(mapElement->properties.scenery.type)->small_scenery.flags & SMALL_SCENERY_FLAG_FULL_TILE)) {
|
|
|
|
sint16 quadrant = (mapElement->type & MAP_ELEMENT_QUADRANT_MASK) >> 6;
|
|
|
|
static rct_string_id quadrant_string_idx[] = {
|
|
|
|
STR_TILE_INSPECTOR_SCENERY_QUADRANT_SW,
|
|
|
|
STR_TILE_INSPECTOR_SCENERY_QUADRANT_NW,
|
|
|
|
STR_TILE_INSPECTOR_SCENERY_QUADRANT_NE,
|
|
|
|
STR_TILE_INSPECTOR_SCENERY_QUADRANT_SE
|
|
|
|
};
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_SCENERY_QUADRANT, &quadrant_string_idx[quadrant], COLOUR_DARK_GREEN, x, y + 11);
|
2016-09-18 10:29:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Scenery ID
|
|
|
|
sint16 idx = mapElement->properties.scenery.type;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_SCENERY_ENTRY_IDX, &idx, COLOUR_DARK_GREEN, x, y + 22);
|
2016-09-18 10:29:48 +02:00
|
|
|
|
|
|
|
// Properties
|
|
|
|
// Raise / Lower
|
|
|
|
y = w->y + w->widgets[WIDX_SCENERY_SPINNER_HEIGHT].top;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, NULL, COLOUR_DARK_GREEN, x, y);
|
2016-09-18 10:29:48 +02:00
|
|
|
|
|
|
|
// Current base height
|
|
|
|
x = w->x + w->widgets[WIDX_SCENERY_SPINNER_HEIGHT].left + 3;
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 baseHeight = mapElement->base_height;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_FORMAT_INTEGER, &baseHeight, COLOUR_DARK_GREEN, x, y);
|
2016-09-18 10:29:48 +02:00
|
|
|
|
|
|
|
// Quarter tile
|
|
|
|
x = w->x + w->widgets[WIDX_GROUPBOX_DETAILS].left + 7;
|
|
|
|
y = w->y + w->widgets[WIDX_SCENERY_CHECK_QUARTER_E].top;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_SCENERY_QUADRANT_LABEL, NULL, COLOUR_DARK_GREEN, x, y);
|
2016-09-18 10:29:48 +02:00
|
|
|
|
|
|
|
// Collision
|
|
|
|
y = w->y + w->widgets[WIDX_SCENERY_CHECK_COLLISION_E].top;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_COLLISSION, NULL, COLOUR_DARK_GREEN, x, y);
|
2016-09-18 10:29:48 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_ENTRANCE: {
|
2016-10-02 16:50:48 +02:00
|
|
|
// Details
|
2016-09-18 23:59:23 +02:00
|
|
|
// Entrance type
|
2016-09-18 22:52:27 +02:00
|
|
|
rct_string_id entranceType = entranceTypeStringIds[mapElement->properties.entrance.type];
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_ENTRANCE_TYPE, &entranceType, COLOUR_DARK_GREEN, x, y);
|
2016-09-18 23:59:23 +02:00
|
|
|
|
|
|
|
if (mapElement->properties.entrance.type == ENTRANCE_TYPE_PARK_ENTRANCE) {
|
|
|
|
// Park entrance ID
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 middleX = windowTileInspectorTileX << 5;
|
|
|
|
sint32 middleY = windowTileInspectorTileY << 5;
|
2016-09-18 23:59:23 +02:00
|
|
|
// TODO: Make this work with Left/Right park entrance parts
|
|
|
|
sint16 parkEntranceIndex = park_get_entrance_index(middleX, middleY, mapElement->base_height * 8);
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, &parkEntranceIndex, COLOUR_DARK_GREEN, x, y + 11);
|
2016-09-18 23:59:23 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
sint16 rideEntranceIndex = (mapElement->properties.entrance.index & 0x30) >> 4;
|
|
|
|
if (mapElement->properties.entrance.type == ENTRANCE_TYPE_RIDE_ENTRANCE) {
|
|
|
|
// Ride entrance ID
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, &rideEntranceIndex, COLOUR_DARK_GREEN, x, y + 11);
|
2016-09-18 23:59:23 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
// Ride exit ID
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_ENTRANCE_EXIT_ID, &rideEntranceIndex, COLOUR_DARK_GREEN, x, y + 11);
|
2016-09-18 23:59:23 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mapElement->properties.entrance.type == ENTRANCE_TYPE_PARK_ENTRANCE) {
|
|
|
|
// Entrance part
|
|
|
|
rct_string_id entrancePart = parkEntrancePartStringIds[mapElement->properties.entrance.index & 0x0F];
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_ENTRANCE_PART, &entrancePart, COLOUR_DARK_GREEN, x, y + 22);
|
2016-09-18 23:59:23 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
// Ride ID
|
|
|
|
sint16 rideId = mapElement->properties.entrance.ride_index;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_ENTRANCE_RIDE_ID, &rideId, COLOUR_DARK_GREEN, x, y + 22);
|
2016-09-18 23:59:23 +02:00
|
|
|
}
|
2016-10-16 22:56:44 +02:00
|
|
|
|
|
|
|
// Properties
|
|
|
|
// Raise / Lower
|
|
|
|
y = w->y + w->widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].top;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, NULL, COLOUR_DARK_GREEN, x, y);
|
2016-10-16 22:56:44 +02:00
|
|
|
|
|
|
|
// Current base height
|
|
|
|
x = w->x + w->widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].left + 3;
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 baseHeight = mapElement->base_height;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_FORMAT_INTEGER, &baseHeight, COLOUR_DARK_GREEN, x, y);
|
2016-10-09 15:14:56 +02:00
|
|
|
break;
|
2016-09-18 22:52:27 +02:00
|
|
|
}
|
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_FENCE: {
|
2016-10-02 16:50:48 +02:00
|
|
|
// Details
|
|
|
|
// Type
|
|
|
|
sint16 fenceType = mapElement->properties.fence.type;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_FENCE_TYPE, &fenceType, COLOUR_DARK_GREEN, x, y);
|
2016-10-02 16:50:48 +02:00
|
|
|
|
2016-10-02 22:15:54 +02:00
|
|
|
// Banner info
|
2016-10-02 16:50:48 +02:00
|
|
|
rct_wall_scenery_entry fenceEntry = get_wall_entry(fenceType)->wall;
|
2016-10-06 21:50:07 +02:00
|
|
|
if (fenceEntry.flags & WALL_SCENERY_IS_BANNER) {
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, &gBanners[mapElement->properties.fence.item[0]].string_idx, COLOUR_DARK_GREEN, x, y + 11);
|
2016-10-02 16:50:48 +02:00
|
|
|
}
|
|
|
|
else {
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_ENTRY_BANNER_NONE, NULL, COLOUR_DARK_GREEN, x, y + 11);
|
2016-10-02 16:50:48 +02:00
|
|
|
}
|
|
|
|
|
2016-09-11 23:02:34 +02:00
|
|
|
// Properties
|
|
|
|
// Raise / lower label
|
|
|
|
y = w->y + w->widgets[WIDX_FENCE_SPINNER_HEIGHT].top;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, NULL, COLOUR_DARK_GREEN, x, y);
|
2016-09-11 23:02:34 +02:00
|
|
|
|
|
|
|
// Current base height
|
|
|
|
x = w->x + w->widgets[WIDX_FENCE_SPINNER_HEIGHT].left + 3;
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 baseHeight = mapElement->base_height;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_FORMAT_INTEGER, &baseHeight, COLOUR_DARK_GREEN, x, y);
|
2016-10-01 22:57:09 +02:00
|
|
|
|
|
|
|
// Slope label
|
|
|
|
x = w->x + w->widgets[WIDX_GROUPBOX_DETAILS].left + 7;
|
|
|
|
y = w->y + w->widgets[WIDX_FENCE_DROPDOWN_SLOPE].top;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_FENCE_SLOPE, NULL, COLOUR_DARK_GREEN, x, y);
|
2016-06-05 22:07:11 +02:00
|
|
|
break;
|
2016-05-29 16:12:53 +02:00
|
|
|
}
|
2016-09-26 23:31:41 +02:00
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_LARGE_SCENERY:
|
2016-09-26 23:31:41 +02:00
|
|
|
{
|
2016-10-02 22:15:54 +02:00
|
|
|
// Details
|
|
|
|
// Type
|
|
|
|
sint16 largeSceneryType = mapElement->properties.scenerymultiple.type & 0x03FF;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_LARGE_SCENERY_TYPE, &largeSceneryType, COLOUR_DARK_GREEN, x, y);
|
2016-10-02 22:15:54 +02:00
|
|
|
|
|
|
|
// Part ID
|
|
|
|
sint16 pieceID = (mapElement->properties.scenerymultiple.type & 0xFC00) >> 10;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_LARGE_SCENERY_PIECE_ID, &pieceID, COLOUR_DARK_GREEN, x, y + 11);
|
2016-10-02 22:15:54 +02:00
|
|
|
|
|
|
|
// Banner info
|
|
|
|
rct_scenery_entry *largeSceneryEntry = get_large_scenery_entry(mapElement->properties.scenerymultiple.type & MAP_ELEMENT_LARGE_TYPE_MASK);
|
|
|
|
if (largeSceneryEntry->large_scenery.var_11 != 0xFF) {
|
2017-01-04 22:17:08 +01:00
|
|
|
const sint32 bannerIndex = (mapElement->type & 0xC0) |
|
2016-10-02 22:15:54 +02:00
|
|
|
((mapElement->properties.scenerymultiple.colour[0] & 0xE0) >> 2) |
|
|
|
|
((mapElement->properties.scenerymultiple.colour[1] & 0xE0) >> 5);
|
|
|
|
//window_sign_open(bannerIndex);
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, &gBanners[bannerIndex].string_idx, COLOUR_DARK_GREEN, x, y + 22);
|
2016-10-02 22:15:54 +02:00
|
|
|
}
|
|
|
|
else {
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_ENTRY_BANNER_NONE, NULL, COLOUR_DARK_GREEN, x, y + 22);
|
2016-10-02 22:15:54 +02:00
|
|
|
}
|
|
|
|
|
2016-09-26 23:31:41 +02:00
|
|
|
// Properties
|
|
|
|
// Raise / lower label
|
|
|
|
y = w->y + w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].top;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, NULL, COLOUR_DARK_GREEN, x, y);
|
2016-09-26 23:31:41 +02:00
|
|
|
|
|
|
|
// Current base height
|
|
|
|
x = w->x + w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].left + 3;
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 baseHeight = mapElement->base_height;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_FORMAT_INTEGER, &baseHeight, COLOUR_DARK_GREEN, x, y);
|
2016-09-26 23:31:41 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_BANNER:
|
2016-09-26 23:31:41 +02:00
|
|
|
{
|
2016-10-05 00:01:09 +02:00
|
|
|
// Details
|
|
|
|
// Banner info
|
|
|
|
const uint8 bannerIndex = mapElement->properties.banner.index;
|
|
|
|
if (gBanners[bannerIndex].flags & BANNER_FLAG_NO_ENTRY) {
|
|
|
|
rct_string_id noEntryStringIdx = STR_NO_ENTRY;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, &noEntryStringIdx, COLOUR_DARK_GREEN, x, y);
|
2016-10-05 00:01:09 +02:00
|
|
|
}
|
|
|
|
else {
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, &gBanners[bannerIndex].string_idx, COLOUR_DARK_GREEN, x, y);
|
2016-10-05 00:01:09 +02:00
|
|
|
}
|
|
|
|
|
2016-09-26 23:31:41 +02:00
|
|
|
// Properties
|
|
|
|
// Raise / lower label
|
|
|
|
y = w->y + w->widgets[WIDX_BANNER_SPINNER_HEIGHT].top;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, NULL, COLOUR_DARK_GREEN, x, y);
|
2016-09-26 23:31:41 +02:00
|
|
|
|
|
|
|
// Current base height
|
|
|
|
x = w->x + w->widgets[WIDX_BANNER_SPINNER_HEIGHT].left + 3;
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 baseHeight = mapElement->base_height;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_FORMAT_INTEGER, &baseHeight, COLOUR_DARK_GREEN, x, y);
|
2016-10-05 00:01:09 +02:00
|
|
|
|
|
|
|
// Blocked paths
|
|
|
|
y += 28;
|
|
|
|
x = w->x + w->widgets[WIDX_GROUPBOX_DETAILS].left + 7;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_BANNER_BLOCKED_PATHS, NULL, COLOUR_DARK_GREEN, x, y);
|
2016-09-26 23:31:41 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2017-01-26 19:06:49 +01:00
|
|
|
case TILE_INSPECTOR_PAGE_CORRUPT:
|
2016-09-26 23:31:41 +02:00
|
|
|
{
|
|
|
|
// Properties
|
|
|
|
// Raise / lower label
|
|
|
|
y = w->y + w->widgets[WIDX_CORRUPT_SPINNER_HEIGHT].top;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, NULL, COLOUR_DARK_GREEN, x, y);
|
2016-09-26 23:31:41 +02:00
|
|
|
|
|
|
|
// Current base height
|
|
|
|
x = w->x + w->widgets[WIDX_CORRUPT_SPINNER_HEIGHT].left + 3;
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 baseHeight = mapElement->base_height;
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_FORMAT_INTEGER, &baseHeight, COLOUR_DARK_GREEN, x, y);
|
2016-09-26 23:31:41 +02:00
|
|
|
break;
|
|
|
|
}
|
2016-06-05 22:07:11 +02:00
|
|
|
} // switch page
|
2016-05-29 16:12:53 +02:00
|
|
|
}
|
2015-06-01 03:33:56 +02:00
|
|
|
}
|
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_tile_inspector_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
2016-11-01 23:43:39 +01:00
|
|
|
{
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 y = LIST_ITEM_HEIGHT * (windowTileInspectorElementCount - 1);
|
|
|
|
sint32 i = 0;
|
2015-06-01 03:33:56 +02:00
|
|
|
char buffer[256];
|
|
|
|
|
2016-10-09 15:14:56 +02:00
|
|
|
if (!windowTileInspectorTileSelected)
|
2015-06-01 03:33:56 +02:00
|
|
|
return;
|
|
|
|
|
2016-09-18 20:47:35 +02:00
|
|
|
rct_map_element *mapElement = map_get_first_element_at(windowTileInspectorTileX, windowTileInspectorTileY);
|
2015-06-01 03:33:56 +02:00
|
|
|
|
2016-04-26 00:00:58 +02:00
|
|
|
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
|
2015-06-01 03:33:56 +02:00
|
|
|
do {
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 type = map_element_get_type(mapElement);
|
2016-09-18 20:47:35 +02:00
|
|
|
char *typeName;
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 baseHeight = mapElement->base_height;
|
|
|
|
sint32 clearanceHeight = mapElement->clearance_height;
|
2015-06-01 03:33:56 +02:00
|
|
|
|
2015-12-28 23:11:36 +01:00
|
|
|
// Fill colour for current list element
|
2017-01-04 22:17:08 +01:00
|
|
|
const sint32 listWidth = w->widgets[WIDX_LIST].right - w->widgets[WIDX_LIST].left;
|
2015-12-28 23:11:36 +01:00
|
|
|
if (i == w->selected_list_item) // Currently selected element
|
2016-09-18 20:47:35 +02:00
|
|
|
gfx_fill_rect(dpi, 0, y, listWidth, y + LIST_ITEM_HEIGHT - 1, ColourMapA[w->colours[1]].darker | 0x1000000);
|
|
|
|
else if (i == windowTileInspectorHighlightedIndex) // Hovering
|
|
|
|
gfx_fill_rect(dpi, 0, y, listWidth, y + LIST_ITEM_HEIGHT - 1, ColourMapA[w->colours[1]].mid_dark | 0x1000000);
|
2015-12-28 23:11:36 +01:00
|
|
|
else if ((i & 1) != 0) // odd / even check
|
2016-09-18 20:47:35 +02:00
|
|
|
gfx_fill_rect(dpi, 0, y, listWidth, y + LIST_ITEM_HEIGHT - 1, ColourMapA[w->colours[1]].lighter | 0x1000000);
|
2015-06-01 03:33:56 +02:00
|
|
|
|
|
|
|
switch (type) {
|
2016-05-29 16:12:53 +02:00
|
|
|
case MAP_ELEMENT_TYPE_SURFACE:
|
2016-09-18 20:47:35 +02:00
|
|
|
typeName = "Surface";
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
|
|
|
case MAP_ELEMENT_TYPE_PATH:
|
2016-09-18 20:47:35 +02:00
|
|
|
typeName = footpath_element_is_queue(mapElement) ? "Queue" : "Footpath";
|
2016-06-05 22:07:11 +02:00
|
|
|
break;
|
2016-05-29 16:12:53 +02:00
|
|
|
case MAP_ELEMENT_TYPE_TRACK:
|
2016-09-18 20:47:35 +02:00
|
|
|
typeName = "Track";
|
2015-06-01 03:33:56 +02:00
|
|
|
break;
|
2016-05-29 16:12:53 +02:00
|
|
|
case MAP_ELEMENT_TYPE_SCENERY:
|
|
|
|
snprintf(
|
|
|
|
buffer, sizeof(buffer),
|
|
|
|
"Scenery (%s)",
|
2016-06-05 22:07:11 +02:00
|
|
|
language_get_string(get_small_scenery_entry(mapElement->properties.scenery.type)->name)
|
2016-05-29 16:12:53 +02:00
|
|
|
);
|
2016-09-18 20:47:35 +02:00
|
|
|
typeName = buffer;
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
|
|
|
case MAP_ELEMENT_TYPE_ENTRANCE:
|
2016-09-18 20:47:35 +02:00
|
|
|
typeName = "Entrance";
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
|
|
|
case MAP_ELEMENT_TYPE_FENCE:
|
|
|
|
snprintf(
|
|
|
|
buffer, sizeof(buffer),
|
|
|
|
"Fence (%s)",
|
2016-06-05 22:07:11 +02:00
|
|
|
language_get_string(get_wall_entry(mapElement->properties.scenery.type)->name)
|
|
|
|
);
|
2016-09-18 20:47:35 +02:00
|
|
|
typeName = buffer;
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
|
|
|
case MAP_ELEMENT_TYPE_SCENERY_MULTIPLE:
|
2016-09-18 20:47:35 +02:00
|
|
|
typeName = "Scenery multiple";
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
|
|
|
case MAP_ELEMENT_TYPE_BANNER:
|
|
|
|
snprintf(
|
|
|
|
buffer, sizeof(buffer),
|
|
|
|
"Banner (%d)",
|
2016-06-05 22:07:11 +02:00
|
|
|
mapElement->properties.banner.index
|
2016-05-29 16:12:53 +02:00
|
|
|
);
|
2016-09-18 20:47:35 +02:00
|
|
|
typeName = buffer;
|
2016-05-29 16:12:53 +02:00
|
|
|
break;
|
|
|
|
case MAP_ELEMENT_TYPE_CORRUPT:
|
|
|
|
// fall-through
|
|
|
|
default:
|
|
|
|
snprintf(buffer, sizeof(buffer), "Unknown (type %d)", type);
|
2016-09-18 20:47:35 +02:00
|
|
|
typeName = buffer;
|
2015-06-01 03:33:56 +02:00
|
|
|
}
|
|
|
|
|
2015-12-29 23:19:01 +01:00
|
|
|
// Undo relative scroll offset, but keep the 3 pixel padding
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 x = -w->widgets[WIDX_LIST].left;
|
2016-06-05 22:07:11 +02:00
|
|
|
const bool ghost = (mapElement->flags & MAP_ELEMENT_FLAG_GHOST) != 0;
|
|
|
|
const bool broken = (mapElement->flags & MAP_ELEMENT_FLAG_BROKEN) != 0;
|
|
|
|
const bool last = (mapElement->flags & MAP_ELEMENT_FLAG_LAST_TILE) != 0;
|
2016-10-02 19:37:21 +02:00
|
|
|
gfx_clip_string(buffer, w->widgets[WIDX_COLUMN_TYPE].right - w->widgets[WIDX_COLUMN_TYPE].left - COL_X_TYPE);
|
2016-11-13 18:44:34 +01:00
|
|
|
gfx_draw_string(dpi, typeName, COLOUR_DARK_GREEN, x + COL_X_TYPE + 3, y); // 3px padding
|
|
|
|
gfx_draw_string_left(dpi, STR_FORMAT_INTEGER, &baseHeight, COLOUR_DARK_GREEN, x + COL_X_BH, y);
|
|
|
|
gfx_draw_string_left(dpi, STR_FORMAT_INTEGER, &clearanceHeight, COLOUR_DARK_GREEN, x + COL_X_CH, y);
|
2016-01-01 20:35:08 +01:00
|
|
|
if (ghost) gfx_draw_string(dpi, (char*)CheckBoxMarkString, w->colours[1], x + COL_X_GF, y);
|
|
|
|
if (broken) gfx_draw_string(dpi, (char*)CheckBoxMarkString, w->colours[1], x + COL_X_BF, y);
|
|
|
|
if (last) gfx_draw_string(dpi, (char*)CheckBoxMarkString, w->colours[1], x + COL_X_LF, y);
|
2015-06-01 03:33:56 +02:00
|
|
|
|
2015-12-28 23:11:36 +01:00
|
|
|
y -= LIST_ITEM_HEIGHT;
|
2015-06-01 03:33:56 +02:00
|
|
|
i++;
|
2016-06-05 22:07:11 +02:00
|
|
|
} while (!map_element_is_last_for_tile(mapElement++));
|
2015-06-01 03:33:56 +02:00
|
|
|
}
|