1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 23:34:37 +01:00

Refactor another set of widget definitions (#12503)

* Refactor TopToolbar

* Refactor TrackDesignManage

* Refactor TrackDesignPlace

* Refactor TrackList

* Refactor ViewClipping

* Refactor Viewport

* Refactor TitleEditor

* Refactor TitleCommandEditor

* Refactor Themes

* Refactor TextInput
This commit is contained in:
Aaron van Geffen
2020-07-30 22:58:49 +02:00
committed by GitHub
parent e0f2aa9b99
commit 16ad1d18fb
10 changed files with 139 additions and 144 deletions

View File

@@ -69,12 +69,12 @@ enum WINDOW_WATER_WIDGET_IDX {
WIDX_CANCEL
};
static constexpr rct_string_id WINDOW_TITLE = STR_TITLE_COMMAND_EDITOR_TITLE;
static constexpr const int32_t WW = 200;
static constexpr const int32_t WH = 120;
constexpr int32_t BY = 32;
constexpr int32_t BY2 = 70;
constexpr int32_t WS = 16;
static constexpr const int32_t WHA = (WW-WS*2)/2;
static constexpr int32_t BY = 32;
static constexpr int32_t BY2 = 70;
static constexpr int32_t WS = 16;
static bool _window_title_command_editor_insert;
static int32_t _window_title_command_editor_index;
@@ -85,28 +85,25 @@ static TitleCommand command = { TITLE_SCRIPT_LOAD, { 0 } };
static TitleSequence * _sequence = nullptr;
static rct_widget window_title_command_editor_widgets[] = {
{ WWT_FRAME, 1, 0, WW-1, 0, WH-1, 0xFFFFFFFF, STR_NONE }, // panel / background
{ WWT_CAPTION, 1, 1, WW-2, 1, 14, STR_TITLE_COMMAND_EDITOR_TITLE, STR_WINDOW_TITLE_TIP }, // title bar
{ WWT_CLOSEBOX, 1, WW-13, WW-3, 2, 13, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP }, // close x button
{ WWT_DROPDOWN, 1, WS, WW-WS-1, BY, BY+11, STR_NONE, STR_NONE }, // Command dropdown
{ WWT_BUTTON, 1, WW-WS-12, WW-WS-2, BY+1, BY+10, STR_DROPDOWN_GLYPH, STR_NONE },
{ WWT_TEXT_BOX, 1, WS, WW-WS-1, BY2, BY2+11, STR_NONE, STR_NONE }, // full textbox
WINDOW_SHIM(WINDOW_TITLE, WW, WH),
MakeWidget({ 16, 32}, { 168, 12}, WWT_DROPDOWN, 1 ), // Command dropdown
MakeWidget({172, 33}, { 11, 12}, WWT_BUTTON, 1, STR_DROPDOWN_GLYPH ),
MakeWidget({ 16, 70}, { 168, 12}, WWT_TEXT_BOX, 1 ), // full textbox
{ WWT_TEXT_BOX, 1, WS, WS+WHA-4, BY2, BY2+11, STR_NONE, STR_NONE }, // x textbox
{ WWT_TEXT_BOX, 1, WS+WHA+3, WW-WS-1, BY2, BY2+11, STR_NONE, STR_NONE }, // y textbox
MakeWidget({ 16, 70}, { 81, 12}, WWT_TEXT_BOX, 1 ), // x textbox
MakeWidget({103, 70}, { 81, 12}, WWT_TEXT_BOX, 1 ), // y textbox
{ WWT_DROPDOWN, 1, 16, WW-17, BY2, BY2+11, STR_NONE, STR_NONE }, // Save dropdown
{ WWT_BUTTON, 1, WW-28, WW-18, BY2+1, BY2+10, STR_DROPDOWN_GLYPH, STR_NONE },
MakeWidget({ 16, 70}, { 168, 12}, WWT_DROPDOWN, 1 ), // Save dropdown
MakeWidget({172, 71}, { 11, 10}, WWT_BUTTON, 1, STR_DROPDOWN_GLYPH ),
{ WWT_BUTTON, 1, WS+WHA+3, WW-WS-1, BY2-14, BY2-3, STR_TITLE_COMMAND_EDITOR_ACTION_GET_LOCATION, STR_NONE }, // Get location/zoom/etc
{ WWT_BUTTON, 1, WS+WHA+12, WW-WS-1, BY2-14, BY2-3, STR_TITLE_COMMAND_EDITOR_ACTION_SELECT_SCENARIO, STR_NONE }, // Select scenario
MakeWidget({103, 56}, { 81, 12}, WWT_BUTTON, 1, STR_TITLE_COMMAND_EDITOR_ACTION_GET_LOCATION ), // Get location/zoom/etc
MakeWidget({112, 56}, { 72, 12}, WWT_BUTTON, 1, STR_TITLE_COMMAND_EDITOR_ACTION_SELECT_SCENARIO), // Select scenario
{ WWT_BUTTON, 1, WS, WW-WS-1, BY2-14, BY2-3, STR_TITLE_COMMAND_EDITOR_SELECT_SPRITE, STR_NONE }, // Select sprite
{ WWT_VIEWPORT, 1, WS, WW-WS-1, BY2, BY2+22, STR_NONE, STR_NONE }, // Viewport
{ WWT_BUTTON, 1, 10, 80, WH-21, WH-10, STR_OK, STR_NONE }, // OKAY
{ WWT_BUTTON, 1, WW-80, WW-10, WH-21, WH-10, STR_CANCEL, STR_NONE }, // Cancel
MakeWidget({ 16, 56}, { 168, 12}, WWT_BUTTON, 1, STR_TITLE_COMMAND_EDITOR_SELECT_SPRITE ), // Select sprite
MakeWidget({ 16, 70}, { 168, 24}, WWT_VIEWPORT, 1 ), // Viewport
MakeWidget({ 10, 99}, { 71, 14}, WWT_BUTTON, 1, STR_OK ), // OKAY
MakeWidget({120, 99}, { 71, 14}, WWT_BUTTON, 1, STR_CANCEL ), // Cancel
{ WIDGETS_END },
};