Refactor constants in window .cpp files

This commit is contained in:
Michael Steenbeek authored and GitHub committed 2025-06-16 23:10:47 +02:00
1 parent 0e9982d6ca
commit 7b322d825a
71 files changed
+1234 -1282

No files matched your search

+7 -9
View File
@@ -254,8 +254,7 @@ namespace OpenRCT2::Ui::Windows
std::string Classification;
std::optional<int32_t> X;
std::optional<int32_t> Y;
int32_t Width{};
int32_t Height{};
ScreenSize size{};
std::optional<int32_t> MinWidth;
std::optional<int32_t> MinHeight;
std::optional<int32_t> MaxWidth;
@@ -285,8 +284,8 @@ namespace OpenRCT2::Ui::Windows
result.Classification = desc["classification"].as_string();
result.X = GetOptionalInt(desc["x"]);
result.Y = GetOptionalInt(desc["y"]);
result.Width = desc["width"].as_int();
result.Height = desc["height"].as_int();
result.size.width = desc["width"].as_int();
result.size.height = desc["height"].as_int();
result.MinWidth = GetOptionalInt(desc["minWidth"]);
result.MaxWidth = GetOptionalInt(desc["maxWidth"]);
result.MinHeight = GetOptionalInt(desc["minHeight"]);
@@ -898,7 +897,7 @@ namespace OpenRCT2::Ui::Windows
// Add window tabs
if (_info.Desc.Tabs.size() != 0)
{
widgetList[WIDX_CONTENT_PANEL].top = 43;
widgetList[WIDX_CONTENT_PANEL].top = kTabBarHeight;
}
for (size_t tabDescIndex = 0; tabDescIndex < _info.Desc.Tabs.size(); tabDescIndex++)
{
@@ -908,7 +907,7 @@ namespace OpenRCT2::Ui::Windows
widget.left = static_cast<int16_t>(3 + (tabDescIndex * 31));
widget.right = widget.left + 30;
widget.top = 17;
widget.bottom = 43;
widget.bottom = kTabBarHeight;
widget.image = ImageId(SPR_TAB, FilterPaletteID::PaletteNull);
widget.tooltip = kStringIdNone;
widgetList.push_back(widget);
@@ -1141,12 +1140,11 @@ namespace OpenRCT2::Ui::Windows
if (desc.X && desc.Y)
{
window = windowMgr->Create<CustomWindow>(
WindowClass::Custom, { *desc.X, *desc.Y }, { desc.Width, desc.Height }, windowFlags, owner, desc);
WindowClass::Custom, { *desc.X, *desc.Y }, desc.size, windowFlags, owner, desc);
}
else
{
window = windowMgr->Create<CustomWindow>(
WindowClass::Custom, { desc.Width, desc.Height }, windowFlags, owner, desc);
window = windowMgr->Create<CustomWindow>(WindowClass::Custom, desc.size, windowFlags, owner, desc);
}
return window;
}
+22 -22
View File
@@ -23,10 +23,9 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr int32_t WW = 400;
static constexpr int32_t WH = 450;
static constexpr StringId WINDOW_TITLE = STR_ABOUT;
static constexpr int32_t TABHEIGHT = 50;
static constexpr ScreenSize kWindowSize = { 400, 450 };
static constexpr StringId kWindowTitle = STR_ABOUT;
static constexpr int32_t kTabHeight = 50;
static constexpr auto kPadding = 10;
@@ -58,23 +57,24 @@ namespace OpenRCT2::Ui::Windows
WIDX_CONTRIBUTORS_BUTTON,
};
static constexpr auto kMainWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ 0, TABHEIGHT }, { WW, WH - TABHEIGHT }, WidgetType::frame, WindowColour::secondary),
makeRemapWidget({ 3, 17 }, { 91, TABHEIGHT - 16 }, WidgetType::tab, WindowColour::secondary, SPR_TAB_LARGE),
makeRemapWidget({ 94, 17 }, { 91, TABHEIGHT - 16 }, WidgetType::tab, WindowColour::secondary, SPR_TAB_LARGE));
// clang-format off
static constexpr auto kMainWidgets = makeWidgets(
makeWindowShim (kWindowTitle, kWindowSize),
makeWidget ({ 0, kTabHeight }, { kWindowSize.width, kWindowSize.height - kTabHeight }, WidgetType::frame, WindowColour::secondary),
makeRemapWidget({ 3, 17 }, { 91, kTabHeight - 16 }, WidgetType::tab, WindowColour::secondary, SPR_TAB_LARGE),
makeRemapWidget({ 94, 17 }, { 91, kTabHeight - 16 }, WidgetType::tab, WindowColour::secondary, SPR_TAB_LARGE)
);
static constexpr auto _windowAboutOpenRCT2Widgets = makeWidgets(
kMainWidgets,
makeWidget({10, 60}, {WW - 20, 20}, WidgetType::labelCentred, WindowColour::secondary, STR_ABOUT_OPENRCT2_DESCRIPTION), // Introduction
makeWidget({30, 90}, {128, 128}, WidgetType::placeholder, WindowColour::secondary, kStringIdNone), // OpenRCT2 Logo
makeWidget({168, 100}, {173, 24}, WidgetType::placeholder, WindowColour::secondary, kStringIdNone), // Build version
makeWidget({344, 100 }, {24, 24}, WidgetType::imgBtn, WindowColour::secondary, ImageId(SPR_G2_COPY), STR_COPY_BUILD_HASH ), // "Copy build info" button
makeWidget({168, 115 + 20}, {200, 14}, WidgetType::placeholder, WindowColour::secondary, STR_UPDATE_AVAILABLE ), // "new version" button
makeWidget({168, 115 + 40}, {200, 14}, WidgetType::button, WindowColour::secondary, STR_CHANGELOG_ELLIPSIS), // changelog button
makeWidget({168, 115 + 60}, {200, 14}, WidgetType::button, WindowColour::secondary, STR_JOIN_DISCORD ), // "join discord" button
makeWidget({168, 115 + 80}, {200, 14}, WidgetType::button, WindowColour::secondary, STR_CONTRIBUTORS_WINDOW_BUTTON) // "contributors" button
makeWidget({10, 60}, {kWindowSize.width - 20, 20}, WidgetType::labelCentred, WindowColour::secondary, STR_ABOUT_OPENRCT2_DESCRIPTION ), // Introduction
makeWidget({30, 90}, {128, 128}, WidgetType::placeholder, WindowColour::secondary, kStringIdNone ), // OpenRCT2 Logo
makeWidget({168, 100}, {173, 24}, WidgetType::placeholder, WindowColour::secondary, kStringIdNone ), // Build version
makeWidget({344, 100 }, {24, 24}, WidgetType::imgBtn, WindowColour::secondary, ImageId(SPR_G2_COPY), STR_COPY_BUILD_HASH), // "Copy build info" button
makeWidget({168, 115 + 20}, {200, 14}, WidgetType::placeholder, WindowColour::secondary, STR_UPDATE_AVAILABLE ), // "new version" button
makeWidget({168, 115 + 40}, {200, 14}, WidgetType::button, WindowColour::secondary, STR_CHANGELOG_ELLIPSIS ), // changelog button
makeWidget({168, 115 + 60}, {200, 14}, WidgetType::button, WindowColour::secondary, STR_JOIN_DISCORD ), // "join discord" button
makeWidget({168, 115 + 80}, {200, 14}, WidgetType::button, WindowColour::secondary, STR_CONTRIBUTORS_WINDOW_BUTTON ) // "contributors" button
);
// clang-format on
@@ -205,7 +205,7 @@ namespace OpenRCT2::Ui::Windows
frame_no = 0;
pressed_widgets = 0;
WindowSetResize(*this, { WW, WH }, { WW, WH });
WindowSetResize(*this, kWindowSize, kWindowSize);
SetWidgets(_windowAboutPageWidgets[p]);
switch (p)
@@ -245,7 +245,7 @@ namespace OpenRCT2::Ui::Windows
// Draw the rest of the text
TextPaint tp{ colours[1], TextAlignment::CENTRE };
auto textCoords = windowPos + ScreenCoordsXY((width / 2) - 1, 240);
auto textWidth = WW - (kPadding * 2);
auto textWidth = kWindowSize.width - (kPadding * 2);
for (auto stringId : _OpenRCT2InfoStrings)
textCoords.y += DrawTextWrapped(rt, textCoords, textWidth, stringId, {}, tp) + 5;
@@ -256,7 +256,7 @@ namespace OpenRCT2::Ui::Windows
{
auto& backgroundWidget = widgets[WIDX_PAGE_BACKGROUND];
auto textCoords = windowPos + ScreenCoordsXY{ backgroundWidget.midX(), backgroundWidget.top + kPadding };
auto textWidth = WW - 20;
auto textWidth = kWindowSize.width - 20;
TextPaint tp{ colours[1], TextAlignment::CENTRE };
// Draw credits
@@ -288,6 +288,6 @@ namespace OpenRCT2::Ui::Windows
WindowBase* AboutOpen()
{
auto* windowMgr = GetWindowManager();
return windowMgr->FocusOrCreate<AboutWindow>(WindowClass::About, { WW, WH }, WF_CENTRE_SCREEN);
return windowMgr->FocusOrCreate<AboutWindow>(WindowClass::About, kWindowSize, WF_CENTRE_SCREEN);
}
} // namespace OpenRCT2::Ui::Windows
+10 -11
View File
@@ -23,9 +23,8 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = STR_ASSET_PACKS;
static constexpr int32_t WW = 400;
static constexpr int32_t WH = 200;
static constexpr StringId kWindowTitle = STR_ASSET_PACKS;
static constexpr ScreenSize kWindowSize = { 400, 200 };
enum WindowAssetPacksWidgetIdx
{
@@ -42,13 +41,13 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto WindowAssetPacksWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ 0, 0 }, { 0, 0 }, WidgetType::labelCentred, WindowColour::secondary, STR_HIGH_PRIORITY),
makeWidget({ 0, 0 }, { 0, 147 }, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL),
makeWidget({ 0, 0 }, { 0, 0 }, WidgetType::labelCentred, WindowColour::secondary, STR_LOW_PRIORITY),
makeWidget({ 0, 0 }, { 0, 0 }, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_ARROW_UP), STR_INCREASE_PRIOTITY_TIP),
makeWidget({ 0, 0 }, { 0, 0 }, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_ARROW_DOWN), STR_DECREASE_PRIOTITY_TIP),
makeWidget({ 0, 0 }, { 0, 0 }, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_RELOAD), STR_RELOAD_ASSET_PACKS_TIP)
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 0, 0 }, { 0, 0 }, WidgetType::labelCentred, WindowColour::secondary, STR_HIGH_PRIORITY),
makeWidget({ 0, 0 }, { 0, 147 }, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL),
makeWidget({ 0, 0 }, { 0, 0 }, WidgetType::labelCentred, WindowColour::secondary, STR_LOW_PRIORITY),
makeWidget({ 0, 0 }, { 0, 0 }, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_ARROW_UP), STR_INCREASE_PRIOTITY_TIP),
makeWidget({ 0, 0 }, { 0, 0 }, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_ARROW_DOWN), STR_DECREASE_PRIOTITY_TIP),
makeWidget({ 0, 0 }, { 0, 0 }, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_RELOAD), STR_RELOAD_ASSET_PACKS_TIP)
);
// clang-format on
@@ -344,6 +343,6 @@ namespace OpenRCT2::Ui::Windows
auto* windowMgr = GetWindowManager();
auto flags = WF_AUTO_POSITION | WF_CENTRE_SCREEN;
return windowMgr->FocusOrCreate<AssetPacksWindow>(WindowClass::AssetPacks, { WW, WH }, flags);
return windowMgr->FocusOrCreate<AssetPacksWindow>(WindowClass::AssetPacks, kWindowSize, flags);
}
} // namespace OpenRCT2::Ui::Windows
+11 -12
View File
@@ -29,9 +29,8 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr int32_t WW = 113;
static constexpr int32_t WH = 96;
static constexpr StringId WINDOW_TITLE = STR_BANNER_WINDOW_TITLE;
static constexpr StringId kWindowTitle = STR_BANNER_WINDOW_TITLE;
static constexpr ScreenSize kWindowSize = { 113, 96 };
enum WindowBannerWidgetIdx
{
@@ -66,14 +65,14 @@ namespace OpenRCT2::Ui::Windows
};
static constexpr auto window_banner_widgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ 3, 17}, {85, 60}, WidgetType::viewport, WindowColour::secondary, 0x0FFFFFFFE ), // tab content panel
makeWidget({WW - 25, 19}, {24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RENAME), STR_CHANGE_BANNER_TEXT_TIP ), // change banner button
makeWidget({WW - 25, 43}, {24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_NO_ENTRY), STR_SET_AS_NO_ENTRY_BANNER_TIP ), // no entry button
makeWidget({WW - 25, 67}, {24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH), STR_DEMOLISH_BANNER_TIP ), // demolish button
makeWidget({ 5, WH - 16}, {12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_MAIN_SIGN_COLOUR_TIP), // high money
makeWidget({ 43, WH - 16}, {39, 12}, WidgetType::dropdownMenu, WindowColour::secondary ), // high money
makeWidget({ 70, WH - 15}, {11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_TEXT_COLOUR_TIP ) // high money
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 3, 17}, {85, 60}, WidgetType::viewport, WindowColour::secondary, 0x0FFFFFFFE ), // tab content panel
makeWidget({kWindowSize.width - 25, 19}, {24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RENAME), STR_CHANGE_BANNER_TEXT_TIP ), // change banner button
makeWidget({kWindowSize.width - 25, 43}, {24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_NO_ENTRY), STR_SET_AS_NO_ENTRY_BANNER_TIP ), // no entry button
makeWidget({kWindowSize.width - 25, 67}, {24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH), STR_DEMOLISH_BANNER_TIP ), // demolish button
makeWidget({ 5, kWindowSize.height - 16}, {12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_MAIN_SIGN_COLOUR_TIP), // high money
makeWidget({ 43, kWindowSize.height - 16}, {39, 12}, WidgetType::dropdownMenu, WindowColour::secondary ), // high money
makeWidget({ 70, kWindowSize.height - 15}, {11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_TEXT_COLOUR_TIP ) // high money
);
// clang-format on
@@ -317,7 +316,7 @@ namespace OpenRCT2::Ui::Windows
if (w != nullptr)
return w;
w = windowMgr->Create<BannerWindow>(WindowClass::Banner, { WW, WH }, 0);
w = windowMgr->Create<BannerWindow>(WindowClass::Banner, kWindowSize, 0);
if (w != nullptr)
w->Initialise(number);
+7 -7
View File
@@ -35,15 +35,14 @@ namespace OpenRCT2::Ui::Windows
WIDX_OPEN_URL,
};
static constexpr int32_t WW = 500;
static constexpr int32_t WH = 400;
static constexpr StringId WINDOW_TITLE = STR_CHANGELOG_TITLE;
constexpr int32_t MIN_WW = 300;
constexpr int32_t MIN_WH = 250;
static constexpr ScreenSize kWindowSize = { 500, 400 };
static constexpr StringId kWindowTitle = STR_CHANGELOG_TITLE;
constexpr int32_t kMinimumWindowWidth = 300;
constexpr int32_t kMinimumWindowHeight = 250;
// clang-format off
static constexpr auto _windowChangelogWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({0, 14}, {500, 382}, WidgetType::resize, WindowColour::secondary ), // content panel
makeWidget({3, 16}, {495, 366}, WidgetType::scroll, WindowColour::secondary, SCROLL_BOTH ), // scroll area
makeWidget({3, 473}, {300, 14}, WidgetType::placeholder, WindowColour::secondary, STR_NEW_RELEASE_DOWNLOAD_PAGE) // changelog button
@@ -127,7 +126,8 @@ namespace OpenRCT2::Ui::Windows
int32_t screenWidth = ContextGetWidth();
int32_t screenHeight = ContextGetHeight();
WindowSetResize(*this, { MIN_WW, MIN_WH }, { (screenWidth * 4) / 5, (screenHeight * 4) / 5 });
WindowSetResize(
*this, { kMinimumWindowWidth, kMinimumWindowHeight }, { (screenWidth * 4) / 5, (screenHeight * 4) / 5 });
}
void OnOpen() override
+106 -109
View File
@@ -32,8 +32,8 @@
namespace OpenRCT2::Ui::Windows
{
constexpr auto CHEATS_MONEY_DEFAULT = 10000.00_GBP;
constexpr auto CHEATS_MONEY_INCREMENT_DIV = 5000.00_GBP;
constexpr auto kCheatsMoneyDefault = 10000.00_GBP;
constexpr auto kCheatsMoneyIncrement = 5000.00_GBP;
// clang-format off
enum
@@ -195,14 +195,13 @@ enum WindowCheatsWidgetIdx
#pragma region MEASUREMENTS
static constexpr StringId WINDOW_TITLE = STR_CHEAT_TITLE;
static constexpr int32_t WW = 249;
static constexpr int32_t WH = 300;
static constexpr StringId kWindowTitle = STR_CHEAT_TITLE;
static constexpr ScreenSize kWindowSize = { 249, 300 };
static constexpr ScreenSize CHEAT_BUTTON = {110, 17};
static constexpr ScreenSize CHEAT_CHECK = {221, 12};
static constexpr ScreenSize CHEAT_SPINNER = {117, 14};
static constexpr ScreenSize MINMAX_BUTTON = {55, 17};
static constexpr ScreenSize kCheatButtonSize = {110, 17};
static constexpr ScreenSize kCheatCheckSize = {221, 12};
static constexpr ScreenSize kCheatSpinnerSize = {117, 14};
static constexpr ScreenSize kMinMaxButtonSize = {55, 17};
static constexpr int32_t kTabWidth = 31;
static constexpr int32_t kTabStart = 3;
@@ -210,8 +209,8 @@ static constexpr int32_t kTabStart = 3;
#pragma endregion
static constexpr auto kMainCheatWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ 0, 43}, {WW, 257}, WidgetType::resize, WindowColour::secondary), /* tab content panel */
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 0, 43}, {kWindowSize.width, 257}, WidgetType::resize, WindowColour::secondary), /* tab content panel */
makeTab ({ 3, 17}, STR_FINANCIAL_CHEATS_TIP ), /* tab 1 */
makeTab ({ 34, 17}, STR_DATE_CHEATS_TIP ), /* tab 2 */
makeTab ({ 65, 17}, STR_GUEST_CHEATS_TIP ), /* tab 3 */
@@ -223,131 +222,131 @@ static constexpr auto kMainCheatWidgets = makeWidgets(
static constexpr auto window_cheats_money_widgets = makeWidgets(
kMainCheatWidgets,
makeWidget ({ 11, 48}, CHEAT_BUTTON, WidgetType::checkbox, WindowColour::secondary, STR_MAKE_PARK_NO_MONEY), // No money
makeWidget ({ 5, 69}, {238, 69}, WidgetType::groupbox, WindowColour::secondary, STR_ADD_SET_MONEY ), // add / set money group frame
makeSpinnerWidgets({ 11, 92}, CHEAT_SPINNER, WidgetType::spinner, WindowColour::secondary ), // money value
makeWidget ({ 11, 111}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_ADD_MONEY ), // add money
makeWidget ({127, 111}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_SET_MONEY ), // set money
makeWidget ({ 11, 145}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_CLEAR_LOAN ) // Clear loan
makeWidget ({ 11, 48}, kCheatButtonSize, WidgetType::checkbox, WindowColour::secondary, STR_MAKE_PARK_NO_MONEY), // No money
makeWidget ({ 5, 69}, {238, 69}, WidgetType::groupbox, WindowColour::secondary, STR_ADD_SET_MONEY ), // add / set money group frame
makeSpinnerWidgets({ 11, 92}, kCheatSpinnerSize, WidgetType::spinner, WindowColour::secondary ), // money value
makeWidget ({ 11, 111}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_ADD_MONEY ), // add money
makeWidget ({127, 111}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_SET_MONEY ), // set money
makeWidget ({ 11, 145}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_CLEAR_LOAN ) // Clear loan
);
static constexpr auto window_cheats_date_widgets = makeWidgets(
kMainCheatWidgets,
makeWidget ({ 5, 48}, {238, 99} , WidgetType::groupbox, WindowColour::secondary, STR_DATE_SET ), // Date group
makeSpinnerWidgets({120, 61}, CHEAT_SPINNER, WidgetType::spinner, WindowColour::secondary ), // Year box
makeSpinnerWidgets({120, 82}, CHEAT_SPINNER, WidgetType::spinner, WindowColour::secondary ), // Month box
makeSpinnerWidgets({120, 103}, CHEAT_SPINNER, WidgetType::spinner, WindowColour::secondary ), // Day box
makeWidget ({ 11, 122}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_DATE_SET ), // Set Date
makeWidget ({127, 122}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_DATE_RESET) // Reset Date
makeWidget ({ 5, 48}, {238, 99} , WidgetType::groupbox, WindowColour::secondary, STR_DATE_SET ), // Date group
makeSpinnerWidgets({120, 61}, kCheatSpinnerSize, WidgetType::spinner, WindowColour::secondary ), // Year box
makeSpinnerWidgets({120, 82}, kCheatSpinnerSize, WidgetType::spinner, WindowColour::secondary ), // Month box
makeSpinnerWidgets({120, 103}, kCheatSpinnerSize, WidgetType::spinner, WindowColour::secondary ), // Day box
makeWidget ({ 11, 122}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_DATE_SET ), // Set Date
makeWidget ({127, 122}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_DATE_RESET) // Reset Date
);
static constexpr auto window_cheats_guests_widgets = makeWidgets(
kMainCheatWidgets,
makeWidget({ 11, 48}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_LARGE_TRAM_GUESTS, STR_CHEAT_LARGE_TRAM_GUESTS_TIP), // large tram
makeWidget({127, 48}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_REMOVE_ALL_GUESTS, STR_CHEAT_REMOVE_ALL_GUESTS_TIP), // remove all guests
makeWidget({ 11, 48}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_LARGE_TRAM_GUESTS, STR_CHEAT_LARGE_TRAM_GUESTS_TIP), // large tram
makeWidget({127, 48}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_REMOVE_ALL_GUESTS, STR_CHEAT_REMOVE_ALL_GUESTS_TIP), // remove all guests
makeWidget({ 5, 70}, {238, 206}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_SET_GUESTS_PARAMETERS ), // Guests parameters group frame
makeWidget({183, 84}, MINMAX_BUTTON, WidgetType::button, WindowColour::secondary, STR_MAX ), // happiness max
makeWidget({127, 84}, MINMAX_BUTTON, WidgetType::button, WindowColour::secondary, STR_MIN ), // happiness min
makeWidget({183, 105}, MINMAX_BUTTON, WidgetType::button, WindowColour::secondary, STR_MAX ), // energy max
makeWidget({127, 105}, MINMAX_BUTTON, WidgetType::button, WindowColour::secondary, STR_MIN ), // energy min
makeWidget({183, 126}, MINMAX_BUTTON, WidgetType::button, WindowColour::secondary, STR_MAX ), // hunger max
makeWidget({127, 126}, MINMAX_BUTTON, WidgetType::button, WindowColour::secondary, STR_MIN ), // hunger min
makeWidget({183, 147}, MINMAX_BUTTON, WidgetType::button, WindowColour::secondary, STR_MAX ), // thirst max
makeWidget({127, 147}, MINMAX_BUTTON, WidgetType::button, WindowColour::secondary, STR_MIN ), // thirst min
makeWidget({183, 168}, MINMAX_BUTTON, WidgetType::button, WindowColour::secondary, STR_MAX ), // nausea max
makeWidget({127, 168}, MINMAX_BUTTON, WidgetType::button, WindowColour::secondary, STR_MIN ), // nausea min
makeWidget({183, 189}, MINMAX_BUTTON, WidgetType::button, WindowColour::secondary, STR_MAX ), // nausea tolerance max
makeWidget({127, 189}, MINMAX_BUTTON, WidgetType::button, WindowColour::secondary, STR_MIN ), // nausea tolerance min
makeWidget({183, 210}, MINMAX_BUTTON, WidgetType::button, WindowColour::secondary, STR_MAX ), // toilet max
makeWidget({127, 210}, MINMAX_BUTTON, WidgetType::button, WindowColour::secondary, STR_MIN ), // toilet min
makeWidget({127, 251}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_MORE_THAN_1 ), // ride intensity > 1
makeWidget({ 11, 251}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_LESS_THAN_15 ), // ride intensity < 15
makeWidget({ 5, 70}, {238, 206}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_SET_GUESTS_PARAMETERS ), // Guests parameters group frame
makeWidget({183, 84}, kMinMaxButtonSize, WidgetType::button, WindowColour::secondary, STR_MAX ), // happiness max
makeWidget({127, 84}, kMinMaxButtonSize, WidgetType::button, WindowColour::secondary, STR_MIN ), // happiness min
makeWidget({183, 105}, kMinMaxButtonSize, WidgetType::button, WindowColour::secondary, STR_MAX ), // energy max
makeWidget({127, 105}, kMinMaxButtonSize, WidgetType::button, WindowColour::secondary, STR_MIN ), // energy min
makeWidget({183, 126}, kMinMaxButtonSize, WidgetType::button, WindowColour::secondary, STR_MAX ), // hunger max
makeWidget({127, 126}, kMinMaxButtonSize, WidgetType::button, WindowColour::secondary, STR_MIN ), // hunger min
makeWidget({183, 147}, kMinMaxButtonSize, WidgetType::button, WindowColour::secondary, STR_MAX ), // thirst max
makeWidget({127, 147}, kMinMaxButtonSize, WidgetType::button, WindowColour::secondary, STR_MIN ), // thirst min
makeWidget({183, 168}, kMinMaxButtonSize, WidgetType::button, WindowColour::secondary, STR_MAX ), // nausea max
makeWidget({127, 168}, kMinMaxButtonSize, WidgetType::button, WindowColour::secondary, STR_MIN ), // nausea min
makeWidget({183, 189}, kMinMaxButtonSize, WidgetType::button, WindowColour::secondary, STR_MAX ), // nausea tolerance max
makeWidget({127, 189}, kMinMaxButtonSize, WidgetType::button, WindowColour::secondary, STR_MIN ), // nausea tolerance min
makeWidget({183, 210}, kMinMaxButtonSize, WidgetType::button, WindowColour::secondary, STR_MAX ), // toilet max
makeWidget({127, 210}, kMinMaxButtonSize, WidgetType::button, WindowColour::secondary, STR_MIN ), // toilet min
makeWidget({127, 251}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_MORE_THAN_1 ), // ride intensity > 1
makeWidget({ 11, 251}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_LESS_THAN_15 ), // ride intensity < 15
makeWidget({ 5, 258+15+6+2}, {238, 62}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_GIVE_ALL_GUESTS ), // Guests inventory group frame
makeWidget({ 11, 279+15+6-3}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CURRENCY_FORMAT ), // give guests money
makeWidget({127, 279+15+6-3}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_SHOP_ITEM_PLURAL_PARK_MAP ), // give guests park maps
makeWidget({ 11, 300+15+6-3}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_SHOP_ITEM_PLURAL_BALLOON ), // give guests balloons
makeWidget({127, 300+15+6-3}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_SHOP_ITEM_PLURAL_UMBRELLA ), // give guests umbrellas
makeWidget({ 5, 258+15+6+2}, {238, 62}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_GIVE_ALL_GUESTS ), // Guests inventory group frame
makeWidget({ 11, 279+15+6-3}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CURRENCY_FORMAT ), // give guests money
makeWidget({127, 279+15+6-3}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_SHOP_ITEM_PLURAL_PARK_MAP ), // give guests park maps
makeWidget({ 11, 300+15+6-3}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_SHOP_ITEM_PLURAL_BALLOON ), // give guests balloons
makeWidget({127, 300+15+6-3}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_SHOP_ITEM_PLURAL_UMBRELLA ), // give guests umbrellas
makeWidget({ 5, 342+6}, {238, 85}, WidgetType::groupbox, WindowColour::secondary, STR_GUEST_BEHAVIOUR ), // Guests behaviour group frame
makeWidget({ 11, 363+1}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_IGNORE_INTENSITY, STR_CHEAT_IGNORE_INTENSITY_TIP ), // guests ignore intensity
makeWidget({ 11, 380+1}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_IGNORE_PRICE, STR_CHEAT_IGNORE_PRICE_TIP ), // guests ignore price
makeWidget({ 11, 397+1}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_DISABLE_VANDALISM, STR_CHEAT_DISABLE_VANDALISM_TIP), // disable vandalism
makeWidget({ 11, 414+1}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_DISABLE_LITTERING, STR_CHEAT_DISABLE_LITTERING_TIP) // disable littering
makeWidget({ 5, 342+6}, {238, 85}, WidgetType::groupbox, WindowColour::secondary, STR_GUEST_BEHAVIOUR ), // Guests behaviour group frame
makeWidget({ 11, 363+1}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_IGNORE_INTENSITY, STR_CHEAT_IGNORE_INTENSITY_TIP ), // guests ignore intensity
makeWidget({ 11, 380+1}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_IGNORE_PRICE, STR_CHEAT_IGNORE_PRICE_TIP ), // guests ignore price
makeWidget({ 11, 397+1}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_DISABLE_VANDALISM, STR_CHEAT_DISABLE_VANDALISM_TIP), // disable vandalism
makeWidget({ 11, 414+1}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_DISABLE_LITTERING, STR_CHEAT_DISABLE_LITTERING_TIP) // disable littering
);
static constexpr auto window_cheats_staff_widgets = makeWidgets(
kMainCheatWidgets,
makeWidget ({ 5, 357-309}, {238, 35}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_STAFF_GROUP ), // Staff group
makeWidget ({126, 371-309}, {111, 14}, WidgetType::dropdownMenu, WindowColour::secondary ), // Staff speed
makeWidget ({225, 372-309}, { 11, 12}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH ), // Staff speed
makeWidget ({ 5, 357-309}, {238, 35}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_STAFF_GROUP ), // Staff group
makeWidget ({126, 371-309}, {111, 14}, WidgetType::dropdownMenu, WindowColour::secondary ), // Staff speed
makeWidget ({225, 372-309}, { 11, 12}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH ), // Staff speed
makeWidget ({ 5, 257-168}, {238, 99}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_MAINTENANCE_GROUP ), // Maintenance group
makeWidget ({ 11, 271-168}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_REMOVE_LITTER ), // Remove litter
makeWidget ({127, 271-168}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_FIX_VANDALISM ), // Fix vandalism
makeWidget ({ 11, 292-168}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_CLEAR_GRASS ), // Clear grass
makeWidget ({127, 292-168}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_MOWED_GRASS ), // Mowed grass
makeWidget ({ 11, 313-168}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_WATER_PLANTS ), // Water plants
makeWidget ({ 11, 334-164}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_DISABLE_PLANT_AGING, STR_CHEAT_DISABLE_PLANT_AGING_TIP ) // Disable plant ageing
makeWidget ({ 5, 257-168}, {238, 99}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_MAINTENANCE_GROUP ), // Maintenance group
makeWidget ({ 11, 271-168}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_REMOVE_LITTER ), // Remove litter
makeWidget ({127, 271-168}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_FIX_VANDALISM ), // Fix vandalism
makeWidget ({ 11, 292-168}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_CLEAR_GRASS ), // Clear grass
makeWidget ({127, 292-168}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_MOWED_GRASS ), // Mowed grass
makeWidget ({ 11, 313-168}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_WATER_PLANTS ), // Water plants
makeWidget ({ 11, 334-164}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_DISABLE_PLANT_AGING, STR_CHEAT_DISABLE_PLANT_AGING_TIP) // Disable plant ageing
);
static constexpr auto window_cheats_park_widgets = makeWidgets(
kMainCheatWidgets,
makeWidget ({ 5, 48}, {238, 60}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_GENERAL_GROUP ), // General group
makeWidget ({ 11, 62}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_OWN_ALL_LAND, STR_CHEAT_OWN_ALL_LAND_TIP ), // Own all land
makeWidget ({127, 62}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_REMOVE_PARK_FENCES, STR_CHEAT_REMOVE_PARK_FENCES_TIP ), // Remove park fences
makeWidget ({ 11, 83}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_OPEN_PARK, STR_CHEAT_OPEN_PARK_TIP ), // open / close park
makeWidget ({ 5, 48}, {238, 60}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_GENERAL_GROUP ), // General group
makeWidget ({ 11, 62}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_OWN_ALL_LAND, STR_CHEAT_OWN_ALL_LAND_TIP ), // Own all land
makeWidget ({127, 62}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_REMOVE_PARK_FENCES, STR_CHEAT_REMOVE_PARK_FENCES_TIP ), // Remove park fences
makeWidget ({ 11, 83}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_OPEN_PARK, STR_CHEAT_OPEN_PARK_TIP ), // open / close park
makeWidget ({ 5, 113}, {238, 75}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_OBJECTIVE_GROUP ), // Objective group
makeWidget ({ 11, 128}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_NEVERENDING_MARKETING, STR_CHEAT_NEVERENDING_MARKETING_TIP), // never ending marketing campaigns
makeWidget ({ 11, 145}, {281, 12}, WidgetType::checkbox, WindowColour::secondary, STR_FORCE_PARK_RATING ), // Force park rating
makeSpinnerWidgets({156, 143}, { 81, 14}, WidgetType::spinner, WindowColour::secondary ), // park rating (3 widgets)
makeWidget ({ 11, 163}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_WIN_SCENARIO ), // Win scenario
makeWidget ({127, 163}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_HAVE_FUN ), // Have fun!
makeWidget ({ 5, 113}, {238, 75}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_OBJECTIVE_GROUP ), // Objective group
makeWidget ({ 11, 128}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_NEVERENDING_MARKETING, STR_CHEAT_NEVERENDING_MARKETING_TIP ), // never ending marketing campaigns
makeWidget ({ 11, 145}, {281, 12}, WidgetType::checkbox, WindowColour::secondary, STR_FORCE_PARK_RATING ), // Force park rating
makeSpinnerWidgets({156, 143}, { 81, 14}, WidgetType::spinner, WindowColour::secondary ), // park rating (3 widgets)
makeWidget ({ 11, 163}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_WIN_SCENARIO ), // Win scenario
makeWidget ({127, 163}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_HAVE_FUN ), // Have fun!
makeWidget ({ 5, 192}, {238, 68}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_GROUP_CONSTRUCTION ), // Construction group
makeWidget ({ 11, 207}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_BUILD_IN_PAUSE_MODE, STR_CHEAT_BUILD_IN_PAUSE_MODE_TIP ), // Build in pause mode
makeWidget ({ 11, 224}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_ALLOW_PATH_AS_QUEUE, STR_CHEAT_ALLOW_PATH_AS_QUEUE_TIP ), // Allow regular footpaths as queue path
makeWidget ({ 11, 241}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES_TIP) // Allow special colours in dropdown
makeWidget ({ 5, 192}, {238, 68}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_GROUP_CONSTRUCTION ), // Construction group
makeWidget ({ 11, 207}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_BUILD_IN_PAUSE_MODE, STR_CHEAT_BUILD_IN_PAUSE_MODE_TIP ), // Build in pause mode
makeWidget ({ 11, 224}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_ALLOW_PATH_AS_QUEUE, STR_CHEAT_ALLOW_PATH_AS_QUEUE_TIP ), // Allow regular footpaths as queue path
makeWidget ({ 11, 241}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES_TIP) // Allow special colours in dropdown
);
static constexpr auto window_cheats_rides_widgets = makeWidgets(
kMainCheatWidgets,
makeWidget({ 11, 48}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_FIX_ALL_RIDES, STR_CHEAT_FIX_ALL_RIDES_TIP ), // Fix all rides
makeWidget({127, 48}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_RENEW_RIDES, STR_CHEAT_RENEW_RIDES_TIP ), // Renew rides
makeWidget({127, 69}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_RESET_CRASH_STATUS, STR_CHEAT_RESET_CRASH_STATUS_TIP ), // Reset crash status
makeWidget({ 11, 69}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CHEAT_10_MINUTE_INSPECTIONS, STR_CHEAT_10_MINUTE_INSPECTIONS_TIP ), // 10 minute inspections
makeWidget({ 11, 48}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_FIX_ALL_RIDES, STR_CHEAT_FIX_ALL_RIDES_TIP ), // Fix all rides
makeWidget({127, 48}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_RENEW_RIDES, STR_CHEAT_RENEW_RIDES_TIP ), // Renew rides
makeWidget({127, 69}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_RESET_CRASH_STATUS, STR_CHEAT_RESET_CRASH_STATUS_TIP ), // Reset crash status
makeWidget({ 11, 69}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CHEAT_10_MINUTE_INSPECTIONS, STR_CHEAT_10_MINUTE_INSPECTIONS_TIP ), // 10 minute inspections
makeWidget({ 5, 95}, {238, 87}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_GROUP_CONSTRUCTION ), // Construction group
makeWidget({ 11, 111}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_ENABLE_ALL_DRAWABLE_TRACK_PIECES, STR_CHEAT_ENABLE_ALL_DRAWABLE_TRACK_PIECES_TIP ), // Show all drawable track pieces
makeWidget({ 11, 128}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_ENABLE_CHAIN_LIFT_ON_ALL_TRACK, STR_CHEAT_ENABLE_CHAIN_LIFT_ON_ALL_TRACK_TIP ), // Enable chain lift on all track
makeWidget({ 11, 145}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_ALLOW_TRACK_PLACE_INVALID_HEIGHTS, STR_CHEAT_ALLOW_TRACK_PLACE_INVALID_HEIGHTS_TIP), // Allow track place at invalid heights
makeWidget({ 11, 162}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_MAKE_DESTRUCTABLE, STR_CHEAT_MAKE_DESTRUCTABLE_TIP ), // All destructible
makeWidget({ 5, 95}, {238, 87}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_GROUP_CONSTRUCTION ), // Construction group
makeWidget({ 11, 111}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_ENABLE_ALL_DRAWABLE_TRACK_PIECES, STR_CHEAT_ENABLE_ALL_DRAWABLE_TRACK_PIECES_TIP ), // Show all drawable track pieces
makeWidget({ 11, 128}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_ENABLE_CHAIN_LIFT_ON_ALL_TRACK, STR_CHEAT_ENABLE_CHAIN_LIFT_ON_ALL_TRACK_TIP ), // Enable chain lift on all track
makeWidget({ 11, 145}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_ALLOW_TRACK_PLACE_INVALID_HEIGHTS, STR_CHEAT_ALLOW_TRACK_PLACE_INVALID_HEIGHTS_TIP), // Allow track place at invalid heights
makeWidget({ 11, 162}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_MAKE_DESTRUCTABLE, STR_CHEAT_MAKE_DESTRUCTABLE_TIP ), // All destructible
makeWidget({ 5, 186}, {238, 102}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_GROUP_OPERATION ), // Operation group
makeWidget({ 11, 201}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_SHOW_ALL_OPERATING_MODES ), // Show all operating modes
makeWidget({ 11, 218}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_UNLOCK_OPERATING_LIMITS, STR_CHEAT_UNLOCK_OPERATING_LIMITS_TIP ), // 410 km/h lift hill etc.
makeWidget({ 11, 235}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_DISABLE_BRAKES_FAILURE, STR_CHEAT_DISABLE_BRAKES_FAILURE_TIP ), // Disable brakes failure
makeWidget({ 11, 252}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_DISABLE_BREAKDOWNS, STR_CHEAT_DISABLE_BREAKDOWNS_TIP ), // Disable all breakdowns
makeWidget({ 11, 269}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_DISABLE_RIDE_VALUE_AGING, STR_CHEAT_DISABLE_RIDE_VALUE_AGING_TIP ), // Disable ride ageing
makeWidget({ 5, 186}, {238, 102}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_GROUP_OPERATION ), // Operation group
makeWidget({ 11, 201}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_SHOW_ALL_OPERATING_MODES ), // Show all operating modes
makeWidget({ 11, 218}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_UNLOCK_OPERATING_LIMITS, STR_CHEAT_UNLOCK_OPERATING_LIMITS_TIP ), // 410 km/h lift hill etc.
makeWidget({ 11, 235}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_DISABLE_BRAKES_FAILURE, STR_CHEAT_DISABLE_BRAKES_FAILURE_TIP ), // Disable brakes failure
makeWidget({ 11, 252}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_DISABLE_BREAKDOWNS, STR_CHEAT_DISABLE_BREAKDOWNS_TIP ), // Disable all breakdowns
makeWidget({ 11, 269}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_DISABLE_RIDE_VALUE_AGING, STR_CHEAT_DISABLE_RIDE_VALUE_AGING_TIP ), // Disable ride ageing
makeWidget({ 5, 292}, {238, 86}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_GROUP_AVAILABILITY ), // Availability group
makeWidget({ 11, 308}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_ALLOW_ARBITRARY_RIDE_TYPE_CHANGES, STR_CHEAT_ALLOW_ARBITRARY_RIDE_TYPE_CHANGES_TIP), // Allow arbitrary ride type changes
makeWidget({ 11, 325}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES ), // Show vehicles from other track types
makeWidget({ 11, 342}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_DISABLE_TRAIN_LENGTH_LIMIT, STR_CHEAT_DISABLE_TRAIN_LENGTH_LIMIT_TIP ), // Disable train length limits
makeWidget({ 11, 359}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_IGNORE_RESEARCH_STATUS, STR_CHEAT_IGNORE_RESEARCH_STATUS_TIP ) // Ignore Research Status
makeWidget({ 5, 292}, {238, 86}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_GROUP_AVAILABILITY ), // Availability group
makeWidget({ 11, 308}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_ALLOW_ARBITRARY_RIDE_TYPE_CHANGES, STR_CHEAT_ALLOW_ARBITRARY_RIDE_TYPE_CHANGES_TIP), // Allow arbitrary ride type changes
makeWidget({ 11, 325}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES ), // Show vehicles from other track types
makeWidget({ 11, 342}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_DISABLE_TRAIN_LENGTH_LIMIT, STR_CHEAT_DISABLE_TRAIN_LENGTH_LIMIT_TIP ), // Disable train length limits
makeWidget({ 11, 359}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_IGNORE_RESEARCH_STATUS, STR_CHEAT_IGNORE_RESEARCH_STATUS_TIP ) // Ignore Research Status
);
static constexpr auto window_cheats_weather_widgets = makeWidgets(
kMainCheatWidgets,
makeWidget ({ 5, 48}, {238, 50}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_WEATHER_GROUP ), // Weather group
makeWidget ({126, 62}, {111, 14}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdNone, STR_CHANGE_WEATHER_TOOLTIP ), // Force weather
makeWidget ({225, 63}, { 11, 12}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_CHANGE_WEATHER_TOOLTIP ), // Force weather
makeWidget ({ 11, 80}, CHEAT_CHECK, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_FREEZE_WEATHER, STR_CHEAT_FREEZE_WEATHER_TIP), // Freeze weather
makeWidget ({ 5, 102}, {238, 37}, WidgetType::groupbox, WindowColour::secondary, STR_FAUNA ), // Fauna group
makeWidget ({ 11, 115}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_CREATE_DUCKS, STR_CREATE_DUCKS_TIP ), // Create ducks
makeWidget ({127, 115}, CHEAT_BUTTON, WidgetType::button, WindowColour::secondary, STR_REMOVE_DUCKS, STR_REMOVE_DUCKS_TIP ) // Remove ducks
makeWidget ({ 5, 48}, {238, 50}, WidgetType::groupbox, WindowColour::secondary, STR_CHEAT_WEATHER_GROUP ), // Weather group
makeWidget ({126, 62}, {111, 14}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdNone, STR_CHANGE_WEATHER_TOOLTIP ), // Force weather
makeWidget ({225, 63}, { 11, 12}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_CHANGE_WEATHER_TOOLTIP ), // Force weather
makeWidget ({ 11, 80}, kCheatCheckSize, WidgetType::checkbox, WindowColour::secondary, STR_CHEAT_FREEZE_WEATHER, STR_CHEAT_FREEZE_WEATHER_TIP), // Freeze weather
makeWidget ({ 5, 102}, {238, 37}, WidgetType::groupbox, WindowColour::secondary, STR_FAUNA ), // Fauna group
makeWidget ({ 11, 115}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_CREATE_DUCKS, STR_CREATE_DUCKS_TIP ), // Create ducks
makeWidget ({127, 115}, kCheatButtonSize, WidgetType::button, WindowColour::secondary, STR_REMOVE_DUCKS, STR_REMOVE_DUCKS_TIP ) // Remove ducks
);
static constexpr std::span<const Widget> window_cheats_page_widgets[] =
@@ -400,7 +399,7 @@ static StringId window_cheats_page_titles[] = {
{
private:
char _moneySpinnerText[kMoneyStringMaxlength]{};
money64 _moneySpinnerValue = CHEATS_MONEY_DEFAULT;
money64 _moneySpinnerValue = kCheatsMoneyDefault;
int32_t _parkRatingSpinnerValue{};
int32_t _yearSpinnerValue = 1;
int32_t _monthSpinnerValue = 1;
@@ -857,14 +856,12 @@ static StringId window_cheats_page_titles[] = {
{
case WIDX_MONEY_SPINNER_INCREMENT:
_moneySpinnerValue = AddClamp<money64>(
CHEATS_MONEY_INCREMENT_DIV * (_moneySpinnerValue / CHEATS_MONEY_INCREMENT_DIV),
CHEATS_MONEY_INCREMENT_DIV);
kCheatsMoneyIncrement * (_moneySpinnerValue / kCheatsMoneyIncrement), kCheatsMoneyIncrement);
InvalidateWidget(WIDX_MONEY_SPINNER);
break;
case WIDX_MONEY_SPINNER_DECREMENT:
_moneySpinnerValue = AddClamp<money64>(
CHEATS_MONEY_INCREMENT_DIV * (_moneySpinnerValue / CHEATS_MONEY_INCREMENT_DIV),
-CHEATS_MONEY_INCREMENT_DIV);
kCheatsMoneyIncrement * (_moneySpinnerValue / kCheatsMoneyIncrement), -kCheatsMoneyIncrement);
InvalidateWidget(WIDX_MONEY_SPINNER);
break;
case WIDX_ADD_MONEY:
@@ -1352,7 +1349,7 @@ static StringId window_cheats_page_titles[] = {
auto* window = windowMgr->BringToFrontByClass(WindowClass::Cheats);
if (window == nullptr)
{
window = windowMgr->Create<CheatsWindow>(WindowClass::Cheats, ScreenCoordsXY(32, 32), { WW, WH });
window = windowMgr->Create<CheatsWindow>(WindowClass::Cheats, ScreenCoordsXY(32, 32), kWindowSize);
}
return window;
}
+11 -12
View File
@@ -37,21 +37,20 @@ namespace OpenRCT2::Ui::Windows
WIDX_FOOTPATH
};
static constexpr StringId WINDOW_TITLE = STR_CLEAR_SCENERY;
static constexpr int32_t WW = 98;
static constexpr int32_t WH = 94;
static constexpr StringId kWindowTitle = STR_CLEAR_SCENERY;
static constexpr ScreenSize kWindowSize = { 98, 94 };
static constexpr ScreenSize CLEAR_SCENERY_BUTTON = { 24, 24 };
static constexpr ScreenSize kClearSceneryButtonSize = { 24, 24 };
// clang-format off
static constexpr auto window_clear_scenery_widgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget ({ 27, 17 }, { 44, 32 }, WidgetType::imgBtn, WindowColour::primary, SPR_LAND_TOOL_SIZE_0, kStringIdNone ), // preview box
makeRemapWidget({ 28, 18 }, { 16, 16 }, WidgetType::trnBtn, WindowColour::secondary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_LAND_TIP ), // decrement size
makeRemapWidget({ 54, 32 }, { 16, 16 }, WidgetType::trnBtn, WindowColour::secondary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_LAND_TIP ), // increment size
makeRemapWidget({ 7, 53 }, CLEAR_SCENERY_BUTTON, WidgetType::flatBtn, WindowColour::secondary, SPR_G2_BUTTON_TREES, STR_CLEAR_SCENERY_REMOVE_SMALL_SCENERY_TIP), // small scenery
makeRemapWidget({ 37, 53 }, CLEAR_SCENERY_BUTTON, WidgetType::flatBtn, WindowColour::secondary, SPR_G2_BUTTON_LARGE_SCENERY, STR_CLEAR_SCENERY_REMOVE_LARGE_SCENERY_TIP), // large scenery
makeRemapWidget({ 67, 53 }, CLEAR_SCENERY_BUTTON, WidgetType::flatBtn, WindowColour::secondary, SPR_G2_BUTTON_FOOTPATH, STR_CLEAR_SCENERY_REMOVE_FOOTPATHS_TIP ) // footpaths
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget ({ 27, 17 }, { 44, 32 }, WidgetType::imgBtn, WindowColour::primary, SPR_LAND_TOOL_SIZE_0, kStringIdNone ), // preview box
makeRemapWidget({ 28, 18 }, { 16, 16 }, WidgetType::trnBtn, WindowColour::secondary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_LAND_TIP ), // decrement size
makeRemapWidget({ 54, 32 }, { 16, 16 }, WidgetType::trnBtn, WindowColour::secondary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_LAND_TIP ), // increment size
makeRemapWidget({ 7, 53 }, kClearSceneryButtonSize, WidgetType::flatBtn, WindowColour::secondary, SPR_G2_BUTTON_TREES, STR_CLEAR_SCENERY_REMOVE_SMALL_SCENERY_TIP), // small scenery
makeRemapWidget({ 37, 53 }, kClearSceneryButtonSize, WidgetType::flatBtn, WindowColour::secondary, SPR_G2_BUTTON_LARGE_SCENERY, STR_CLEAR_SCENERY_REMOVE_LARGE_SCENERY_TIP), // large scenery
makeRemapWidget({ 67, 53 }, kClearSceneryButtonSize, WidgetType::flatBtn, WindowColour::secondary, SPR_G2_BUTTON_FOOTPATH, STR_CLEAR_SCENERY_REMOVE_FOOTPATHS_TIP ) // footpaths
);
// clang-format on
@@ -369,7 +368,7 @@ namespace OpenRCT2::Ui::Windows
{
auto* windowMgr = GetWindowManager();
return windowMgr->FocusOrCreate<CleanSceneryWindow>(
WindowClass::ClearScenery, ScreenCoordsXY(ContextGetWidth() - WW, 29), { WW, WH }, 0);
WindowClass::ClearScenery, ScreenCoordsXY(ContextGetWidth() - kWindowSize.width, 29), kWindowSize, 0);
}
/**
+8 -9
View File
@@ -22,9 +22,8 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = STR_CUSTOM_CURRENCY_WINDOW_TITLE;
static constexpr int32_t WH = 100;
static constexpr int32_t WW = 400;
static constexpr StringId kWindowTitle = STR_CUSTOM_CURRENCY_WINDOW_TITLE;
static constexpr ScreenSize kWindowSize = { 400, 100 };
enum WindowCustomCurrencyWidgetIdx
{
@@ -41,11 +40,11 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto window_custom_currency_widgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeSpinnerWidgets({100, 30}, {101, 11}, WidgetType::spinner, WindowColour::secondary, STR_CURRENCY_FORMAT), // NB: 3 widgets
makeWidget ({120, 50}, { 81, 11}, WidgetType::button, WindowColour::secondary, kStringIdEmpty ),
makeWidget ({220, 50}, {131, 11}, WidgetType::dropdownMenu, WindowColour::secondary ),
makeWidget ({339, 51}, { 11, 9}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH )
makeWindowShim(kWindowTitle, kWindowSize),
makeSpinnerWidgets({100, 30}, {101, 11}, WidgetType::spinner, WindowColour::secondary, STR_CURRENCY_FORMAT), // NB: 3 widgets
makeWidget ({120, 50}, { 81, 11}, WidgetType::button, WindowColour::secondary, kStringIdEmpty ),
makeWidget ({220, 50}, {131, 11}, WidgetType::dropdownMenu, WindowColour::secondary ),
makeWidget ({339, 51}, { 11, 9}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH )
);
// clang-format on
@@ -227,6 +226,6 @@ namespace OpenRCT2::Ui::Windows
WindowBase* CustomCurrencyOpen()
{
auto* windowMgr = GetWindowManager();
return windowMgr->FocusOrCreate<CustomCurrencyWindow>(WindowClass::CustomCurrencyConfig, { WW, WH }, WF_CENTRE_SCREEN);
return windowMgr->FocusOrCreate<CustomCurrencyWindow>(WindowClass::CustomCurrencyConfig, kWindowSize, WF_CENTRE_SCREEN);
}
} // namespace OpenRCT2::Ui::Windows
+3 -4
View File
@@ -31,12 +31,11 @@ namespace OpenRCT2::Ui::Windows
WIDX_TOGGLE_STABLE_PAINT_SORT,
};
constexpr int32_t WINDOW_WIDTH = 200;
constexpr int32_t WINDOW_HEIGHT = 8 + (15 * 6) + 8;
static constexpr ScreenSize kWindowSize = { 200, 8 + (15 * 6) + 8 };
// clang-format off
static constexpr Widget window_debug_paint_widgets[] = {
makeWidget({0, 0}, {WINDOW_WIDTH, WINDOW_HEIGHT}, WidgetType::frame, WindowColour::primary ),
makeWidget({0, 0}, kWindowSize, WidgetType::frame, WindowColour::primary ),
makeWidget({8, 8 + 15 * 0}, { 185, 12}, WidgetType::checkbox, WindowColour::secondary, STR_DEBUG_PAINT_SHOW_WIDE_PATHS ),
makeWidget({8, 8 + 15 * 1}, { 185, 12}, WidgetType::checkbox, WindowColour::secondary, STR_DEBUG_PAINT_SHOW_BLOCKED_TILES ),
makeWidget({8, 8 + 15 * 2}, { 185, 12}, WidgetType::checkbox, WindowColour::secondary, STR_DEBUG_PAINT_SHOW_SEGMENT_HEIGHTS),
@@ -156,7 +155,7 @@ namespace OpenRCT2::Ui::Windows
{
auto* windowMgr = GetWindowManager();
auto* window = windowMgr->FocusOrCreate<DebugPaintWindow>(
WindowClass::DebugPaint, { 16, ContextGetHeight() - 16 - 33 - WINDOW_HEIGHT }, { WINDOW_WIDTH, WINDOW_HEIGHT },
WindowClass::DebugPaint, { 16, ContextGetHeight() - 16 - 33 - kWindowSize.height }, kWindowSize,
WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_TITLE_BAR);
return window;
@@ -20,8 +20,7 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr int32_t WW = 200;
static constexpr int32_t WH = 100;
static constexpr ScreenSize kWindowSize = { 200, 100 };
enum WindowRideDemolishWidgetIdx
{
@@ -34,9 +33,9 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto window_ride_demolish_widgets = makeWidgets(
makeWindowShim(STR_DEMOLISH_RIDE, { WW, WH }),
makeWidget({ 10, WH - 22}, {85, 14}, WidgetType::button, WindowColour::primary, STR_DEMOLISH ),
makeWidget({WW - 95, WH - 22}, {85, 14}, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_CANCEL)
makeWindowShim(STR_DEMOLISH_RIDE, kWindowSize),
makeWidget({ 10, kWindowSize.height - 22}, {85, 14}, WidgetType::button, WindowColour::primary, STR_DEMOLISH ),
makeWidget({kWindowSize.width - 95, kWindowSize.height - 22}, {85, 14}, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_CANCEL)
);
// clang-format on
@@ -87,8 +86,8 @@ namespace OpenRCT2::Ui::Windows
currentRide->formatNameTo(ft);
ft.Add<money64>(_demolishRideCost);
ScreenCoordsXY stringCoords(windowPos.x + WW / 2, windowPos.y + (WH / 2) - 3);
DrawTextWrapped(rt, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE });
ScreenCoordsXY stringCoords(windowPos.x + kWindowSize.width / 2, windowPos.y + (kWindowSize.height / 2) - 3);
DrawTextWrapped(rt, stringCoords, kWindowSize.width - 4, stringId, ft, { TextAlignment::CENTRE });
}
}
};
@@ -105,12 +104,12 @@ namespace OpenRCT2::Ui::Windows
windowMgr->Close(*w);
newWindow = windowMgr->Create<DemolishRidePromptWindow>(
WindowClass::DemolishRidePrompt, windowPos, { WW, WH }, WF_TRANSPARENT);
WindowClass::DemolishRidePrompt, windowPos, kWindowSize, WF_TRANSPARENT);
}
else
{
newWindow = windowMgr->Create<DemolishRidePromptWindow>(
WindowClass::DemolishRidePrompt, { WW, WH }, WF_CENTRE_SCREEN | WF_TRANSPARENT);
WindowClass::DemolishRidePrompt, kWindowSize, WF_CENTRE_SCREEN | WF_TRANSPARENT);
}
newWindow->SetRide(ride);
@@ -31,6 +31,8 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr int32_t kToolbarHeight = 32;
enum
{
WIDX_PREVIOUS_IMAGE, // 1
@@ -446,8 +448,8 @@ namespace OpenRCT2::Ui::Windows
{
auto* windowMgr = GetWindowManager();
auto* window = windowMgr->Create<EditorBottomToolbarWindow>(
WindowClass::BottomToolbar, ScreenCoordsXY(0, ContextGetHeight() - 32), { ContextGetWidth(), 32 },
WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND | WF_NO_TITLE_BAR);
WindowClass::BottomToolbar, ScreenCoordsXY(0, ContextGetHeight() - kToolbarHeight),
{ ContextGetWidth(), kToolbarHeight }, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND | WF_NO_TITLE_BAR);
return window;
}
@@ -32,9 +32,8 @@ namespace OpenRCT2::Ui::Windows
{
#pragma region Widgets
static constexpr int32_t WW = 600;
static constexpr int32_t WH = 400;
static constexpr StringId WINDOW_TITLE = STR_INVENTION_LIST;
static constexpr ScreenSize kWindowSize = { 600, 400 };
static constexpr StringId kWindowTitle = STR_INVENTION_LIST;
enum
{
@@ -53,9 +52,9 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto _inventionListWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 0, 43}, {600, 357}, WidgetType::resize, WindowColour::secondary ),
makeTab ({ 3, 17} ),
makeTab ({ 3, 17} ),
makeWidget({ 4, 56}, {368, 161}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ),
makeWidget({ 4, 231}, {368, 157}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ),
makeWidget({431, 106}, {114, 114}, WidgetType::flatBtn, WindowColour::secondary ),
@@ -155,7 +154,7 @@ namespace OpenRCT2::Ui::Windows
selected_tab = 0;
_selectedResearchItem = nullptr;
WindowSetResize(*this, { WW, WH }, { WW * 2, WH * 2 });
WindowSetResize(*this, kWindowSize, { kWindowSize.width * 2, kWindowSize.height * 2 });
}
void OnClose() override
@@ -588,7 +587,7 @@ namespace OpenRCT2::Ui::Windows
{
auto* windowMgr = GetWindowManager();
return windowMgr->FocusOrCreate<InventionListWindow>(
WindowClass::EditorInventionList, { WW, WH }, WF_NO_SCROLLING | WF_RESIZABLE | WF_CENTRE_SCREEN);
WindowClass::EditorInventionList, kWindowSize, WF_NO_SCROLLING | WF_RESIZABLE | WF_CENTRE_SCREEN);
}
#pragma endregion
@@ -107,9 +107,10 @@ namespace OpenRCT2::Ui::Windows
static constexpr uint8_t _numSourceGameItems = 8;
static constexpr StringId WINDOW_TITLE = STR_OBJECT_SELECTION;
static constexpr int32_t WH = 400;
static constexpr int32_t WW = 600;
static constexpr StringId kWindowTitle = STR_OBJECT_SELECTION;
static constexpr ScreenSize kWindowSize = { 755, 400 };
static constexpr ScreenSize kMinimumWindowSize = { 600, 400 };
static constexpr ScreenSize kMaximumWindowSize = { 1200, 1000 };
static constexpr auto kFilterWidth = 150;
static constexpr auto kPreviewSize = 113;
@@ -218,26 +219,26 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto _window_editor_object_selection_widgets = makeWidgets(
makeWindowShim (WINDOW_TITLE, { WW, WH }),
makeWidget ({ 0, 43}, {WW, 357}, WidgetType::resize, WindowColour::secondary ),
makeWidget ({ 4, 60}, {288, 277}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ),
makeWidget ({391, 45}, {114, 114}, WidgetType::flatBtn, WindowColour::secondary ),
makeWidget ({340, 22}, {122, 14}, WidgetType::button, WindowColour::primary, STR_INSTALL_NEW_TRACK_DESIGN, STR_INSTALL_NEW_TRACK_DESIGN_TIP ),
makeDropdownWidgets({470, 22}, {114, 14}, WidgetType::dropdownMenu, WindowColour::primary, STR_OBJECT_FILTER, STR_OBJECT_FILTER_TIP ),
makeWidget ({ 4, 45}, {211, 14}, WidgetType::textBox, WindowColour::secondary ),
makeWidget ({218, 45}, { 70, 14}, WidgetType::button, WindowColour::secondary, STR_OBJECT_SEARCH_CLEAR ),
makeWidget ({ 3, 73}, {285, 4}, WidgetType::imgBtn, WindowColour::secondary ),
makeTab ({ 3, 47}),
makeTab ({ 34, 47}),
makeTab ({ 65, 47}),
makeTab ({ 96, 47}),
makeTab ({127, 47}),
makeTab ({158, 47}),
makeTab ({189, 47}),
makeWidget ({ 4, 80}, {145, 14}, WidgetType::tableHeader, WindowColour::secondary ),
makeWidget ({149, 80}, {143, 14}, WidgetType::tableHeader, WindowColour::secondary ),
makeWidget ({700, 50}, { 24, 24}, WidgetType::imgBtn, WindowColour::secondary, SPR_G2_RELOAD, STR_RELOAD_OBJECT_TIP ),
makeTab ({ 3, 17}, STR_STRING_DEFINED_TOOLTIP )
makeWindowShim (kWindowTitle, kWindowSize),
makeWidget ({ 0, 43}, {kWindowSize.width, 357}, WidgetType::resize, WindowColour::secondary ),
makeWidget ({ 4, 60}, { 288, 277}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ),
makeWidget ({391, 45}, { 114, 114}, WidgetType::flatBtn, WindowColour::secondary ),
makeWidget ({340, 22}, { 122, 14}, WidgetType::button, WindowColour::primary, STR_INSTALL_NEW_TRACK_DESIGN, STR_INSTALL_NEW_TRACK_DESIGN_TIP ),
makeDropdownWidgets({470, 22}, { 114, 14}, WidgetType::dropdownMenu, WindowColour::primary, STR_OBJECT_FILTER, STR_OBJECT_FILTER_TIP ),
makeWidget ({ 4, 45}, { 211, 14}, WidgetType::textBox, WindowColour::secondary ),
makeWidget ({218, 45}, { 70, 14}, WidgetType::button, WindowColour::secondary, STR_OBJECT_SEARCH_CLEAR ),
makeWidget ({ 3, 73}, { 285, 4}, WidgetType::imgBtn, WindowColour::secondary ),
makeTab ({ 3, 47} ),
makeTab ({ 34, 47} ),
makeTab ({ 65, 47} ),
makeTab ({ 96, 47} ),
makeTab ({127, 47} ),
makeTab ({158, 47} ),
makeTab ({189, 47} ),
makeWidget ({ 4, 80}, { 145, 14}, WidgetType::tableHeader, WindowColour::secondary ),
makeWidget ({149, 80}, { 143, 14}, WidgetType::tableHeader, WindowColour::secondary ),
makeWidget ({700, 50}, { 24, 24}, WidgetType::imgBtn, WindowColour::secondary, SPR_G2_RELOAD, STR_RELOAD_OBJECT_TIP ),
makeTab ({ 3, 17}, STR_STRING_DEFINED_TOOLTIP )
// Copied object type times...
);
// clang-format on
@@ -283,7 +284,7 @@ namespace OpenRCT2::Ui::Windows
selected_tab = 0;
selected_list_item = -1;
WindowSetResize(*this, { WW, WH }, { 1200, 1000 });
WindowSetResize(*this, kMinimumWindowSize, kMaximumWindowSize);
_listSortType = RIDE_SORT_TYPE;
_listSortDescending = false;
@@ -494,7 +495,7 @@ namespace OpenRCT2::Ui::Windows
void OnResize() override
{
WindowSetResize(*this, { WW, WH }, { 1200, 1000 });
WindowSetResize(*this, kMinimumWindowSize, kMaximumWindowSize);
}
static constexpr StringId kSourceStringIds[] = {
@@ -1631,7 +1632,7 @@ namespace OpenRCT2::Ui::Windows
{
auto* windowMgr = GetWindowManager();
return windowMgr->FocusOrCreate<EditorObjectSelectionWindow>(
WindowClass::EditorObjectSelection, { 755, 400 }, WF_10 | WF_RESIZABLE | WF_CENTRE_SCREEN);
WindowClass::EditorObjectSelection, kWindowSize, WF_10 | WF_RESIZABLE | WF_CENTRE_SCREEN);
}
// Used for forced closure
+9 -11
View File
@@ -34,8 +34,7 @@ namespace OpenRCT2::Ui::Windows
static constexpr int32_t kScrollPadding = 2;
static constexpr int32_t kScrollWidth = (kImageSize * kNumColumns) + kScrollBarWidth + 4;
static constexpr int32_t kScrollHeight = (kImageSize * kNumRows);
static constexpr int32_t kWindowWidth = kScrollWidth + 28;
static constexpr int32_t kWindowHeight = kScrollHeight + 51;
static constexpr ScreenSize kWindowSize = { kScrollWidth + 28, kScrollHeight + 51 };
struct EntranceSelection
{
@@ -59,11 +58,11 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto _widgets = makeWidgets(
makeWindowShim(kWindowTitle, { kWindowWidth, kWindowHeight }),
makeWidget ({ 0, 43 }, { kWindowWidth, kWindowHeight - 43 }, WidgetType::resize, WindowColour::secondary ),
makeTab ({ 3, 17 }, kStringIdNone ),
makeWidget ({ 2, 45 }, { kScrollWidth, kScrollHeight }, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ),
makeWidget ({ kWindowWidth - 26, 59 }, { 24, 24 }, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_OBJECTS_90 )
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget ({ 0, 43 }, { kWindowSize.width, kWindowSize.height - 43 }, WidgetType::resize, WindowColour::secondary ),
makeTab ({ 3, 17 }, kStringIdNone ),
makeWidget ({ 2, 45 }, { kScrollWidth, kScrollHeight }, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ),
makeWidget ({ kWindowSize.width - 26, 59 }, { 24, 24 }, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_OBJECTS_90 )
);
// clang-format on
@@ -247,8 +246,8 @@ namespace OpenRCT2::Ui::Windows
list_information_type = 0;
auto maxHeight = static_cast<int16_t>(kWindowHeight + kImageSize * (GetNumRows() - 1));
WindowSetResize(*this, { kWindowWidth, kWindowHeight }, { kWindowWidth, maxHeight });
auto maxHeight = static_cast<int16_t>(kWindowSize.height + kImageSize * (GetNumRows() - 1));
WindowSetResize(*this, kWindowSize, { kWindowSize.width, maxHeight });
pressed_widgets |= 1LL << WIDX_TAB;
@@ -395,8 +394,7 @@ namespace OpenRCT2::Ui::Windows
if (window != nullptr)
return window;
window = windowMgr->Create<EditorParkEntrance>(
WindowClass::EditorParkEntrance, { kWindowWidth, kWindowHeight }, WF_10 | WF_RESIZABLE);
window = windowMgr->Create<EditorParkEntrance>(WindowClass::EditorParkEntrance, kWindowSize, WF_10 | WF_RESIZABLE);
return window;
}
@@ -214,45 +214,45 @@ namespace OpenRCT2::Ui::Windows
static constexpr auto window_editor_scenario_options_objective_widgets = makeWidgets(
makeOptionsWidgets(STR_SCENARIO_OPTIONS_OBJECTIVE, kSizeObjective),
makeWidget ({ 8, 48}, {344, 12}, WidgetType::label, WindowColour::secondary, STR_OBJECTIVE_DROPDOWN_LABEL ),
makeWidget ({ 98, 48}, {344, 12}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdNone, STR_SELECT_OBJECTIVE_FOR_THIS_SCENARIO_TIP ),
makeWidget ({430, 49}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_OBJECTIVE_FOR_THIS_SCENARIO_TIP ),
makeWidget ({ 28, 65}, {140, 12}, WidgetType::label, WindowColour::secondary, kStringIdEmpty ),
makeSpinnerWidgets({158, 65}, {120, 12}, WidgetType::button, WindowColour::secondary ), // NB: 3 widgets
makeWidget ({ 28, 82}, {140, 12}, WidgetType::label, WindowColour::secondary, STR_WINDOW_OBJECTIVE_DATE ),
makeSpinnerWidgets({158, 82}, {120, 12}, WidgetType::button, WindowColour::secondary ), // NB: 3 widgets
makeWidget ({ 14, 99}, {340, 12}, WidgetType::checkbox, WindowColour::secondary, STR_HARD_PARK_RATING, STR_HARD_PARK_RATING_TIP )
makeWidget ({ 8, 48}, {344, 12}, WidgetType::label, WindowColour::secondary, STR_OBJECTIVE_DROPDOWN_LABEL ),
makeWidget ({ 98, 48}, {344, 12}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdNone, STR_SELECT_OBJECTIVE_FOR_THIS_SCENARIO_TIP),
makeWidget ({430, 49}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_OBJECTIVE_FOR_THIS_SCENARIO_TIP),
makeWidget ({ 28, 65}, {140, 12}, WidgetType::label, WindowColour::secondary, kStringIdEmpty ),
makeSpinnerWidgets({158, 65}, {120, 12}, WidgetType::button, WindowColour::secondary ), // NB: 3 widgets
makeWidget ({ 28, 82}, {140, 12}, WidgetType::label, WindowColour::secondary, STR_WINDOW_OBJECTIVE_DATE ),
makeSpinnerWidgets({158, 82}, {120, 12}, WidgetType::button, WindowColour::secondary ), // NB: 3 widgets
makeWidget ({ 14, 99}, {340, 12}, WidgetType::checkbox, WindowColour::secondary, STR_HARD_PARK_RATING, STR_HARD_PARK_RATING_TIP )
);
static constexpr auto window_editor_scenario_options_scenario_details_widgets = makeWidgets(
makeOptionsWidgets(STR_SCENARIO_OPTIONS_SCENARIO_DETAILS, kSizeScenarioDetails),
makeWidget ({370, 48}, { 75, 12}, WidgetType::button, WindowColour::secondary, STR_CHANGE, STR_CHANGE_NAME_OF_PARK_TIP ),
makeWidget ({370, 65}, { 75, 12}, WidgetType::button, WindowColour::secondary, STR_CHANGE, STR_CHANGE_NAME_OF_SCENARIO_TIP ),
makeWidget ({ 98, 82}, {180, 12}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdNone, STR_SELECT_WHICH_GROUP_THIS_SCENARIO_APPEARS_IN),
makeWidget ({266, 83}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_WHICH_GROUP_THIS_SCENARIO_APPEARS_IN),
makeWidget ({370, 99}, { 75, 12}, WidgetType::button, WindowColour::secondary, STR_CHANGE, STR_CHANGE_DETAIL_NOTES_ABOUT_PARK_SCENARIO_TIP)
makeWidget ({370, 48}, { 75, 12}, WidgetType::button, WindowColour::secondary, STR_CHANGE, STR_CHANGE_NAME_OF_PARK_TIP ),
makeWidget ({370, 65}, { 75, 12}, WidgetType::button, WindowColour::secondary, STR_CHANGE, STR_CHANGE_NAME_OF_SCENARIO_TIP ),
makeWidget ({ 98, 82}, {180, 12}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdNone, STR_SELECT_WHICH_GROUP_THIS_SCENARIO_APPEARS_IN),
makeWidget ({266, 83}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_WHICH_GROUP_THIS_SCENARIO_APPEARS_IN),
makeWidget ({370, 99}, { 75, 12}, WidgetType::button, WindowColour::secondary, STR_CHANGE, STR_CHANGE_DETAIL_NOTES_ABOUT_PARK_SCENARIO_TIP)
);
static constexpr auto window_editor_scenario_options_financial_widgets = makeWidgets(
makeOptionsWidgets(STR_SCENARIO_OPTIONS_FINANCIAL, kSizeFinancial),
makeWidget ({ 8, 48}, {kSizeFinancial.width - 16, 12}, WidgetType::checkbox, WindowColour::secondary, STR_MAKE_PARK_NO_MONEY, STR_MAKE_PARK_NO_MONEY_TIP ),
makeWidget ({ 5, 63}, {kSizeFinancial.width - 10, 67}, WidgetType::groupbox, WindowColour::secondary, STR_GROUP_LOAN_OPTIONS ),
makeWidget ({ 9, 77}, { 250, 12}, WidgetType::label, WindowColour::secondary, STR_INIT_LOAN_LABEL ),
makeSpinnerWidgets({268, 77}, { 100, 12}, WidgetType::spinner, WindowColour::secondary ), // NB: 3 widgets
makeWidget ({ 9, 94}, { 250, 12}, WidgetType::label, WindowColour::secondary, STR_MAX_LOAN_LABEL ),
makeSpinnerWidgets({268, 94}, { 100, 12}, WidgetType::spinner, WindowColour::secondary ), // NB: 3 widgets
makeWidget ({ 9, 111}, { 280, 12}, WidgetType::label, WindowColour::secondary, STR_INTEREST_RATE_LABEL ),
makeSpinnerWidgets({298, 111}, { 70, 12}, WidgetType::spinner, WindowColour::secondary ), // NB: 3 widgets
makeWidget ({ 10, 111}, {kSizeFinancial.width - 16, 12}, WidgetType::checkbox, WindowColour::secondary, STR_RCT1_INTEREST, STR_RCT1_INTEREST_TIP ),
makeWidget ({ 5, 133}, {kSizeFinancial.width - 10, 87}, WidgetType::groupbox, WindowColour::secondary, STR_GROUP_BUSINESS_MODEL ),
makeWidget ({ 9, 150}, { 250, 12}, WidgetType::label, WindowColour::secondary, STR_INIT_CASH_LABEL ),
makeSpinnerWidgets({268, 150}, { 100, 12}, WidgetType::spinner, WindowColour::secondary ), // NB: 3 widgets
makeWidget ({ 9, 167}, { 150, 12}, WidgetType::label, WindowColour::secondary, STR_EARNINGS_LABEL ),
makeWidget ({158, 167}, { 210, 12}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdNone, STR_PAY_FOR_PARK_PAY_FOR_RIDES_TIP),
makeWidget ({356, 168}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_PAY_FOR_PARK_PAY_FOR_RIDES_TIP),
makeWidget ({ 9, 184}, { 280, 12}, WidgetType::label, WindowColour::secondary, STR_ENTRY_PRICE_LABEL ),
makeSpinnerWidgets({298, 184}, { 70, 12}, WidgetType::spinner, WindowColour::secondary ), // NB: 3 widgets
makeWidget ({ 10, 201}, {kSizeFinancial.width - 16, 12}, WidgetType::checkbox, WindowColour::secondary, STR_FORBID_MARKETING, STR_FORBID_MARKETING_TIP )
makeWidget ({ 8, 48}, {kSizeFinancial.width - 16, 12}, WidgetType::checkbox, WindowColour::secondary, STR_MAKE_PARK_NO_MONEY, STR_MAKE_PARK_NO_MONEY_TIP ),
makeWidget ({ 5, 63}, {kSizeFinancial.width - 10, 67}, WidgetType::groupbox, WindowColour::secondary, STR_GROUP_LOAN_OPTIONS ),
makeWidget ({ 9, 77}, { 250, 12}, WidgetType::label, WindowColour::secondary, STR_INIT_LOAN_LABEL ),
makeSpinnerWidgets({268, 77}, { 100, 12}, WidgetType::spinner, WindowColour::secondary ), // NB: 3 widgets
makeWidget ({ 9, 94}, { 250, 12}, WidgetType::label, WindowColour::secondary, STR_MAX_LOAN_LABEL ),
makeSpinnerWidgets({268, 94}, { 100, 12}, WidgetType::spinner, WindowColour::secondary ), // NB: 3 widgets
makeWidget ({ 9, 111}, { 280, 12}, WidgetType::label, WindowColour::secondary, STR_INTEREST_RATE_LABEL ),
makeSpinnerWidgets({298, 111}, { 70, 12}, WidgetType::spinner, WindowColour::secondary ), // NB: 3 widgets
makeWidget ({ 10, 111}, {kSizeFinancial.width - 16, 12}, WidgetType::checkbox, WindowColour::secondary, STR_RCT1_INTEREST, STR_RCT1_INTEREST_TIP ),
makeWidget ({ 5, 133}, {kSizeFinancial.width - 10, 87}, WidgetType::groupbox, WindowColour::secondary, STR_GROUP_BUSINESS_MODEL ),
makeWidget ({ 9, 150}, { 250, 12}, WidgetType::label, WindowColour::secondary, STR_INIT_CASH_LABEL ),
makeSpinnerWidgets({268, 150}, { 100, 12}, WidgetType::spinner, WindowColour::secondary ), // NB: 3 widgets
makeWidget ({ 9, 167}, { 150, 12}, WidgetType::label, WindowColour::secondary, STR_EARNINGS_LABEL ),
makeWidget ({158, 167}, { 210, 12}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdNone, STR_PAY_FOR_PARK_PAY_FOR_RIDES_TIP),
makeWidget ({356, 168}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_PAY_FOR_PARK_PAY_FOR_RIDES_TIP),
makeWidget ({ 9, 184}, { 280, 12}, WidgetType::label, WindowColour::secondary, STR_ENTRY_PRICE_LABEL ),
makeSpinnerWidgets({298, 184}, { 70, 12}, WidgetType::spinner, WindowColour::secondary ), // NB: 3 widgets
makeWidget ({ 10, 201}, {kSizeFinancial.width - 16, 12}, WidgetType::checkbox, WindowColour::secondary, STR_FORBID_MARKETING, STR_FORBID_MARKETING_TIP )
);
static constexpr auto window_editor_scenario_options_guests_widgets = makeWidgets(
+50 -52
View File
@@ -81,17 +81,16 @@ namespace OpenRCT2::Ui::Windows
#pragma region Measurements
static constexpr ScreenSize kWindowSizeResearch = { 320, 207 };
static constexpr ScreenSize kTabContentSizeResearch = kWindowSizeResearch - ScreenSize(0, kTabBarHeight);
static constexpr ScreenSize kWindowSizeSummary = { 530, 309 };
static constexpr ScreenSize kTabContentSizeSummary = kWindowSizeSummary - ScreenSize(0, kTabBarHeight);
static constexpr ScreenSize kWindowSizeGraphsMarketing = { 530, 257 };
static constexpr ScreenSize kTabContentSizeGraphsMarketing = kWindowSizeGraphsMarketing - ScreenSize(0, kTabBarHeight);
static constexpr int32_t kCostPerWeekOffset = 321;
static constexpr int32_t kHeightSummary = 309;
static constexpr int32_t kHeightResearch = 207;
static constexpr int32_t kHeightOtherTabs = 257;
static constexpr int32_t WW_RESEARCH = 320;
static constexpr int32_t WW_OTHER_TABS = 530;
static constexpr int32_t RSH_SUMMARY = 266;
static constexpr int32_t RSH_RESEARCH = 164;
static constexpr int32_t RSH_OTHER_TABS = 214;
static constexpr int32_t RSW_RESEARCH = WW_RESEARCH;
static constexpr int32_t RSW_OTHER_TABS = WW_OTHER_TABS;
#pragma endregion
@@ -101,59 +100,59 @@ namespace OpenRCT2::Ui::Windows
static constexpr auto makeFinancesWidgets = [](StringId title, ScreenSize resizeSize, ScreenSize frameSize) {
return makeWidgets(
makeWindowShim(title, frameSize),
makeWidget({ 0, 43 }, resizeSize, WidgetType::resize, WindowColour::secondary),
makeTab({ 3, 17 }, STR_FINANCES_SHOW_SUMMARY_TAB_TIP),
makeTab({ 34, 17 }, STR_FINANCES_SHOW_CASH_TAB_TIP),
makeTab({ 65, 17 }, STR_FINANCES_SHOW_PARK_VALUE_TAB_TIP),
makeTab({ 96, 17 }, STR_FINANCES_SHOW_WEEKLY_PROFIT_TAB_TIP),
makeTab({ 127, 17 }, STR_FINANCES_SHOW_MARKETING_TAB_TIP),
makeTab({ 158, 17 }, STR_FINANCES_RESEARCH_TIP)
makeWidget({ 0, 43 }, resizeSize, WidgetType::resize, WindowColour::secondary),
makeTab ({ 3, 17 }, STR_FINANCES_SHOW_SUMMARY_TAB_TIP),
makeTab ({ 34, 17 }, STR_FINANCES_SHOW_CASH_TAB_TIP),
makeTab ({ 65, 17 }, STR_FINANCES_SHOW_PARK_VALUE_TAB_TIP),
makeTab ({ 96, 17 }, STR_FINANCES_SHOW_WEEKLY_PROFIT_TAB_TIP),
makeTab ({ 127, 17 }, STR_FINANCES_SHOW_MARKETING_TAB_TIP),
makeTab ({ 158, 17 }, STR_FINANCES_RESEARCH_TIP)
);
};
static constexpr auto _windowFinancesSummaryWidgets = makeWidgets(
makeFinancesWidgets(STR_FINANCIAL_SUMMARY,{ RSW_OTHER_TABS, RSH_SUMMARY }, { WW_OTHER_TABS, kHeightSummary }),
makeFinancesWidgets(STR_FINANCIAL_SUMMARY, kTabContentSizeSummary, kWindowSizeSummary),
makeWidget ({130, 50}, {391, 211}, WidgetType::scroll, WindowColour::secondary, SCROLL_HORIZONTAL ),
makeSpinnerWidgets({ 64, 279}, { 97, 14}, WidgetType::spinner, WindowColour::secondary, STR_FINANCES_SUMMARY_LOAN_VALUE) // NB: 3 widgets
);
static constexpr auto _windowFinancesCashWidgets = makeWidgets(
makeFinancesWidgets(STR_FINANCIAL_GRAPH, { RSW_OTHER_TABS, RSH_OTHER_TABS }, { WW_OTHER_TABS, kHeightOtherTabs })
makeFinancesWidgets(STR_FINANCIAL_GRAPH, kTabContentSizeGraphsMarketing, kWindowSizeGraphsMarketing)
);
static constexpr auto _windowFinancesParkValueWidgets = makeWidgets(
makeFinancesWidgets(STR_PARK_VALUE_GRAPH, { RSW_OTHER_TABS, RSH_OTHER_TABS }, { WW_OTHER_TABS, kHeightOtherTabs })
makeFinancesWidgets(STR_PARK_VALUE_GRAPH, kTabContentSizeGraphsMarketing, kWindowSizeGraphsMarketing)
);
static constexpr auto _windowFinancesProfitWidgets = makeWidgets(
makeFinancesWidgets(STR_PROFIT_GRAPH, { RSW_OTHER_TABS, RSH_OTHER_TABS }, { WW_OTHER_TABS, kHeightOtherTabs })
makeFinancesWidgets(STR_PROFIT_GRAPH, kTabContentSizeGraphsMarketing, kWindowSizeGraphsMarketing)
);
static constexpr auto _windowFinancesMarketingWidgets = makeWidgets(
makeFinancesWidgets(STR_MARKETING, { RSW_OTHER_TABS, RSH_OTHER_TABS }, { WW_OTHER_TABS, kHeightOtherTabs }),
makeWidget({3, 47}, { WW_OTHER_TABS - 6, 45}, WidgetType::groupbox, WindowColour::tertiary , STR_MARKETING_CAMPAIGNS_IN_OPERATION ),
makeWidget({3, 47}, { WW_OTHER_TABS - 6, 206}, WidgetType::groupbox, WindowColour::tertiary , STR_MARKETING_CAMPAIGNS_AVAILABLE ),
makeWidget({8, 0}, {WW_OTHER_TABS - 16, 14}, WidgetType::imgBtn, WindowColour::secondary, 0xFFFFFFFF, STR_START_THIS_MARKETING_CAMPAIGN),
makeWidget({8, 0}, {WW_OTHER_TABS - 16, 14}, WidgetType::imgBtn, WindowColour::secondary, 0xFFFFFFFF, STR_START_THIS_MARKETING_CAMPAIGN),
makeWidget({8, 0}, {WW_OTHER_TABS - 16, 14}, WidgetType::imgBtn, WindowColour::secondary, 0xFFFFFFFF, STR_START_THIS_MARKETING_CAMPAIGN),
makeWidget({8, 0}, {WW_OTHER_TABS - 16, 14}, WidgetType::imgBtn, WindowColour::secondary, 0xFFFFFFFF, STR_START_THIS_MARKETING_CAMPAIGN),
makeWidget({8, 0}, {WW_OTHER_TABS - 16, 14}, WidgetType::imgBtn, WindowColour::secondary, 0xFFFFFFFF, STR_START_THIS_MARKETING_CAMPAIGN),
makeWidget({8, 0}, {WW_OTHER_TABS - 16, 14}, WidgetType::imgBtn, WindowColour::secondary, 0xFFFFFFFF, STR_START_THIS_MARKETING_CAMPAIGN)
makeFinancesWidgets(STR_MARKETING, kTabContentSizeGraphsMarketing, kWindowSizeGraphsMarketing),
makeWidget({3, 47}, { kWindowSizeGraphsMarketing.width - 6, 45}, WidgetType::groupbox, WindowColour::tertiary , STR_MARKETING_CAMPAIGNS_IN_OPERATION ),
makeWidget({3, 47}, { kWindowSizeGraphsMarketing.width - 6, 206}, WidgetType::groupbox, WindowColour::tertiary , STR_MARKETING_CAMPAIGNS_AVAILABLE ),
makeWidget({8, 0}, {kWindowSizeGraphsMarketing.width - 16, 14}, WidgetType::imgBtn, WindowColour::secondary, 0xFFFFFFFF, STR_START_THIS_MARKETING_CAMPAIGN),
makeWidget({8, 0}, {kWindowSizeGraphsMarketing.width - 16, 14}, WidgetType::imgBtn, WindowColour::secondary, 0xFFFFFFFF, STR_START_THIS_MARKETING_CAMPAIGN),
makeWidget({8, 0}, {kWindowSizeGraphsMarketing.width - 16, 14}, WidgetType::imgBtn, WindowColour::secondary, 0xFFFFFFFF, STR_START_THIS_MARKETING_CAMPAIGN),
makeWidget({8, 0}, {kWindowSizeGraphsMarketing.width - 16, 14}, WidgetType::imgBtn, WindowColour::secondary, 0xFFFFFFFF, STR_START_THIS_MARKETING_CAMPAIGN),
makeWidget({8, 0}, {kWindowSizeGraphsMarketing.width - 16, 14}, WidgetType::imgBtn, WindowColour::secondary, 0xFFFFFFFF, STR_START_THIS_MARKETING_CAMPAIGN),
makeWidget({8, 0}, {kWindowSizeGraphsMarketing.width - 16, 14}, WidgetType::imgBtn, WindowColour::secondary, 0xFFFFFFFF, STR_START_THIS_MARKETING_CAMPAIGN)
);
static constexpr auto _windowFinancesResearchWidgets = makeWidgets(
makeFinancesWidgets(STR_RESEARCH_FUNDING, { RSW_RESEARCH, RSH_RESEARCH }, { WW_RESEARCH, kHeightResearch }),
makeWidget({ 3, 47}, { WW_RESEARCH - 6, 45}, WidgetType::groupbox, WindowColour::tertiary, STR_RESEARCH_FUNDING_ ),
makeWidget({ 8, 59}, { 160, 14}, WidgetType::dropdownMenu, WindowColour::tertiary, 0xFFFFFFFF, STR_SELECT_LEVEL_OF_RESEARCH_AND_DEVELOPMENT),
makeWidget({156, 60}, { 11, 12}, WidgetType::button, WindowColour::tertiary, STR_DROPDOWN_GLYPH, STR_SELECT_LEVEL_OF_RESEARCH_AND_DEVELOPMENT),
makeWidget({ 3, 96}, { WW_RESEARCH - 6, 107}, WidgetType::groupbox, WindowColour::tertiary, STR_RESEARCH_PRIORITIES ),
makeWidget({ 8, 108}, {WW_RESEARCH - 14, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_TRANSPORT_RIDES, STR_RESEARCH_NEW_TRANSPORT_RIDES_TIP ),
makeWidget({ 8, 121}, {WW_RESEARCH - 14, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_GENTLE_RIDES, STR_RESEARCH_NEW_GENTLE_RIDES_TIP ),
makeWidget({ 8, 134}, {WW_RESEARCH - 14, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_ROLLER_COASTERS, STR_RESEARCH_NEW_ROLLER_COASTERS_TIP ),
makeWidget({ 8, 147}, {WW_RESEARCH - 14, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_THRILL_RIDES, STR_RESEARCH_NEW_THRILL_RIDES_TIP ),
makeWidget({ 8, 160}, {WW_RESEARCH - 14, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_WATER_RIDES, STR_RESEARCH_NEW_WATER_RIDES_TIP ),
makeWidget({ 8, 173}, {WW_RESEARCH - 14, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_SHOPS_AND_STALLS, STR_RESEARCH_NEW_SHOPS_AND_STALLS_TIP ),
makeWidget({ 8, 186}, {WW_RESEARCH - 14, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_SCENERY_AND_THEMING, STR_RESEARCH_NEW_SCENERY_AND_THEMING_TIP )
makeFinancesWidgets(STR_RESEARCH_FUNDING, kTabContentSizeResearch, kWindowSizeResearch),
makeWidget({ 3, 47}, { kWindowSizeResearch.width - 6, 45}, WidgetType::groupbox, WindowColour::tertiary, STR_RESEARCH_FUNDING_ ),
makeWidget({ 8, 59}, { 160, 14}, WidgetType::dropdownMenu, WindowColour::tertiary, 0xFFFFFFFF, STR_SELECT_LEVEL_OF_RESEARCH_AND_DEVELOPMENT),
makeWidget({156, 60}, { 11, 12}, WidgetType::button, WindowColour::tertiary, STR_DROPDOWN_GLYPH, STR_SELECT_LEVEL_OF_RESEARCH_AND_DEVELOPMENT),
makeWidget({ 3, 96}, {kWindowSizeResearch.width - 6, 107}, WidgetType::groupbox, WindowColour::tertiary, STR_RESEARCH_PRIORITIES ),
makeWidget({ 8, 108}, {kWindowSizeResearch.width - 14, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_TRANSPORT_RIDES, STR_RESEARCH_NEW_TRANSPORT_RIDES_TIP ),
makeWidget({ 8, 121}, {kWindowSizeResearch.width - 14, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_GENTLE_RIDES, STR_RESEARCH_NEW_GENTLE_RIDES_TIP ),
makeWidget({ 8, 134}, {kWindowSizeResearch.width - 14, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_ROLLER_COASTERS, STR_RESEARCH_NEW_ROLLER_COASTERS_TIP ),
makeWidget({ 8, 147}, {kWindowSizeResearch.width - 14, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_THRILL_RIDES, STR_RESEARCH_NEW_THRILL_RIDES_TIP ),
makeWidget({ 8, 160}, {kWindowSizeResearch.width - 14, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_WATER_RIDES, STR_RESEARCH_NEW_WATER_RIDES_TIP ),
makeWidget({ 8, 173}, {kWindowSizeResearch.width - 14, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_SHOPS_AND_STALLS, STR_RESEARCH_NEW_SHOPS_AND_STALLS_TIP ),
makeWidget({ 8, 186}, {kWindowSizeResearch.width - 14, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_SCENERY_AND_THEMING, STR_RESEARCH_NEW_SCENERY_AND_THEMING_TIP )
);
// clang-format on
@@ -487,14 +486,14 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
if (p == WINDOW_FINANCES_PAGE_RESEARCH)
{
width = WW_RESEARCH;
height = kHeightResearch;
width = kWindowSizeResearch.width;
height = kWindowSizeResearch.height;
flags &= ~WF_RESIZABLE;
}
else if (p == WINDOW_FINANCES_PAGE_SUMMARY)
{
width = WW_OTHER_TABS;
height = kHeightSummary;
width = kWindowSizeSummary.width;
height = kWindowSizeSummary.height;
flags &= ~WF_RESIZABLE;
}
else if (
@@ -507,12 +506,12 @@ namespace OpenRCT2::Ui::Windows
// constrain the window height between tabs (e.g. chart tabs)
height -= getTitleBarDiffNormal();
WindowSetResize(*this, { WW_OTHER_TABS, kHeightOtherTabs }, kMaxWindowSize);
WindowSetResize(*this, kWindowSizeGraphsMarketing, kMaxWindowSize);
}
else
{
width = WW_OTHER_TABS;
height = kHeightOtherTabs;
width = kWindowSizeGraphsMarketing.width;
height = kWindowSizeGraphsMarketing.height;
flags &= ~WF_RESIZABLE;
}
@@ -881,8 +880,7 @@ namespace OpenRCT2::Ui::Windows
static FinancesWindow* FinancesWindowOpen(uint8_t page)
{
auto* windowMgr = Ui::GetWindowManager();
auto* window = windowMgr->FocusOrCreate<FinancesWindow>(
WindowClass::Finances, { WW_OTHER_TABS, kHeightSummary }, WF_10);
auto* window = windowMgr->FocusOrCreate<FinancesWindow>(WindowClass::Finances, kWindowSizeSummary, WF_10);
if (window != nullptr && page != WINDOW_FINANCES_PAGE_SUMMARY)
window->SetPage(page);
@@ -893,7 +891,7 @@ namespace OpenRCT2::Ui::Windows
WindowBase* FinancesOpen()
{
auto* windowMgr = Ui::GetWindowManager();
return windowMgr->FocusOrCreate<FinancesWindow>(WindowClass::Finances, { WW_OTHER_TABS, kHeightSummary }, WF_10);
return windowMgr->FocusOrCreate<FinancesWindow>(WindowClass::Finances, kWindowSizeSummary, WF_10);
}
WindowBase* FinancesResearchOpen()
+12 -13
View File
@@ -85,9 +85,8 @@ namespace OpenRCT2::Ui::Windows
#pragma region Measurements
static constexpr StringId WINDOW_TITLE = STR_FOOTPATHS;
static constexpr int32_t WH_WINDOW = 421;
static constexpr int32_t WW_WINDOW = 106;
static constexpr StringId kWindowTitle = STR_FOOTPATHS;
static constexpr ScreenSize kWindowSize = { 106, 421 };
#pragma endregion
@@ -124,31 +123,31 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto window_footpath_widgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW_WINDOW, WH_WINDOW }),
makeWindowShim(kWindowTitle, kWindowSize),
// Type group
makeWidget({ 3, 17}, {100, 95}, WidgetType::groupbox, WindowColour::primary , STR_TYPE ),
makeWidget({ 6, 30}, { 47, 36}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_FOOTPATH_TIP ),
makeWidget({53, 30}, { 47, 36}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_QUEUE_LINE_PATH_TIP ),
makeWidget({29, 69}, { 47, 36}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_OBJECT_SELECTION_FOOTPATH_RAILINGS ),
makeWidget({ 3, 17}, {100, 95}, WidgetType::groupbox, WindowColour::primary , STR_TYPE ),
makeWidget({ 6, 30}, { 47, 36}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_FOOTPATH_TIP ),
makeWidget({53, 30}, { 47, 36}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_QUEUE_LINE_PATH_TIP ),
makeWidget({29, 69}, { 47, 36}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_OBJECT_SELECTION_FOOTPATH_RAILINGS ),
// Direction group
makeWidget({ 3, 115}, {100, 77}, WidgetType::groupbox, WindowColour::primary , STR_DIRECTION ),
makeWidget({ 3, 115}, {100, 77}, WidgetType::groupbox, WindowColour::primary , STR_DIRECTION ),
makeWidget({53, 127}, { 45, 29}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_DIRECTION_NE), STR_DIRECTION_TIP ),
makeWidget({53, 156}, { 45, 29}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_DIRECTION_SE), STR_DIRECTION_TIP ),
makeWidget({ 8, 156}, { 45, 29}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_DIRECTION_SW), STR_DIRECTION_TIP ),
makeWidget({ 8, 127}, { 45, 29}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_DIRECTION_NW), STR_DIRECTION_TIP ),
// Slope group
makeWidget({ 3, 195}, {100, 41}, WidgetType::groupbox, WindowColour::primary , STR_SLOPE ),
makeWidget({ 3, 195}, {100, 41}, WidgetType::groupbox, WindowColour::primary , STR_SLOPE ),
makeWidget({17, 207}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_DOWN), STR_SLOPE_DOWN_TIP ),
makeWidget({41, 207}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_LEVEL), STR_LEVEL_TIP ),
makeWidget({65, 207}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_UP), STR_SLOPE_UP_TIP ),
makeWidget({ 8, 242}, { 90, 90}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_CONSTRUCT_THE_SELECTED_FOOTPATH_SECTION_TIP),
makeWidget({ 8, 242}, { 90, 90}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_CONSTRUCT_THE_SELECTED_FOOTPATH_SECTION_TIP),
makeWidget({30, 335}, { 46, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH_CURRENT_SECTION), STR_REMOVE_PREVIOUS_FOOTPATH_SECTION_TIP ),
// Mode group
makeWidget({ 3, 361}, {100, 54}, WidgetType::groupbox, WindowColour::primary ),
makeWidget({ 3, 361}, {100, 54}, WidgetType::groupbox, WindowColour::primary ),
makeWidget({13, 372}, { 36, 36}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_FOOTPATH_LAND), STR_CONSTRUCT_FOOTPATH_ON_LAND_TIP ),
makeWidget({57, 372}, { 36, 36}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_FOOTPATH_BRIDGE), STR_CONSTRUCT_BRIDGE_OR_TUNNEL_FOOTPATH_TIP )
);
@@ -1634,7 +1633,7 @@ namespace OpenRCT2::Ui::Windows
}
auto* windowMgr = GetWindowManager();
return windowMgr->FocusOrCreate<FootpathWindow>(WindowClass::Footpath, { WW_WINDOW, WH_WINDOW }, 0);
return windowMgr->FocusOrCreate<FootpathWindow>(WindowClass::Footpath, kWindowSize, 0);
}
void WindowFootpathResetSelectedPath()
@@ -686,12 +686,12 @@ namespace OpenRCT2::Ui::Windows
int32_t screenHeight = ContextGetHeight();
// Figure out how much line height we have to work with.
uint32_t line_height = FontGetLineHeight(FontStyle::Medium);
int32_t toolbar_height = line_height * 2 + 12;
uint32_t lineHeight = FontGetLineHeight(FontStyle::Medium);
int32_t toolbarHeight = lineHeight * 2 + 12;
auto* windowMgr = GetWindowManager();
auto* window = windowMgr->Create<GameBottomToolbar>(
WindowClass::BottomToolbar, ScreenCoordsXY(0, screenHeight - toolbar_height), { screenWidth, toolbar_height },
WindowClass::BottomToolbar, ScreenCoordsXY(0, screenHeight - toolbarHeight), { screenWidth, toolbarHeight },
WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND | WF_NO_TITLE_BAR);
return window;
+35 -36
View File
@@ -45,9 +45,8 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = STR_STRINGID;
static constexpr int32_t WH = 157;
static constexpr int32_t WW = 192;
static constexpr StringId kWindowTitle = STR_STRINGID;
static constexpr ScreenSize kWindowSize = { 192, 157 };
enum WindowGuestPage
{
@@ -109,53 +108,53 @@ namespace OpenRCT2::Ui::Windows
validate_global_widx(WC_PEEP, WIDX_PICKUP);
static constexpr int32_t TabWidth = 30;
static constexpr int32_t kTabWidth = 30;
// clang-format off
static constexpr auto kMainGuestWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 0, 43 }, { 192, 114 }, WidgetType::resize, WindowColour::secondary), /* Resize */
makeTab({ 3, 17 }, STR_SHOW_GUEST_VIEW_TIP), /* Tab 1 */
makeTab({ 34, 17 }, STR_SHOW_GUEST_NEEDS_TIP), /* Tab 2 */
makeTab({ 65, 17 }, STR_SHOW_GUEST_VISITED_RIDES_TIP), /* Tab 3 */
makeTab({ 96, 17 }, STR_SHOW_GUEST_FINANCE_TIP), /* Tab 4 */
makeTab({ 127, 17 }, STR_SHOW_GUEST_THOUGHTS_TIP), /* Tab 5 */
makeTab({ 158, 17 }, STR_SHOW_GUEST_ITEMS_TIP), /* Tab 6 */
makeTab({ 189, 17 }, STR_DEBUG_TIP) /* Tab 7 */
makeTab({ 3, 17 }, STR_SHOW_GUEST_VIEW_TIP), /* Tab 1 */
makeTab({ 34, 17 }, STR_SHOW_GUEST_NEEDS_TIP), /* Tab 2 */
makeTab({ 65, 17 }, STR_SHOW_GUEST_VISITED_RIDES_TIP), /* Tab 3 */
makeTab({ 96, 17 }, STR_SHOW_GUEST_FINANCE_TIP), /* Tab 4 */
makeTab({ 127, 17 }, STR_SHOW_GUEST_THOUGHTS_TIP), /* Tab 5 */
makeTab({ 158, 17 }, STR_SHOW_GUEST_ITEMS_TIP), /* Tab 6 */
makeTab({ 189, 17 }, STR_DEBUG_TIP) /* Tab 7 */
);
static constexpr auto _guestWindowWidgetsOverview = makeWidgets(
kMainGuestWidgets,
makeWidget({ 3, 45}, {164, 12}, WidgetType::labelCentred, WindowColour::secondary ), // Label Thought marquee
makeWidget({ 3, 57}, {164, 87}, WidgetType::viewport, WindowColour::secondary ), // Viewport
makeWidget({ 3, 144}, {164, 11}, WidgetType::labelCentred, WindowColour::secondary ), // Label Action
makeWidget({167, 45}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_PICKUP_BTN), STR_PICKUP_TIP ), // Pickup Button
makeWidget({167, 69}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RENAME), STR_NAME_GUEST_TIP ), // Rename Button
makeWidget({167, 93}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_LOCATE), STR_LOCATE_SUBJECT_TIP ), // Locate Button
makeWidget({167, 117}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_TRACK_PEEP), STR_TOGGLE_GUEST_TRACKING_TIP) // Track Button
makeWidget({ 3, 45}, {164, 12}, WidgetType::labelCentred, WindowColour::secondary ), // Label Thought marquee
makeWidget({ 3, 57}, {164, 87}, WidgetType::viewport, WindowColour::secondary ), // Viewport
makeWidget({ 3, 144}, {164, 11}, WidgetType::labelCentred, WindowColour::secondary ), // Label Action
makeWidget({167, 45}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_PICKUP_BTN), STR_PICKUP_TIP ), // Pickup Button
makeWidget({167, 69}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RENAME), STR_NAME_GUEST_TIP ), // Rename Button
makeWidget({167, 93}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_LOCATE), STR_LOCATE_SUBJECT_TIP ), // Locate Button
makeWidget({167, 117}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_TRACK_PEEP), STR_TOGGLE_GUEST_TRACKING_TIP) // Track Button
);
static constexpr auto _guestWindowWidgetsStats = makeWidgets(
kMainGuestWidgets,
makeWidget ({ 3, (kListRowHeight * 0) + 4 + 43 }, { 62, 10 }, WidgetType::label, WindowColour::secondary, STR_GUEST_STAT_HAPPINESS_LABEL),
makeProgressBar({ 65, (kListRowHeight * 0) + 4 + 43 }, { 119, 10 }, COLOUR_BRIGHT_GREEN, 0, 19),
makeWidget ({ 3, (kListRowHeight * 1) + 4 + 43 }, { 62, 10 }, WidgetType::label, WindowColour::secondary, STR_GUEST_STAT_ENERGY_LABEL),
makeProgressBar({ 65, (kListRowHeight * 1) + 4 + 43 }, { 119, 10 }, COLOUR_BRIGHT_GREEN, 0, 19),
makeWidget ({ 3, (kListRowHeight * 2) + 4 + 43 }, { 62, 10 }, WidgetType::label, WindowColour::secondary, STR_GUEST_STAT_HUNGER_LABEL),
makeProgressBar({ 65, (kListRowHeight * 2) + 4 + 43 }, { 119, 10 }, COLOUR_BRIGHT_RED, 67, 100),
makeWidget ({ 3, (kListRowHeight * 3) + 4 + 43 }, { 62, 10 }, WidgetType::label, WindowColour::secondary, STR_GUEST_STAT_THIRST_LABEL),
makeProgressBar({ 65, (kListRowHeight * 3) + 4 + 43 }, { 119, 10 }, COLOUR_BRIGHT_RED, 67, 100),
makeWidget ({ 3, (kListRowHeight * 4) + 4 + 43 }, { 62, 10 }, WidgetType::label, WindowColour::secondary, STR_GUEST_STAT_NAUSEA_LABEL),
makeProgressBar({ 65, (kListRowHeight * 4) + 4 + 43 }, { 119, 10 }, COLOUR_BRIGHT_RED, 47, 100),
makeWidget ({ 3, (kListRowHeight * 5) + 4 + 43 }, { 62, 10 }, WidgetType::label, WindowColour::secondary, STR_GUEST_STAT_TOILET_LABEL),
makeProgressBar({ 65, (kListRowHeight * 5) + 4 + 43 }, { 119, 10 }, COLOUR_BRIGHT_RED, 62, 100),
makeWidget ({ 3, (kListRowHeight * 0) + 4 + 43 }, { 62, 10 }, WidgetType::label, WindowColour::secondary, STR_GUEST_STAT_HAPPINESS_LABEL),
makeProgressBar({ 65, (kListRowHeight * 0) + 4 + 43 }, { 119, 10 }, COLOUR_BRIGHT_GREEN, 0, 19),
makeWidget ({ 3, (kListRowHeight * 1) + 4 + 43 }, { 62, 10 }, WidgetType::label, WindowColour::secondary, STR_GUEST_STAT_ENERGY_LABEL),
makeProgressBar({ 65, (kListRowHeight * 1) + 4 + 43 }, { 119, 10 }, COLOUR_BRIGHT_GREEN, 0, 19),
makeWidget ({ 3, (kListRowHeight * 2) + 4 + 43 }, { 62, 10 }, WidgetType::label, WindowColour::secondary, STR_GUEST_STAT_HUNGER_LABEL),
makeProgressBar({ 65, (kListRowHeight * 2) + 4 + 43 }, { 119, 10 }, COLOUR_BRIGHT_RED, 67, 100),
makeWidget ({ 3, (kListRowHeight * 3) + 4 + 43 }, { 62, 10 }, WidgetType::label, WindowColour::secondary, STR_GUEST_STAT_THIRST_LABEL),
makeProgressBar({ 65, (kListRowHeight * 3) + 4 + 43 }, { 119, 10 }, COLOUR_BRIGHT_RED, 67, 100),
makeWidget ({ 3, (kListRowHeight * 4) + 4 + 43 }, { 62, 10 }, WidgetType::label, WindowColour::secondary, STR_GUEST_STAT_NAUSEA_LABEL),
makeProgressBar({ 65, (kListRowHeight * 4) + 4 + 43 }, { 119, 10 }, COLOUR_BRIGHT_RED, 47, 100),
makeWidget ({ 3, (kListRowHeight * 5) + 4 + 43 }, { 62, 10 }, WidgetType::label, WindowColour::secondary, STR_GUEST_STAT_TOILET_LABEL),
makeProgressBar({ 65, (kListRowHeight * 5) + 4 + 43 }, { 119, 10 }, COLOUR_BRIGHT_RED, 62, 100),
makeWidget ({ 3, (kListRowHeight * 7) + 9 + 43 }, { 180, 2 }, WidgetType::horizontalSeparator, WindowColour::secondary)
);
static constexpr auto _guestWindowWidgetsRides = makeWidgets(
kMainGuestWidgets,
makeWidget({ 3, 45 }, { 186, 10 }, WidgetType::label, WindowColour::secondary, STR_GUEST_LABEL_RIDES_BEEN_ON),
makeWidget({ 3, 57 }, { 186, 87 }, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL)
makeWidget({ 3, 57 }, { 186, 87 }, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL)
);
static constexpr auto _guestWindowWidgetsFinance = makeWidgets(
@@ -217,7 +216,7 @@ namespace OpenRCT2::Ui::Windows
_marqueePosition = 0;
picked_peep_frame = 0;
WindowSetResize(*this, { WW, WH }, { 500, 450 });
WindowSetResize(*this, kWindowSize, { 500, 450 });
selected_list_item = -1;
}
@@ -1912,11 +1911,11 @@ namespace OpenRCT2::Ui::Windows
auto* window = static_cast<GuestWindow*>(windowMgr->BringToFrontByNumber(WindowClass::Peep, peep->Id.ToUnderlying()));
if (window == nullptr)
{
int32_t windowWidth = 192;
auto windowSize = kWindowSize;
if (Config::Get().general.DebuggingTools)
windowWidth += TabWidth;
windowSize.width += kTabWidth;
window = windowMgr->Create<GuestWindow>(WindowClass::Peep, { windowWidth, 157 }, WF_RESIZABLE);
window = windowMgr->Create<GuestWindow>(WindowClass::Peep, windowSize, WF_RESIZABLE);
if (window == nullptr)
{
return nullptr;
+41 -42
View File
@@ -34,9 +34,8 @@ using namespace OpenRCT2::Numerics;
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = STR_GUESTS;
static constexpr int32_t WH = 330;
static constexpr int32_t WW = 350;
static constexpr StringId kWindowTitle = STR_GUESTS;
static constexpr ScreenSize kWindowSize = { 350, 330 };
enum WindowGuestListWidgetIdx
{
@@ -58,18 +57,18 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto window_guest_list_widgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ 0, 43}, {350, 287}, WidgetType::resize, WindowColour::secondary ), // tab content panel
makeWidget({ 5, 59}, { 80, 12}, WidgetType::dropdownMenu, WindowColour::secondary, STR_ARG_4_PAGE_X ), // page dropdown
makeWidget({ 73, 60}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH ), // page dropdown button
makeWidget({120, 59}, {142, 12}, WidgetType::dropdownMenu, WindowColour::secondary, 0xFFFFFFFF, STR_INFORMATION_TYPE_TIP ), // information type dropdown
makeWidget({250, 60}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_INFORMATION_TYPE_TIP ), // information type dropdown button
makeWidget({273, 46}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_MAP), STR_SHOW_GUESTS_ON_MAP_TIP ), // map
makeWidget({297, 46}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_SEARCH), STR_GUESTS_FILTER_BY_NAME_TIP), // filter by name
makeWidget({321, 46}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_TRACK_PEEP), STR_TRACKED_GUESTS_ONLY_TIP ), // tracking
makeTab ({ 3, 17}, STR_INDIVIDUAL_GUESTS_TIP ), // tab 1
makeTab ({ 34, 17}, STR_SUMMARISED_GUESTS_TIP ), // tab 2
makeWidget({ 3, 72}, {344, 255}, WidgetType::scroll, WindowColour::secondary, SCROLL_BOTH ) // guest list
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 0, 43}, {350, 287}, WidgetType::resize, WindowColour::secondary ), // tab content panel
makeWidget({ 5, 59}, { 80, 12}, WidgetType::dropdownMenu, WindowColour::secondary, STR_ARG_4_PAGE_X ), // page dropdown
makeWidget({ 73, 60}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH ), // page dropdown button
makeWidget({120, 59}, {142, 12}, WidgetType::dropdownMenu, WindowColour::secondary, 0xFFFFFFFF, STR_INFORMATION_TYPE_TIP ), // information type dropdown
makeWidget({250, 60}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_INFORMATION_TYPE_TIP ), // information type dropdown button
makeWidget({273, 46}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_MAP), STR_SHOW_GUESTS_ON_MAP_TIP ), // map
makeWidget({297, 46}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_SEARCH), STR_GUESTS_FILTER_BY_NAME_TIP), // filter by name
makeWidget({321, 46}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_TRACK_PEEP), STR_TRACKED_GUESTS_ONLY_TIP ), // tracking
makeTab ({ 3, 17}, STR_INDIVIDUAL_GUESTS_TIP ), // tab 1
makeTab ({ 34, 17}, STR_SUMMARISED_GUESTS_TIP ), // tab 2
makeWidget({ 3, 72}, {344, 255}, WidgetType::scroll, WindowColour::secondary, SCROLL_BOTH ) // guest list
);
// clang-format on
@@ -131,10 +130,10 @@ namespace OpenRCT2::Ui::Windows
char Name[256];
};
static constexpr uint8_t SUMMARISED_GUEST_ROW_HEIGHT = kScrollableRowHeight + 11;
static constexpr auto GUESTS_PER_PAGE = 2000;
static constexpr const auto GUEST_PAGE_HEIGHT = GUESTS_PER_PAGE * kScrollableRowHeight;
static constexpr size_t MaxGroups = 240;
static constexpr uint8_t kSummarisedGuestsRowHeight = kScrollableRowHeight + 11;
static constexpr auto kGuestsPerPage = 2000;
static constexpr const auto kGuestPageHeight = kGuestsPerPage * kScrollableRowHeight;
static constexpr size_t kMaxGroups = 240;
TabId _selectedTab{};
GuestViewType _selectedView{};
@@ -170,7 +169,7 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_PAGE_DROPDOWN].type = WidgetType::empty;
widgets[WIDX_PAGE_DROPDOWN_BUTTON].type = WidgetType::empty;
WindowSetResize(*this, { 350, 330 }, { 500, 450 });
WindowSetResize(*this, kWindowSize, { 500, 450 });
RefreshList();
}
@@ -407,12 +406,12 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_GUEST_LIST].right = width - 4;
widgets[WIDX_GUEST_LIST].bottom = height - 15;
widgets[WIDX_MAP].left = 273 - 350 + width;
widgets[WIDX_MAP].right = 296 - 350 + width;
widgets[WIDX_FILTER_BY_NAME].left = 297 - 350 + width;
widgets[WIDX_FILTER_BY_NAME].right = 320 - 350 + width;
widgets[WIDX_TRACKING].left = 321 - 350 + width;
widgets[WIDX_TRACKING].right = 344 - 350 + width;
widgets[WIDX_MAP].left = 273 - kWindowSize.width + width;
widgets[WIDX_MAP].right = 296 - kWindowSize.width + width;
widgets[WIDX_FILTER_BY_NAME].left = 297 - kWindowSize.width + width;
widgets[WIDX_FILTER_BY_NAME].right = 320 - kWindowSize.width + width;
widgets[WIDX_TRACKING].left = 321 - kWindowSize.width + width;
widgets[WIDX_TRACKING].right = 344 - kWindowSize.width + width;
if (_numPages > 1)
{
@@ -485,7 +484,7 @@ namespace OpenRCT2::Ui::Windows
case TabId::Individual:
// Count the number of guests
y = static_cast<int32_t>(_guestList.size()) * kScrollableRowHeight;
_numPages = (_guestList.size() + GUESTS_PER_PAGE - 1) / GUESTS_PER_PAGE;
_numPages = (_guestList.size() + kGuestsPerPage - 1) / kGuestsPerPage;
if (_numPages == 0)
_selectedPage = 0;
else if (_selectedPage >= _numPages)
@@ -498,12 +497,12 @@ namespace OpenRCT2::Ui::Windows
{
RefreshGroups();
}
y = static_cast<int32_t>(_groups.size() * SUMMARISED_GUEST_ROW_HEIGHT);
y = static_cast<int32_t>(_groups.size() * kSummarisedGuestsRowHeight);
break;
}
y -= static_cast<int32_t>(GUEST_PAGE_HEIGHT * _selectedPage);
y = std::max(0, std::min(y, GUEST_PAGE_HEIGHT));
y -= static_cast<int32_t>(kGuestPageHeight * _selectedPage);
y = std::max(0, std::min(y, kGuestPageHeight));
if (_highlightedIndex)
{
@@ -523,8 +522,8 @@ namespace OpenRCT2::Ui::Windows
void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
auto i = screenCoords.y / (_selectedTab == TabId::Individual ? kScrollableRowHeight : SUMMARISED_GUEST_ROW_HEIGHT);
i += static_cast<int32_t>(_selectedPage * GUESTS_PER_PAGE);
auto i = screenCoords.y / (_selectedTab == TabId::Individual ? kScrollableRowHeight : kSummarisedGuestsRowHeight);
i += static_cast<int32_t>(_selectedPage * kGuestsPerPage);
if (static_cast<size_t>(i) != _highlightedIndex)
{
_highlightedIndex = i;
@@ -539,7 +538,7 @@ namespace OpenRCT2::Ui::Windows
case TabId::Individual:
{
auto i = screenCoords.y / kScrollableRowHeight;
i += static_cast<int32_t>(_selectedPage * GUESTS_PER_PAGE);
i += static_cast<int32_t>(_selectedPage * kGuestsPerPage);
for (const auto& guestItem : _guestList)
{
if (i == 0)
@@ -557,7 +556,7 @@ namespace OpenRCT2::Ui::Windows
}
case TabId::Summarised:
{
auto i = static_cast<size_t>(screenCoords.y / SUMMARISED_GUEST_ROW_HEIGHT);
auto i = static_cast<size_t>(screenCoords.y / kSummarisedGuestsRowHeight);
if (i < _groups.size())
{
_filterArguments = _groups[i].Arguments;
@@ -648,7 +647,7 @@ namespace OpenRCT2::Ui::Windows
void DrawScrollIndividual(RenderTarget& rt)
{
size_t index = 0;
auto y = static_cast<int32_t>(_selectedPage) * -GUEST_PAGE_HEIGHT;
auto y = static_cast<int32_t>(_selectedPage) * -kGuestPageHeight;
for (const auto& guestItem : _guestList)
{
// Check if y is beyond the scroll control
@@ -719,7 +718,7 @@ namespace OpenRCT2::Ui::Windows
for (auto& group : _groups)
{
// Check if y is beyond the scroll control
if (y + SUMMARISED_GUEST_ROW_HEIGHT + 1 >= rt.y)
if (y + kSummarisedGuestsRowHeight + 1 >= rt.y)
{
// Check if y is beyond the scroll control
if (y >= rt.y + rt.height)
@@ -729,7 +728,7 @@ namespace OpenRCT2::Ui::Windows
StringId format = STR_BLACK_STRING;
if (index == _highlightedIndex)
{
GfxFilterRect(rt, { 0, y, 800, y + SUMMARISED_GUEST_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1);
GfxFilterRect(rt, { 0, y, 800, y + kSummarisedGuestsRowHeight }, FilterPaletteID::PaletteDarken1);
format = STR_WINDOW_COLOUR_2_STRINGID;
}
@@ -759,7 +758,7 @@ namespace OpenRCT2::Ui::Windows
ft.Add<uint32_t>(group.NumGuests);
DrawTextBasic(rt, { 326, y }, format, ft, { TextAlignment::RIGHT });
}
y += SUMMARISED_GUEST_ROW_HEIGHT;
y += kSummarisedGuestsRowHeight;
index++;
}
}
@@ -858,10 +857,10 @@ namespace OpenRCT2::Ui::Windows
return a.NumGuests > b.NumGuests;
});
// Remove up to MaxGroups
if (_groups.size() > MaxGroups)
// Remove up to kMaxGroups
if (_groups.size() > kMaxGroups)
{
_groups.resize(MaxGroups);
_groups.resize(kMaxGroups);
}
}
@@ -955,7 +954,7 @@ namespace OpenRCT2::Ui::Windows
auto* window = windowMgr->BringToFrontByClass(WindowClass::GuestList);
if (window == nullptr)
{
window = windowMgr->Create<GuestListWindow>(WindowClass::GuestList, { 350, 330 }, WF_10 | WF_RESIZABLE);
window = windowMgr->Create<GuestListWindow>(WindowClass::GuestList, kWindowSize, WF_10 | WF_RESIZABLE);
}
return window;
}
+11 -12
View File
@@ -44,20 +44,19 @@ namespace OpenRCT2::Ui::Windows
WIDX_CANCEL
};
static constexpr StringId WINDOW_TITLE = STR_TRACK_DESIGN_INSTALL_WINDOW_TITLE;
static constexpr int32_t WW = 380;
static constexpr int32_t WH = 460;
constexpr int32_t PREVIEW_BUTTONS_LEFT = WW - 25;
constexpr int32_t ACTION_BUTTONS_LEFT = WW - 100;
static constexpr StringId kWindowTitle = STR_TRACK_DESIGN_INSTALL_WINDOW_TITLE;
static constexpr ScreenSize kWindowSize = { 380, 460 };
constexpr int32_t kPreviewButtonsLeft = kWindowSize.width - 25;
constexpr int32_t kActionButtonsLeft = kWindowSize.width - 100;
// clang-format off
static constexpr auto window_install_track_widgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ 4, 18}, {372, 219}, WidgetType::flatBtn, WindowColour::primary ),
makeWidget({PREVIEW_BUTTONS_LEFT, 422}, { 22, 24}, WidgetType::flatBtn, WindowColour::primary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_90_TIP ),
makeWidget({PREVIEW_BUTTONS_LEFT, 398}, { 22, 24}, WidgetType::flatBtn, WindowColour::primary, ImageId(SPR_SCENERY), STR_TOGGLE_SCENERY_TIP),
makeWidget({ ACTION_BUTTONS_LEFT, 241}, { 97, 15}, WidgetType::button, WindowColour::primary, STR_INSTALL_NEW_TRACK_DESIGN_INSTALL ),
makeWidget({ ACTION_BUTTONS_LEFT, 259}, { 97, 15}, WidgetType::button, WindowColour::primary, STR_INSTALL_NEW_TRACK_DESIGN_CANCEL )
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 4, 18}, {372, 219}, WidgetType::flatBtn, WindowColour::primary ),
makeWidget({kPreviewButtonsLeft, 422}, { 22, 24}, WidgetType::flatBtn, WindowColour::primary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_90_TIP ),
makeWidget({kPreviewButtonsLeft, 398}, { 22, 24}, WidgetType::flatBtn, WindowColour::primary, ImageId(SPR_SCENERY), STR_TOGGLE_SCENERY_TIP),
makeWidget({ kActionButtonsLeft, 241}, { 97, 15}, WidgetType::button, WindowColour::primary, STR_INSTALL_NEW_TRACK_DESIGN_INSTALL ),
makeWidget({ kActionButtonsLeft, 259}, { 97, 15}, WidgetType::button, WindowColour::primary, STR_INSTALL_NEW_TRACK_DESIGN_CANCEL )
);
// clang-format on
@@ -424,7 +423,7 @@ namespace OpenRCT2::Ui::Windows
_currentTrackPieceDirection = 2;
auto* window = windowMgr->FocusOrCreate<InstallTrackWindow>(
WindowClass::InstallTrack, { WW, WH }, WF_AUTO_POSITION | WF_CENTRE_SCREEN);
WindowClass::InstallTrack, kWindowSize, WF_AUTO_POSITION | WF_CENTRE_SCREEN);
window->SetupTrack(path, std::move(trackDesign));
return window;
+9 -10
View File
@@ -33,9 +33,8 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = STR_LAND;
static constexpr int32_t WH = 160;
static constexpr int32_t WW = 98;
static constexpr StringId kWindowTitle = STR_LAND;
static constexpr ScreenSize kWindowSize = { 98, 160 };
enum WindowLandWidgetIdx : WidgetIndex
{
@@ -53,14 +52,14 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto window_land_widgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget ({19, 19}, {24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_UP), STR_ENABLE_MOUNTAIN_TOOL_TIP), // mountain mode
makeWidget ({55, 19}, {24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_PAINTBRUSH), STR_DISABLE_ELEVATION), // paint mode
makeWidget ({27, 48}, {44, 32}, WidgetType::imgBtn, WindowColour::primary , ImageId(SPR_LAND_TOOL_SIZE_0), kStringIdNone), // preview box
makeRemapWidget({28, 49}, {16, 16}, WidgetType::trnBtn, WindowColour::secondary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_LAND_TIP), // decrement size
makeRemapWidget({54, 63}, {16, 16}, WidgetType::trnBtn, WindowColour::secondary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_LAND_TIP), // increment size
makeWidget ({ 2, 106}, {47, 36}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_CHANGE_BASE_LAND_TIP), // floor texture
makeWidget ({49, 106}, {47, 36}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_CHANGE_VERTICAL_LAND_TIP) // wall texture
makeWidget ({27, 48}, {44, 32}, WidgetType::imgBtn, WindowColour::primary , ImageId(SPR_LAND_TOOL_SIZE_0), kStringIdNone), // preview box
makeRemapWidget({28, 49}, {16, 16}, WidgetType::trnBtn, WindowColour::secondary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_LAND_TIP), // decrement size
makeRemapWidget({54, 63}, {16, 16}, WidgetType::trnBtn, WindowColour::secondary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_LAND_TIP), // increment size
makeWidget ({ 2, 106}, {47, 36}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_CHANGE_BASE_LAND_TIP), // floor texture
makeWidget ({49, 106}, {47, 36}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_CHANGE_VERTICAL_LAND_TIP) // wall texture
);
// clang-format on
@@ -869,7 +868,7 @@ namespace OpenRCT2::Ui::Windows
{
auto* windowMgr = GetWindowManager();
return windowMgr->FocusOrCreate<LandWindow>(
WindowClass::Land, ScreenCoordsXY(ContextGetWidth() - WW, 29), { WW, WH }, 0);
WindowClass::Land, ScreenCoordsXY(ContextGetWidth() - kWindowSize.width, 29), kWindowSize, 0);
}
/**
+4 -5
View File
@@ -32,9 +32,8 @@ namespace OpenRCT2::Ui::Windows
static constexpr ScreenSize kInGameSize = { 94, 94 };
static constexpr ScreenSize kEditorSize = { 280, 104 };
static constexpr StringId WINDOW_TITLE = STR_LAND_RIGHTS;
static constexpr int32_t WW = kInGameSize.width;
static constexpr int32_t WH = kInGameSize.height;
static constexpr ScreenSize kWindowSize = kInGameSize;
static constexpr StringId kWindowTitle = STR_LAND_RIGHTS;
enum WindowLandRightsWidgetIdx
{
@@ -59,7 +58,7 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto window_land_rights_widgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget ({ 27, 17}, { 44, 32}, WidgetType::imgBtn, WindowColour::primary, ImageId(SPR_LAND_TOOL_SIZE_0) ), // preview box
makeRemapWidget({ 28, 18}, { 16, 16}, WidgetType::trnBtn, WindowColour::primary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_LAND_RIGHTS_TIP ), // decrement size
makeRemapWidget({ 54, 32}, { 16, 16}, WidgetType::trnBtn, WindowColour::primary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_LAND_RIGHTS_TIP ), // increment size
@@ -592,6 +591,6 @@ namespace OpenRCT2::Ui::Windows
{
auto* windowMgr = GetWindowManager();
return windowMgr->FocusOrCreate<LandRightsWindow>(
WindowClass::LandRights, ScreenCoordsXY(ContextGetWidth() - WW, 29), { WW, WH }, 0);
WindowClass::LandRights, ScreenCoordsXY(ContextGetWidth() - kWindowSize.width, 29), kWindowSize, 0);
}
} // namespace OpenRCT2::Ui::Windows
+22 -26
View File
@@ -55,14 +55,14 @@ namespace OpenRCT2::Ui::Windows
#pragma region Widgets
static constexpr ScreenSize kWindowSizeInit = { 400, 350 };
static constexpr ScreenSize kWindowSizeMin = { 300, kWindowSizeInit.height / 2 };
static constexpr ScreenSize kWindowSizeMax = kWindowSizeInit * 3;
static constexpr ScreenSize kWindowSize = { 400, 350 };
static constexpr ScreenSize kWindowSizeMin = { 300, kWindowSize.height / 2 };
static constexpr ScreenSize kWindowSizeMax = kWindowSize * 3;
static constexpr auto kPadding = 5;
static constexpr auto kPreviewWidth = 250;
static constexpr auto kWindowSizeMinPreview = ScreenSize{ kWindowSizeInit.width + kPreviewWidth, kWindowSizeInit.height };
static constexpr auto kWindowSizeMinPreview = ScreenSize{ kWindowSize.width + kPreviewWidth, kWindowSize.height };
static constexpr int kKibiByte = 1024;
static constexpr int kMebiByte = kKibiByte * 1024;
@@ -96,24 +96,21 @@ namespace OpenRCT2::Ui::Windows
WIDX_SAVE,
};
static constexpr int16_t WW = kWindowSizeInit.width;
static constexpr int16_t WH = kWindowSizeInit.height;
// clang-format off
static constexpr auto window_loadsave_widgets = makeWidgets(
makeWindowShim(kStringIdNone, { WW, WH }),
makeWidget({ 0, 15 }, { WW, WH - 15 }, WidgetType::resize, WindowColour::secondary ), // WIDX_RESIZE
makeWidget({ WW - 100 - 4, 20 }, { 20, 20 }, WidgetType::flatBtn, WindowColour::primary, SPR_G2_FOLDER_PARENT, STR_PARENT_FOLDER_TIP ), // WIDX_PARENT_FOLDER
makeWidget({ WW - 50 - 4, 20 }, { 20, 20 }, WidgetType::flatBtn, WindowColour::primary, SPR_G2_FOLDER_NEW, STR_FILEBROWSER_ACTION_NEW_FOLDER), // WIDX_NEW_FOLDER
makeWidget({ WW - 75 - 4, 20 }, { 20, 20 }, WidgetType::flatBtn, WindowColour::primary, SPR_G2_FOLDER_DEFAULT, STR_LOADSAVE_DEFAULT_TIP ), // WIDX_DEFAULT_FOLDER
makeWidget({ WW - 25 - 4, 20 }, { 20, 20 }, WidgetType::flatBtn, WindowColour::primary, SPR_G2_SYSTEM_BROWSER, STR_FILEBROWSER_USE_SYSTEM_WINDOW), // WIDX_SYSTEM_BROWSER
makeWidget({ 4, 45 }, { 160, 14 }, WidgetType::tableHeader, WindowColour::primary ), // WIDX_SORT_NAME
makeWidget({ (WW - 5) / 3 + 1, 45 }, { 160, 14 }, WidgetType::tableHeader, WindowColour::primary ), // WIDX_SORT_SIZE
makeWidget({ (WW - 5) / 3 + 1, 45 }, { 160, 14 }, WidgetType::tableHeader, WindowColour::primary ), // WIDX_SORT_DATE
makeWidget({ (WW - 19), 45 }, { 14, 14 }, WidgetType::button, WindowColour::primary, STR_DROPDOWN_GLYPH ), // WIDX_SORT_CUSTOMISE
makeWidget({ 4, 58 }, { 342, 303 }, WidgetType::scroll, WindowColour::primary, SCROLL_VERTICAL ), // WIDX_SCROLL
makeWidget({ 64, WH - 50 }, { WW - 133, 14 }, WidgetType::textBox, WindowColour::secondary ), // WIDX_FILENAME_TEXTBOX
makeWidget({ WW - 65, WH - 50 }, { 60, 14 }, WidgetType::button, WindowColour::secondary, STR_FILEBROWSER_SAVE_BUTTON ) // WIDX_SAVE
makeWindowShim(kStringIdNone, kWindowSize),
makeWidget({ 0, 15 }, { kWindowSize.width, kWindowSize.height - 15 }, WidgetType::resize, WindowColour::secondary ), // WIDX_RESIZE
makeWidget({ kWindowSize.width - 100 - 4, 20 }, { 20, 20 }, WidgetType::flatBtn, WindowColour::primary, SPR_G2_FOLDER_PARENT, STR_PARENT_FOLDER_TIP ), // WIDX_PARENT_FOLDER
makeWidget({ kWindowSize.width - 50 - 4, 20 }, { 20, 20 }, WidgetType::flatBtn, WindowColour::primary, SPR_G2_FOLDER_NEW, STR_FILEBROWSER_ACTION_NEW_FOLDER), // WIDX_NEW_FOLDER
makeWidget({ kWindowSize.width - 75 - 4, 20 }, { 20, 20 }, WidgetType::flatBtn, WindowColour::primary, SPR_G2_FOLDER_DEFAULT, STR_LOADSAVE_DEFAULT_TIP ), // WIDX_DEFAULT_FOLDER
makeWidget({ kWindowSize.width - 25 - 4, 20 }, { 20, 20 }, WidgetType::flatBtn, WindowColour::primary, SPR_G2_SYSTEM_BROWSER, STR_FILEBROWSER_USE_SYSTEM_WINDOW), // WIDX_SYSTEM_BROWSER
makeWidget({ 4, 45 }, { 160, 14 }, WidgetType::tableHeader, WindowColour::primary ), // WIDX_SORT_NAME
makeWidget({ (kWindowSize.width - 5) / 3 + 1, 45 }, { 160, 14 }, WidgetType::tableHeader, WindowColour::primary ), // WIDX_SORT_SIZE
makeWidget({ (kWindowSize.width - 5) / 3 + 1, 45 }, { 160, 14 }, WidgetType::tableHeader, WindowColour::primary ), // WIDX_SORT_DATE
makeWidget({ kWindowSize.width - 19, 45 }, { 14, 14 }, WidgetType::button, WindowColour::primary, STR_DROPDOWN_GLYPH ), // WIDX_SORT_CUSTOMISE
makeWidget({ 4, 58 }, { 342, 303 }, WidgetType::scroll, WindowColour::primary, SCROLL_VERTICAL ), // WIDX_SCROLL
makeWidget({ 64, kWindowSize.height - 50 }, { kWindowSize.width - 133, 14 }, WidgetType::textBox, WindowColour::secondary ), // WIDX_FILENAME_TEXTBOX
makeWidget({ kWindowSize.width - 65, kWindowSize.height - 50 }, { 60, 14 }, WidgetType::button, WindowColour::secondary, STR_FILEBROWSER_SAVE_BUTTON ) // WIDX_SAVE
);
// clang-format on
@@ -1126,17 +1123,16 @@ namespace OpenRCT2::Ui::Windows
if (config.FileBrowserWidth < kWindowSizeMin.width || config.FileBrowserHeight < kWindowSizeMin.height
|| config.FileBrowserWidth > kWindowSizeMax.width || config.FileBrowserHeight > kWindowSizeMax.height)
{
config.FileBrowserWidth = kWindowSizeInit.width;
config.FileBrowserHeight = kWindowSizeInit.height;
config.FileBrowserWidth = kWindowSize.width;
config.FileBrowserHeight = kWindowSize.height;
Config::Save();
}
auto width = config.FileBrowserWidth;
auto height = config.FileBrowserHeight;
ScreenSize windowSize = { config.FileBrowserWidth, config.FileBrowserHeight };
w = windowMgr->Create<LoadSaveWindow>(
WindowClass::Loadsave, { width, height },
WF_STICK_TO_FRONT | WF_RESIZABLE | WF_AUTO_POSITION | WF_CENTRE_SCREEN, action, type);
WindowClass::Loadsave, windowSize, WF_STICK_TO_FRONT | WF_RESIZABLE | WF_AUTO_POSITION | WF_CENTRE_SCREEN,
action, type);
}
bool isSave = action == LoadSaveAction::save;
+8 -9
View File
@@ -77,9 +77,8 @@ namespace OpenRCT2::Ui::Windows
return gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode;
}
static constexpr StringId WINDOW_TITLE = STR_MAP_LABEL;
static constexpr int32_t WH = 259;
static constexpr int32_t WW = 245;
static constexpr StringId kWindowTitle = STR_MAP_LABEL;
static constexpr ScreenSize kWindowSize = { 245, 259 };
static constexpr uint16_t kReservedHSpace = 4;
static constexpr uint16_t kReservedTopSpace = 46;
@@ -132,7 +131,7 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto window_map_widgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget ({ 0, 43}, {245, 215}, WidgetType::resize, WindowColour::secondary ),
makeRemapWidget ({ 3, 17}, { 31, 27}, WidgetType::colourBtn, WindowColour::secondary, SPR_TAB, STR_SHOW_PEOPLE_ON_MAP_TIP ),
makeRemapWidget ({ 34, 17}, { 31, 27}, WidgetType::colourBtn, WindowColour::secondary, SPR_TAB, STR_SHOW_RIDES_STALLS_ON_MAP_TIP),
@@ -1210,15 +1209,15 @@ namespace OpenRCT2::Ui::Windows
void ResetMaxWindowDimensions()
{
auto newMaxWidth = std::clamp(getMiniMapWidth() + GetReservedRightSpace(), WW, ContextGetWidth());
auto newMaxWidth = std::clamp(getMiniMapWidth() + GetReservedRightSpace(), kWindowSize.width, ContextGetWidth());
auto newMaxHeight = std::clamp(
getMiniMapWidth() + kReservedTopSpace + GetReservedBottomSpace(), WH, ContextGetHeight() - 68);
getMiniMapWidth() + kReservedTopSpace + GetReservedBottomSpace(), kWindowSize.height, ContextGetHeight() - 68);
auto scrollbarSize = getMiniMapWidth() + GetReservedRightSpace() > ContextGetWidth() ? kScrollBarWidth : 2;
newMaxWidth += scrollbarSize;
newMaxHeight += scrollbarSize;
WindowSetResize(*this, { WW, WH }, { newMaxWidth, newMaxHeight });
WindowSetResize(*this, kWindowSize, { newMaxWidth, newMaxHeight });
}
void ResizeMiniMap()
@@ -1238,7 +1237,7 @@ namespace OpenRCT2::Ui::Windows
}
textOffset += _firstColumnWidth + 4;
min_width = WW;
min_width = kWindowSize.width;
for (uint32_t i = 4; i < std::size(MapLabels); i++)
{
const auto* labelStr = LanguageGetString(MapLabels[i]);
@@ -1255,7 +1254,7 @@ namespace OpenRCT2::Ui::Windows
try
{
auto* windowMgr = GetWindowManager();
auto* w = windowMgr->FocusOrCreate<MapWindow>(WindowClass::Map, { 245, 259 }, WF_10);
auto* w = windowMgr->FocusOrCreate<MapWindow>(WindowClass::Map, kWindowSize, WF_10);
w->selected_tab = 0;
w->list_information_type = 0;
return w;
+6 -6
View File
@@ -147,12 +147,12 @@ namespace OpenRCT2::Ui::Windows
static constexpr auto TerrainWidgets = makeWidgets(
makeMapGenWidgets(STR_MAPGEN_CAPTION_TERRAIN),
makeSpinnerWidgets({179, 52}, {109, 12}, WidgetType::spinner, WindowColour::secondary ), // WIDX_HEIGHTMAP_LOW{,_UP,_DOWN}
makeSpinnerWidgets({179, 70}, {109, 12}, WidgetType::spinner, WindowColour::secondary ), // WIDX_HEIGHTMAP_HIGH{,_UP,_DOWN}
makeSpinnerWidgets({179, 52}, {109, 12}, WidgetType::spinner, WindowColour::secondary ), // WIDX_HEIGHTMAP_LOW{,_UP,_DOWN}
makeSpinnerWidgets({179, 70}, {109, 12}, WidgetType::spinner, WindowColour::secondary ), // WIDX_HEIGHTMAP_HIGH{,_UP,_DOWN}
makeWidget ({179, 88}, { 47, 36}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_CHANGE_BASE_LAND_TIP ),
makeWidget ({236, 88}, { 47, 36}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_CHANGE_VERTICAL_LAND_TIP),
makeWidget ({ 10, 106}, {150, 12}, WidgetType::checkbox, WindowColour::secondary, STR_MAPGEN_OPTION_RANDOM_TERRAIN ),
makeWidget ({ 10, 122}, {150, 12}, WidgetType::checkbox, WindowColour::secondary, STR_MAPGEN_SMOOTH_TILE) // WIDX_HEIGHTMAP_SMOOTH_TILE_EDGES
makeWidget ({ 10, 122}, {150, 12}, WidgetType::checkbox, WindowColour::secondary, STR_MAPGEN_SMOOTH_TILE ) // WIDX_HEIGHTMAP_SMOOTH_TILE_EDGES
);
static constexpr auto WaterWidgets = makeWidgets(
@@ -164,9 +164,9 @@ namespace OpenRCT2::Ui::Windows
static constexpr auto ForestsWidgets = makeWidgets(
makeMapGenWidgets(STR_MAPGEN_CAPTION_FORESTS),
makeWidget ({ 10, 52}, {255, 12}, WidgetType::checkbox, WindowColour::secondary, STR_MAPGEN_OPTION_PLACE_TREES),
makeSpinnerWidgets({179, 70}, {109, 12}, WidgetType::spinner, WindowColour::secondary), // WIDX_TREE_LAND_RATIO{,_UP,_DOWN}
makeSpinnerWidgets({179, 88}, {109, 12}, WidgetType::spinner, WindowColour::secondary), // WIDX_TREE_ALTITUDE_MIN{,_UP,_DOWN}
makeSpinnerWidgets({179, 106}, {109, 12}, WidgetType::spinner, WindowColour::secondary) // WIDX_TREE_ALTITUDE_MAX{,_UP,_DOWN}
makeSpinnerWidgets({179, 70}, {109, 12}, WidgetType::spinner, WindowColour::secondary ), // WIDX_TREE_LAND_RATIO{,_UP,_DOWN}
makeSpinnerWidgets({179, 88}, {109, 12}, WidgetType::spinner, WindowColour::secondary ), // WIDX_TREE_ALTITUDE_MIN{,_UP,_DOWN}
makeSpinnerWidgets({179, 106}, {109, 12}, WidgetType::spinner, WindowColour::secondary ) // WIDX_TREE_ALTITUDE_MAX{,_UP,_DOWN}
);
static std::span<const Widget> PageWidgets[WINDOW_MAPGEN_PAGE_COUNT] = {
+37 -38
View File
@@ -33,9 +33,8 @@ namespace OpenRCT2::Ui::Windows
{
#pragma region Widgets
static constexpr StringId WINDOW_TITLE = STR_RIDE_CONSTRUCTION_WINDOW_TITLE;
static constexpr int32_t WH = 200;
static constexpr int32_t WW = 166;
static constexpr StringId kWindowTitle = STR_RIDE_CONSTRUCTION_WINDOW_TITLE;
static constexpr ScreenSize kWindowSize = { 166, 200 };
enum : WidgetIndex
{
@@ -61,40 +60,40 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto window_maze_construction_widgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ 3, 17}, {160, 55}, WidgetType::groupbox, WindowColour::primary , STR_RIDE_CONSTRUCTION_MODE ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({35, 29}, { 32, 32}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_MAZE_CONSTRUCTION_BUILD), STR_RIDE_CONSTRUCTION_BUILD_MODE ),
makeWidget({67, 29}, { 32, 32}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_MAZE_CONSTRUCTION_MOVE), STR_RIDE_CONSTRUCTION_MOVE_MODE ),
makeWidget({99, 29}, { 32, 32}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_MAZE_CONSTRUCTION_FILL_IN), STR_RIDE_CONSTRUCTION_FILL_IN_MODE ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 3, 168}, {160, 28}, WidgetType::groupbox, WindowColour::primary ),
makeWidget({ 3, 80}, {160, 87}, WidgetType::groupbox, WindowColour::primary , STR_RIDE_CONSTRUCTION_BUILD ),
makeWidget({83, 96}, { 45, 29}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_DIRECTION_NE), STR_RIDE_CONSTRUCTION_BUILD_MAZE_IN_THIS_DIRECTION_TIP),
makeWidget({83, 125}, { 45, 29}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_DIRECTION_SE), STR_RIDE_CONSTRUCTION_BUILD_MAZE_IN_THIS_DIRECTION_TIP),
makeWidget({38, 125}, { 45, 29}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_DIRECTION_SW), STR_RIDE_CONSTRUCTION_BUILD_MAZE_IN_THIS_DIRECTION_TIP),
makeWidget({38, 96}, { 45, 29}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_DIRECTION_NW), STR_RIDE_CONSTRUCTION_BUILD_MAZE_IN_THIS_DIRECTION_TIP),
makeWidget({ 9, 178}, { 70, 12}, WidgetType::button, WindowColour::secondary, STR_RIDE_CONSTRUCTION_ENTRANCE, STR_RIDE_CONSTRUCTION_ENTRANCE_TIP ),
makeWidget({87, 178}, { 70, 12}, WidgetType::button, WindowColour::secondary, STR_RIDE_CONSTRUCTION_EXIT, STR_RIDE_CONSTRUCTION_EXIT_TIP ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary )
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 3, 17}, {160, 55}, WidgetType::groupbox, WindowColour::primary, STR_RIDE_CONSTRUCTION_MODE ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({35, 29}, { 32, 32}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_MAZE_CONSTRUCTION_BUILD), STR_RIDE_CONSTRUCTION_BUILD_MODE ),
makeWidget({67, 29}, { 32, 32}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_MAZE_CONSTRUCTION_MOVE), STR_RIDE_CONSTRUCTION_MOVE_MODE ),
makeWidget({99, 29}, { 32, 32}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_MAZE_CONSTRUCTION_FILL_IN), STR_RIDE_CONSTRUCTION_FILL_IN_MODE ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 3, 168}, {160, 28}, WidgetType::groupbox, WindowColour::primary ),
makeWidget({ 3, 80}, {160, 87}, WidgetType::groupbox, WindowColour::primary, STR_RIDE_CONSTRUCTION_BUILD ),
makeWidget({83, 96}, { 45, 29}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_DIRECTION_NE), STR_RIDE_CONSTRUCTION_BUILD_MAZE_IN_THIS_DIRECTION_TIP),
makeWidget({83, 125}, { 45, 29}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_DIRECTION_SE), STR_RIDE_CONSTRUCTION_BUILD_MAZE_IN_THIS_DIRECTION_TIP),
makeWidget({38, 125}, { 45, 29}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_DIRECTION_SW), STR_RIDE_CONSTRUCTION_BUILD_MAZE_IN_THIS_DIRECTION_TIP),
makeWidget({38, 96}, { 45, 29}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_DIRECTION_NW), STR_RIDE_CONSTRUCTION_BUILD_MAZE_IN_THIS_DIRECTION_TIP),
makeWidget({ 9, 178}, { 70, 12}, WidgetType::button, WindowColour::secondary, STR_RIDE_CONSTRUCTION_ENTRANCE, STR_RIDE_CONSTRUCTION_ENTRANCE_TIP ),
makeWidget({87, 178}, { 70, 12}, WidgetType::button, WindowColour::secondary, STR_RIDE_CONSTRUCTION_EXIT, STR_RIDE_CONSTRUCTION_EXIT_TIP ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary ),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary )
);
// clang-format on
@@ -443,7 +442,7 @@ namespace OpenRCT2::Ui::Windows
{
auto* windowMgr = GetWindowManager();
return windowMgr->FocusOrCreate<MazeConstructionWindow>(
WindowClass::RideConstruction, ScreenCoordsXY(0, 29), { WW, WH }, WF_NO_AUTO_CLOSE);
WindowClass::RideConstruction, ScreenCoordsXY(0, 29), kWindowSize, WF_NO_AUTO_CLOSE);
}
void WindowMazeConstructionUpdatePressedWidgets()
+12 -11
View File
@@ -61,15 +61,16 @@ namespace OpenRCT2::Ui::Windows
WIDX_KNOWN_KEYS_ONLY_CHECKBOX,
};
static constexpr ScreenSize kWindowSize = { 340, 240 };
// clang-format off
static constexpr auto kMainMultiplayerWidgets = makeWidgets(
makeWindowShim(kStringIdNone, { 340, 240 }),
makeWindowShim(kStringIdNone, kWindowSize),
makeWidget({ 0, 43}, {340, 197}, WidgetType::resize, WindowColour::secondary ),
makeTab ({ 3, 17}, STR_SHOW_SERVER_INFO_TIP),
makeTab ({ 34, 17}, STR_PLAYERS_TIP ),
makeTab ({ 65, 17}, STR_GROUPS_TIP ),
makeTab ({ 96, 17}, STR_OPTIONS_TIP )
makeTab ({ 3, 17}, STR_SHOW_SERVER_INFO_TIP),
makeTab ({ 34, 17}, STR_PLAYERS_TIP ),
makeTab ({ 65, 17}, STR_GROUPS_TIP ),
makeTab ({ 96, 17}, STR_OPTIONS_TIP )
);
static constexpr auto window_multiplayer_information_widgets = makeWidgets(
@@ -88,13 +89,13 @@ namespace OpenRCT2::Ui::Windows
static constexpr auto window_multiplayer_groups_widgets = makeWidgets(
kMainMultiplayerWidgets,
makeWidget({141, 46}, {175, 12}, WidgetType::dropdownMenu, WindowColour::secondary ), // default group
makeWidget({305, 47}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH),
makeWidget({ 11, 65}, { 92, 12}, WidgetType::button, WindowColour::secondary, STR_ADD_GROUP ), // add group button
makeWidget({113, 65}, { 92, 12}, WidgetType::button, WindowColour::secondary, STR_REMOVE_GROUP ), // remove group button
makeWidget({215, 65}, { 92, 12}, WidgetType::button, WindowColour::secondary, STR_RENAME_GROUP ), // rename group button
makeWidget({305, 47}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH),
makeWidget({ 11, 65}, { 92, 12}, WidgetType::button, WindowColour::secondary, STR_ADD_GROUP ), // add group button
makeWidget({113, 65}, { 92, 12}, WidgetType::button, WindowColour::secondary, STR_REMOVE_GROUP ), // remove group button
makeWidget({215, 65}, { 92, 12}, WidgetType::button, WindowColour::secondary, STR_RENAME_GROUP ), // rename group button
makeWidget({ 72, 80}, {175, 12}, WidgetType::dropdownMenu, WindowColour::secondary ), // selected group
makeWidget({236, 81}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH),
makeWidget({ 3, 94}, {314, 207}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ) // permissions list
makeWidget({236, 81}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH),
makeWidget({ 3, 94}, {314, 207}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ) // permissions list
);
static constexpr auto window_multiplayer_options_widgets = makeWidgets(
+5 -4
View File
@@ -24,9 +24,10 @@ namespace OpenRCT2::Ui::Windows
WIDX_PASSWORD
};
static constexpr ScreenSize kWindowSize = { 400, 90 };
// clang-format off
static constexpr auto window_network_status_widgets = makeWidgets(
makeWindowShim(kStringIdEmpty, { 320, 90 })
makeWindowShim(kStringIdEmpty, kWindowSize)
);
// clang-format on
@@ -35,7 +36,7 @@ namespace OpenRCT2::Ui::Windows
public:
void OnOpen() override
{
WindowSetResize(*this, { 320, 90 }, { 320, 90 });
WindowSetResize(*this, kWindowSize, kWindowSize);
SetWidgets(window_network_status_widgets);
frame_no = 0;
@@ -135,7 +136,7 @@ namespace OpenRCT2::Ui::Windows
else
{
window = windowMgr->Create<NetworkStatusWindow>(
WindowClass::NetworkStatus, { 400, 90 }, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_STICK_TO_FRONT);
WindowClass::NetworkStatus, kWindowSize, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_STICK_TO_FRONT);
}
window->SetCloseCallBack(onClose);
@@ -163,7 +164,7 @@ namespace OpenRCT2::Ui::Windows
auto* windowMgr = GetWindowManager();
auto* window = windowMgr->FocusOrCreate<NetworkStatusWindow>(
WindowClass::NetworkStatus, { 400, 90 }, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN);
WindowClass::NetworkStatus, kWindowSize, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN);
char password[33]{};
WindowTextInputRawOpen(window, WIDX_PASSWORD, STR_PASSWORD_REQUIRED, STR_PASSWORD_REQUIRED_DESC, {}, password, 32);
+12 -13
View File
@@ -26,11 +26,10 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = kStringIdNone;
static constexpr int32_t WH = 109;
static constexpr int32_t WW = 350;
static constexpr StringId kWindowTitle = kStringIdNone;
static constexpr ScreenSize kWindowSize = { 350, 109 };
constexpr uint16_t SELECTED_ITEM_UNDEFINED = 0xFFFF;
constexpr uint16_t kSelectedItemUndefined = 0xFFFF;
enum WindowNewCampaignWidgetIdx
{
@@ -49,13 +48,13 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto window_new_campaign_widgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget ({ 14, 24}, {126, 12}, WidgetType::label, WindowColour::primary, kStringIdEmpty ), // ride label
makeWidget ({100, 24}, {242, 12}, WidgetType::dropdownMenu, WindowColour::primary, kStringIdEmpty ), // ride dropdown
makeWidget ({330, 25}, { 11, 10}, WidgetType::button, WindowColour::primary, STR_DROPDOWN_GLYPH ), // ride dropdown button
makeWidget ({ 14, 41}, {126, 14}, WidgetType::label, WindowColour::primary, STR_LENGTH_OF_TIME ), // weeks label
makeSpinnerWidgets({120, 41}, {100, 14}, WidgetType::spinner, WindowColour::primary, kStringIdEmpty ), // weeks (3 widgets)
makeWidget ({ 14, 89}, {322, 14}, WidgetType::button, WindowColour::primary, STR_MARKETING_START_THIS_MARKETING_CAMPAIGN) // start button
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget ({ 14, 24}, {126, 12}, WidgetType::label, WindowColour::primary, kStringIdEmpty ), // ride label
makeWidget ({100, 24}, {242, 12}, WidgetType::dropdownMenu, WindowColour::primary, kStringIdEmpty ), // ride dropdown
makeWidget ({330, 25}, { 11, 10}, WidgetType::button, WindowColour::primary, STR_DROPDOWN_GLYPH ), // ride dropdown button
makeWidget ({ 14, 41}, {126, 14}, WidgetType::label, WindowColour::primary, STR_LENGTH_OF_TIME ), // weeks label
makeSpinnerWidgets({120, 41}, {100, 14}, WidgetType::spinner, WindowColour::primary, kStringIdEmpty ), // weeks (3 widgets)
makeWidget ({ 14, 89}, {322, 14}, WidgetType::button, WindowColour::primary, STR_MARKETING_START_THIS_MARKETING_CAMPAIGN) // start button
);
// clang-format on
@@ -346,7 +345,7 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_RIDE_DROPDOWN].type = WidgetType::dropdownMenu;
widgets[WIDX_RIDE_DROPDOWN_BUTTON].type = WidgetType::button;
widgets[WIDX_RIDE_LABEL].text = STR_MARKETING_ITEM;
if (Campaign.ShopItemId != SELECTED_ITEM_UNDEFINED)
if (Campaign.ShopItemId != kSelectedItemUndefined)
{
widgets[WIDX_RIDE_DROPDOWN].text = GetShopItemDescriptor(ShopItem(Campaign.ShopItemId)).Naming.Plural;
}
@@ -408,7 +407,7 @@ namespace OpenRCT2::Ui::Windows
w->Close();
}
w = windowMgr->Create<NewCampaignWindow>(WindowClass::NewCampaign, { WW, WH }, 0);
w = windowMgr->Create<NewCampaignWindow>(WindowClass::NewCampaign, kWindowSize, 0);
if (w != nullptr)
{
w->SetCampaign(campaignType);
+27 -27
View File
@@ -43,9 +43,8 @@ using namespace OpenRCT2::TrackMetaData;
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WindowTitle = kStringIdNone;
static constexpr int32_t kWindowHeight = 382;
static constexpr ScreenSize kWindowSize = { 601, 382 };
static constexpr int32_t kWindowHeightResearch = 194;
static constexpr int32_t WindowWidth = 601;
static constexpr int32_t RideListItemsMax = 384;
static constexpr int32_t RideTabCount = 6;
static constexpr int32_t GroupByTrackTypeWidth = 172;
@@ -205,28 +204,28 @@ namespace OpenRCT2::Ui::Windows
WIDX_GROUP_BY_TRACK_TYPE,
};
static constexpr ScreenCoordsXY GroupByTrackTypeOrigin{ WindowWidth - 8 - GroupByTrackTypeWidth, 47 };
static constexpr ScreenCoordsXY GroupByTrackTypeOrigin{ kWindowSize.width - 8 - GroupByTrackTypeWidth, 47 };
static constexpr ScreenSize GroupTrackTypeSize{ GroupByTrackTypeWidth, 14 };
// clang-format off
static constexpr auto window_new_ride_widgets = makeWidgets(
makeWindowShim(WindowTitle, { WindowWidth, kWindowHeight }),
makeWidget({ 0, 43}, {601, 339}, WidgetType::resize, WindowColour::secondary ),
makeTab ({ 3, 17}, STR_TRANSPORT_RIDES_TIP ),
makeTab ({ 34, 17}, STR_GENTLE_RIDES_TIP ),
makeTab ({ 65, 17}, STR_ROLLER_COASTERS_TIP ),
makeTab ({ 96, 17}, STR_THRILL_RIDES_TIP ),
makeTab ({127, 17}, STR_WATER_RIDES_TIP ),
makeTab ({158, 17}, STR_SHOPS_STALLS_TIP ),
makeTab ({189, 17}, STR_RESEARCH_AND_DEVELOPMENT_TIP ),
makeWidget({ 3, 62}, {595, 256}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ),
makeWidget({ 3, 47}, {290, 70}, WidgetType::groupbox, WindowColour::tertiary, STR_CURRENTLY_IN_DEVELOPMENT ),
makeWidget({ 3, 124}, {290, 65}, WidgetType::groupbox, WindowColour::tertiary, STR_LAST_DEVELOPMENT ),
makeWidget({265, 161}, { 24, 24}, WidgetType::flatBtn, WindowColour::tertiary, 0xFFFFFFFF, STR_RESEARCH_SHOW_DETAILS_TIP),
makeWidget({265, 68}, { 24, 24}, WidgetType::flatBtn, WindowColour::tertiary, ImageId(SPR_FINANCE), STR_FINANCES_RESEARCH_TIP ),
makeWidget({ 4, 46}, {211, 14}, WidgetType::textBox, WindowColour::secondary ),
makeWidget({218, 46}, { 70, 14}, WidgetType::button, WindowColour::secondary, STR_OBJECT_SEARCH_CLEAR ),
makeWidget(GroupByTrackTypeOrigin, GroupTrackTypeSize, WidgetType::checkbox, WindowColour::secondary, STR_GROUP_BY_TRACK_TYPE, STR_GROUP_BY_TRACK_TYPE_TIP )
makeWindowShim(WindowTitle, kWindowSize),
makeWidget({ 0, 43}, {601, 339}, WidgetType::resize, WindowColour::secondary ),
makeTab ({ 3, 17}, STR_TRANSPORT_RIDES_TIP ),
makeTab ({ 34, 17}, STR_GENTLE_RIDES_TIP ),
makeTab ({ 65, 17}, STR_ROLLER_COASTERS_TIP ),
makeTab ({ 96, 17}, STR_THRILL_RIDES_TIP ),
makeTab ({127, 17}, STR_WATER_RIDES_TIP ),
makeTab ({158, 17}, STR_SHOPS_STALLS_TIP ),
makeTab ({189, 17}, STR_RESEARCH_AND_DEVELOPMENT_TIP ),
makeWidget({ 3, 62}, {595, 256}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ),
makeWidget({ 3, 47}, {290, 70}, WidgetType::groupbox, WindowColour::tertiary, STR_CURRENTLY_IN_DEVELOPMENT ),
makeWidget({ 3, 124}, {290, 65}, WidgetType::groupbox, WindowColour::tertiary, STR_LAST_DEVELOPMENT ),
makeWidget({265, 161}, { 24, 24}, WidgetType::flatBtn, WindowColour::tertiary, 0xFFFFFFFF, STR_RESEARCH_SHOW_DETAILS_TIP),
makeWidget({265, 68}, { 24, 24}, WidgetType::flatBtn, WindowColour::tertiary, ImageId(SPR_FINANCE), STR_FINANCES_RESEARCH_TIP ),
makeWidget({ 4, 46}, {211, 14}, WidgetType::textBox, WindowColour::secondary ),
makeWidget({218, 46}, { 70, 14}, WidgetType::button, WindowColour::secondary, STR_OBJECT_SEARCH_CLEAR ),
makeWidget(GroupByTrackTypeOrigin, GroupTrackTypeSize, WidgetType::checkbox, WindowColour::secondary, STR_GROUP_BY_TRACK_TYPE, STR_GROUP_BY_TRACK_TYPE_TIP )
);
// clang-format on
@@ -843,8 +842,8 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WidgetType::empty;
widgets[WIDX_RESEARCH_FUNDING_BUTTON].type = WidgetType::empty;
newWidth = WindowWidth;
newHeight = kWindowHeight;
newWidth = kWindowSize.width;
newHeight = kWindowSize.height;
}
else
{
@@ -942,13 +941,15 @@ namespace OpenRCT2::Ui::Windows
{
ft = Formatter();
ft.Add<StringId>(rideEntry.naming.Name);
DrawTextEllipsised(rt, screenPos + ScreenCoordsXY{ 0, 39 }, WindowWidth - 2, STR_NEW_RIDE_VEHICLE_NAME, ft);
DrawTextEllipsised(
rt, screenPos + ScreenCoordsXY{ 0, 39 }, kWindowSize.width - 2, STR_NEW_RIDE_VEHICLE_NAME, ft);
}
else
{
ft = Formatter();
ft.Add<const utf8*>(_vehicleAvailability.c_str());
DrawTextEllipsised(rt, screenPos + ScreenCoordsXY{ 0, 39 }, WindowWidth - 2, STR_AVAILABLE_VEHICLES, ft);
DrawTextEllipsised(
rt, screenPos + ScreenCoordsXY{ 0, 39 }, kWindowSize.width - 2, STR_AVAILABLE_VEHICLES, ft);
}
}
@@ -999,7 +1000,7 @@ namespace OpenRCT2::Ui::Windows
ft.Add<const char*>(authorsString.c_str());
DrawTextEllipsised(
rt, screenPos + ScreenCoordsXY{ textWidth, 0 }, WindowWidth - 2, STR_WINDOW_COLOUR_2_STRINGID, ft,
rt, screenPos + ScreenCoordsXY{ textWidth, 0 }, kWindowSize.width - 2, STR_WINDOW_COLOUR_2_STRINGID, ft,
{ TextAlignment::RIGHT });
}
}
@@ -1084,8 +1085,7 @@ namespace OpenRCT2::Ui::Windows
windowMgr->CloseByClass(WindowClass::TrackDesignList);
windowMgr->CloseByClass(WindowClass::TrackDesignPlace);
window = windowMgr->Create<NewRideWindow>(
WindowClass::ConstructRide, { WindowWidth, kWindowHeight }, WF_10 | WF_AUTO_POSITION);
window = windowMgr->Create<NewRideWindow>(WindowClass::ConstructRide, kWindowSize, WF_10 | WF_AUTO_POSITION);
return window;
}
+8 -9
View File
@@ -27,8 +27,7 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr int32_t WH = 300;
static constexpr int32_t WW = 400;
static constexpr ScreenSize kWindowSize = { 400, 300 };
enum WindowNewsWidgetIdx
{
@@ -54,10 +53,10 @@ namespace OpenRCT2::Ui::Windows
static constexpr auto makeNewsWidgets = [](StringId title) {
return makeWidgets(
makeWindowShim(title, { WW, WH }),
makeWidget({ 0, 43 }, { WW, 257 }, WidgetType::resize, WindowColour::secondary),
makeTab({ 3, 17 }, STR_RECENT_MESSAGES),
makeTab({ 34, 17 }, STR_NOTIFICATION_SETTINGS)
makeWindowShim(title, kWindowSize),
makeWidget({ 0, 43 }, { kWindowSize.width, 257 }, WidgetType::resize, WindowColour::secondary),
makeTab ({ 3, 17 }, STR_RECENT_MESSAGES),
makeTab ({ 34, 17 }, STR_NOTIFICATION_SETTINGS)
);
};
@@ -117,7 +116,7 @@ namespace OpenRCT2::Ui::Windows
{
Invalidate();
page = newsTab;
height = WH;
height = kWindowSize.height;
SetWidgets(kNewsTabWidgets);
WindowInitScrollWidgets(*this);
@@ -393,7 +392,7 @@ namespace OpenRCT2::Ui::Windows
{
int32_t scrollHeight = static_cast<int32_t>(getGameState().newsItems.GetArchived().size())
* CalculateNewsItemHeight();
return { WW, scrollHeight };
return { kWindowSize.width, scrollHeight };
}
void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
@@ -582,6 +581,6 @@ namespace OpenRCT2::Ui::Windows
WindowBase* NewsOpen()
{
auto* windowMgr = GetWindowManager();
return windowMgr->FocusOrCreate<NewsWindow>(WindowClass::RecentNews, { WW, WH }, 0);
return windowMgr->FocusOrCreate<NewsWindow>(WindowClass::RecentNews, kWindowSize, 0);
}
} // namespace OpenRCT2::Ui::Windows
+22 -23
View File
@@ -38,7 +38,7 @@ namespace OpenRCT2::Ui::Windows
class ObjectDownloader
{
private:
static constexpr auto OPENRCT2_API_LEGACY_OBJECT_URL = "https://api.openrct2.io/objects/legacy/";
static constexpr auto kOpenRCT2ApiLegacyObjectURL = "https://api.openrct2.io/objects/legacy/";
struct DownloadStatusInfo
{
@@ -217,7 +217,7 @@ namespace OpenRCT2::Ui::Windows
{
Http::Request req;
req.method = Http::Method::GET;
req.url = OPENRCT2_API_LEGACY_OBJECT_URL + name;
req.url = kOpenRCT2ApiLegacyObjectURL + name;
Http::DoAsync(req, [this, entry, name](Http::Response response) {
if (response.status == Http::Status::Ok)
{
@@ -271,25 +271,24 @@ namespace OpenRCT2::Ui::Windows
WIDX_DOWNLOAD_ALL
};
static constexpr StringId WINDOW_TITLE = STR_OBJECT_LOAD_ERROR_TITLE;
static constexpr int32_t WW = 450;
static constexpr int32_t WH = 400;
static constexpr int32_t WW_LESS_PADDING = WW - 5;
constexpr int32_t NAME_COL_LEFT = 4;
constexpr int32_t SOURCE_COL_LEFT = (WW_LESS_PADDING / 4) + 1;
constexpr int32_t TYPE_COL_LEFT = 5 * WW_LESS_PADDING / 8 + 1;
static constexpr StringId kWindowTitle = STR_OBJECT_LOAD_ERROR_TITLE;
static constexpr ScreenSize kWindowSize = { 450, 400 };
static constexpr int32_t kWindowWidthLessPadding = kWindowSize.width - 5;
constexpr int32_t kNameColLeft = 4;
constexpr int32_t kSourceColLeft = (kWindowWidthLessPadding / 4) + 1;
constexpr int32_t kTypeColLeft = 5 * kWindowWidthLessPadding / 8 + 1;
// clang-format off
static constexpr auto window_object_load_error_widgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ NAME_COL_LEFT, 57}, {108, 14}, WidgetType::tableHeader, WindowColour::primary, STR_OBJECT_NAME ), // 'Object name' header
makeWidget({SOURCE_COL_LEFT, 57}, {166, 14}, WidgetType::tableHeader, WindowColour::primary, STR_OBJECT_SOURCE ), // 'Object source' header
makeWidget({ TYPE_COL_LEFT, 57}, {166, 14}, WidgetType::tableHeader, WindowColour::primary, STR_OBJECT_TYPE ), // 'Object type' header
makeWidget({ NAME_COL_LEFT, 70}, {442, 298}, WidgetType::scroll, WindowColour::primary, SCROLL_VERTICAL ), // Scrollable list area
makeWidget({ NAME_COL_LEFT, 377}, {145, 14}, WidgetType::button, WindowColour::primary, STR_COPY_SELECTED, STR_COPY_SELECTED_TIP), // Copy selected button
makeWidget({ 152, 377}, {145, 14}, WidgetType::button, WindowColour::primary, STR_COPY_ALL, STR_COPY_ALL_TIP ) // Copy all button
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ kNameColLeft, 57}, {108, 14}, WidgetType::tableHeader, WindowColour::primary, STR_OBJECT_NAME ), // 'Object name' header
makeWidget({kSourceColLeft, 57}, {166, 14}, WidgetType::tableHeader, WindowColour::primary, STR_OBJECT_SOURCE ), // 'Object source' header
makeWidget({ kTypeColLeft, 57}, {166, 14}, WidgetType::tableHeader, WindowColour::primary, STR_OBJECT_TYPE ), // 'Object type' header
makeWidget({ kNameColLeft, 70}, {442, 298}, WidgetType::scroll, WindowColour::primary, SCROLL_VERTICAL ), // Scrollable list area
makeWidget({ kNameColLeft, 377}, {145, 14}, WidgetType::button, WindowColour::primary, STR_COPY_SELECTED, STR_COPY_SELECTED_TIP), // Copy selected button
makeWidget({ 152, 377}, {145, 14}, WidgetType::button, WindowColour::primary, STR_COPY_ALL, STR_COPY_ALL_TIP ) // Copy all button
#ifndef DISABLE_HTTP
, makeWidget({ 300, 377}, {146, 14}, WidgetType::button, WindowColour::primary, STR_DOWNLOAD_ALL, STR_DOWNLOAD_ALL_TIP ) // Download all button
, makeWidget({ 300, 377}, {146, 14}, WidgetType::button, WindowColour::primary, STR_DOWNLOAD_ALL, STR_DOWNLOAD_ALL_TIP ) // Download all button
#endif
);
// clang-format on
@@ -499,13 +498,13 @@ namespace OpenRCT2::Ui::Windows
// Draw explanatory message
auto ft = Formatter();
ft.Add<StringId>(STR_OBJECT_ERROR_WINDOW_EXPLANATION);
DrawTextWrapped(rt, screenPos + ScreenCoordsXY{ 0, 4 }, WW - 10, STR_BLACK_STRING, ft);
DrawTextWrapped(rt, screenPos + ScreenCoordsXY{ 0, 4 }, kWindowSize.width - 10, STR_BLACK_STRING, ft);
// Draw file name
ft = Formatter();
ft.Add<StringId>(STR_OBJECT_ERROR_WINDOW_FILE);
ft.Add<utf8*>(_filePath.c_str());
DrawTextEllipsised(rt, screenPos + ScreenCoordsXY{ 0, 29 }, WW - 5, STR_BLACK_STRING, ft);
DrawTextEllipsised(rt, screenPos + ScreenCoordsXY{ 0, 29 }, kWindowSize.width - 5, STR_BLACK_STRING, ft);
}
void OnScrollDraw(const int32_t scrollIndex, RenderTarget& rt) override
@@ -537,7 +536,7 @@ namespace OpenRCT2::Ui::Windows
GfxFillRect(rt, screenRect, ColourMapA[colours[1].colour].light);
// Draw the actual object entry's name...
screenCoords.x = NAME_COL_LEFT - 3;
screenCoords.x = kNameColLeft - 3;
const auto& entry = _invalidEntries[i];
@@ -550,12 +549,12 @@ namespace OpenRCT2::Ui::Windows
{
// ... source game ...
const auto sourceStringId = ObjectManagerGetSourceGameString(entry.Entry.GetSourceGame());
DrawTextBasic(rt, { SOURCE_COL_LEFT - 3, screenCoords.y }, sourceStringId, {}, { COLOUR_DARK_GREEN });
DrawTextBasic(rt, { kSourceColLeft - 3, screenCoords.y }, sourceStringId, {}, { COLOUR_DARK_GREEN });
}
// ... and type
const auto type = GetStringFromObjectType(entry.GetType());
DrawTextBasic(rt, { TYPE_COL_LEFT - 3, screenCoords.y }, type, {}, { COLOUR_DARK_GREEN });
DrawTextBasic(rt, { kTypeColLeft - 3, screenCoords.y }, type, {}, { COLOUR_DARK_GREEN });
}
}
@@ -578,7 +577,7 @@ namespace OpenRCT2::Ui::Windows
auto* window = windowMgr->BringToFrontByClass(WindowClass::ObjectLoadError);
if (window == nullptr)
{
window = windowMgr->Create<ObjectLoadErrorWindow>(WindowClass::ObjectLoadError, { WW, WH }, 0);
window = windowMgr->Create<ObjectLoadErrorWindow>(WindowClass::ObjectLoadError, kWindowSize, 0);
}
static_cast<ObjectLoadErrorWindow*>(window)->Initialise(path, numMissingObjects, missingObjects);
+15 -16
View File
@@ -250,21 +250,20 @@ namespace OpenRCT2::Ui::Windows
};
// clang-format off
static constexpr StringId WINDOW_TITLE = STR_OPTIONS_TITLE;
static constexpr int32_t WW = 310;
static constexpr int32_t WH = 332;
static constexpr StringId kWindowTitle = STR_OPTIONS_TITLE;
static constexpr ScreenSize kWindowSize = { 310, 332 };
static constexpr auto kMainOptionsWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ 0, 43 }, { WW, 289 }, WidgetType::resize, WindowColour::secondary),
makeTab({ 3, 17 }, STR_OPTIONS_DISPLAY_TIP),
makeTab({ 34, 17 }, STR_OPTIONS_RENDERING_TIP),
makeTab({ 65, 17 }, STR_OPTIONS_CULTURE_TIP),
makeTab({ 96, 17 }, STR_OPTIONS_AUDIO_TIP),
makeTab({ 127, 17 }, STR_OPTIONS_INTERFACE_TIP),
makeTab({ 158, 17 }, STR_OPTIONS_CONTROLS_TIP),
makeTab({ 189, 17 }, STR_OPTIONS_MISCELLANEOUS_TIP),
makeTab({ 220, 17 }, STR_OPTIONS_ADVANCED)
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 0, 43 }, { kWindowSize.width, 289 }, WidgetType::resize, WindowColour::secondary),
makeTab ({ 3, 17 }, STR_OPTIONS_DISPLAY_TIP),
makeTab ({ 34, 17 }, STR_OPTIONS_RENDERING_TIP),
makeTab ({ 65, 17 }, STR_OPTIONS_CULTURE_TIP),
makeTab ({ 96, 17 }, STR_OPTIONS_AUDIO_TIP),
makeTab ({ 127, 17 }, STR_OPTIONS_INTERFACE_TIP),
makeTab ({ 158, 17 }, STR_OPTIONS_CONTROLS_TIP),
makeTab ({ 189, 17 }, STR_OPTIONS_MISCELLANEOUS_TIP),
makeTab ({ 220, 17 }, STR_OPTIONS_ADVANCED)
);
static constexpr auto window_options_display_widgets = makeWidgets(
@@ -306,7 +305,7 @@ namespace OpenRCT2::Ui::Windows
makeWidget({ 10, kFrameRenderingStart + 60}, {281, 12}, WidgetType::checkbox, WindowColour::secondary, STR_SHOW_GUEST_PURCHASES, STR_SHOW_GUEST_PURCHASES_TIP ), // Guest purchases
makeWidget({ 10, kFrameRenderingStart + 75}, {281, 12}, WidgetType::checkbox, WindowColour::secondary, STR_TRANSPARENT_SCREENSHOT, STR_TRANSPARENT_SCREENSHOT_TIP), // Transparent screenshot
makeWidget({ 10, kFrameRenderingStart + 90}, {281, 12}, WidgetType::label, WindowColour::secondary, STR_VIRTUAL_FLOOR_STYLE, STR_VIRTUAL_FLOOR_STYLE_TIP ), // Virtual floor
makeWidget({155, kFrameRenderingStart + 90}, {145, 12}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdNone, STR_VIRTUAL_FLOOR_STYLE_TIP ), // Virtual floor dropdown
makeWidget({155, kFrameRenderingStart + 90}, {145, 12}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdNone, STR_VIRTUAL_FLOOR_STYLE_TIP ), // Virtual floor dropdown
makeWidget({288, kFrameRenderingStart + 91}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_VIRTUAL_FLOOR_STYLE_TIP ), // Virtual floor dropdown
makeWidget({ 5, kFrameEffectStart + 0}, {300, 94}, WidgetType::groupbox, WindowColour::secondary, STR_EFFECTS_GROUP ), // Rendering group
@@ -673,7 +672,7 @@ namespace OpenRCT2::Ui::Windows
case WINDOW_OPTIONS_PAGE_MISC:
case WINDOW_OPTIONS_PAGE_ADVANCED:
default:
return { WW, WH };
return kWindowSize;
}
}
@@ -2422,6 +2421,6 @@ namespace OpenRCT2::Ui::Windows
WindowBase* OptionsOpen()
{
auto* windowMgr = GetWindowManager();
return windowMgr->FocusOrCreate<OptionsWindow>(WindowClass::Options, { WW, WH }, WF_CENTRE_SCREEN);
return windowMgr->FocusOrCreate<OptionsWindow>(WindowClass::Options, kWindowSize, WF_CENTRE_SCREEN);
}
} // namespace OpenRCT2::Ui::Windows
+6 -7
View File
@@ -19,8 +19,7 @@ struct TrackDesign;
namespace OpenRCT2::Ui::Windows
{
constexpr int32_t OVERWRITE_WW = 200;
constexpr int32_t OVERWRITE_WH = 100;
static constexpr ScreenSize kWindowSize = { 200, 100 };
enum
{
@@ -33,9 +32,9 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto window_overwrite_prompt_widgets = makeWidgets(
makeWindowShim(STR_FILEBROWSER_OVERWRITE_TITLE, { OVERWRITE_WW, OVERWRITE_WH }),
makeWidget({ 10, OVERWRITE_WH - 20 }, { 84, 11 }, WidgetType::button, WindowColour::primary, STR_FILEBROWSER_OVERWRITE_TITLE),
makeWidget({ OVERWRITE_WW - 95, OVERWRITE_WH - 20 }, { 85, 11 }, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_CANCEL)
makeWindowShim(STR_FILEBROWSER_OVERWRITE_TITLE, kWindowSize),
makeWidget({ 10, kWindowSize.height - 20 }, { 84, 11 }, WidgetType::button, WindowColour::primary, STR_FILEBROWSER_OVERWRITE_TITLE),
makeWidget({ kWindowSize.width - 95, kWindowSize.height - 20 }, { 85, 11 }, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_CANCEL)
);
// clang-format on
@@ -107,8 +106,8 @@ namespace OpenRCT2::Ui::Windows
windowMgr->CloseByClass(WindowClass::LoadsaveOverwritePrompt);
return windowMgr->Create<OverwritePromptWindow>(
WindowClass::LoadsaveOverwritePrompt, { OVERWRITE_WW, OVERWRITE_WH },
WF_TRANSPARENT | WF_STICK_TO_FRONT | WF_CENTRE_SCREEN, name, path, action, type, trackDesignPtr);
WindowClass::LoadsaveOverwritePrompt, kWindowSize, WF_TRANSPARENT | WF_STICK_TO_FRONT | WF_CENTRE_SCREEN, name,
path, action, type, trackDesignPtr);
}
void WindowLoadSaveOverwritePromptInputKey(WindowBase* w, uint32_t keycode)
+19 -19
View File
@@ -34,8 +34,8 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = STR_STRINGID;
static constexpr int32_t WH = 224;
static constexpr StringId kWindowTitle = STR_STRINGID;
static constexpr int32_t kWindowHeight = 224;
static constexpr ScreenCoordsXY kGraphTopLeftPadding{ 45, 20 };
static constexpr ScreenCoordsXY kGraphBottomRightPadding{ 25, 10 };
@@ -89,28 +89,28 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto makeParkWidgets = [](int16_t width) {
return makeWidgets(
makeWindowShim(WINDOW_TITLE, { width, WH }),
makeWidget({ 0, 43 }, { width, 131 }, WidgetType::resize, WindowColour::secondary),
makeTab({ 3, 17 }, STR_PARK_ENTRANCE_TAB_TIP),
makeTab({ 34, 17 }, STR_PARK_RATING_TAB_TIP),
makeTab({ 65, 17 }, STR_PARK_GUESTS_TAB_TIP),
makeTab({ 96, 17 }, STR_PARK_PRICE_TAB_TIP),
makeTab({ 127, 17 }, STR_PARK_STATS_TAB_TIP),
makeTab({ 158, 17 }, STR_PARK_OBJECTIVE_TAB_TIP),
makeTab({ 189, 17 }, STR_PARK_AWARDS_TAB_TIP)
makeWindowShim(kWindowTitle, { width, kWindowHeight }),
makeWidget({ 0, 43 }, { width, 131 }, WidgetType::resize, WindowColour::secondary),
makeTab ({ 3, 17 }, STR_PARK_ENTRANCE_TAB_TIP ),
makeTab ({ 34, 17 }, STR_PARK_RATING_TAB_TIP ),
makeTab ({ 65, 17 }, STR_PARK_GUESTS_TAB_TIP ),
makeTab ({ 96, 17 }, STR_PARK_PRICE_TAB_TIP ),
makeTab ({ 127, 17 }, STR_PARK_STATS_TAB_TIP ),
makeTab ({ 158, 17 }, STR_PARK_OBJECTIVE_TAB_TIP ),
makeTab ({ 189, 17 }, STR_PARK_AWARDS_TAB_TIP )
);
};
static constexpr auto _entranceWidgets = makeWidgets(
makeParkWidgets(230),
makeWidget({ 3, 46}, {202, 115}, WidgetType::viewport, WindowColour::secondary ), // viewport
makeWidget({ 3, 161}, {202, 11}, WidgetType::labelCentred, WindowColour::secondary ), // status
makeWidget({205, 49}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_OPEN_OR_CLOSE_PARK_TIP ), // open / close
makeWidget({205, 73}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_BUY_LAND_RIGHTS), STR_BUY_LAND_AND_CONSTRUCTION_RIGHTS_TIP), // buy land rights
makeWidget({205, 97}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_LOCATE), STR_LOCATE_SUBJECT_TIP ), // locate
makeWidget({205, 121}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RENAME), STR_NAME_PARK_TIP ), // rename
makeWidget({210, 51}, { 14, 15}, WidgetType::imgBtn, WindowColour::secondary, ImageId(SPR_G2_RCT1_CLOSE_BUTTON_0), STR_CLOSE_PARK_TIP ),
makeWidget({210, 66}, { 14, 14}, WidgetType::imgBtn, WindowColour::secondary, ImageId(SPR_G2_RCT1_OPEN_BUTTON_0), STR_OPEN_PARK_TIP )
makeWidget({ 3, 46}, {202, 115}, WidgetType::viewport, WindowColour::secondary ), // viewport
makeWidget({ 3, 161}, {202, 11}, WidgetType::labelCentred, WindowColour::secondary ), // status
makeWidget({205, 49}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_OPEN_OR_CLOSE_PARK_TIP ), // open / close
makeWidget({205, 73}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_BUY_LAND_RIGHTS), STR_BUY_LAND_AND_CONSTRUCTION_RIGHTS_TIP), // buy land rights
makeWidget({205, 97}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_LOCATE), STR_LOCATE_SUBJECT_TIP ), // locate
makeWidget({205, 121}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RENAME), STR_NAME_PARK_TIP ), // rename
makeWidget({210, 51}, { 14, 15}, WidgetType::imgBtn, WindowColour::secondary, ImageId(SPR_G2_RCT1_CLOSE_BUTTON_0), STR_CLOSE_PARK_TIP ),
makeWidget({210, 66}, { 14, 14}, WidgetType::imgBtn, WindowColour::secondary, ImageId(SPR_G2_RCT1_OPEN_BUTTON_0), STR_OPEN_PARK_TIP )
);
static constexpr auto _ratingWidgets = makeWidgets(
+4 -5
View File
@@ -29,9 +29,8 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = STR_SET_PATROL_AREA;
static constexpr int32_t WH = 54;
static constexpr int32_t WW = 104;
static constexpr StringId kWindowTitle = STR_SET_PATROL_AREA;
static constexpr ScreenSize kWindowSize = { 104, 54 };
enum WindowPatrolAreaWidgetIdx
{
@@ -45,7 +44,7 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto PatrolAreaWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget ({27, 17}, {44, 32}, WidgetType::imgBtn, WindowColour::primary , ImageId(SPR_LAND_TOOL_SIZE_0) ), // preview box
makeRemapWidget({28, 18}, {16, 16}, WidgetType::trnBtn, WindowColour::tertiary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_PATROL_AREA_TIP), // decrement size
makeRemapWidget({54, 32}, {16, 16}, WidgetType::trnBtn, WindowColour::tertiary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_PATROL_AREA_TIP ) // increment size
@@ -292,7 +291,7 @@ namespace OpenRCT2::Ui::Windows
{
auto* windowMgr = GetWindowManager();
auto* w = windowMgr->FocusOrCreate<PatrolAreaWindow>(
WindowClass::PatrolArea, ScreenCoordsXY(ContextGetWidth() - WW, 29), { WW, WH }, 0);
WindowClass::PatrolArea, ScreenCoordsXY(ContextGetWidth() - kWindowSize.width, 29), kWindowSize, 0);
if (w != nullptr)
{
w->SetStaffId(staffId);
+11 -9
View File
@@ -49,21 +49,23 @@ namespace OpenRCT2::Ui::Windows
WIDX_VIEWPORT,
};
static constexpr ScreenSize kWindowSize = { 192, 157 };
// clang-format off
static constexpr auto kCommonPlayerWidgets = makeWidgets(
makeWindowShim(STR_STRING, { 192, 157 }),
makeWidget({ 0, 43 }, { 192, 114 }, WidgetType::resize, WindowColour::secondary),
makeTab({ 3, 17 }),
makeTab({ 34, 17 })
makeWindowShim(STR_STRING, kWindowSize),
makeWidget({ 0, 43}, {192, 114}, WidgetType::resize, WindowColour::secondary),
makeTab ({ 3, 17} ),
makeTab ({34, 17} )
);
static constexpr auto window_player_overview_widgets = makeWidgets(
kCommonPlayerWidgets,
makeWidget({ 3, 46}, {175, 12}, WidgetType::dropdownMenu, WindowColour::secondary ), // Permission group
makeWidget({167, 47}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH ),
makeWidget({179, 45}, { 12, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_LOCATE), STR_LOCATE_PLAYER_TIP), // Locate button
makeWidget({179, 69}, { 12, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH), STR_KICK_PLAYER_TIP ), // Kick button
makeWidget({ 3, 60}, {175, 61}, WidgetType::viewport, WindowColour::secondary ) // Viewport
makeWidget({ 3, 46}, {175, 12}, WidgetType::dropdownMenu, WindowColour::secondary ), // Permission group
makeWidget({167, 47}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH ),
makeWidget({179, 45}, { 12, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_LOCATE), STR_LOCATE_PLAYER_TIP), // Locate button
makeWidget({179, 69}, { 12, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH), STR_KICK_PLAYER_TIP ), // Kick button
makeWidget({ 3, 60}, {175, 61}, WidgetType::viewport, WindowColour::secondary ) // Viewport
);
static constexpr auto window_player_statistics_widgets = makeWidgets(
+4 -6
View File
@@ -30,12 +30,11 @@ namespace OpenRCT2::Ui::Windows
WIDX_CLOSE,
};
static constexpr int32_t kWindowWidth = 400;
static constexpr int32_t kWindowHeight = 90;
static constexpr ScreenSize kWindowSize = { 400, 90 };
// clang-format off
static constexpr auto kProgressWindowWidgets = makeWidgets(
makeWindowShim(STR_STRINGID, { kWindowWidth, kWindowHeight })
makeWindowShim(STR_STRINGID, kWindowSize)
);
struct LoaderVehicleStyle
@@ -85,7 +84,7 @@ namespace OpenRCT2::Ui::Windows
Audio::StopSFX();
SetWidgets(kProgressWindowWidgets);
WindowSetResize(*this, { kWindowWidth, kWindowHeight }, { kWindowWidth, kWindowHeight });
WindowSetResize(*this, kWindowSize, kWindowSize);
frame_no = 0;
@@ -242,8 +241,7 @@ namespace OpenRCT2::Ui::Windows
else
{
window = windowMgr->Create<ProgressWindow>(
WindowClass::ProgressWindow, { kWindowWidth, kWindowHeight },
WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_STICK_TO_FRONT);
WindowClass::ProgressWindow, kWindowSize, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_STICK_TO_FRONT);
}
window->SetCaption(text);
@@ -19,8 +19,7 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr int32_t WW = 200;
static constexpr int32_t WH = 100;
static constexpr ScreenSize kWindowSize = { 200, 100 };
enum WindowRideRefurbishWidgetIdx
{
@@ -33,9 +32,9 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto window_ride_refurbish_widgets = makeWidgets(
makeWindowShim(STR_REFURBISH_RIDE, { WW, WH }),
makeWidget({ 10, WH - 22 }, { 85, 14 }, WidgetType::button, WindowColour::primary, STR_REFURBISH),
makeWidget({ WW - 95, WH - 22 }, { 85, 14 }, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_CANCEL)
makeWindowShim(STR_REFURBISH_RIDE, kWindowSize ),
makeWidget ({ 10, kWindowSize.height - 22 }, { 85, 14 }, WidgetType::button, WindowColour::primary, STR_REFURBISH ),
makeWidget ({ kWindowSize.width - 95, kWindowSize.height - 22 }, { 85, 14 }, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_CANCEL)
);
// clang-format on
@@ -86,8 +85,8 @@ namespace OpenRCT2::Ui::Windows
currentRide->formatNameTo(ft);
ft.Add<money64>(_demolishRideCost / 2);
ScreenCoordsXY stringCoords(windowPos.x + WW / 2, windowPos.y + (WH / 2) - 3);
DrawTextWrapped(rt, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE });
ScreenCoordsXY stringCoords(windowPos.x + kWindowSize.width / 2, windowPos.y + (kWindowSize.height / 2) - 3);
DrawTextWrapped(rt, stringCoords, kWindowSize.width - 4, stringId, ft, { TextAlignment::CENTRE });
}
}
};
@@ -104,12 +103,12 @@ namespace OpenRCT2::Ui::Windows
windowMgr->Close(*w);
newWindow = windowMgr->Create<RefurbishRidePromptWindow>(
WindowClass::DemolishRidePrompt, windowPos, { WW, WH }, WF_TRANSPARENT);
WindowClass::DemolishRidePrompt, windowPos, kWindowSize, WF_TRANSPARENT);
}
else
{
newWindow = windowMgr->Create<RefurbishRidePromptWindow>(
WindowClass::DemolishRidePrompt, { WW, WH }, WF_CENTRE_SCREEN | WF_TRANSPARENT);
WindowClass::DemolishRidePrompt, kWindowSize, WF_CENTRE_SCREEN | WF_TRANSPARENT);
}
newWindow->SetRide(ride);
+29 -32
View File
@@ -27,10 +27,8 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr int32_t WH_DEVELOPMENT = 196;
static constexpr int32_t WW_DEVELOPMENT = 300;
static constexpr int32_t WH_FUNDING = 207;
static constexpr int32_t WW_FUNDING = 320;
static constexpr ScreenSize kWindowSizeDevelopment = { 300, 196 };
static constexpr ScreenSize kWindowSizeFunding = { 320, 207 };
enum
{
@@ -69,31 +67,31 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto window_research_development_widgets = makeWidgets(
makeWindowShim(STR_RESEARCH_AND_DEVELOPMENT, { WW_DEVELOPMENT, WH_DEVELOPMENT }),
makeWidget({ 0, 43}, { WW_DEVELOPMENT, 153}, WidgetType::resize, WindowColour::secondary ),
makeTab ({ 3, 17}, STR_RESEARCH_AND_DEVELOPMENT_TIP),
makeTab ({ 34, 17}, STR_FINANCES_RESEARCH_TIP ),
makeWidget({ 3, 47}, {WW_DEVELOPMENT - 10, 70}, WidgetType::groupbox, WindowColour::tertiary , STR_CURRENTLY_IN_DEVELOPMENT ),
makeWidget({ 3, 124}, {WW_DEVELOPMENT - 10, 65}, WidgetType::groupbox, WindowColour::tertiary , STR_LAST_DEVELOPMENT ),
makeWidget({265, 161}, { 24, 24}, WidgetType::flatBtn, WindowColour::tertiary , 0xFFFFFFFF, STR_RESEARCH_SHOW_DETAILS_TIP )
makeWindowShim(STR_RESEARCH_AND_DEVELOPMENT, kWindowSizeDevelopment),
makeWidget({ 0, 43}, { kWindowSizeDevelopment.width, 153}, WidgetType::resize, WindowColour::secondary ),
makeTab ({ 3, 17}, STR_RESEARCH_AND_DEVELOPMENT_TIP ),
makeTab ({ 34, 17}, STR_FINANCES_RESEARCH_TIP ),
makeWidget({ 3, 47}, {kWindowSizeDevelopment.width - 10, 70}, WidgetType::groupbox, WindowColour::tertiary, STR_CURRENTLY_IN_DEVELOPMENT ),
makeWidget({ 3, 124}, {kWindowSizeDevelopment.width - 10, 65}, WidgetType::groupbox, WindowColour::tertiary, STR_LAST_DEVELOPMENT ),
makeWidget({265, 161}, { 24, 24}, WidgetType::flatBtn, WindowColour::tertiary, 0xFFFFFFFF, STR_RESEARCH_SHOW_DETAILS_TIP)
);
static constexpr auto window_research_funding_widgets = makeWidgets(
makeWindowShim(STR_RESEARCH_FUNDING, { WW_FUNDING, WH_FUNDING }),
makeWidget({ 0, 43}, { WW_FUNDING, 164}, WidgetType::resize, WindowColour::secondary ),
makeTab ({ 3, 17}, STR_RESEARCH_AND_DEVELOPMENT_TIP ),
makeTab ({ 34, 17}, STR_FINANCES_RESEARCH_TIP ),
makeWidget({ 3, 47}, { WW_FUNDING - 6, 45}, WidgetType::groupbox, WindowColour::tertiary , STR_RESEARCH_FUNDING_ ),
makeWidget({ 8, 59}, { 160, 14}, WidgetType::dropdownMenu, WindowColour::tertiary , 0xFFFFFFFF, STR_SELECT_LEVEL_OF_RESEARCH_AND_DEVELOPMENT),
makeWidget({156, 60}, { 11, 12}, WidgetType::button, WindowColour::tertiary , STR_DROPDOWN_GLYPH, STR_SELECT_LEVEL_OF_RESEARCH_AND_DEVELOPMENT),
makeWidget({ 3, 96}, { WW_FUNDING - 6, 107}, WidgetType::groupbox, WindowColour::tertiary , STR_RESEARCH_PRIORITIES ),
makeWidget({ 8, 108}, {WW_FUNDING - 16, 12}, WidgetType::checkbox, WindowColour::tertiary , STR_RESEARCH_NEW_TRANSPORT_RIDES, STR_RESEARCH_NEW_TRANSPORT_RIDES_TIP ),
makeWidget({ 8, 121}, {WW_FUNDING - 16, 12}, WidgetType::checkbox, WindowColour::tertiary , STR_RESEARCH_NEW_GENTLE_RIDES, STR_RESEARCH_NEW_GENTLE_RIDES_TIP ),
makeWidget({ 8, 134}, {WW_FUNDING - 16, 12}, WidgetType::checkbox, WindowColour::tertiary , STR_RESEARCH_NEW_ROLLER_COASTERS, STR_RESEARCH_NEW_ROLLER_COASTERS_TIP ),
makeWidget({ 8, 147}, {WW_FUNDING - 16, 12}, WidgetType::checkbox, WindowColour::tertiary , STR_RESEARCH_NEW_THRILL_RIDES, STR_RESEARCH_NEW_THRILL_RIDES_TIP ),
makeWidget({ 8, 160}, {WW_FUNDING - 16, 12}, WidgetType::checkbox, WindowColour::tertiary , STR_RESEARCH_NEW_WATER_RIDES, STR_RESEARCH_NEW_WATER_RIDES_TIP ),
makeWidget({ 8, 173}, {WW_FUNDING - 16, 12}, WidgetType::checkbox, WindowColour::tertiary , STR_RESEARCH_NEW_SHOPS_AND_STALLS, STR_RESEARCH_NEW_SHOPS_AND_STALLS_TIP ),
makeWidget({ 8, 186}, {WW_FUNDING - 16, 12}, WidgetType::checkbox, WindowColour::tertiary , STR_RESEARCH_NEW_SCENERY_AND_THEMING, STR_RESEARCH_NEW_SCENERY_AND_THEMING_TIP )
makeWindowShim(STR_RESEARCH_FUNDING, kWindowSizeFunding),
makeWidget({ 0, 43}, { kWindowSizeFunding.width, 164}, WidgetType::resize, WindowColour::secondary ),
makeTab ({ 3, 17}, STR_RESEARCH_AND_DEVELOPMENT_TIP ),
makeTab ({ 34, 17}, STR_FINANCES_RESEARCH_TIP ),
makeWidget({ 3, 47}, { kWindowSizeFunding.width - 6, 45}, WidgetType::groupbox, WindowColour::tertiary, STR_RESEARCH_FUNDING_ ),
makeWidget({ 8, 59}, { 160, 14}, WidgetType::dropdownMenu, WindowColour::tertiary, 0xFFFFFFFF, STR_SELECT_LEVEL_OF_RESEARCH_AND_DEVELOPMENT),
makeWidget({156, 60}, { 11, 12}, WidgetType::button, WindowColour::tertiary, STR_DROPDOWN_GLYPH, STR_SELECT_LEVEL_OF_RESEARCH_AND_DEVELOPMENT),
makeWidget({ 3, 96}, { kWindowSizeFunding.width - 6, 107}, WidgetType::groupbox, WindowColour::tertiary, STR_RESEARCH_PRIORITIES ),
makeWidget({ 8, 108}, {kWindowSizeFunding.width - 16, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_TRANSPORT_RIDES, STR_RESEARCH_NEW_TRANSPORT_RIDES_TIP ),
makeWidget({ 8, 121}, {kWindowSizeFunding.width - 16, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_GENTLE_RIDES, STR_RESEARCH_NEW_GENTLE_RIDES_TIP ),
makeWidget({ 8, 134}, {kWindowSizeFunding.width - 16, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_ROLLER_COASTERS, STR_RESEARCH_NEW_ROLLER_COASTERS_TIP ),
makeWidget({ 8, 147}, {kWindowSizeFunding.width - 16, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_THRILL_RIDES, STR_RESEARCH_NEW_THRILL_RIDES_TIP ),
makeWidget({ 8, 160}, {kWindowSizeFunding.width - 16, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_WATER_RIDES, STR_RESEARCH_NEW_WATER_RIDES_TIP ),
makeWidget({ 8, 173}, {kWindowSizeFunding.width - 16, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_SHOPS_AND_STALLS, STR_RESEARCH_NEW_SHOPS_AND_STALLS_TIP ),
makeWidget({ 8, 186}, {kWindowSizeFunding.width - 16, 12}, WidgetType::checkbox, WindowColour::tertiary, STR_RESEARCH_NEW_SCENERY_AND_THEMING, STR_RESEARCH_NEW_SCENERY_AND_THEMING_TIP )
);
static constexpr std::span<const Widget> window_research_page_widgets[] = {
@@ -136,13 +134,13 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
if (newPageIndex == WINDOW_RESEARCH_PAGE_DEVELOPMENT)
{
width = WW_DEVELOPMENT;
height = WH_DEVELOPMENT;
width = kWindowSizeDevelopment.width;
height = kWindowSizeDevelopment.height;
}
else
{
width = WW_FUNDING;
height = WH_FUNDING;
width = kWindowSizeFunding.width;
height = kWindowSizeFunding.height;
}
Invalidate();
@@ -298,8 +296,7 @@ namespace OpenRCT2::Ui::Windows
WindowBase* ResearchOpen()
{
auto* windowMgr = GetWindowManager();
auto* window = windowMgr->FocusOrCreate<ResearchWindow>(
WindowClass::Research, { WW_DEVELOPMENT, WH_DEVELOPMENT }, WF_10);
auto* window = windowMgr->FocusOrCreate<ResearchWindow>(WindowClass::Research, kWindowSizeDevelopment, WF_10);
window->SetPage(WINDOW_RESEARCH_PAGE_DEVELOPMENT);
return window;
}
+62 -63
View File
@@ -81,9 +81,8 @@ namespace OpenRCT2::Ui::Windows
{
static constexpr int32_t kMinimumWindowWidth = 316;
static constexpr StringId WINDOW_TITLE = STR_RIDE_WINDOW_TITLE;
static constexpr int32_t WH = 207;
static constexpr int32_t WW = kMinimumWindowWidth;
static constexpr StringId kWindowTitle = STR_RIDE_WINDOW_TITLE;
static constexpr ScreenSize kWindowSize = { kMinimumWindowWidth, 207 };
enum
{
@@ -243,12 +242,12 @@ namespace OpenRCT2::Ui::Windows
constexpr int32_t RCT1_LIGHT_OFFSET = 4;
static constexpr auto kMainRideWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 0, 43}, {kMinimumWindowWidth, 137}, WidgetType::resize, WindowColour::secondary),
makeTab({ 3, 17 }, STR_VIEW_OF_RIDE_ATTRACTION_TIP),
makeTab({ 34, 17 }, STR_VEHICLE_DETAILS_AND_OPTIONS_TIP),
makeTab({ 65, 17 }, STR_OPERATING_OPTIONS_TIP),
makeTab({ 96, 17 }, STR_MAINTENANCE_OPTIONS_TIP),
makeTab({ 3, 17 }, STR_VIEW_OF_RIDE_ATTRACTION_TIP),
makeTab({ 34, 17 }, STR_VEHICLE_DETAILS_AND_OPTIONS_TIP),
makeTab({ 65, 17 }, STR_OPERATING_OPTIONS_TIP),
makeTab({ 96, 17 }, STR_MAINTENANCE_OPTIONS_TIP),
makeTab({ 127, 17 }, STR_COLOUR_SCHEME_OPTIONS_TIP),
makeTab({ 158, 17 }, STR_SOUND_AND_MUSIC_OPTIONS_TIP),
makeTab({ 189, 17 }, STR_MEASUREMENTS_AND_TEST_DATA_TIP),
@@ -273,87 +272,87 @@ namespace OpenRCT2::Ui::Windows
makeWidget({296, 62}, { 14, 14}, WidgetType::imgBtn, WindowColour::secondary, ImageId(SPR_G2_RCT1_TEST_BUTTON_0), STR_SIMULATE_RIDE_TIP ),
makeWidget({296, 62}, { 14, 14}, WidgetType::imgBtn, WindowColour::secondary, ImageId(SPR_G2_RCT1_TEST_BUTTON_0), STR_TEST_RIDE_TIP ),
makeWidget({296, 76}, { 14, 14}, WidgetType::imgBtn, WindowColour::secondary, ImageId(SPR_G2_RCT1_OPEN_BUTTON_0), STR_OPEN_RIDE_TIP ),
makeWidget({ 3, 180}, {305, 12}, WidgetType::dropdownMenu, WindowColour::secondary, STR_ARG_6_STRINGID ),
makeWidget({297, 180}, { 11, 12}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH )
makeWidget({ 3, 180}, {305, 12}, WidgetType::dropdownMenu, WindowColour::secondary, STR_ARG_6_STRINGID ),
makeWidget({297, 180}, { 11, 12}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH )
);
// 0x009ADDA8
static constexpr auto _vehicleWidgets = makeWidgets(
kMainRideWidgets,
makeWidget ({ 7, 50}, {302, 12}, WidgetType::dropdownMenu, WindowColour::secondary ),
makeWidget ({297, 51}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH ),
makeWidget ({ 7, 137}, {302, 12}, WidgetType::checkbox, WindowColour::secondary, STR_OPTION_REVERSE_TRAINS, STR_OPTION_REVERSE_TRAINS_TIP ),
makeWidget ({ 7, 154}, {302, 43}, WidgetType::scroll, WindowColour::secondary, kStringIdEmpty ),
makeSpinnerWidgets({ 7, 203}, {145, 12}, WidgetType::spinner, WindowColour::secondary, STR_RIDE_VEHICLE_COUNT, STR_MAX_VEHICLES_TIP ),
makeSpinnerWidgets({164, 203}, {145, 12}, WidgetType::spinner, WindowColour::secondary, STR_1_CAR_PER_TRAIN, STR_MAX_CARS_PER_TRAIN_TIP)
makeWidget ({ 7, 50}, {302, 12}, WidgetType::dropdownMenu, WindowColour::secondary ),
makeWidget ({297, 51}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH ),
makeWidget ({ 7, 137}, {302, 12}, WidgetType::checkbox, WindowColour::secondary, STR_OPTION_REVERSE_TRAINS, STR_OPTION_REVERSE_TRAINS_TIP),
makeWidget ({ 7, 154}, {302, 43}, WidgetType::scroll, WindowColour::secondary, kStringIdEmpty ),
makeSpinnerWidgets({ 7, 203}, {145, 12}, WidgetType::spinner, WindowColour::secondary, STR_RIDE_VEHICLE_COUNT, STR_MAX_VEHICLES_TIP ),
makeSpinnerWidgets({164, 203}, {145, 12}, WidgetType::spinner, WindowColour::secondary, STR_1_CAR_PER_TRAIN, STR_MAX_CARS_PER_TRAIN_TIP )
);
// 0x009ADEFC
static constexpr auto _operatingWidgets = makeWidgets(
kMainRideWidgets,
makeSpinnerWidgets({157, 61}, {152, 12}, WidgetType::spinner, WindowColour::secondary, STR_ARG_18_STRINGID ), // NB: 3 widgets
makeSpinnerWidgets({157, 75}, {152, 12}, WidgetType::spinner, WindowColour::secondary, STR_LIFT_HILL_CHAIN_SPEED_VALUE ), // NB: 3 widgets
makeWidget ({ 7, 109}, { 80, 12}, WidgetType::checkbox, WindowColour::secondary, STR_WAIT_FOR, STR_WAIT_FOR_PASSENGERS_BEFORE_DEPARTING_TIP),
makeWidget ({ 7, 124}, {302, 12}, WidgetType::checkbox, WindowColour::secondary ),
makeWidget ({ 7, 139}, {150, 12}, WidgetType::checkbox, WindowColour::secondary, STR_MINIMUM_WAITING_TIME, STR_MINIMUM_LENGTH_BEFORE_DEPARTING_TIP ),
makeSpinnerWidgets({157, 139}, {152, 12}, WidgetType::spinner, WindowColour::secondary, STR_ARG_10_STRINGID ), // NB: 3 widgets
makeWidget ({ 7, 154}, {150, 12}, WidgetType::checkbox, WindowColour::secondary, STR_MAXIMUM_WAITING_TIME, STR_MAXIMUM_LENGTH_BEFORE_DEPARTING_TIP ),
makeSpinnerWidgets({157, 154}, {152, 12}, WidgetType::spinner, WindowColour::secondary, STR_ARG_14_STRINGID ), // NB: 3 widgets
makeWidget ({ 7, 169}, {302, 12}, WidgetType::checkbox, WindowColour::secondary, STR_SYNCHRONISE_WITH_ADJACENT_STATIONS, STR_SYNCHRONISE_WITH_ADJACENT_STATIONS_TIP ),
makeWidget ({ 21, 61}, {129, 12}, WidgetType::label, WindowColour::secondary ),
makeWidget ({ 21, 75}, {129, 12}, WidgetType::label, WindowColour::secondary, STR_LIFT_HILL_CHAIN_SPEED ),
makeSpinnerWidgets({157, 61}, {152, 12}, WidgetType::spinner, WindowColour::secondary, STR_ARG_18_STRINGID ), // NB: 3 widgets
makeSpinnerWidgets({157, 75}, {152, 12}, WidgetType::spinner, WindowColour::secondary, STR_LIFT_HILL_CHAIN_SPEED_VALUE ), // NB: 3 widgets
makeWidget ({ 7, 109}, { 80, 12}, WidgetType::checkbox, WindowColour::secondary, STR_WAIT_FOR, STR_WAIT_FOR_PASSENGERS_BEFORE_DEPARTING_TIP),
makeWidget ({ 7, 124}, {302, 12}, WidgetType::checkbox, WindowColour::secondary ),
makeWidget ({ 7, 139}, {150, 12}, WidgetType::checkbox, WindowColour::secondary, STR_MINIMUM_WAITING_TIME, STR_MINIMUM_LENGTH_BEFORE_DEPARTING_TIP ),
makeSpinnerWidgets({157, 139}, {152, 12}, WidgetType::spinner, WindowColour::secondary, STR_ARG_10_STRINGID ), // NB: 3 widgets
makeWidget ({ 7, 154}, {150, 12}, WidgetType::checkbox, WindowColour::secondary, STR_MAXIMUM_WAITING_TIME, STR_MAXIMUM_LENGTH_BEFORE_DEPARTING_TIP ),
makeSpinnerWidgets({157, 154}, {152, 12}, WidgetType::spinner, WindowColour::secondary, STR_ARG_14_STRINGID ), // NB: 3 widgets
makeWidget ({ 7, 169}, {302, 12}, WidgetType::checkbox, WindowColour::secondary, STR_SYNCHRONISE_WITH_ADJACENT_STATIONS, STR_SYNCHRONISE_WITH_ADJACENT_STATIONS_TIP ),
makeWidget ({ 21, 61}, {129, 12}, WidgetType::label, WindowColour::secondary ),
makeWidget ({ 21, 75}, {129, 12}, WidgetType::label, WindowColour::secondary, STR_LIFT_HILL_CHAIN_SPEED ),
makeWidget ({ 7, 47}, {302, 12}, WidgetType::dropdownMenu, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_OPERATING_MODE ),
makeWidget ({297, 48}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_OPERATING_MODE ),
makeWidget ({297, 48}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_OPERATING_MODE ),
makeWidget ({ 87, 109}, {222, 12}, WidgetType::dropdownMenu, WindowColour::secondary ),
makeWidget ({297, 110}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH ),
makeWidget ({ 21, 89}, {129, 12}, WidgetType::label, WindowColour::secondary, STR_NUMBER_OF_CIRCUITS, STR_NUMBER_OF_CIRCUITS_TIP ),
makeSpinnerWidgets({157, 89}, {152, 12}, WidgetType::spinner, WindowColour::secondary, STR_NUMBER_OF_CIRCUITS_VALUE ) // NB: 3 widgets
makeWidget ({297, 110}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH ),
makeWidget ({ 21, 89}, {129, 12}, WidgetType::label, WindowColour::secondary, STR_NUMBER_OF_CIRCUITS, STR_NUMBER_OF_CIRCUITS_TIP ),
makeSpinnerWidgets({157, 89}, {152, 12}, WidgetType::spinner, WindowColour::secondary, STR_NUMBER_OF_CIRCUITS_VALUE ) // NB: 3 widgets
);
// 0x009AE190
static constexpr auto _maintenanceWidgets = makeWidgets(
kMainRideWidgets,
makeWidget({107, 71}, {202, 12}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdEmpty, STR_SELECT_HOW_OFTEN_A_MECHANIC_SHOULD_CHECK_THIS_RIDE),
makeWidget({297, 72}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_HOW_OFTEN_A_MECHANIC_SHOULD_CHECK_THIS_RIDE),
makeWidget({289, 108}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_LOCATE_NEAREST_AVAILABLE_MECHANIC_TIP ),
makeWidget({265, 108}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION), STR_REFURBISH_RIDE_TIP ),
makeWidget({241, 108}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_NO_ENTRY), STR_DEBUG_FORCE_BREAKDOWN_TIP ),
makeProgressBar({107, 47}, { 147, 10}, COLOUR_BRIGHT_GREEN),
makeProgressBar({107, 58}, { 147, 10}, COLOUR_BRIGHT_RED)
makeWidget ({107, 71}, {202, 12}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdEmpty, STR_SELECT_HOW_OFTEN_A_MECHANIC_SHOULD_CHECK_THIS_RIDE),
makeWidget ({297, 72}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_HOW_OFTEN_A_MECHANIC_SHOULD_CHECK_THIS_RIDE),
makeWidget ({289, 108}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_LOCATE_NEAREST_AVAILABLE_MECHANIC_TIP ),
makeWidget ({265, 108}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION), STR_REFURBISH_RIDE_TIP ),
makeWidget ({241, 108}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_NO_ENTRY), STR_DEBUG_FORCE_BREAKDOWN_TIP ),
makeProgressBar({107, 47}, { 147, 10}, COLOUR_BRIGHT_GREEN ),
makeProgressBar({107, 58}, { 147, 10}, COLOUR_BRIGHT_RED )
);
// 0x009AE2A4
static constexpr auto _colourWidgets = makeWidgets(
kMainRideWidgets,
makeWidget({ 3, 47}, { 68, 47}, WidgetType::spinner, WindowColour::secondary ),
makeWidget({ 74, 49}, {239, 12}, WidgetType::dropdownMenu, WindowColour::secondary, STR_ARG_14_STRINGID ),
makeWidget({301, 50}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_COLOUR_SCHEME_TO_CHANGE_TIP ),
makeWidget({ 79, 74}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_MAIN_COLOUR_TIP ),
makeWidget({ 99, 74}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_ADDITIONAL_COLOUR_1_TIP ),
makeWidget({119, 74}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_SUPPORT_STRUCTURE_COLOUR_TIP ),
makeWidget({ 74, 49}, {239, 12}, WidgetType::dropdownMenu, WindowColour::secondary ),
makeWidget({301, 50}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH ),
makeWidget({289, 68}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_PAINTBRUSH), STR_PAINT_INDIVIDUAL_AREA_TIP ),
makeWidget({245, 101}, { 68, 47}, WidgetType::spinner, WindowColour::secondary ),
makeWidget({103, 103}, {139, 12}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdEmpty ),
makeWidget({230, 104}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_STYLE_OF_ENTRANCE_EXIT_STATION_TIP),
makeWidget({ 3, 157}, { 68, 47}, WidgetType::scroll, WindowColour::secondary, kStringIdEmpty ),
makeWidget({ 74, 157}, {239, 12}, WidgetType::dropdownMenu, WindowColour::secondary, STR_ARG_6_STRINGID ),
makeWidget({301, 158}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_VEHICLE_COLOUR_SCHEME_TIP ),
makeWidget({ 74, 173}, {239, 12}, WidgetType::dropdownMenu, WindowColour::secondary ),
makeWidget({301, 174}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_VEHICLE_TO_MODIFY_TIP ),
makeWidget({ 79, 190}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_MAIN_COLOUR_TIP ),
makeWidget({ 99, 190}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_ADDITIONAL_COLOUR_1_TIP ),
makeWidget({119, 190}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_ADDITIONAL_COLOUR_2_TIP ),
makeWidget({100, 74}, {239, 12}, WidgetType::checkbox, WindowColour::secondary, STR_RANDOM_COLOUR ),
makeWidget({139, 190}, {110, 12}, WidgetType::button, WindowColour::secondary, STR_RANDOMISE_VEHICLE_COLOURS, STR_RANDOMISE_VEHICLE_COLOURS_TIP )
makeWidget({ 3, 47}, { 68, 47}, WidgetType::spinner, WindowColour::secondary ),
makeWidget({ 74, 49}, {239, 12}, WidgetType::dropdownMenu, WindowColour::secondary, STR_ARG_14_STRINGID ),
makeWidget({301, 50}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_COLOUR_SCHEME_TO_CHANGE_TIP ),
makeWidget({ 79, 74}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_MAIN_COLOUR_TIP ),
makeWidget({ 99, 74}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_ADDITIONAL_COLOUR_1_TIP ),
makeWidget({119, 74}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_SUPPORT_STRUCTURE_COLOUR_TIP ),
makeWidget({ 74, 49}, {239, 12}, WidgetType::dropdownMenu, WindowColour::secondary ),
makeWidget({301, 50}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH ),
makeWidget({289, 68}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_PAINTBRUSH), STR_PAINT_INDIVIDUAL_AREA_TIP ),
makeWidget({245, 101}, { 68, 47}, WidgetType::spinner, WindowColour::secondary ),
makeWidget({103, 103}, {139, 12}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdEmpty ),
makeWidget({230, 104}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_STYLE_OF_ENTRANCE_EXIT_STATION_TIP),
makeWidget({ 3, 157}, { 68, 47}, WidgetType::scroll, WindowColour::secondary, kStringIdEmpty ),
makeWidget({ 74, 157}, {239, 12}, WidgetType::dropdownMenu, WindowColour::secondary, STR_ARG_6_STRINGID ),
makeWidget({301, 158}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_VEHICLE_COLOUR_SCHEME_TIP ),
makeWidget({ 74, 173}, {239, 12}, WidgetType::dropdownMenu, WindowColour::secondary ),
makeWidget({301, 174}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_VEHICLE_TO_MODIFY_TIP ),
makeWidget({ 79, 190}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_MAIN_COLOUR_TIP ),
makeWidget({ 99, 190}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_ADDITIONAL_COLOUR_1_TIP ),
makeWidget({119, 190}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_ADDITIONAL_COLOUR_2_TIP ),
makeWidget({100, 74}, {239, 12}, WidgetType::checkbox, WindowColour::secondary, STR_RANDOM_COLOUR ),
makeWidget({139, 190}, {110, 12}, WidgetType::button, WindowColour::secondary, STR_RANDOMISE_VEHICLE_COLOURS, STR_RANDOMISE_VEHICLE_COLOURS_TIP )
);
// 0x009AE4C8
static constexpr auto _musicWidgets = makeWidgets(
kMainRideWidgets,
makeWidget({ 7, 47}, {302, 12}, WidgetType::checkbox, WindowColour::secondary, STR_PLAY_MUSIC, STR_SELECT_MUSIC_TIP ),
makeWidget({ 7, 62}, {302, 12}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdEmpty ),
makeWidget({ 7, 62}, {302, 12}, WidgetType::dropdownMenu, WindowColour::secondary, kStringIdEmpty ),
makeWidget({297, 63}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_MUSIC_STYLE_TIP),
makeWidget({154, 90}, {114, 114}, WidgetType::flatBtn, WindowColour::secondary ),
makeWidget({ 7, 90}, {500, 450}, WidgetType::scroll, WindowColour::secondary, SCROLL_BOTH )
@@ -362,7 +361,7 @@ namespace OpenRCT2::Ui::Windows
// 0x009AE5DC
static constexpr auto _measurementWidgets = makeWidgets(
kMainRideWidgets,
makeWidget({288, 194}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_FLOPPY), STR_SAVE_TRACK_DESIGN),
makeWidget({288, 194}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_FLOPPY), STR_SAVE_TRACK_DESIGN),
makeWidget({ 4, 127}, {154, 14}, WidgetType::button, WindowColour::secondary, STR_SELECT_NEARBY_SCENERY ),
makeWidget({158, 127}, {154, 14}, WidgetType::button, WindowColour::secondary, STR_RESET_SELECTION ),
makeWidget({ 4, 177}, {154, 14}, WidgetType::button, WindowColour::secondary, STR_DESIGN_SAVE ),
@@ -6954,7 +6953,7 @@ namespace OpenRCT2::Ui::Windows
static RideWindow* WindowRideOpen(const Ride& ride)
{
auto* windowMgr = GetWindowManager();
return windowMgr->Create<RideWindow>(WindowClass::Ride, { kMinimumWindowWidth, 207 }, WF_10 | WF_RESIZABLE, ride);
return windowMgr->Create<RideWindow>(WindowClass::Ride, kWindowSize, WF_10 | WF_RESIZABLE, ride);
}
/**
+43 -44
View File
@@ -79,12 +79,11 @@ namespace OpenRCT2::Ui::Windows
static std::pair<bool, OpenRCT2::TrackElemType> WindowRideConstructionUpdateStateGetTrackElement();
static constexpr StringId kWindowTitle = STR_RIDE_CONSTRUCTION_WINDOW_TITLE;
static constexpr int32_t WH = 394;
static constexpr int32_t WW = 210;
static constexpr ScreenSize kWindowSize = { 210, 394 };
static constexpr uint16_t kArrowPulseDuration = 200;
// Width of the group boxes, e.g. “Banking”
static constexpr int32_t GW = WW - 6;
static constexpr int32_t kGroupWidth = kWindowSize.width - 6;
#pragma region Widgets
@@ -145,44 +144,44 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto kRideConstructionWidgets = makeWidgets(
makeWindowShim(kWindowTitle, { WW, WH }),
makeWidget ({ 3, 17}, { GW, 57}, WidgetType::groupbox, WindowColour::primary , STR_RIDE_CONSTRUCTION_DIRECTION ),
makeWidget ({ 3, 76}, { GW, 41}, WidgetType::groupbox, WindowColour::primary , STR_RIDE_CONSTRUCTION_SLOPE ),
makeWidget ({ 3, 120}, { GW, 41}, WidgetType::groupbox, WindowColour::primary , STR_RIDE_CONSTRUCTION_ROLL_BANKING ),
makeWidget ({ 6, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_LEFT_CURVE_SMALL), STR_RIDE_CONSTRUCTION_LEFT_CURVE_VERY_SMALL_TIP ),
makeWidget ({ 28, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_ICON_MEDIUM_CURVE_LEFT), STR_RIDE_CONSTRUCTION_LEFT_CURVE_SMALL_TIP ),
makeWidget ({ 50, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_LEFT_CURVE), STR_RIDE_CONSTRUCTION_LEFT_CURVE_TIP ),
makeWidget ({ 72, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_LEFT_CURVE_LARGE), STR_RIDE_CONSTRUCTION_LEFT_CURVE_LARGE_TIP ),
makeWidget ({ 94, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_STRAIGHT), STR_RIDE_CONSTRUCTION_STRAIGHT_TIP ),
makeWidget ({116, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_RIGHT_CURVE_LARGE), STR_RIDE_CONSTRUCTION_RIGHT_CURVE_LARGE_TIP ),
makeWidget ({138, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_RIGHT_CURVE), STR_RIDE_CONSTRUCTION_RIGHT_CURVE_TIP ),
makeWidget ({160, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_ICON_MEDIUM_CURVE_RIGHT), STR_RIDE_CONSTRUCTION_RIGHT_CURVE_SMALL_TIP ),
makeWidget ({182, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_RIGHT_CURVE_SMALL), STR_RIDE_CONSTRUCTION_RIGHT_CURVE_VERY_SMALL_TIP ),
makeWidget ({ 6, 55}, { GW - 6, 14}, WidgetType::button, WindowColour::secondary, STR_YELLOW_STRING, STR_RIDE_CONSTRUCTION_OTHER_TRACK_CONFIGURATIONS_TIP),
makeWidget ({ 6, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_VERTICAL_DROP), STR_RIDE_CONSTRUCTION_VERTICAL_DROP_TIP ),
makeWidget ({ 30, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_DOWN_STEEP), STR_RIDE_CONSTRUCTION_STEEP_SLOPE_DOWN_TIP ),
makeWidget ({ 54, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_DOWN), STR_RIDE_CONSTRUCTION_SLOPE_DOWN_TIP ),
makeWidget ({ 78, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_LEVEL), STR_RIDE_CONSTRUCTION_LEVEL_TIP ),
makeWidget ({102, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_UP), STR_RIDE_CONSTRUCTION_SLOPE_UP_TIP ),
makeWidget ({126, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_UP_STEEP), STR_RIDE_CONSTRUCTION_STEEP_SLOPE_UP_TIP ),
makeWidget ({150, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_VERTICAL_RISE), STR_RIDE_CONSTRUCTION_VERTICAL_RISE_TIP ),
makeWidget ({178, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CHAIN_LIFT), STR_RIDE_CONSTRUCTION_CHAIN_LIFT_TIP ),
makeWidget ({ 69, 132}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_LEFT_BANK), STR_RIDE_CONSTRUCTION_ROLL_FOR_LEFT_CURVE_TIP ),
makeWidget ({ 93, 132}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_NO_BANK), STR_RIDE_CONSTRUCTION_NO_ROLL_TIP ),
makeWidget ({117, 132}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_RIGHT_BANK), STR_RIDE_CONSTRUCTION_ROLL_FOR_RIGHT_CURVE_TIP ),
makeWidget ({ 3, 164}, { GW, 170}, WidgetType::imgBtn, WindowColour::secondary, 0xFFFFFFFF, STR_RIDE_CONSTRUCTION_CONSTRUCT_SELECTED_SECTION_TIP),
makeWidget ({ 82, 338}, { 46, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH_CURRENT_SECTION), STR_RIDE_CONSTRUCTION_REMOVE_HIGHLIGHTED_SECTION_TIP),
makeWidget ({ 52, 338}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_PREVIOUS), STR_RIDE_CONSTRUCTION_MOVE_TO_PREVIOUS_SECTION_TIP ),
makeWidget ({134, 338}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_NEXT), STR_RIDE_CONSTRUCTION_MOVE_TO_NEXT_SECTION_TIP ),
makeWidget ({ 3, 362}, { GW, 28}, WidgetType::groupbox, WindowColour::primary ),
makeWidget ({ 31, 372}, { 70, 12}, WidgetType::button, WindowColour::secondary, STR_RIDE_CONSTRUCTION_ENTRANCE, STR_RIDE_CONSTRUCTION_ENTRANCE_TIP ),
makeWidget ({109, 372}, { 70, 12}, WidgetType::button, WindowColour::secondary, STR_RIDE_CONSTRUCTION_EXIT, STR_RIDE_CONSTRUCTION_EXIT_TIP ),
makeWidget ({ 94, 338}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_90_TIP ),
makeWidget ({ 41, 132}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_U_SHAPED_TRACK), STR_RIDE_CONSTRUCTION_U_SHAPED_OPEN_TRACK_TIP ),
makeWidget ({144, 132}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_O_SHAPED_TRACK), STR_RIDE_CONSTRUCTION_O_SHAPED_ENCLOSED_TRACK_TIP ),
makeWidget ({118, 120}, { 89, 41}, WidgetType::groupbox, WindowColour::primary , STR_RIDE_CONSTRUCTION_SEAT_ROT ),
makeSpinnerWidgets({123, 138}, { 58, 12}, WidgetType::spinner, WindowColour::secondary, 0, STR_RIDE_CONSTRUCTION_SELECT_SEAT_ROTATION_ANGLE_TIP),
makeWidget ({161, 338}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_SIMULATE), STR_SIMULATE_RIDE_TIP )
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget ({ 3, 17}, { kGroupWidth, 57}, WidgetType::groupbox, WindowColour::primary , STR_RIDE_CONSTRUCTION_DIRECTION ),
makeWidget ({ 3, 76}, { kGroupWidth, 41}, WidgetType::groupbox, WindowColour::primary , STR_RIDE_CONSTRUCTION_SLOPE ),
makeWidget ({ 3, 120}, { kGroupWidth, 41}, WidgetType::groupbox, WindowColour::primary , STR_RIDE_CONSTRUCTION_ROLL_BANKING ),
makeWidget ({ 6, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_LEFT_CURVE_SMALL), STR_RIDE_CONSTRUCTION_LEFT_CURVE_VERY_SMALL_TIP ),
makeWidget ({ 28, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_ICON_MEDIUM_CURVE_LEFT), STR_RIDE_CONSTRUCTION_LEFT_CURVE_SMALL_TIP ),
makeWidget ({ 50, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_LEFT_CURVE), STR_RIDE_CONSTRUCTION_LEFT_CURVE_TIP ),
makeWidget ({ 72, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_LEFT_CURVE_LARGE), STR_RIDE_CONSTRUCTION_LEFT_CURVE_LARGE_TIP ),
makeWidget ({ 94, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_STRAIGHT), STR_RIDE_CONSTRUCTION_STRAIGHT_TIP ),
makeWidget ({116, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_RIGHT_CURVE_LARGE), STR_RIDE_CONSTRUCTION_RIGHT_CURVE_LARGE_TIP ),
makeWidget ({138, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_RIGHT_CURVE), STR_RIDE_CONSTRUCTION_RIGHT_CURVE_TIP ),
makeWidget ({160, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_ICON_MEDIUM_CURVE_RIGHT), STR_RIDE_CONSTRUCTION_RIGHT_CURVE_SMALL_TIP ),
makeWidget ({182, 29}, { 22, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_RIGHT_CURVE_SMALL), STR_RIDE_CONSTRUCTION_RIGHT_CURVE_VERY_SMALL_TIP ),
makeWidget ({ 6, 55}, { kGroupWidth - 6, 14}, WidgetType::button, WindowColour::secondary, STR_YELLOW_STRING, STR_RIDE_CONSTRUCTION_OTHER_TRACK_CONFIGURATIONS_TIP),
makeWidget ({ 6, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_VERTICAL_DROP), STR_RIDE_CONSTRUCTION_VERTICAL_DROP_TIP ),
makeWidget ({ 30, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_DOWN_STEEP), STR_RIDE_CONSTRUCTION_STEEP_SLOPE_DOWN_TIP ),
makeWidget ({ 54, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_DOWN), STR_RIDE_CONSTRUCTION_SLOPE_DOWN_TIP ),
makeWidget ({ 78, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_LEVEL), STR_RIDE_CONSTRUCTION_LEVEL_TIP ),
makeWidget ({102, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_UP), STR_RIDE_CONSTRUCTION_SLOPE_UP_TIP ),
makeWidget ({126, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_UP_STEEP), STR_RIDE_CONSTRUCTION_STEEP_SLOPE_UP_TIP ),
makeWidget ({150, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_VERTICAL_RISE), STR_RIDE_CONSTRUCTION_VERTICAL_RISE_TIP ),
makeWidget ({178, 88}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CHAIN_LIFT), STR_RIDE_CONSTRUCTION_CHAIN_LIFT_TIP ),
makeWidget ({ 69, 132}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_LEFT_BANK), STR_RIDE_CONSTRUCTION_ROLL_FOR_LEFT_CURVE_TIP ),
makeWidget ({ 93, 132}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_NO_BANK), STR_RIDE_CONSTRUCTION_NO_ROLL_TIP ),
makeWidget ({117, 132}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_RIGHT_BANK), STR_RIDE_CONSTRUCTION_ROLL_FOR_RIGHT_CURVE_TIP ),
makeWidget ({ 3, 164}, { kGroupWidth, 170}, WidgetType::imgBtn, WindowColour::secondary, 0xFFFFFFFF, STR_RIDE_CONSTRUCTION_CONSTRUCT_SELECTED_SECTION_TIP),
makeWidget ({ 82, 338}, { 46, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH_CURRENT_SECTION), STR_RIDE_CONSTRUCTION_REMOVE_HIGHLIGHTED_SECTION_TIP),
makeWidget ({ 52, 338}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_PREVIOUS), STR_RIDE_CONSTRUCTION_MOVE_TO_PREVIOUS_SECTION_TIP ),
makeWidget ({134, 338}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_NEXT), STR_RIDE_CONSTRUCTION_MOVE_TO_NEXT_SECTION_TIP ),
makeWidget ({ 3, 362}, { kGroupWidth, 28}, WidgetType::groupbox, WindowColour::primary ),
makeWidget ({ 31, 372}, { 70, 12}, WidgetType::button, WindowColour::secondary, STR_RIDE_CONSTRUCTION_ENTRANCE, STR_RIDE_CONSTRUCTION_ENTRANCE_TIP ),
makeWidget ({109, 372}, { 70, 12}, WidgetType::button, WindowColour::secondary, STR_RIDE_CONSTRUCTION_EXIT, STR_RIDE_CONSTRUCTION_EXIT_TIP ),
makeWidget ({ 94, 338}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_90_TIP ),
makeWidget ({ 41, 132}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_U_SHAPED_TRACK), STR_RIDE_CONSTRUCTION_U_SHAPED_OPEN_TRACK_TIP ),
makeWidget ({144, 132}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE_CONSTRUCTION_O_SHAPED_TRACK), STR_RIDE_CONSTRUCTION_O_SHAPED_ENCLOSED_TRACK_TIP ),
makeWidget ({118, 120}, { 89, 41}, WidgetType::groupbox, WindowColour::primary , STR_RIDE_CONSTRUCTION_SEAT_ROT ),
makeSpinnerWidgets({123, 138}, { 58, 12}, WidgetType::spinner, WindowColour::secondary, 0, STR_RIDE_CONSTRUCTION_SELECT_SEAT_ROTATION_ANGLE_TIP),
makeWidget ({161, 338}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_SIMULATE), STR_SIMULATE_RIDE_TIP )
);
// clang-format on
@@ -1980,7 +1979,7 @@ namespace OpenRCT2::Ui::Windows
hold_down_widgets |= (1uLL << WIDX_SPEED_SETTING_SPINNER_UP) | (1uLL << WIDX_SPEED_SETTING_SPINNER_DOWN);
}
static constexpr int16_t bankingGroupboxRightNoSeatRotation = GW;
static constexpr int16_t bankingGroupboxRightNoSeatRotation = kGroupWidth;
static constexpr int16_t bankingGroupboxRightWithSeatRotation = 114;
widgets[WIDX_BANKING_GROUPBOX].right = bankingGroupboxRightNoSeatRotation;
@@ -2842,10 +2841,10 @@ namespace OpenRCT2::Ui::Windows
return ContextOpenWindowView(WV_MAZE_CONSTRUCTION);
case RideConstructionWindowContext::Default:
return windowMgr->Create<RideConstructionWindow>(
WindowClass::RideConstruction, ScreenCoordsXY(0, 29), { WW, WH }, WF_NO_AUTO_CLOSE);
WindowClass::RideConstruction, ScreenCoordsXY(0, 29), kWindowSize, WF_NO_AUTO_CLOSE);
}
return windowMgr->Create<RideConstructionWindow>(
WindowClass::RideConstruction, ScreenCoordsXY(0, 29), { WW, WH }, WF_NO_AUTO_CLOSE);
WindowClass::RideConstruction, ScreenCoordsXY(0, 29), kWindowSize, WF_NO_AUTO_CLOSE);
}
static void CloseConstructWindowOnCompletion(const Ride& ride)
+16 -17
View File
@@ -32,9 +32,8 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = kStringIdNone;
static constexpr int32_t WH = 240;
static constexpr int32_t WW = 340;
static constexpr StringId kWindowTitle = kStringIdNone;
static constexpr ScreenSize kWindowSize = { 340, 240 };
enum
{
@@ -65,19 +64,19 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto _rideListWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ 0, 43}, {340, 197}, WidgetType::resize, WindowColour::secondary ), // tab page background
makeWidget({315, 60}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_TOGGLE_OPEN_CLOSE), STR_OPEN_OR_CLOSE_ALL_RIDES ), // open / close all toggle
makeWidget({150, 46}, {124, 12}, WidgetType::dropdownMenu, WindowColour::secondary ), // current information type
makeWidget({262, 47}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_RIDE_LIST_INFORMATION_TYPE_TIP), // information type dropdown button
makeWidget({280, 46}, { 54, 12}, WidgetType::button, WindowColour::secondary, STR_SORT, STR_RIDE_LIST_SORT_TIP ), // sort button
makeTab ({ 3, 17}, STR_LIST_RIDES_TIP ), // tab 1
makeTab ({ 34, 17}, STR_LIST_SHOPS_AND_STALLS_TIP ), // tab 2
makeTab ({ 65, 17}, STR_LIST_KIOSKS_AND_FACILITIES_TIP), // tab 3
makeWidget({ 3, 60}, {334, 177}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ), // list
makeWidget({320, 62}, { 14, 14}, WidgetType::imgBtn, WindowColour::secondary, ImageId(SPR_G2_RCT1_CLOSE_BUTTON_0) ),
makeWidget({320, 76}, { 14, 14}, WidgetType::imgBtn, WindowColour::secondary, ImageId(SPR_G2_RCT1_OPEN_BUTTON_0) ),
makeWidget({315, 90}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH), STR_QUICK_DEMOLISH_RIDE )
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 0, 43}, {340, 197}, WidgetType::resize, WindowColour::secondary ), // tab page background
makeWidget({315, 60}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_TOGGLE_OPEN_CLOSE), STR_OPEN_OR_CLOSE_ALL_RIDES ), // open / close all toggle
makeWidget({150, 46}, {124, 12}, WidgetType::dropdownMenu, WindowColour::secondary ), // current information type
makeWidget({262, 47}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_RIDE_LIST_INFORMATION_TYPE_TIP), // information type dropdown button
makeWidget({280, 46}, { 54, 12}, WidgetType::button, WindowColour::secondary, STR_SORT, STR_RIDE_LIST_SORT_TIP ), // sort button
makeTab ({ 3, 17}, STR_LIST_RIDES_TIP ), // tab 1
makeTab ({ 34, 17}, STR_LIST_SHOPS_AND_STALLS_TIP ), // tab 2
makeTab ({ 65, 17}, STR_LIST_KIOSKS_AND_FACILITIES_TIP ), // tab 3
makeWidget({ 3, 60}, {334, 177}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ), // list
makeWidget({320, 62}, { 14, 14}, WidgetType::imgBtn, WindowColour::secondary, ImageId(SPR_G2_RCT1_CLOSE_BUTTON_0) ),
makeWidget({320, 76}, { 14, 14}, WidgetType::imgBtn, WindowColour::secondary, ImageId(SPR_G2_RCT1_OPEN_BUTTON_0) ),
makeWidget({315, 90}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH), STR_QUICK_DEMOLISH_RIDE )
);
// clang-format on
@@ -1007,7 +1006,7 @@ namespace OpenRCT2::Ui::Windows
if (window == nullptr)
{
window = windowMgr->Create<RideListWindow>(
WindowClass::RideList, ScreenCoordsXY(32, 32), { WW, WH }, WF_10 | WF_RESIZABLE);
WindowClass::RideList, ScreenCoordsXY(32, 32), kWindowSize, WF_10 | WF_RESIZABLE);
}
return window;
}
+11 -15
View File
@@ -23,10 +23,8 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr int32_t WH_SAVE = 54;
static constexpr int32_t WW_SAVE = 260;
static constexpr int32_t WH_QUIT = 38;
static constexpr int32_t WW_QUIT = 177;
static constexpr ScreenSize kWindowSizeSave = { 260, 54 };
static constexpr ScreenSize kWindowSizeQuit = { 177, 38 };
enum WindowSavePromptWidgetIdx
{
@@ -41,11 +39,11 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto _savePromptWidgets = makeWidgets(
makeWindowShim(kStringIdNone, { WW_SAVE, WH_SAVE }),
makeWidget({ 2, 19}, {256, 12}, WidgetType::labelCentred, WindowColour::primary, kStringIdEmpty ), // question/label
makeWidget({ 8, 35}, { 78, 14}, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_SAVE ), // save
makeWidget({ 91, 35}, { 78, 14}, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_DONT_SAVE), // don't save
makeWidget({174, 35}, { 78, 14}, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_CANCEL ) // cancel
makeWindowShim(kStringIdNone, kWindowSizeSave),
makeWidget({ 2, 19}, {256, 12}, WidgetType::labelCentred, WindowColour::primary, kStringIdEmpty ), // question/label
makeWidget({ 8, 35}, { 78, 14}, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_SAVE ), // save
makeWidget({ 91, 35}, { 78, 14}, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_DONT_SAVE), // don't save
makeWidget({174, 35}, { 78, 14}, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_CANCEL ) // cancel
);
// clang-format on
@@ -60,7 +58,7 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto _quitPromptWidgets = makeWidgets(
makeWindowShim(STR_QUIT_GAME_PROMPT_TITLE, { WW_QUIT, WH_QUIT }),
makeWindowShim(STR_QUIT_GAME_PROMPT_TITLE, kWindowSizeQuit),
makeWidget({ 8, 19}, {78, 14}, WidgetType::button, WindowColour::primary, STR_OK ), // ok
makeWidget({91, 19}, {78, 14}, WidgetType::button, WindowColour::primary, STR_CANCEL) // cancel
);
@@ -243,17 +241,15 @@ namespace OpenRCT2::Ui::Windows
return nullptr;
}
int32_t width = WW_SAVE;
int32_t height = WH_SAVE;
auto windowSize = kWindowSizeSave;
if (isInTrackDesignerOrManager())
{
width = WW_QUIT;
height = WH_QUIT;
windowSize = kWindowSizeQuit;
}
auto savePromptWindow = std::make_unique<SavePromptWindow>(prompt_mode);
return windowMgr->Create(
std::move(savePromptWindow), WindowClass::SavePrompt, {}, { width, height },
std::move(savePromptWindow), WindowClass::SavePrompt, {}, windowSize,
WF_TRANSPARENT | WF_STICK_TO_FRONT | WF_CENTRE_SCREEN | WF_AUTO_POSITION);
}
} // namespace OpenRCT2::Ui::Windows
+16 -21
View File
@@ -49,8 +49,7 @@ namespace OpenRCT2::Ui::Windows
static constexpr int32_t kTabsStart = kWidgetsStart;
static constexpr int32_t kTabWidth = 92;
static constexpr int32_t kTrueFontSize = 24;
static constexpr int32_t kWindowHeight = 384;
static constexpr int32_t kWindowWidth = 734;
static constexpr ScreenSize kWindowSize = { 734, 384 };
static constexpr StringId kWindowTitle = STR_SELECT_SCENARIO;
enum class ListItemType : uint8_t
@@ -104,19 +103,19 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto _scenarioSelectWidgets = makeWidgets(
makeWindowShim(kWindowTitle, { kWindowWidth, kWindowHeight }),
makeWidget({ kTabWidth + 1, kWidgetsStart }, { kWindowWidth, 284 }, WidgetType::resize, WindowColour::secondary), // tab content panel
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 0) }, { kTabWidth, kTabHeight}, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 01
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 1) }, { kTabWidth, kTabHeight}, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 02
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 2) }, { kTabWidth, kTabHeight}, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 03
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 3) }, { kTabWidth, kTabHeight}, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 04
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 4) }, { kTabWidth, kTabHeight}, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 05
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 5) }, { kTabWidth, kTabHeight}, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 06
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 6) }, { kTabWidth, kTabHeight}, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 07
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 7) }, { kTabWidth, kTabHeight}, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 08
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 8) }, { kTabWidth, kTabHeight}, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 09
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 8) }, { kTabWidth, kTabHeight}, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 10
makeWidget({ kTabWidth + 3, kWidgetsStart + 1 }, { kWindowWidth - kPreviewPaneWidthRegular, 362 }, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL) // level list
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ kTabWidth + 1, kWidgetsStart }, { kWindowSize.width, 284 }, WidgetType::resize, WindowColour::secondary ), // tab content panel
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 0) }, { kTabWidth, kTabHeight }, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 01
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 1) }, { kTabWidth, kTabHeight }, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 02
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 2) }, { kTabWidth, kTabHeight }, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 03
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 3) }, { kTabWidth, kTabHeight }, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 04
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 4) }, { kTabWidth, kTabHeight }, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 05
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 5) }, { kTabWidth, kTabHeight }, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 06
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 6) }, { kTabWidth, kTabHeight }, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 07
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 7) }, { kTabWidth, kTabHeight }, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 08
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 8) }, { kTabWidth, kTabHeight }, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 09
makeRemapWidget({ 3, kTabsStart + (kTabHeight * 8) }, { kTabWidth, kTabHeight }, WidgetType::tab, WindowColour::secondary, SPR_G2_SIDEWAYS_TAB), // tab 10
makeWidget({ kTabWidth + 3, kWidgetsStart + 1 }, { kWindowSize.width - kPreviewPaneWidthRegular, 362 }, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ) // level list
);
// clang-format on
@@ -460,7 +459,7 @@ namespace OpenRCT2::Ui::Windows
}
}
return { kWindowWidth, y };
return { kWindowSize.width, y };
}
void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
@@ -929,12 +928,8 @@ namespace OpenRCT2::Ui::Windows
return window;
}
int32_t screenWidth = ContextGetWidth();
int32_t screenHeight = ContextGetHeight();
ScreenCoordsXY screenPos = { (screenWidth - kWindowWidth) / 2,
std::max(kTopToolbarHeight + 1, (screenHeight - kWindowHeight) / 2) };
window = windowMgr->Create<ScenarioSelectWindow>(
WindowClass::ScenarioSelect, screenPos, { kWindowWidth, kWindowHeight }, 0, callback);
WindowClass::ScenarioSelect, {}, kWindowSize, WF_AUTO_POSITION | WF_CENTRE_SCREEN, callback);
return window;
}
} // namespace OpenRCT2::Ui::Windows
+65 -65
View File
@@ -66,22 +66,21 @@ using namespace OpenRCT2::Numerics;
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = kStringIdNone;
constexpr int32_t WINDOW_SCENERY_MIN_WIDTH = 634;
constexpr int32_t WINDOW_SCENERY_MIN_HEIGHT = 195 - kTitleHeightNormal;
constexpr int32_t SCENERY_BUTTON_WIDTH = 66;
constexpr int32_t SCENERY_BUTTON_HEIGHT = 80;
static constexpr StringId kWindowTitle = kStringIdNone;
static constexpr ScreenSize kMinimumWindowSize = { 634, 195 - kTitleHeightNormal };
constexpr int32_t kSceneryButtonWidth = 66;
constexpr int32_t kSceneryButtonHeight = 80;
constexpr int32_t kDescriptionHeight = 24;
constexpr int32_t kInputMargin = 2;
constexpr int32_t kMaxWindowHeight = 473;
constexpr int32_t kTabMargin = 3;
constexpr int32_t TabWidth = 31;
constexpr int32_t TabHeight = 28;
constexpr int32_t ReservedTabCount = 2;
constexpr int32_t MaxTabs = 257; // 255 selected tabs + misc + all
constexpr int32_t MaxTabsPerRow = 20;
constexpr int32_t kTabWidth = 31;
constexpr int32_t kTabHeight = 28;
constexpr int32_t kReservedTabCount = 2;
constexpr int32_t kMaxTabs = 257; // 255 selected tabs + misc + all
constexpr int32_t kMaxTabsPerRow = 20;
constexpr uint8_t SceneryContentScrollIndex = 0;
constexpr uint8_t kSceneryContentScrollIndex = 0;
enum WindowSceneryListWidgetIdx : WidgetIndex
{
@@ -110,19 +109,19 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto WindowSceneryBaseWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WINDOW_SCENERY_MIN_WIDTH, WINDOW_SCENERY_MIN_HEIGHT }),
makeWidget ({ 0, 43}, {634, 99}, WidgetType::resize, WindowColour::secondary ), // 8 0x009DE2C8
makeWidget ({ 2, 62}, {607, 80}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ), // 1000000 0x009DE418
makeWidget ({609, 59}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_OBJECTS_90 ), // 2000000 0x009DE428
makeWidget ({609, 83}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_PAINTBRUSH), STR_SCENERY_PAINTBRUSH_TIP ), // 4000000 0x009DE438
makeWidget ({615, 108}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_COLOUR ), // 8000000 0x009DE448
makeWidget ({615, 120}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_SECONDARY_COLOUR), // 10000000 0x009DE458
makeWidget ({615, 132}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_TERTIARY_COLOUR ), // 20000000 0x009DE468
makeWidget ({609, 145}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_EYEDROPPER), STR_SCENERY_EYEDROPPER_TIP ), // 40000000 0x009DE478
makeWidget ({609, 169}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_SCENERY_CLUSTER), STR_SCENERY_CLUSTER_TIP ), // 40000000 0x009DE478
makeWidget ({ 4, 46}, {211, 14}, WidgetType::textBox, WindowColour::secondary ),
makeWidget ({218, 46}, { 70, 14}, WidgetType::button, WindowColour::secondary, STR_OBJECT_SEARCH_CLEAR ),
makeWidget ({539, 46}, { 70, 14}, WidgetType::button, WindowColour::secondary, STR_RESTRICT_SCENERY, STR_RESTRICT_SCENERY_TIP )
makeWindowShim(kWindowTitle, kMinimumWindowSize),
makeWidget({ 0, 43}, {634, 99}, WidgetType::resize, WindowColour::secondary ), // 8 0x009DE2C8
makeWidget({ 2, 62}, {607, 80}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ), // 1000000 0x009DE418
makeWidget({609, 59}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_OBJECTS_90 ), // 2000000 0x009DE428
makeWidget({609, 83}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_PAINTBRUSH), STR_SCENERY_PAINTBRUSH_TIP ), // 4000000 0x009DE438
makeWidget({615, 108}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_COLOUR ), // 8000000 0x009DE448
makeWidget({615, 120}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_SECONDARY_COLOUR), // 10000000 0x009DE458
makeWidget({615, 132}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_TERTIARY_COLOUR ), // 20000000 0x009DE468
makeWidget({609, 145}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_EYEDROPPER), STR_SCENERY_EYEDROPPER_TIP ), // 40000000 0x009DE478
makeWidget({609, 169}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_SCENERY_CLUSTER), STR_SCENERY_CLUSTER_TIP ), // 40000000 0x009DE478
makeWidget({ 4, 46}, {211, 14}, WidgetType::textBox, WindowColour::secondary ),
makeWidget({218, 46}, { 70, 14}, WidgetType::button, WindowColour::secondary, STR_OBJECT_SEARCH_CLEAR ),
makeWidget({539, 46}, { 70, 14}, WidgetType::button, WindowColour::secondary, STR_RESTRICT_SCENERY, STR_RESTRICT_SCENERY_TIP )
);
// clang-format on
@@ -486,7 +485,7 @@ namespace OpenRCT2::Ui::Windows
const auto nonListHeight = height - listWidget.height() + 2;
const auto numRows = static_cast<int32_t>(CountRows());
const auto maxContentHeight = numRows * SCENERY_BUTTON_HEIGHT;
const auto maxContentHeight = numRows * kSceneryButtonHeight;
const auto expandedWindowHeight = maxContentHeight + nonListHeight;
const auto windowHeight = std::clamp(expandedWindowHeight, _actualMinHeight, kMaxWindowHeight);
@@ -597,7 +596,7 @@ namespace OpenRCT2::Ui::Windows
ScreenSize OnScrollGetSize(int32_t scrollIndex) override
{
if (scrollIndex == SceneryContentScrollIndex)
if (scrollIndex == kSceneryContentScrollIndex)
{
return ContentScrollGetSize();
}
@@ -606,7 +605,7 @@ namespace OpenRCT2::Ui::Windows
void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
if (scrollIndex == SceneryContentScrollIndex)
if (scrollIndex == kSceneryContentScrollIndex)
{
ContentScrollMouseDown(screenCoords);
}
@@ -614,7 +613,7 @@ namespace OpenRCT2::Ui::Windows
void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
if (scrollIndex == SceneryContentScrollIndex)
if (scrollIndex == kSceneryContentScrollIndex)
{
ContentScrollMouseOver(screenCoords);
}
@@ -799,7 +798,8 @@ namespace OpenRCT2::Ui::Windows
auto windowWidth = width;
if (_tabEntries.size() > 0)
{
const auto lastTabIndex = GetMaxTabCountInARow() == MaxTabsPerRow ? MaxTabsPerRow - 1 : _tabEntries.size() - 1;
const auto lastTabIndex = GetMaxTabCountInARow() == kMaxTabsPerRow ? kMaxTabsPerRow - 1
: _tabEntries.size() - 1;
const auto lastTabWidget = &widgets[WIDX_SCENERY_TAB_1 + lastTabIndex];
windowWidth = std::max<int32_t>(windowWidth, lastTabWidget->right + 3);
@@ -807,19 +807,19 @@ namespace OpenRCT2::Ui::Windows
if (GetSceneryTabInfoForMisc() != nullptr)
{
auto miscTabWidget = &widgets[WIDX_SCENERY_TAB_1 + _tabEntries.size() - 2];
miscTabWidget->left = windowWidth - 2 * TabWidth - 6;
miscTabWidget->right = windowWidth - TabWidth - 7;
miscTabWidget->left = windowWidth - 2 * kTabWidth - 6;
miscTabWidget->right = windowWidth - kTabWidth - 7;
miscTabWidget->top = tabTop;
miscTabWidget->bottom = tabTop + TabHeight;
miscTabWidget->bottom = tabTop + kTabHeight;
}
if (_tabEntries.back().IsAll())
{
auto allTabWidget = &widgets[WIDX_SCENERY_TAB_1 + _tabEntries.size() - 1];
allTabWidget->left = windowWidth - TabWidth - 6;
allTabWidget->left = windowWidth - kTabWidth - 6;
allTabWidget->right = windowWidth - 7;
allTabWidget->top = tabTop;
allTabWidget->bottom = tabTop + TabHeight;
allTabWidget->bottom = tabTop + kTabHeight;
}
}
@@ -910,7 +910,7 @@ namespace OpenRCT2::Ui::Windows
void OnScrollDraw(int32_t scrollIndex, RenderTarget& rt) override
{
if (scrollIndex == SceneryContentScrollIndex)
if (scrollIndex == kSceneryContentScrollIndex)
{
ContentScrollDraw(rt);
}
@@ -1005,7 +1005,7 @@ namespace OpenRCT2::Ui::Windows
{
_tabEntries.clear();
for (ObjectEntryIndex scenerySetIndex = 0; scenerySetIndex < MaxTabs - ReservedTabCount; scenerySetIndex++)
for (ObjectEntryIndex scenerySetIndex = 0; scenerySetIndex < kMaxTabs - kReservedTabCount; scenerySetIndex++)
{
const auto* sceneryGroupEntry = OpenRCT2::ObjectManager::GetObjectEntry<SceneryGroupEntry>(scenerySetIndex);
if (sceneryGroupEntry != nullptr && SceneryGroupIsInvented(scenerySetIndex))
@@ -1090,7 +1090,7 @@ namespace OpenRCT2::Ui::Windows
_tabEntries.end());
// Set required width
_requiredWidth = std::min(static_cast<int32_t>(_tabEntries.size()), MaxTabsPerRow) * TabWidth + 5;
_requiredWidth = std::min(static_cast<int32_t>(_tabEntries.size()), kMaxTabsPerRow) * kTabWidth + 5;
PrepareWidgets();
@@ -1100,15 +1100,15 @@ namespace OpenRCT2::Ui::Windows
int32_t GetRequiredWidth() const
{
return std::max(_requiredWidth, WINDOW_SCENERY_MIN_WIDTH);
return std::max(_requiredWidth, kMinimumWindowSize.width);
}
private:
int32_t GetMinimumHeight() const
{
// Minimum window height: title, one scenery button, status bar, padding
int32_t minHeight = getTitleBarTargetHeight() + SCENERY_BUTTON_HEIGHT + kDescriptionHeight + 2 * kTabMargin;
minHeight += static_cast<int32_t>(1 + (_tabEntries.size() / GetMaxTabCountInARow())) * TabHeight;
int32_t minHeight = getTitleBarTargetHeight() + kSceneryButtonHeight + kDescriptionHeight + 2 * kTabMargin;
minHeight += static_cast<int32_t>(1 + (_tabEntries.size() / GetMaxTabCountInARow())) * kTabHeight;
minHeight += widgets[WIDX_FILTER_TEXT_BOX].height() + 2 * kInputMargin;
return minHeight;
}
@@ -1117,7 +1117,7 @@ namespace OpenRCT2::Ui::Windows
{
const auto& listWidget = widgets[WIDX_SCENERY_LIST];
const auto contentWidth = listWidget.width() - kScrollBarWidth;
return contentWidth / SCENERY_BUTTON_WIDTH;
return contentWidth / kSceneryButtonWidth;
}
template<typename T>
@@ -1143,7 +1143,7 @@ namespace OpenRCT2::Ui::Windows
int32_t constexpr ContentRowsHeight(const size_t rows) const
{
return static_cast<int32_t>(rows * SCENERY_BUTTON_HEIGHT);
return static_cast<int32_t>(rows * kSceneryButtonHeight);
}
void ContentUpdateScroll()
@@ -1159,9 +1159,9 @@ namespace OpenRCT2::Ui::Windows
const int32_t listHeight = height - 14 - widgets[WIDX_SCENERY_LIST].top - 1;
const auto sceneryItem = ContentCountRowsWithSelectedItem(tabIndex);
scrolls[SceneryContentScrollIndex].contentHeight = ContentRowsHeight(sceneryItem.allRows) + 1;
scrolls[kSceneryContentScrollIndex].contentHeight = ContentRowsHeight(sceneryItem.allRows) + 1;
const int32_t maxTop = std::max(0, scrolls[SceneryContentScrollIndex].contentHeight - listHeight);
const int32_t maxTop = std::max(0, scrolls[kSceneryContentScrollIndex].contentHeight - listHeight);
auto rowSelected = CountRows(sceneryItem.selected_item);
if (sceneryItem.scenerySelection.IsUndefined())
{
@@ -1188,9 +1188,9 @@ namespace OpenRCT2::Ui::Windows
}
}
scrolls[SceneryContentScrollIndex].contentOffsetY = ContentRowsHeight(rowSelected);
scrolls[SceneryContentScrollIndex].contentOffsetY = std::min<int32_t>(
maxTop, scrolls[SceneryContentScrollIndex].contentOffsetY);
scrolls[kSceneryContentScrollIndex].contentOffsetY = ContentRowsHeight(rowSelected);
scrolls[kSceneryContentScrollIndex].contentOffsetY = std::min<int32_t>(
maxTop, scrolls[kSceneryContentScrollIndex].contentOffsetY);
widgetScrollUpdateThumbs(*this, WIDX_SCENERY_LIST);
}
@@ -1389,13 +1389,13 @@ namespace OpenRCT2::Ui::Windows
int32_t GetTabRowCount()
{
return std::max<int32_t>((static_cast<int32_t>(_tabEntries.size()) + MaxTabsPerRow - 1) / MaxTabsPerRow, 0);
return std::max<int32_t>((static_cast<int32_t>(_tabEntries.size()) + kMaxTabsPerRow - 1) / kMaxTabsPerRow, 0);
}
int32_t GetMaxTabCountInARow() const
{
int32_t tabEntries = static_cast<int32_t>(_tabEntries.size());
return std::clamp(tabEntries, 1, MaxTabsPerRow);
return std::clamp(tabEntries, 1, kMaxTabsPerRow);
}
void PrepareWidgets()
@@ -1404,7 +1404,7 @@ namespace OpenRCT2::Ui::Windows
SetWidgets(WindowSceneryBaseWidgets);
auto hasMisc = GetSceneryTabInfoForMisc() != nullptr;
auto maxTabsInThisRow = MaxTabsPerRow - 1 - (hasMisc ? 1 : 0);
auto kMaxTabsInThisRow = kMaxTabsPerRow - 1 - (hasMisc ? 1 : 0);
// Add tabs
int32_t tabsInThisRow = 0;
@@ -1412,7 +1412,7 @@ namespace OpenRCT2::Ui::Windows
for (const auto& tabInfo : _tabEntries)
{
auto widget = makeTab(pos, STR_STRING_DEFINED_TOOLTIP);
pos.x += TabWidth;
pos.x += kTabWidth;
if (tabInfo.IsMisc())
{
@@ -1438,18 +1438,18 @@ namespace OpenRCT2::Ui::Windows
widgets.push_back(widget);
tabsInThisRow++;
if (tabsInThisRow >= maxTabsInThisRow)
if (tabsInThisRow >= kMaxTabsInThisRow)
{
pos.x = kTabMargin;
pos.y += TabHeight;
pos.y += kTabHeight;
tabsInThisRow = 0;
_actualMinHeight += TabHeight;
maxTabsInThisRow = MaxTabsPerRow;
_actualMinHeight += kTabHeight;
kMaxTabsInThisRow = kMaxTabsPerRow;
}
}
// Shift base widgets based on number of tab rows
int32_t shiftAmount = (GetTabRowCount() - 1) * TabHeight;
int32_t shiftAmount = (GetTabRowCount() - 1) * kTabHeight;
if (shiftAmount > 0)
{
widgets[WIDX_SCENERY_LIST].top += shiftAmount;
@@ -1480,8 +1480,8 @@ namespace OpenRCT2::Ui::Windows
ScenerySelection scenery{};
const auto numColumns = GetNumColumns();
const auto colIndex = screenCoords.x / SCENERY_BUTTON_WIDTH;
const auto rowIndex = screenCoords.y / SCENERY_BUTTON_HEIGHT;
const auto colIndex = screenCoords.x / kSceneryButtonWidth;
const auto rowIndex = screenCoords.y / kSceneryButtonHeight;
if (colIndex >= 0 && colIndex < numColumns && rowIndex >= 0)
{
const auto tabSceneryIndex = static_cast<size_t>((rowIndex * numColumns) + colIndex);
@@ -1745,7 +1745,7 @@ namespace OpenRCT2::Ui::Windows
if (_selectedScenery == currentSceneryGlobal)
{
GfxFillRectInset(
rt, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } },
rt, { topLeft, topLeft + ScreenCoordsXY{ kSceneryButtonWidth - 1, kSceneryButtonHeight - 1 } },
colours[1], INSET_RECT_FLAG_FILL_MID_LIGHT);
}
}
@@ -1754,28 +1754,28 @@ namespace OpenRCT2::Ui::Windows
if (tabSelectedScenery == currentSceneryGlobal)
{
GfxFillRectInset(
rt, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } },
rt, { topLeft, topLeft + ScreenCoordsXY{ kSceneryButtonWidth - 1, kSceneryButtonHeight - 1 } },
colours[1], (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_MID_LIGHT));
}
else if (_selectedScenery == currentSceneryGlobal)
{
GfxFillRectInset(
rt, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } },
rt, { topLeft, topLeft + ScreenCoordsXY{ kSceneryButtonWidth - 1, kSceneryButtonHeight - 1 } },
colours[1], INSET_RECT_FLAG_FILL_MID_LIGHT);
}
}
RenderTarget clippedRT;
if (ClipDrawPixelInfo(
clippedRT, rt, topLeft + ScreenCoordsXY{ 1, 1 }, SCENERY_BUTTON_WIDTH - 2, SCENERY_BUTTON_HEIGHT - 2))
clippedRT, rt, topLeft + ScreenCoordsXY{ 1, 1 }, kSceneryButtonWidth - 2, kSceneryButtonHeight - 2))
{
DrawSceneryItem(clippedRT, currentSceneryGlobal);
}
topLeft.x += SCENERY_BUTTON_WIDTH;
if (topLeft.x >= numColumns * SCENERY_BUTTON_WIDTH)
topLeft.x += kSceneryButtonWidth;
if (topLeft.x >= numColumns * kSceneryButtonWidth)
{
topLeft.y += SCENERY_BUTTON_HEIGHT;
topLeft.y += kSceneryButtonHeight;
topLeft.x = 0;
}
}
+4 -2
View File
@@ -37,9 +37,11 @@ namespace OpenRCT2::Ui::Windows
uint16_t gWindowSceneryScatterSize;
ScatterToolDensity gWindowSceneryScatterDensity;
static constexpr ScreenSize kWindowSize = { 86, 100 };
// clang-format off
static constexpr auto _sceneryScatterWidgets = makeWidgets(
makeWindowShim(STR_SCENERY_SCATTER, { 86, 100 }),
makeWindowShim(STR_SCENERY_SCATTER, kWindowSize),
makeWidget ({20, 17}, {44, 32}, WidgetType::imgBtn, WindowColour::secondary, ImageId(SPR_LAND_TOOL_SIZE_0) ), // preview box
makeRemapWidget({21, 18}, {16, 16}, WidgetType::trnBtn, WindowColour::secondary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_LAND_TIP ), // decrement size
@@ -203,7 +205,7 @@ namespace OpenRCT2::Ui::Windows
auto* window = windowMgr->FindByClass(WindowClass::SceneryScatter);
if (window == nullptr)
{
window = windowMgr->Create<SceneryScatterWindow>(WindowClass::SceneryScatter, { 86, 100 }, 0);
window = windowMgr->Create<SceneryScatterWindow>(WindowClass::SceneryScatter, kWindowSize, 0);
}
return window;
+9 -10
View File
@@ -30,13 +30,12 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr int32_t kWindowWidthMin = 500;
static constexpr int32_t kWindowHeightMin = 288;
static constexpr int32_t kWindowWidthMax = 1200;
static constexpr int32_t kWindowHeightMax = 788;
static constexpr ScreenSize kMinimumWindowSize = { 500, 288 };
static constexpr ScreenSize kMaximumWindowSize = { 1200, 788 };
static constexpr ScreenSize kWindowSize = kMinimumWindowSize;
static constexpr int32_t kItemHeight = (3 + 9 + 3);
constexpr size_t MaxPlayerNameLength = 32;
static constexpr size_t kMaxPlayerNameLength = 32;
enum
{
@@ -64,7 +63,7 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto _serverListWidgets = makeWidgets(
makeWindowShim(STR_SERVER_LIST, { 340, 90 }),
makeWindowShim(STR_SERVER_LIST, kWindowSize),
makeWidget({100, 20}, {245, 12}, WidgetType::textBox, WindowColour::secondary ), // player name text box
makeWidget({ 6, 37}, {489, 226}, WidgetType::scroll, WindowColour::secondary ), // server list
makeWidget({ 6, 53}, {101, 14}, WidgetType::button, WindowColour::secondary, STR_FETCH_SERVERS ), // fetch servers button
@@ -103,7 +102,7 @@ namespace OpenRCT2::Ui::Windows
page = 0;
list_information_type = 0;
WindowSetResize(*this, { kWindowWidthMin, kWindowHeightMin }, { kWindowWidthMax, kWindowHeightMax });
WindowSetResize(*this, kMinimumWindowSize, kMaximumWindowSize);
no_list_items = static_cast<uint16_t>(_serverList.GetCount());
@@ -125,7 +124,7 @@ namespace OpenRCT2::Ui::Windows
Close();
break;
case WIDX_PLAYER_NAME_INPUT:
WindowStartTextbox(*this, widgetIndex, _playerName, MaxPlayerNameLength);
WindowStartTextbox(*this, widgetIndex, _playerName, kMaxPlayerNameLength);
break;
case WIDX_LIST:
{
@@ -160,7 +159,7 @@ namespace OpenRCT2::Ui::Windows
void OnResize() override
{
WindowSetResize(*this, { kWindowWidthMin, kWindowHeightMin }, { kWindowWidthMax, kWindowHeightMax });
WindowSetResize(*this, kMinimumWindowSize, kMaximumWindowSize);
}
void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override
@@ -545,7 +544,7 @@ namespace OpenRCT2::Ui::Windows
return window;
window = windowMgr->Create<ServerListWindow>(
WindowClass::ServerList, { kWindowWidthMin, kWindowHeightMin }, WF_10 | WF_RESIZABLE | WF_CENTRE_SCREEN);
WindowClass::ServerList, kMinimumWindowSize, WF_10 | WF_RESIZABLE | WF_CENTRE_SCREEN);
return window;
}
+5 -6
View File
@@ -42,12 +42,11 @@ namespace OpenRCT2::Ui::Windows
WIDX_LOAD_SERVER
};
static constexpr int32_t WW = 300;
static constexpr int32_t WH = 154;
static constexpr ScreenSize kWindowSize = { 300, 154 };
// clang-format off
static constexpr auto _windowServerStartWidgets = makeWidgets(
makeWindowShim(STR_START_SERVER, { WW, WH }),
makeWindowShim(STR_START_SERVER, kWindowSize),
makeWidget({ 120, 20 }, { 173, 13 }, WidgetType::textBox, WindowColour::secondary), // port text box
makeWidget({ 120, 36 }, { 173, 13 }, WidgetType::textBox, WindowColour::secondary), // name text box
makeWidget({ 120, 52 }, { 173, 13 }, WidgetType::textBox, WindowColour::secondary), // description text box
@@ -55,8 +54,8 @@ namespace OpenRCT2::Ui::Windows
makeWidget({ 120, 84 }, { 173, 13 }, WidgetType::textBox, WindowColour::secondary), // password text box
makeSpinnerWidgets({ 120, 100 }, { 173, 12 }, WidgetType::spinner, WindowColour::secondary,STR_SERVER_MAX_PLAYERS_VALUE), // max players (3 widgets)
makeWidget({ 6, 117 }, { 287, 14 }, WidgetType::checkbox, WindowColour::secondary, STR_ADVERTISE,STR_ADVERTISE_SERVER_TIP), // advertise checkbox
makeWidget({ 6, WH - 6 - 13 }, { 101, 14 }, WidgetType::button, WindowColour::secondary,STR_NEW_GAME), // start server button
makeWidget({ 112, WH - 6 - 13 }, { 101, 14 }, WidgetType::button, WindowColour::secondary, STR_LOAD_GAME) // None
makeWidget({ 6, kWindowSize.height - 6 - 13 }, { 101, 14 }, WidgetType::button, WindowColour::secondary,STR_NEW_GAME), // start server button
makeWidget({ 112, kWindowSize.height - 6 - 13 }, { 101, 14 }, WidgetType::button, WindowColour::secondary, STR_LOAD_GAME) // None
);
// clang-format on
@@ -276,7 +275,7 @@ namespace OpenRCT2::Ui::Windows
WindowBase* ServerStartOpen()
{
auto* windowMgr = GetWindowManager();
return windowMgr->FocusOrCreate<ServerStartWindow>(WindowClass::ServerStart, { WW, WH }, WF_CENTRE_SCREEN);
return windowMgr->FocusOrCreate<ServerStartWindow>(WindowClass::ServerStart, kWindowSize, WF_CENTRE_SCREEN);
}
} // namespace OpenRCT2::Ui::Windows
+19 -24
View File
@@ -23,12 +23,9 @@ namespace OpenRCT2::Ui::Windows
{
WindowBase* ResetShortcutKeysPromptOpen();
static constexpr StringId WINDOW_TITLE = STR_SHORTCUTS_TITLE;
static constexpr int32_t WW = 420;
static constexpr int32_t WH = 280;
static constexpr int32_t WW_SC_MAX = 1200;
static constexpr int32_t WH_SC_MAX = 800;
static constexpr StringId kWindowTitle = STR_SHORTCUTS_TITLE;
static constexpr ScreenSize kWindowSize = { 420, 280 };
static constexpr ScreenSize kMaximumWindowSize = { 1200, 800 };
enum WindowShortcutWidgetIdx
{
@@ -43,16 +40,15 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto _shortcutWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({0, 43}, {350, 287}, WidgetType::resize, WindowColour::secondary),
makeWidget({4, 47}, {412, 215}, WidgetType::scroll, WindowColour::primary, SCROLL_VERTICAL, STR_SHORTCUT_LIST_TIP ),
makeWidget({4, WH-15}, {150, 12}, WidgetType::button, WindowColour::primary, STR_SHORTCUT_ACTION_RESET, STR_SHORTCUT_ACTION_RESET_TIP)
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({0, 43}, {350, 287}, WidgetType::resize, WindowColour::secondary ),
makeWidget({4, 47}, {412, 215}, WidgetType::scroll, WindowColour::primary, SCROLL_VERTICAL, STR_SHORTCUT_LIST_TIP ),
makeWidget({4, kWindowSize.height - 15}, {150, 12}, WidgetType::button, WindowColour::primary, STR_SHORTCUT_ACTION_RESET, STR_SHORTCUT_ACTION_RESET_TIP)
);
// clang-format on
static constexpr StringId CHANGE_WINDOW_TITLE = STR_SHORTCUT_CHANGE_TITLE;
static constexpr int32_t CHANGE_WW = 250;
static constexpr int32_t CHANGE_WH = 80;
static constexpr StringId kWindowTitleChange = STR_SHORTCUT_CHANGE_TITLE;
static constexpr ScreenSize kWindowSizeChange = { 250, 80 };
enum
{
@@ -61,7 +57,7 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto window_shortcut_change_widgets = makeWidgets(
makeWindowShim(CHANGE_WINDOW_TITLE, { CHANGE_WW, CHANGE_WH }),
makeWindowShim(kWindowTitleChange, kWindowSizeChange),
makeWidget({ 75, 56 }, { 100, 14 }, WidgetType::button, WindowColour::primary, STR_SHORTCUT_REMOVE, STR_SHORTCUT_REMOVE_TIP)
);
// clang-format on
@@ -83,7 +79,7 @@ namespace OpenRCT2::Ui::Windows
auto* windowMgr = GetWindowManager();
windowMgr->CloseByClass(WindowClass::ChangeKeyboardShortcut);
auto* w = windowMgr->Create<ChangeShortcutWindow>(
WindowClass::ChangeKeyboardShortcut, { CHANGE_WW, CHANGE_WH }, WF_CENTRE_SCREEN);
WindowClass::ChangeKeyboardShortcut, kWindowSizeChange, WF_CENTRE_SCREEN);
if (w != nullptr)
{
w->_shortcutId = shortcutId;
@@ -199,7 +195,7 @@ namespace OpenRCT2::Ui::Windows
void OnResize() override
{
WindowSetResize(*this, { WW, WH }, { WW_SC_MAX, WH_SC_MAX });
WindowSetResize(*this, kWindowSize, kMaximumWindowSize);
}
void OnUpdate() override
@@ -558,14 +554,13 @@ namespace OpenRCT2::Ui::Windows
auto w = windowMgr->BringToFrontByClass(WindowClass::KeyboardShortcutList);
if (w == nullptr)
{
w = windowMgr->Create<ShortcutKeysWindow>(WindowClass::KeyboardShortcutList, { WW, WH }, WF_RESIZABLE);
w = windowMgr->Create<ShortcutKeysWindow>(WindowClass::KeyboardShortcutList, kWindowSize, WF_RESIZABLE);
}
return w;
}
#pragma region Reset prompt
static constexpr int32_t RESET_PROMPT_WW = 200;
static constexpr int32_t RESET_PROMPT_WH = 80;
static constexpr ScreenSize kWindowSizeReset = { 200, 80 };
enum
{
@@ -579,10 +574,10 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto WindowResetShortcutKeysPromptWidgets = makeWidgets(
makeWindowShim(STR_SHORTCUT_ACTION_RESET, { RESET_PROMPT_WW, RESET_PROMPT_WH }),
makeWidget({ 2, 30 }, { RESET_PROMPT_WW - 4, 12 }, WidgetType::labelCentred, WindowColour::primary, STR_RESET_SHORTCUT_KEYS_PROMPT),
makeWidget({ 8, RESET_PROMPT_WH - 22 }, { 85, 14 }, WidgetType::button, WindowColour::primary, STR_RESET),
makeWidget({ RESET_PROMPT_WW - 95, RESET_PROMPT_WH - 22 }, { 85, 14 }, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_CANCEL)
makeWindowShim(STR_SHORTCUT_ACTION_RESET, kWindowSizeReset),
makeWidget({ 2, 30 }, { kWindowSizeReset.width - 4, 12 }, WidgetType::labelCentred, WindowColour::primary, STR_RESET_SHORTCUT_KEYS_PROMPT),
makeWidget({ 8, kWindowSizeReset.height - 22 }, { 85, 14 }, WidgetType::button, WindowColour::primary, STR_RESET),
makeWidget({ kWindowSizeReset.width - 95, kWindowSizeReset.height - 22 }, { 85, 14 }, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_CANCEL)
);
// clang-format on
@@ -620,7 +615,7 @@ namespace OpenRCT2::Ui::Windows
{
auto* windowMgr = GetWindowManager();
return windowMgr->FocusOrCreate<ResetShortcutKeysPrompt>(
WindowClass::ResetShortcutKeysPrompt, { RESET_PROMPT_WW, RESET_PROMPT_WH }, WF_CENTRE_SCREEN | WF_TRANSPARENT);
WindowClass::ResetShortcutKeysPrompt, kWindowSizeReset, WF_CENTRE_SCREEN | WF_TRANSPARENT);
}
#pragma endregion
} // namespace OpenRCT2::Ui::Windows
+10 -11
View File
@@ -31,9 +31,8 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = STR_SIGN;
static constexpr int32_t WW = 113;
static constexpr int32_t WH = 96;
static constexpr StringId kWindowTitle = STR_SIGN;
static constexpr ScreenSize kWindowSize = { 113, 96 };
enum WindowSignWidgetIdx
{
@@ -50,12 +49,12 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
// 0x9AEE00
static constexpr auto _signWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ 3, 17}, {85, 60}, WidgetType::viewport, WindowColour::secondary ), // Viewport
makeWidget({WW - 25, 19}, {24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RENAME), STR_CHANGE_SIGN_TEXT_TIP ), // change sign button
makeWidget({WW - 25, 67}, {24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH), STR_DEMOLISH_SIGN_TIP ), // demolish button
makeWidget({ 5, WH - 16}, {12, 12}, WidgetType::colourBtn, WindowColour::secondary, kWidgetContentEmpty, STR_SELECT_MAIN_SIGN_COLOUR_TIP), // Main colour
makeWidget({ 17, WH - 16}, {12, 12}, WidgetType::colourBtn, WindowColour::secondary, kWidgetContentEmpty, STR_SELECT_TEXT_COLOUR_TIP ) // Text colour
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 3, 17}, {85, 60}, WidgetType::viewport, WindowColour::secondary ), // Viewport
makeWidget({kWindowSize.width - 25, 19}, {24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RENAME), STR_CHANGE_SIGN_TEXT_TIP ), // change sign button
makeWidget({kWindowSize.width - 25, 67}, {24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH), STR_DEMOLISH_SIGN_TIP ), // demolish button
makeWidget({ 5, kWindowSize.height - 16}, {12, 12}, WidgetType::colourBtn, WindowColour::secondary, kWidgetContentEmpty, STR_SELECT_MAIN_SIGN_COLOUR_TIP), // Main colour
makeWidget({ 17, kWindowSize.height - 16}, {12, 12}, WidgetType::colourBtn, WindowColour::secondary, kWidgetContentEmpty, STR_SELECT_TEXT_COLOUR_TIP ) // Text colour
);
// clang-format on
@@ -336,7 +335,7 @@ namespace OpenRCT2::Ui::Windows
if (w != nullptr)
return w;
w = windowMgr->Create<SignWindow>(WindowClass::Banner, { WW, WH }, 0);
w = windowMgr->Create<SignWindow>(WindowClass::Banner, kWindowSize, 0);
if (w == nullptr)
return nullptr;
@@ -360,7 +359,7 @@ namespace OpenRCT2::Ui::Windows
if (w != nullptr)
return w;
w = windowMgr->Create<SignWindow>(WindowClass::Banner, { WW, WH }, 0);
w = windowMgr->Create<SignWindow>(WindowClass::Banner, kWindowSize, 0);
if (w == nullptr)
return nullptr;
+18 -19
View File
@@ -42,10 +42,9 @@ using namespace OpenRCT2::Numerics;
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = STR_STRINGID;
static constexpr StringId kWindowTitle = STR_STRINGID;
static constexpr int32_t WW = 190;
static constexpr int32_t WH = 180;
static constexpr ScreenSize kWindowSize = { 190, 180 };
enum WindowStaffPage
{
@@ -86,7 +85,7 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto kMainStaffWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 0, 43 }, { 190, 137 }, WidgetType::resize, WindowColour::secondary),
makeTab({ 3, 17 }, STR_STAFF_OVERVIEW_TIP),
makeTab({ 34, 17 }, STR_STAFF_OPTIONS_TIP),
@@ -95,24 +94,24 @@ namespace OpenRCT2::Ui::Windows
static constexpr auto _staffOverviewWidgets = makeWidgets(
kMainStaffWidgets,
makeWidget ({ 3, 47}, {162, 120}, WidgetType::viewport, WindowColour::secondary ), // Viewport
makeWidget ({ 3, WH - 13}, {162, 11}, WidgetType::labelCentred, WindowColour::secondary ), // Label at bottom of viewport
makeWidget ({WW - 25, 45}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_PICKUP_BTN), STR_PICKUP_TIP ), // Pickup Button
makeWidget ({WW - 25, 69}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_PATROL_BTN), STR_SET_PATROL_TIP ), // Patrol Button
makeWidget ({WW - 25, 93}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RENAME), STR_NAME_STAFF_TIP ), // Rename Button
makeWidget ({WW - 25, 117}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_LOCATE), STR_LOCATE_SUBJECT_TIP), // Locate Button
makeWidget ({WW - 25, 141}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH), STR_FIRE_STAFF_TIP ) // Fire Button
makeWidget ({ 3, 47}, {162, 120}, WidgetType::viewport, WindowColour::secondary ), // Viewport
makeWidget ({ 3, kWindowSize.height - 13}, {162, 11}, WidgetType::labelCentred, WindowColour::secondary ), // Label at bottom of viewport
makeWidget ({kWindowSize.width - 25, 45}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_PICKUP_BTN), STR_PICKUP_TIP ), // Pickup Button
makeWidget ({kWindowSize.width - 25, 69}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_PATROL_BTN), STR_SET_PATROL_TIP ), // Patrol Button
makeWidget ({kWindowSize.width - 25, 93}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RENAME), STR_NAME_STAFF_TIP ), // Rename Button
makeWidget ({kWindowSize.width - 25, 117}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_LOCATE), STR_LOCATE_SUBJECT_TIP), // Locate Button
makeWidget ({kWindowSize.width - 25, 141}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH), STR_FIRE_STAFF_TIP ) // Fire Button
);
//0x9AF910
static constexpr auto _staffOptionsWidgets = makeWidgets(
kMainStaffWidgets,
makeWidget ({ 5, 50}, {180, 12}, WidgetType::checkbox, WindowColour::secondary ), // Checkbox 1
makeWidget ({ 5, 67}, {180, 12}, WidgetType::checkbox, WindowColour::secondary ), // Checkbox 2
makeWidget ({ 5, 84}, {180, 12}, WidgetType::checkbox, WindowColour::secondary ), // Checkbox 3
makeWidget ({ 5, 101}, {180, 12}, WidgetType::checkbox, WindowColour::secondary ), // Checkbox 4
makeWidget ({ 5, 50}, {180, 12}, WidgetType::dropdownMenu, WindowColour::secondary ), // Costume Dropdown
makeWidget ({WW - 17, 51}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_COSTUME_TIP) // Costume Dropdown Button
makeWidget ({ 5, 50}, {180, 12}, WidgetType::checkbox, WindowColour::secondary ), // Checkbox 1
makeWidget ({ 5, 67}, {180, 12}, WidgetType::checkbox, WindowColour::secondary ), // Checkbox 2
makeWidget ({ 5, 84}, {180, 12}, WidgetType::checkbox, WindowColour::secondary ), // Checkbox 3
makeWidget ({ 5, 101}, {180, 12}, WidgetType::checkbox, WindowColour::secondary ), // Checkbox 4
makeWidget ({ 5, 50}, {180, 12}, WidgetType::dropdownMenu, WindowColour::secondary ), // Costume Dropdown
makeWidget ({kWindowSize.width - 17, 51}, { 11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_COSTUME_TIP) // Costume Dropdown Button
);
// 0x9AF9F4
@@ -614,7 +613,7 @@ namespace OpenRCT2::Ui::Windows
void OverviewResize()
{
WindowSetResize(*this, { WW, WH }, { 500, 450 });
WindowSetResize(*this, kWindowSize, { 500, 450 });
ViewportInit();
}
@@ -1227,7 +1226,7 @@ namespace OpenRCT2::Ui::Windows
if (w != nullptr)
return w;
w = windowMgr->Create<StaffWindow>(WindowClass::Peep, { WW, WH }, WF_10 | WF_RESIZABLE);
w = windowMgr->Create<StaffWindow>(WindowClass::Peep, kWindowSize, WF_10 | WF_RESIZABLE);
if (w == nullptr)
return nullptr;
+8 -9
View File
@@ -20,9 +20,8 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = STR_SACK_STAFF;
static constexpr int32_t WW = 200;
static constexpr int32_t WH = 100;
static constexpr StringId kWindowTitle = STR_SACK_STAFF;
static constexpr ScreenSize kWindowSize = { 200, 100 };
enum WindowStaffFireWidgetIdx
{
@@ -36,9 +35,9 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
// 0x9AFB4C
static constexpr auto _staffFireWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ 10, WH - 20}, {85, 14}, WidgetType::button, WindowColour::primary, STR_YES ),
makeWidget({WW - 95, WH - 20}, {85, 14}, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_CANCEL)
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 10, kWindowSize.height - 20}, {85, 14}, WidgetType::button, WindowColour::primary, STR_YES ),
makeWidget({kWindowSize.width - 95, kWindowSize.height - 20}, {85, 14}, WidgetType::button, WindowColour::primary, STR_SAVE_PROMPT_CANCEL)
);
// clang-format on
@@ -86,8 +85,8 @@ namespace OpenRCT2::Ui::Windows
auto ft = Formatter();
peep->FormatNameTo(ft);
ScreenCoordsXY textCoords(windowPos + ScreenCoordsXY{ WW / 2, (WH / 2) - 3 });
DrawTextWrapped(rt, textCoords, WW - 4, STR_FIRE_STAFF_ID, ft, { TextAlignment::CENTRE });
ScreenCoordsXY textCoords(windowPos + ScreenCoordsXY{ kWindowSize.width / 2, (kWindowSize.height / 2) - 3 });
DrawTextWrapped(rt, textCoords, kWindowSize.width - 4, STR_FIRE_STAFF_ID, ft, { TextAlignment::CENTRE });
}
};
@@ -96,7 +95,7 @@ namespace OpenRCT2::Ui::Windows
// Check if the confirm window already exists
auto* windowMgr = GetWindowManager();
auto* window = windowMgr->FocusOrCreate<StaffFirePromptWindow>(
WindowClass::FirePrompt, { WW, WH }, WF_CENTRE_SCREEN | WF_TRANSPARENT);
WindowClass::FirePrompt, kWindowSize, WF_CENTRE_SCREEN | WF_TRANSPARENT);
window->SetWindowNumber(peep->Id.ToUnderlying());
return window;
}
+18 -19
View File
@@ -72,26 +72,25 @@ namespace OpenRCT2::Ui::Windows
WIDX_STAFF_LIST_MAP,
};
static constexpr StringId WINDOW_TITLE = STR_STAFF;
static constexpr int32_t WW = 320;
static constexpr int32_t WH = 270;
constexpr int32_t MAX_WW = 500;
constexpr int32_t MAX_WH = 450;
static constexpr StringId kWindowTitle = STR_STAFF;
static constexpr ScreenSize kWindowSize = { 320, 270 };
constexpr int32_t kMaximumWindowWidth = 500;
constexpr int32_t kMaximumWindowHeight = 450;
// clang-format off
static constexpr auto _staffListWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ 0, 43}, { WW, WH - 43}, WidgetType::resize, WindowColour::secondary ), // tab content panel
makeTab ({ 3, 17}, STR_STAFF_HANDYMEN_TAB_TIP ), // handymen tab
makeTab ({ 34, 17}, STR_STAFF_MECHANICS_TAB_TIP ), // mechanics tab
makeTab ({ 65, 17}, STR_STAFF_SECURITY_TAB_TIP ), // security guards tab
makeTab ({ 96, 17}, STR_STAFF_ENTERTAINERS_TAB_TIP ), // entertainers tab
makeWidget({ 3, 72}, {WW - 6, 195}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ), // staff list
makeWidget({130, 58}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, kStringIdNone, STR_UNIFORM_COLOUR_TIP ), // uniform colour picker
makeWidget({165, 17}, { 145, 13}, WidgetType::button, WindowColour::primary , kStringIdNone, STR_HIRE_STAFF_TIP ), // hire button
makeWidget({243, 46}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH), STR_QUICK_FIRE_STAFF ), // quick fire staff
makeWidget({267, 46}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_PATROL_BTN), STR_SHOW_PATROL_AREA_TIP ), // show staff patrol area tool
makeWidget({291, 46}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_MAP), STR_SHOW_STAFF_ON_MAP_TIP) // show staff on map button
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 0, 43}, { kWindowSize.width, kWindowSize.height - 43}, WidgetType::resize, WindowColour::secondary ), // tab content panel
makeTab ({ 3, 17}, STR_STAFF_HANDYMEN_TAB_TIP ), // handymen tab
makeTab ({ 34, 17}, STR_STAFF_MECHANICS_TAB_TIP ), // mechanics tab
makeTab ({ 65, 17}, STR_STAFF_SECURITY_TAB_TIP ), // security guards tab
makeTab ({ 96, 17}, STR_STAFF_ENTERTAINERS_TAB_TIP ), // entertainers tab
makeWidget({ 3, 72}, {kWindowSize.width - 6, 195}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL ), // staff list
makeWidget({130, 58}, { 12, 12}, WidgetType::colourBtn, WindowColour::secondary, kStringIdNone, STR_UNIFORM_COLOUR_TIP ), // uniform colour picker
makeWidget({165, 17}, { 145, 13}, WidgetType::button, WindowColour::primary , kStringIdNone, STR_HIRE_STAFF_TIP ), // hire button
makeWidget({243, 46}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH), STR_QUICK_FIRE_STAFF ), // quick fire staff
makeWidget({267, 46}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_PATROL_BTN), STR_SHOW_PATROL_AREA_TIP ), // show staff patrol area tool
makeWidget({291, 46}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_MAP), STR_SHOW_STAFF_ON_MAP_TIP) // show staff on map button
);
// clang-format on
@@ -122,7 +121,7 @@ namespace OpenRCT2::Ui::Windows
{
SetWidgets(_staffListWidgets);
WindowInitScrollWidgets(*this);
WindowSetResize(*this, { WW, WH }, { MAX_WW, MAX_WH });
WindowSetResize(*this, kWindowSize, { kMaximumWindowWidth, kMaximumWindowHeight });
widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].type = WidgetType::empty;
@@ -725,7 +724,7 @@ namespace OpenRCT2::Ui::Windows
WindowBase* StaffListOpen()
{
auto* windowMgr = GetWindowManager();
return windowMgr->FocusOrCreate<StaffListWindow>(WindowClass::StaffList, { WW, WH }, WF_10 | WF_RESIZABLE);
return windowMgr->FocusOrCreate<StaffListWindow>(WindowClass::StaffList, kWindowSize, WF_10 | WF_RESIZABLE);
}
void WindowStaffListRefresh()
+15 -13
View File
@@ -22,8 +22,7 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr int32_t WW = 250;
static constexpr int32_t WH = 90;
static constexpr ScreenSize kWindowSize = { 250, 90 };
enum WindowTextInputWidgetIdx
{
@@ -35,7 +34,7 @@ namespace OpenRCT2::Ui::Windows
};
static constexpr auto _textInputWidgets = makeWidgets(
makeWindowShim(kStringIdNone, { WW, WH }),
makeWindowShim(kStringIdNone, kWindowSize),
makeWidget({ 170, 68 }, { 71, 14 }, WidgetType::button, WindowColour::secondary, STR_CANCEL),
makeWidget({ 10, 68 }, { 71, 14 }, WidgetType::button, WindowColour::secondary, STR_OK));
@@ -171,7 +170,7 @@ namespace OpenRCT2::Ui::Windows
int32_t newHeight = CalculateWindowHeight(_buffer.data());
if (newHeight != height)
{
WindowSetResize(*this, { WW, newHeight }, { WW, newHeight });
WindowSetResize(*this, { kWindowSize.width, newHeight }, { kWindowSize.width, newHeight });
}
widgets[WIDX_OKAY].top = newHeight - 22;
@@ -197,7 +196,7 @@ namespace OpenRCT2::Ui::Windows
{
DrawWidgets(rt);
auto screenCoords = windowPos + ScreenCoordsXY{ WW / 2, widgets[WIDX_TITLE].bottom + 13 };
auto screenCoords = windowPos + ScreenCoordsXY{ kWindowSize.width / 2, widgets[WIDX_TITLE].bottom + 13 };
int32_t no_lines = 0;
@@ -205,12 +204,13 @@ namespace OpenRCT2::Ui::Windows
{
auto ft = Formatter();
ft.Add<const char*>(_description.c_str());
DrawTextWrapped(rt, screenCoords, WW, STR_STRING, ft, { colours[1], TextAlignment::CENTRE });
DrawTextWrapped(rt, screenCoords, kWindowSize.width, STR_STRING, ft, { colours[1], TextAlignment::CENTRE });
}
else
{
DrawTextWrapped(
rt, screenCoords, WW, _descriptionStringId, _descriptionArgs, { colours[1], TextAlignment::CENTRE });
rt, screenCoords, kWindowSize.width, _descriptionStringId, _descriptionArgs,
{ colours[1], TextAlignment::CENTRE });
}
screenCoords.y += 25;
@@ -219,11 +219,13 @@ namespace OpenRCT2::Ui::Windows
// +13 for cursor when max length.
u8string wrappedString;
GfxWrapString(
u8string_view{ _buffer.data(), _buffer.size() }, WW - (24 + 13), FontStyle::Medium, &wrappedString, &no_lines);
u8string_view{ _buffer.data(), _buffer.size() }, kWindowSize.width - (24 + 13), FontStyle::Medium,
&wrappedString, &no_lines);
GfxFillRectInset(
rt,
{ { windowPos.x + 10, screenCoords.y }, { windowPos.x + WW - 10, screenCoords.y + 10 * (no_lines + 1) + 3 } },
{ { windowPos.x + 10, screenCoords.y },
{ windowPos.x + kWindowSize.width - 10, screenCoords.y + 10 * (no_lines + 1) + 3 } },
colours[1], INSET_RECT_F_60);
screenCoords.y += 1;
@@ -304,10 +306,10 @@ namespace OpenRCT2::Ui::Windows
{
// String length needs to add 12 either side of box +13 for cursor when max length.
int32_t numLines{};
GfxWrapString(text, WW - (24 + 13), FontStyle::Medium, nullptr, &numLines);
GfxWrapString(text, kWindowSize.width - (24 + 13), FontStyle::Medium, nullptr, &numLines);
const auto textHeight = numLines * 10;
return WH + textHeight + getTitleBarDiffNormal();
return kWindowSize.height + textHeight + getTitleBarDiffNormal();
}
private:
@@ -370,7 +372,7 @@ namespace OpenRCT2::Ui::Windows
windowMgr->CloseByClass(WindowClass::Textinput);
auto w = windowMgr->Create<TextInputWindow>(
WindowClass::Textinput, { WW, WH + 10 }, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT);
WindowClass::Textinput, { kWindowSize.width, kWindowSize.height + 10 }, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT);
if (w != nullptr)
{
w->SetParentWindow(call_w, call_widget);
@@ -385,7 +387,7 @@ namespace OpenRCT2::Ui::Windows
{
auto* windowMgr = GetWindowManager();
auto w = windowMgr->Create<TextInputWindow>(
WindowClass::Textinput, { WW, WH + 10 }, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT);
WindowClass::Textinput, { kWindowSize.width, kWindowSize.height + 10 }, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT);
if (w != nullptr)
{
w->SetTitle(title, description);
+15 -16
View File
@@ -70,25 +70,24 @@ namespace OpenRCT2::Ui::Windows
WIDX_THEMES_RCT1_BOTTOM_TOOLBAR
};
static constexpr StringId WINDOW_TITLE = STR_THEMES_TITLE;
static constexpr int32_t WW = 320;
static constexpr int32_t WH = 107;
static constexpr StringId kWindowTitle = STR_THEMES_TITLE;
static constexpr ScreenSize kWindowSize = { 320, 107 };
const uint16_t kWindowHeaderWidth = 152;
// clang-format off
static constexpr auto _themesWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 0, 43}, {320, 64}, WidgetType::resize, WindowColour::secondary ), // tab content panel
makeTab ({ 3, 17}, STR_THEMES_TAB_SETTINGS_TIP ), // settings tab
makeTab ({ 34, 17}, STR_THEMES_TAB_MAIN_TIP ), // main ui tab
makeTab ({ 65, 17}, STR_THEMES_TAB_PARK_TIP ), // park tab
makeTab ({ 96, 17}, STR_THEMES_TAB_TOOLS_TIP ), // tools tab
makeTab ({127, 17}, STR_THEMES_TAB_RIDES_AND_GUESTS_TIP ), // rides and peeps tab
makeTab ({158, 17}, STR_THEMES_TAB_EDITORS_TIP ), // editors tab
makeTab ({189, 17}, STR_THEMES_TAB_MISC_TIP ), // misc tab
makeTab ({220, 17}, STR_THEMES_TAB_PROMPTS_TIP ), // prompts tab
makeTab ({251, 17}, STR_THEMES_TAB_FEATURES_TIP ), // features tab
makeTab ({ 3, 17}, STR_THEMES_TAB_SETTINGS_TIP ), // settings tab
makeTab ({ 34, 17}, STR_THEMES_TAB_MAIN_TIP ), // main ui tab
makeTab ({ 65, 17}, STR_THEMES_TAB_PARK_TIP ), // park tab
makeTab ({ 96, 17}, STR_THEMES_TAB_TOOLS_TIP ), // tools tab
makeTab ({127, 17}, STR_THEMES_TAB_RIDES_AND_GUESTS_TIP ), // rides and peeps tab
makeTab ({158, 17}, STR_THEMES_TAB_EDITORS_TIP ), // editors tab
makeTab ({189, 17}, STR_THEMES_TAB_MISC_TIP ), // misc tab
makeTab ({220, 17}, STR_THEMES_TAB_PROMPTS_TIP ), // prompts tab
makeTab ({251, 17}, STR_THEMES_TAB_FEATURES_TIP ), // features tab
makeWidget({ 5, 46}, {kWindowHeaderWidth, 15}, WidgetType::tableHeader, WindowColour::secondary, STR_THEMES_HEADER_WINDOW ), // Window header
makeWidget({157, 46}, { 79, 15}, WidgetType::tableHeader, WindowColour::secondary, STR_THEMES_HEADER_PALETTE ), // Palette header
makeWidget({236, 46}, { 80, 15}, WidgetType::tableHeader, WindowColour::secondary, STR_THEMES_HEADER_TRANSPARENCY ), // Transparency header
@@ -266,7 +265,7 @@ namespace OpenRCT2::Ui::Windows
WindowThemesInitVars();
WindowInitScrollWidgets(*this);
WindowSetResize(*this, { 320, 107 }, { 320, 107 });
WindowSetResize(*this, kWindowSize, kWindowSize);
list_information_type = 0;
_classIndex = -1;
@@ -277,7 +276,7 @@ namespace OpenRCT2::Ui::Windows
{
if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS)
{
if (WindowSetResize(*this, { 320, 107 }, { 320, 107 }))
if (WindowSetResize(*this, kWindowSize, kWindowSize))
GfxInvalidateScreen();
}
else if (_selected_tab == WINDOW_THEMES_TAB_FEATURES)
@@ -908,7 +907,7 @@ namespace OpenRCT2::Ui::Windows
if (window != nullptr)
return window;
window = windowMgr->Create<ThemesWindow>(WindowClass::Themes, { 320, 107 }, WF_10 | WF_RESIZABLE);
window = windowMgr->Create<ThemesWindow>(WindowClass::Themes, kWindowSize, WF_10 | WF_RESIZABLE);
return window;
}
+91 -94
View File
@@ -217,53 +217,49 @@ namespace OpenRCT2::Ui::Windows
#pragma region MEASUREMENTS
static constexpr StringId WINDOW_TITLE = STR_TILE_INSPECTOR_TITLE;
static constexpr StringId kWindowTitle = STR_TILE_INSPECTOR_TITLE;
// Window sizes
static constexpr int32_t WW = 400;
static constexpr int32_t WH = 170;
constexpr int32_t MIN_WW = WW;
constexpr int32_t MAX_WW = WW;
constexpr int32_t MIN_WH = 130;
constexpr int32_t MAX_WH = 800;
static constexpr ScreenSize kWindowSize = { 400, 170 };
static constexpr ScreenSize kMinimumWindowSize = { 400, 130 };
static constexpr ScreenSize kMaximumWindowSize = { 400, 800 };
// Button space for top buttons
constexpr auto ToolbarButtonAnchor = ScreenCoordsXY{ WW - 27, 17 };
constexpr auto ToolbarButtonSize = ScreenSize{ 24, 24 };
constexpr auto ToolbarButtonHalfSize = ScreenSize{ 24, 12 };
constexpr auto ToolbarButtonOffsetX = ScreenSize{ -24, 0 };
constexpr auto kToolbarButtonAnchor = ScreenCoordsXY{ kWindowSize.width - 27, 17 };
constexpr auto kToolbarButtonSize = ScreenSize{ 24, 24 };
constexpr auto kToolbarButtonHalfSize = ScreenSize{ 24, 12 };
constexpr auto kToolbarButtonOffsetX = ScreenSize{ -24, 0 };
// List's column offsets
constexpr auto InvisibleFlagColumnXY = ScreenCoordsXY{ 3, 42 };
constexpr auto InvisibleFlagColumnSize = ScreenSize{ 20, 14 };
constexpr auto TypeColumnXY = InvisibleFlagColumnXY + ScreenSize{ InvisibleFlagColumnSize.width, 0 };
constexpr auto TypeColumnSize = ScreenSize{ 252, 14 };
constexpr auto BaseHeightColumnXY = TypeColumnXY + ScreenSize{ TypeColumnSize.width, 0 };
constexpr auto BaseHeightColumnSize = ScreenSize{ 30, 14 };
constexpr auto ClearanceHeightColumnXY = BaseHeightColumnXY + ScreenCoordsXY{ BaseHeightColumnSize.width, 0 };
constexpr auto ClearanceHeightColumnSize = ScreenSize{ 30, 14 };
constexpr auto DirectionColumnXY = ClearanceHeightColumnXY + ScreenCoordsXY{ ClearanceHeightColumnSize.width, 0 };
constexpr auto DirectionColumnSize = ScreenSize{ 15, 14 };
constexpr auto GhostFlagColumnXY = DirectionColumnXY + ScreenCoordsXY{ DirectionColumnSize.width, 0 };
constexpr auto GhostFlagColumnSize = ScreenSize{ 15, 14 };
constexpr auto LastFlagColumnXY = GhostFlagColumnXY + ScreenCoordsXY{ GhostFlagColumnSize.width, 0 };
constexpr auto LastFlagColumnSize = ScreenSize{ 32, 14 };
constexpr auto kInvisibleFlagColumnXY = ScreenCoordsXY{ 3, 42 };
constexpr auto kInvisibleFlagColumnSize = ScreenSize{ 20, 14 };
constexpr auto kTypeColumnXY = kInvisibleFlagColumnXY + ScreenSize{ kInvisibleFlagColumnSize.width, 0 };
constexpr auto kTypeColumnSize = ScreenSize{ 252, 14 };
constexpr auto kBaseHeightColumnXY = kTypeColumnXY + ScreenSize{ kTypeColumnSize.width, 0 };
constexpr auto kBaseHeightColumnSize = ScreenSize{ 30, 14 };
constexpr auto kClearanceHeightColumnXY = kBaseHeightColumnXY + ScreenCoordsXY{ kBaseHeightColumnSize.width, 0 };
constexpr auto kClearanceHeightColumnSize = ScreenSize{ 30, 14 };
constexpr auto kDirectionColumnXY = kClearanceHeightColumnXY + ScreenCoordsXY{ kClearanceHeightColumnSize.width, 0 };
constexpr auto kDirectionColumnSize = ScreenSize{ 15, 14 };
constexpr auto kGhostFlagColumnXY = kDirectionColumnXY + ScreenCoordsXY{ kDirectionColumnSize.width, 0 };
constexpr auto kGhostFlagColumnSize = ScreenSize{ 15, 14 };
constexpr auto kLastFlagColumnXY = kGhostFlagColumnXY + ScreenCoordsXY{ kGhostFlagColumnSize.width, 0 };
constexpr auto kLastFlagColumnSize = ScreenSize{ 32, 14 };
constexpr int32_t PADDING_BOTTOM = 15;
constexpr int32_t GROUPBOX_PADDING = 6;
constexpr int32_t HORIZONTAL_GROUPBOX_PADDING = 5;
constexpr int32_t VERTICAL_GROUPBOX_PADDING = 4;
constexpr auto PropertyButtonSize = ScreenSize{ 130, 18 };
constexpr auto PropertyFullWidth = ScreenSize{ 370, 18 };
constexpr int32_t kBottomPadding = 15;
constexpr int32_t kGroupboxPadding = 6;
constexpr int32_t kHorizontalGroupboxPadding = 5;
constexpr int32_t kVerticalGroupboxPadding = 4;
constexpr auto kPropertyButtonSize = ScreenSize{ 130, 18 };
constexpr auto kPropertyFullWidth = ScreenSize{ 370, 18 };
#pragma endregion
// clang-format off
constexpr ScreenCoordsXY PropertyRowCol(ScreenCoordsXY anchor, int32_t row, int32_t column)
{
return anchor + ScreenCoordsXY{ column * (PropertyButtonSize.width + HORIZONTAL_GROUPBOX_PADDING),
row * (PropertyButtonSize.height + VERTICAL_GROUPBOX_PADDING) };
return anchor + ScreenCoordsXY{ column * (kPropertyButtonSize.width + kHorizontalGroupboxPadding),
row * (kPropertyButtonSize.height + kVerticalGroupboxPadding) };
}
constexpr ScreenCoordsXY CheckboxGroupOffset(
@@ -273,36 +269,36 @@ namespace OpenRCT2::Ui::Windows
}
// Macros for easily obtaining the top and bottom of a widget inside a properties group box
#define GBBT(GROUPTOP, row) ((GROUPTOP) + 14 + row * (PropertyButtonSize.height + VERTICAL_GROUPBOX_PADDING))
#define GBBB(GROUPTOP, row) (GBBT((GROUPTOP), row) + PropertyButtonSize.height)
#define GBBT(GROUPTOP, row) ((GROUPTOP) + 14 + row * (kPropertyButtonSize.height + kVerticalGroupboxPadding))
#define GBBB(GROUPTOP, row) (GBBT((GROUPTOP), row) + kPropertyButtonSize.height)
static constexpr auto kMainTileInspectorWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({3, 57}, {WW - 6, WH - PADDING_BOTTOM - 58}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL), /* Element list */
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({3, 57}, {kWindowSize.width - 6, kWindowSize.height - kBottomPadding - 58}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL), /* Element list */
/* X and Y spinners */
makeWidget ({ 4, 24}, {38, 14}, WidgetType::label, WindowColour::secondary, STR_TILE_INSPECTOR_X_LABEL),
makeSpinnerWidgets({20, 23}, {51, 12}, WidgetType::spinner, WindowColour::secondary), /* Spinner X (3 widgets) */
makeWidget ({74, 24}, {38, 14}, WidgetType::label, WindowColour::secondary, STR_TILE_INSPECTOR_Y_LABEL),
makeSpinnerWidgets({90, 23}, {51, 12}, WidgetType::spinner, WindowColour::secondary), /* Spinner Y (3 widgets) */
/* Top buttons */
makeWidget(ToolbarButtonAnchor + ToolbarButtonOffsetX * 0, ToolbarButtonSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH), STR_REMOVE_SELECTED_ELEMENT_TIP ), /* Remove button */
makeWidget(ToolbarButtonAnchor + ToolbarButtonOffsetX * 1, ToolbarButtonHalfSize, WidgetType::button, WindowColour::secondary, STR_UP, STR_MOVE_SELECTED_ELEMENT_UP_TIP), /* Move up */
makeWidget(ToolbarButtonAnchor + ToolbarButtonOffsetX * 1 + ScreenSize{0, 12}, ToolbarButtonHalfSize, WidgetType::button, WindowColour::secondary, STR_DOWN, STR_MOVE_SELECTED_ELEMENT_DOWN_TIP), /* Move down */
makeWidget(ToolbarButtonAnchor + ToolbarButtonOffsetX * 2, ToolbarButtonSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_SELECTED_ELEMENT_TIP), /* Rotate button */
makeWidget(ToolbarButtonAnchor + ToolbarButtonOffsetX * 3, ToolbarButtonSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_SORT), STR_TILE_INSPECTOR_SORT_TIP), /* Sort button */
makeWidget(ToolbarButtonAnchor + ToolbarButtonOffsetX * 4, ToolbarButtonSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_PASTE), STR_TILE_INSPECTOR_PASTE_TIP), /* Paste button */
makeWidget(ToolbarButtonAnchor + ToolbarButtonOffsetX * 5, ToolbarButtonSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_COPY), STR_TILE_INSPECTOR_COPY_TIP), /* Copy button */
makeWidget(kToolbarButtonAnchor + kToolbarButtonOffsetX * 0, kToolbarButtonSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH), STR_REMOVE_SELECTED_ELEMENT_TIP ), /* Remove button */
makeWidget(kToolbarButtonAnchor + kToolbarButtonOffsetX * 1, kToolbarButtonHalfSize, WidgetType::button, WindowColour::secondary, STR_UP, STR_MOVE_SELECTED_ELEMENT_UP_TIP), /* Move up */
makeWidget(kToolbarButtonAnchor + kToolbarButtonOffsetX * 1 + ScreenSize{0, 12}, kToolbarButtonHalfSize, WidgetType::button, WindowColour::secondary, STR_DOWN, STR_MOVE_SELECTED_ELEMENT_DOWN_TIP), /* Move down */
makeWidget(kToolbarButtonAnchor + kToolbarButtonOffsetX * 2, kToolbarButtonSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_SELECTED_ELEMENT_TIP), /* Rotate button */
makeWidget(kToolbarButtonAnchor + kToolbarButtonOffsetX * 3, kToolbarButtonSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_SORT), STR_TILE_INSPECTOR_SORT_TIP), /* Sort button */
makeWidget(kToolbarButtonAnchor + kToolbarButtonOffsetX * 4, kToolbarButtonSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_PASTE), STR_TILE_INSPECTOR_PASTE_TIP), /* Paste button */
makeWidget(kToolbarButtonAnchor + kToolbarButtonOffsetX * 5, kToolbarButtonSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_COPY), STR_TILE_INSPECTOR_COPY_TIP), /* Copy button */
/* Column headers */
makeWidget(InvisibleFlagColumnXY, InvisibleFlagColumnSize, WidgetType::tableHeader, WindowColour::secondary, STR_TILE_INSPECTOR_INVISIBLE_SHORT, STR_TILE_INSPECTOR_FLAG_INVISIBLE), /* Invisible flag */
makeWidget(TypeColumnXY, TypeColumnSize, WidgetType::tableHeader, WindowColour::secondary, STR_TILE_INSPECTOR_ELEMENT_TYPE), /* Type */
makeWidget(BaseHeightColumnXY, BaseHeightColumnSize, WidgetType::tableHeader, WindowColour::secondary, STR_TILE_INSPECTOR_BASE_HEIGHT_SHORT, STR_TILE_INSPECTOR_BASE_HEIGHT), /* Base height */
makeWidget(ClearanceHeightColumnXY, ClearanceHeightColumnSize, WidgetType::tableHeader, WindowColour::secondary, STR_TILE_INSPECTOR_CLEARANGE_HEIGHT_SHORT, STR_TILE_INSPECTOR_CLEARANCE_HEIGHT), /* Clearance height */
makeWidget(DirectionColumnXY, DirectionColumnSize, WidgetType::tableHeader, WindowColour::secondary, STR_TILE_INSPECTOR_DIRECTION_SHORT, STR_TILE_INSPECTOR_DIRECTION), /* Direction */
makeWidget(GhostFlagColumnXY, GhostFlagColumnSize, WidgetType::tableHeader, WindowColour::secondary, STR_TILE_INSPECTOR_FLAG_GHOST_SHORT, STR_TILE_INSPECTOR_FLAG_GHOST), /* Ghost flag */
makeWidget(LastFlagColumnXY, LastFlagColumnSize, WidgetType::tableHeader, WindowColour::secondary, STR_TILE_INSPECTOR_FLAG_LAST_SHORT, STR_TILE_INSPECTOR_FLAG_LAST), /* Last of tile flag */
makeWidget(kInvisibleFlagColumnXY, kInvisibleFlagColumnSize, WidgetType::tableHeader, WindowColour::secondary, STR_TILE_INSPECTOR_INVISIBLE_SHORT, STR_TILE_INSPECTOR_FLAG_INVISIBLE), /* Invisible flag */
makeWidget(kTypeColumnXY, kTypeColumnSize, WidgetType::tableHeader, WindowColour::secondary, STR_TILE_INSPECTOR_ELEMENT_TYPE), /* Type */
makeWidget(kBaseHeightColumnXY, kBaseHeightColumnSize, WidgetType::tableHeader, WindowColour::secondary, STR_TILE_INSPECTOR_BASE_HEIGHT_SHORT, STR_TILE_INSPECTOR_BASE_HEIGHT), /* Base height */
makeWidget(kClearanceHeightColumnXY, kClearanceHeightColumnSize, WidgetType::tableHeader, WindowColour::secondary, STR_TILE_INSPECTOR_CLEARANGE_HEIGHT_SHORT, STR_TILE_INSPECTOR_CLEARANCE_HEIGHT), /* Clearance height */
makeWidget(kDirectionColumnXY, kDirectionColumnSize, WidgetType::tableHeader, WindowColour::secondary, STR_TILE_INSPECTOR_DIRECTION_SHORT, STR_TILE_INSPECTOR_DIRECTION), /* Direction */
makeWidget(kGhostFlagColumnXY, kGhostFlagColumnSize, WidgetType::tableHeader, WindowColour::secondary, STR_TILE_INSPECTOR_FLAG_GHOST_SHORT, STR_TILE_INSPECTOR_FLAG_GHOST), /* Ghost flag */
makeWidget(kLastFlagColumnXY, kLastFlagColumnSize, WidgetType::tableHeader, WindowColour::secondary, STR_TILE_INSPECTOR_FLAG_LAST_SHORT, STR_TILE_INSPECTOR_FLAG_LAST), /* Last of tile flag */
/* Group boxes */
makeWidget({6, 0}, {WW - 12, 0}, WidgetType::groupbox, WindowColour::secondary, kStringIdNone, kStringIdNone ), /* Details group box */
makeWidget({6, 0}, {WW - 12, 0}, WidgetType::groupbox, WindowColour::secondary, STR_TILE_INSPECTOR_GROUPBOX_PROPERTIES, kStringIdNone ) /* Properties group box */
makeWidget({6, 0}, {kWindowSize.width - 12, 0}, WidgetType::groupbox, WindowColour::secondary, kStringIdNone, kStringIdNone ), /* Details group box */
makeWidget({6, 0}, {kWindowSize.width - 12, 0}, WidgetType::groupbox, WindowColour::secondary, STR_TILE_INSPECTOR_GROUPBOX_PROPERTIES, kStringIdNone ) /* Properties group box */
);
static constexpr auto DefaultWidgets = makeWidgets(
@@ -315,14 +311,14 @@ namespace OpenRCT2::Ui::Windows
constexpr int32_t SurfaceDetailsHeight = 20 + NumSurfaceDetails * 11;
static constexpr auto SurfaceWidgets = makeWidgets(
kMainTileInspectorWidgets,
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), PropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_SURFACE_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
makeWidget(PropertyRowCol({ 12, 0 }, 1, 0), PropertyButtonSize, WidgetType::button, WindowColour::secondary, STR_TILE_INSPECTOR_SURFACE_REMOVE_FENCES), // WIDX_SURFACE_BUTTON_REMOVE_FENCES
makeWidget(PropertyRowCol({ 12, 0 }, 1, 1), PropertyButtonSize, WidgetType::button, WindowColour::secondary, STR_TILE_INSPECTOR_SURFACE_RESTORE_FENCES), // WIDX_SURFACE_BUTTON_RESTORE_FENCES
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), kPropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_SURFACE_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
makeWidget(PropertyRowCol({ 12, 0 }, 1, 0), kPropertyButtonSize, WidgetType::button, WindowColour::secondary, STR_TILE_INSPECTOR_SURFACE_REMOVE_FENCES), // WIDX_SURFACE_BUTTON_REMOVE_FENCES
makeWidget(PropertyRowCol({ 12, 0 }, 1, 1), kPropertyButtonSize, WidgetType::button, WindowColour::secondary, STR_TILE_INSPECTOR_SURFACE_RESTORE_FENCES), // WIDX_SURFACE_BUTTON_RESTORE_FENCES
makeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 3, 1), 1, 0), { 12, 12 }, WidgetType::checkbox, WindowColour::secondary), // WIDX_SURFACE_CHECK_CORNER_N
makeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 3, 1), 2, 1), { 12, 12 }, WidgetType::checkbox, WindowColour::secondary), // WIDX_SURFACE_CHECK_CORNER_E
makeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 3, 1), 1, 2), { 12, 12 }, WidgetType::checkbox, WindowColour::secondary), // WIDX_SURFACE_CHECK_CORNER_S
makeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 3, 1), 0, 1), { 12, 12 }, WidgetType::checkbox, WindowColour::secondary), // WIDX_SURFACE_CHECK_CORNER_W
makeWidget(PropertyRowCol({ 12, 0 }, 4, 0), PropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_SURFACE_DIAGONAL) // WIDX_SURFACE_CHECK_DIAGONAL
makeWidget(PropertyRowCol({ 12, 0 }, 4, 0), kPropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_SURFACE_DIAGONAL) // WIDX_SURFACE_CHECK_DIAGONAL
);
constexpr int32_t NumPathProperties = 6;
@@ -331,10 +327,10 @@ namespace OpenRCT2::Ui::Windows
constexpr int32_t PathDetailsHeight = 20 + NumPathDetails * 11;
static constexpr auto PathWidgets = makeWidgets(
kMainTileInspectorWidgets,
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), PropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_PATH_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
makeWidget(PropertyRowCol({ 12, 0 }, 1, 0), PropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_PATH_BROKEN), // WIDX_PATH_CHECK_BROKEN
makeWidget(PropertyRowCol({ 12, 0 }, 2, 0), PropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_PATH_SLOPED), // WIDX_PATH_CHECK_SLOPED
makeWidget(PropertyRowCol({ 12, 0 }, 3, 0), PropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_PATH_JUNCTION_RAILINGS), // WIDX_PATH_CHECK_JUNCTION_RAILINGS
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), kPropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_PATH_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
makeWidget(PropertyRowCol({ 12, 0 }, 1, 0), kPropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_PATH_BROKEN), // WIDX_PATH_CHECK_BROKEN
makeWidget(PropertyRowCol({ 12, 0 }, 2, 0), kPropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_PATH_SLOPED), // WIDX_PATH_CHECK_SLOPED
makeWidget(PropertyRowCol({ 12, 0 }, 3, 0), kPropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_PATH_JUNCTION_RAILINGS), // WIDX_PATH_CHECK_JUNCTION_RAILINGS
makeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 4, 1), 3, 1), { 12, 12 }, WidgetType::checkbox, WindowColour::secondary), // WIDX_PATH_CHECK_EDGE_NE
makeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 4, 1), 4, 2), { 12, 12 }, WidgetType::checkbox, WindowColour::secondary), // WIDX_PATH_CHECK_EDGE_E
makeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 4, 1), 3, 3), { 12, 12 }, WidgetType::checkbox, WindowColour::secondary), // WIDX_PATH_CHECK_EDGE_SE
@@ -351,11 +347,11 @@ namespace OpenRCT2::Ui::Windows
constexpr int32_t TrackDetailsHeight = 20 + NumTrackDetails * 11;
static constexpr auto TrackWidgets = makeWidgets(
kMainTileInspectorWidgets,
makeWidget(PropertyRowCol({ 12, 0}, 0, 0), PropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_TRACK_ENTIRE_TRACK_PIECE), // WIDX_TRACK_CHECK_APPLY_TO_ALL
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 1, 1), PropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_TRACK_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
makeWidget(PropertyRowCol({ 12, 0}, 2, 0), PropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_TRACK_CHAIN_LIFT), // WIDX_TRACK_CHECK_CHAIN_LIFT
makeWidget(PropertyRowCol({ 12, 0}, 3, 0), PropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_TRACK_BRAKE_CLOSED), // WIDX_TRACK_CHECK_BRAKE_CLOSED
makeWidget(PropertyRowCol({ 12, 0}, 4, 0), PropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_TRACK_IS_INDESTRUCTIBLE) // WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE
makeWidget(PropertyRowCol({ 12, 0}, 0, 0), kPropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_TRACK_ENTIRE_TRACK_PIECE), // WIDX_TRACK_CHECK_APPLY_TO_ALL
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 1, 1), kPropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_TRACK_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
makeWidget(PropertyRowCol({ 12, 0}, 2, 0), kPropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_TRACK_CHAIN_LIFT), // WIDX_TRACK_CHECK_CHAIN_LIFT
makeWidget(PropertyRowCol({ 12, 0}, 3, 0), kPropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_TRACK_BRAKE_CLOSED), // WIDX_TRACK_CHECK_BRAKE_CLOSED
makeWidget(PropertyRowCol({ 12, 0}, 4, 0), kPropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_TRACK_IS_INDESTRUCTIBLE) // WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE
);
constexpr int32_t NumSceneryProperties = 4; // The checkbox groups both count for 2 rows
@@ -364,7 +360,7 @@ namespace OpenRCT2::Ui::Windows
constexpr int32_t SceneryDetailsHeight = 20 + NumSceneryDetails * 11;
static constexpr auto SceneryWidgets = makeWidgets(
kMainTileInspectorWidgets,
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), PropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_SCENERY_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), kPropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_SCENERY_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
makeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 1, 1), 1, 0), { 12, 12 }, WidgetType::checkbox, WindowColour::secondary), // WIDX_SCENERY_CHECK_QUARTER_N
makeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 1, 1), 2, 1), { 12, 12 }, WidgetType::checkbox, WindowColour::secondary), // WIDX_SCENERY_CHECK_QUARTER_E
makeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 1, 1), 1, 2), { 12, 12 }, WidgetType::checkbox, WindowColour::secondary), // WIDX_SCENERY_CHECK_QUARTER_S
@@ -381,8 +377,8 @@ namespace OpenRCT2::Ui::Windows
constexpr int32_t EntranceDetailsHeight = 20 + NumEntranceDetails * 11;
static constexpr auto EntranceWidgets = makeWidgets(
kMainTileInspectorWidgets,
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), PropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_ENTRANCE_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
makeWidget(PropertyRowCol({ 12, 0 }, 1, 0), PropertyButtonSize, WidgetType::button, WindowColour::secondary, STR_TILE_INSPECTOR_ENTRANCE_MAKE_USABLE, STR_TILE_INSPECTOR_ENTRANCE_MAKE_USABLE_TIP) // WIDX_ENTRANCE_BUTTON_MAKE_USABLE
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), kPropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_ENTRANCE_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
makeWidget(PropertyRowCol({ 12, 0 }, 1, 0), kPropertyButtonSize, WidgetType::button, WindowColour::secondary, STR_TILE_INSPECTOR_ENTRANCE_MAKE_USABLE, STR_TILE_INSPECTOR_ENTRANCE_MAKE_USABLE_TIP) // WIDX_ENTRANCE_BUTTON_MAKE_USABLE
);
constexpr int32_t NumWallProperties = 4;
@@ -391,11 +387,11 @@ namespace OpenRCT2::Ui::Windows
constexpr int32_t WallDetailsHeight = 20 + NumWallDetails * 11;
static constexpr auto WallWidgets = makeWidgets(
kMainTileInspectorWidgets,
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), PropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_WALL_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
makeWidget(PropertyRowCol({ 12, 0 }, 1, 1), PropertyButtonSize, WidgetType::dropdownMenu, WindowColour::secondary), // WIDX_WALL_DROPDOWN_SLOPE
makeWidget(PropertyRowCol({ 12 + PropertyButtonSize.width - 12, 0 }, 1, 1), { 11, 12}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH), // WIDX_WALL_DROPDOWN_SLOPE_BUTTON
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 2, 1), PropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_WALL_SPINNER_ANIMATION_FRAME{,_INCREASE,_DECREASE}
makeWidget(PropertyRowCol({ 12, 0 }, 3, 0), PropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_WALL_ANIMATION_IS_BACKWARDS) // WIDX_WALL_ANIMATION_IS_BACKWARDS
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), kPropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_WALL_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
makeWidget(PropertyRowCol({ 12, 0 }, 1, 1), kPropertyButtonSize, WidgetType::dropdownMenu, WindowColour::secondary), // WIDX_WALL_DROPDOWN_SLOPE
makeWidget(PropertyRowCol({ 12 + kPropertyButtonSize.width - 12, 0 }, 1, 1), { 11, 12}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH), // WIDX_WALL_DROPDOWN_SLOPE_BUTTON
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 2, 1), kPropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_WALL_SPINNER_ANIMATION_FRAME{,_INCREASE,_DECREASE}
makeWidget(PropertyRowCol({ 12, 0 }, 3, 0), kPropertyFullWidth, WidgetType::checkbox, WindowColour::secondary, STR_TILE_INSPECTOR_WALL_ANIMATION_IS_BACKWARDS) // WIDX_WALL_ANIMATION_IS_BACKWARDS
);
constexpr int32_t NumLargeSceneryProperties = 1;
@@ -404,7 +400,7 @@ namespace OpenRCT2::Ui::Windows
constexpr int32_t LargeSceneryDetailsHeight = 20 + NumLargeSceneryDetails * 11;
static constexpr auto LargeSceneryWidgets = makeWidgets(
kMainTileInspectorWidgets,
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), PropertyButtonSize, WidgetType::spinner, WindowColour::secondary) // WIDX_LARGE_SCENERY_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), kPropertyButtonSize, WidgetType::spinner, WindowColour::secondary) // WIDX_LARGE_SCENERY_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
);
constexpr int32_t NumBannerProperties = 3;
@@ -413,7 +409,7 @@ namespace OpenRCT2::Ui::Windows
constexpr int32_t BannerDetailsHeight = 20 + NumBannerDetails * 11;
static constexpr auto BannerWidgets = makeWidgets(
kMainTileInspectorWidgets,
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), PropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_BANNER_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
makeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), kPropertyButtonSize, WidgetType::spinner, WindowColour::secondary), // WIDX_BANNER_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
makeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 1, 1), 3, 1), { 12, 12 }, WidgetType::checkbox, WindowColour::secondary), // WIDX_BANNER_CHECK_BLOCK_NE
makeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 1, 1), 3, 3), { 12, 12 }, WidgetType::checkbox, WindowColour::secondary), // WIDX_BANNER_CHECK_BLOCK_SE
makeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 1, 1), 1, 3), { 12, 12 }, WidgetType::checkbox, WindowColour::secondary), // WIDX_BANNER_CHECK_BLOCK_SW
@@ -447,9 +443,9 @@ namespace OpenRCT2::Ui::Windows
{
TileInspectorGroupboxSettings settings{};
decltype(settings.properties_bottom_offset) offsetSum = 0;
settings.properties_bottom_offset = (offsetSum += PADDING_BOTTOM);
settings.properties_bottom_offset = (offsetSum += kBottomPadding);
settings.properties_top_offset = (offsetSum += propertiesHeight);
settings.details_bottom_offset = (offsetSum += GROUPBOX_PADDING);
settings.details_bottom_offset = (offsetSum += kGroupboxPadding);
settings.details_top_offset = (offsetSum += detailsHeight);
settings.string_id = stringId;
return settings;
@@ -514,7 +510,7 @@ static uint64_t PageDisabledWidgets[] = {
public:
void OnOpen() override
{
WindowSetResize(*this, { MIN_WW, MIN_WH }, { MAX_WW, MAX_WH });
WindowSetResize(*this, kMinimumWindowSize, kMaximumWindowSize);
windowTileInspectorSelectedIndex = -1;
SetPage(TileInspectorPage::Default);
@@ -1015,7 +1011,7 @@ static uint64_t PageDisabledWidgets[] = {
ScreenSize OnScrollGetSize(int32_t scrollIndex) override
{
return ScreenSize(WW - 30, windowTileInspectorElementCount * kScrollableRowHeight);
return ScreenSize(kWindowSize.width - 30, windowTileInspectorElementCount * kScrollableRowHeight);
}
void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
@@ -1714,31 +1710,32 @@ static uint64_t PageDisabledWidgets[] = {
ft.Add<StringId>(STR_STRING);
ft.Add<char*>(typeName);
DrawTextEllipsised(
rt, screenCoords + ScreenCoordsXY{ TypeColumnXY.x, 0 }, TypeColumnSize.width, stringFormat, ft);
rt, screenCoords + ScreenCoordsXY{ kTypeColumnXY.x, 0 }, kTypeColumnSize.width, stringFormat, ft);
// Base height
ft = Formatter();
ft.Add<StringId>(STR_FORMAT_INTEGER);
ft.Add<int32_t>(tileElement->BaseHeight);
DrawTextBasic(rt, screenCoords + ScreenCoordsXY{ BaseHeightColumnXY.x, 0 }, stringFormat, ft);
DrawTextBasic(rt, screenCoords + ScreenCoordsXY{ kBaseHeightColumnXY.x, 0 }, stringFormat, ft);
// Clearance height
ft = Formatter();
ft.Add<StringId>(STR_FORMAT_INTEGER);
ft.Add<int32_t>(clearanceHeight);
DrawTextBasic(rt, screenCoords + ScreenCoordsXY{ ClearanceHeightColumnXY.x, 0 }, stringFormat, ft);
DrawTextBasic(rt, screenCoords + ScreenCoordsXY{ kClearanceHeightColumnXY.x, 0 }, stringFormat, ft);
// Direction
ft = Formatter();
ft.Add<StringId>(STR_FORMAT_INTEGER);
ft.Add<int32_t>(tileElement->GetDirection());
DrawTextBasic(rt, screenCoords + ScreenCoordsXY{ DirectionColumnXY.x, 0 }, stringFormat, ft);
DrawTextBasic(rt, screenCoords + ScreenCoordsXY{ kDirectionColumnXY.x, 0 }, stringFormat, ft);
// Checkmarks for ghost and last for tile
if (ghost)
DrawTextBasic(rt, screenCoords + ScreenCoordsXY{ GhostFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter);
DrawTextBasic(
rt, screenCoords + ScreenCoordsXY{ kGhostFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter);
if (last)
DrawTextBasic(rt, screenCoords + ScreenCoordsXY{ LastFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter);
DrawTextBasic(rt, screenCoords + ScreenCoordsXY{ kLastFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter);
screenCoords.y -= kScrollableRowHeight;
i++;
@@ -1770,14 +1767,14 @@ static uint64_t PageDisabledWidgets[] = {
if (tileInspectorPage != TileInspectorPage::Default)
{
auto index = EnumValue(tileInspectorPage) - 1;
height -= PageGroupBoxSettings[index].details_top_offset - GROUPBOX_PADDING - 3;
min_height -= PageGroupBoxSettings[index].details_top_offset - GROUPBOX_PADDING - 3;
height -= PageGroupBoxSettings[index].details_top_offset - kGroupboxPadding - 3;
min_height -= PageGroupBoxSettings[index].details_top_offset - kGroupboxPadding - 3;
}
if (p != TileInspectorPage::Default)
{
auto index = EnumValue(p) - 1;
height += PageGroupBoxSettings[index].details_top_offset - GROUPBOX_PADDING - 3;
min_height += PageGroupBoxSettings[index].details_top_offset - GROUPBOX_PADDING - 3;
height += PageGroupBoxSettings[index].details_top_offset - kGroupboxPadding - 3;
min_height += PageGroupBoxSettings[index].details_top_offset - kGroupboxPadding - 3;
}
tileInspectorPage = p;
auto pageIndex = EnumValue(p);
@@ -2144,7 +2141,7 @@ static uint64_t PageDisabledWidgets[] = {
{
widgets[WIDX_GROUPBOX_DETAILS].type = WidgetType::empty;
widgets[WIDX_GROUPBOX_PROPERTIES].type = WidgetType::empty;
widgets[WIDX_LIST].bottom = height - PADDING_BOTTOM;
widgets[WIDX_LIST].bottom = height - kBottomPadding;
}
else
{
@@ -2156,7 +2153,7 @@ static uint64_t PageDisabledWidgets[] = {
widgets[WIDX_GROUPBOX_DETAILS].bottom = height - PageGroupBoxSettings[pageIndex].details_bottom_offset;
widgets[WIDX_GROUPBOX_PROPERTIES].top = height - PageGroupBoxSettings[pageIndex].properties_top_offset;
widgets[WIDX_GROUPBOX_PROPERTIES].bottom = height - PageGroupBoxSettings[pageIndex].properties_bottom_offset;
widgets[WIDX_LIST].bottom = widgets[WIDX_GROUPBOX_DETAILS].top - GROUPBOX_PADDING;
widgets[WIDX_LIST].bottom = widgets[WIDX_GROUPBOX_DETAILS].top - kGroupboxPadding;
}
// The default page doesn't need further invalidation
@@ -2441,7 +2438,7 @@ static uint64_t PageDisabledWidgets[] = {
WindowBase* window = windowMgr->BringToFrontByClass(WindowClass::TileInspector);
if (window == nullptr)
window = windowMgr->Create<TileInspector>(
WindowClass::TileInspector, ScreenCoordsXY(0, 29), { WW, WH }, WF_RESIZABLE);
WindowClass::TileInspector, ScreenCoordsXY(0, 29), kWindowSize, WF_RESIZABLE);
return window;
}
+4 -2
View File
@@ -15,13 +15,15 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr ScreenSize kWindowSize = { 40, 64 };
enum WindowTitleExitWidgetIdx
{
WIDX_EXIT,
};
static constexpr auto _titleExitWidgets = makeWidgets(
makeWidget({ 0, 0 }, { 40, 64 }, WidgetType::imgBtn, WindowColour::tertiary, ImageId(SPR_MENU_EXIT), STR_EXIT));
makeWidget({ 0, 0 }, kWindowSize, WidgetType::imgBtn, WindowColour::tertiary, ImageId(SPR_MENU_EXIT), STR_EXIT));
class TitleExitWindow final : public Window
{
@@ -56,7 +58,7 @@ namespace OpenRCT2::Ui::Windows
{
auto* windowMgr = GetWindowManager();
return windowMgr->Create<TitleExitWindow>(
WindowClass::TitleExit, ScreenCoordsXY(ContextGetWidth() - 40, ContextGetHeight() - 64), { 40, 64 },
WindowClass::TitleExit, ScreenCoordsXY(ContextGetWidth() - 40, ContextGetHeight() - 64), kWindowSize,
WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_TITLE_BAR);
}
} // namespace OpenRCT2::Ui::Windows
+3 -4
View File
@@ -16,8 +16,7 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr int32_t WW = 232;
static constexpr int32_t WH = 136;
static constexpr ScreenSize kWindowSize = { 232, 136 };
enum
{
@@ -25,7 +24,7 @@ namespace OpenRCT2::Ui::Windows
};
static constexpr auto _titleLogoWidgets = makeWidgets(
makeWidget({ 0, 0 }, { WW + 1, WH + 1 }, WidgetType::imgBtn, WindowColour::primary));
makeWidget({ 0, 0 }, kWindowSize, WidgetType::imgBtn, WindowColour::primary));
class TitleLogoWindow final : public Window
{
@@ -72,7 +71,7 @@ namespace OpenRCT2::Ui::Windows
if (window == nullptr)
{
window = windowMgr->Create<TitleLogoWindow>(
WindowClass::TitleLogo, ScreenCoordsXY(0, 0), { WW, WH }, WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_TITLE_BAR);
WindowClass::TitleLogo, ScreenCoordsXY(0, 0), kWindowSize, WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_TITLE_BAR);
}
return window;
}
+4 -2
View File
@@ -14,13 +14,15 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr ScreenSize kWindowSize = { 80, 15 };
enum WindowTitleOptionsWidgetIdx
{
WIDX_OPTIONS,
};
static constexpr auto _windowTitleOptionsWidgets = makeWidgets(
makeWidget({ 0, 0 }, { 80, 15 }, WidgetType::button, WindowColour::tertiary, STR_OPTIONS, STR_OPTIONS_TIP));
makeWidget({ 0, 0 }, kWindowSize, WidgetType::button, WindowColour::tertiary, STR_OPTIONS, STR_OPTIONS_TIP));
class TitleOptionsWindow final : public Window
{
@@ -57,7 +59,7 @@ namespace OpenRCT2::Ui::Windows
if (window == nullptr)
{
window = windowMgr->Create<TitleOptionsWindow>(
WindowClass::TitleOptions, ScreenCoordsXY(ContextGetWidth() - 80, 0), { 80, 15 },
WindowClass::TitleOptions, ScreenCoordsXY(ContextGetWidth() - 80, 0), kWindowSize,
WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_TITLE_BAR);
}
+2 -3
View File
@@ -17,8 +17,7 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr int32_t WW = 500;
static constexpr int32_t WH = 30;
static constexpr ScreenSize kWindowSize = { 500, 30 };
static constexpr uint8_t kTextOffset = 8;
@@ -45,7 +44,7 @@ namespace OpenRCT2::Ui::Windows
if (window == nullptr)
{
window = windowMgr->Create<TitleVersionWindow>(
WindowClass::TitleVersion, ScreenCoordsXY(kTextOffset, ContextGetHeight() - 30), { WW, WH },
WindowClass::TitleVersion, ScreenCoordsXY(kTextOffset, ContextGetHeight() - 30), kWindowSize,
WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_TITLE_BAR);
}
return window;
+12 -13
View File
@@ -19,12 +19,10 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = STR_STRING;
static constexpr int32_t WH = 44;
static constexpr int32_t WW = 250;
static constexpr int32_t WH_DELETE_PROMPT = 74;
static constexpr int32_t WW_DELETE_PROMPT = 250;
static constexpr int32_t TrackDesignNameMaxLength = 127;
static constexpr StringId kWindowTitle = STR_STRING;
static constexpr ScreenSize kWindowSize = { 250, 44 };
static constexpr ScreenSize kWindowSizeDeletePrompt = { 250, 74 };
static constexpr int32_t kTrackDesignNameMaxLength = 127;
#pragma region Widgets
@@ -42,13 +40,13 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto _trackManageWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 10, 24}, {110, 12}, WidgetType::button, WindowColour::primary, STR_TRACK_MANAGE_RENAME),
makeWidget({130, 24}, {110, 12}, WidgetType::button, WindowColour::primary, STR_TRACK_MANAGE_DELETE)
);
static constexpr auto _trackDeletePromptWidgets = makeWidgets(
makeWindowShim(STR_DELETE_FILE, { WW_DELETE_PROMPT, WH_DELETE_PROMPT }),
makeWindowShim(STR_DELETE_FILE, kWindowSizeDeletePrompt),
makeWidget({ 10, 54}, {110, 12}, WidgetType::button, WindowColour::primary, STR_TRACK_MANAGE_DELETE),
makeWidget({130, 54}, {110, 12}, WidgetType::button, WindowColour::primary, STR_CANCEL )
);
@@ -103,7 +101,7 @@ namespace OpenRCT2::Ui::Windows
auto trackDesignManageWindow = std::make_unique<TrackDesignManageWindow>(tdFileRef);
auto* window = windowMgr->Create(
std::move(trackDesignManageWindow), WindowClass::ManageTrackDesign, {}, { WW, WH },
std::move(trackDesignManageWindow), WindowClass::ManageTrackDesign, {}, kWindowSize,
WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_AUTO_POSITION);
return window;
@@ -136,7 +134,7 @@ namespace OpenRCT2::Ui::Windows
case WIDX_RENAME:
WindowTextInputRawOpen(
this, widgetIndex, STR_TRACK_DESIGN_RENAME_TITLE, STR_TRACK_DESIGN_RENAME_DESC, {},
_trackDesignFileReference->name.c_str(), TrackDesignNameMaxLength);
_trackDesignFileReference->name.c_str(), kTrackDesignNameMaxLength);
break;
case WIDX_DELETE:
WindowTrackDeletePromptOpen(_trackDesignFileReference);
@@ -192,7 +190,7 @@ namespace OpenRCT2::Ui::Windows
auto trackDeletePromptWindow = std::make_unique<TrackDeletePromptWindow>(tdFileRef);
windowMgr->Create(
std::move(trackDeletePromptWindow), WindowClass::TrackDeletePrompt, {}, { WW_DELETE_PROMPT, WH_DELETE_PROMPT },
std::move(trackDeletePromptWindow), WindowClass::TrackDeletePrompt, {}, kWindowSizeDeletePrompt,
WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_AUTO_POSITION | WF_CENTRE_SCREEN);
}
@@ -235,7 +233,8 @@ namespace OpenRCT2::Ui::Windows
auto ft = Formatter();
ft.Add<const utf8*>(_trackDesignFileReference->name.c_str());
DrawTextWrapped(
rt, { windowPos.x + (WW_DELETE_PROMPT / 2), windowPos.y + ((WH_DELETE_PROMPT / 2) - 9) }, (WW_DELETE_PROMPT - 4),
STR_ARE_YOU_SURE_YOU_WANT_TO_PERMANENTLY_DELETE_TRACK, ft, { TextAlignment::CENTRE });
rt, windowPos + ScreenCoordsXY{ (kWindowSizeDeletePrompt.width / 2), ((kWindowSizeDeletePrompt.height / 2) - 9) },
(kWindowSizeDeletePrompt.width - 4), STR_ARE_YOU_SURE_YOU_WANT_TO_PERMANENTLY_DELETE_TRACK, ft,
{ TextAlignment::CENTRE });
}
} // namespace OpenRCT2::Ui::Windows
+13 -14
View File
@@ -41,12 +41,11 @@ using namespace OpenRCT2::TrackMetaData;
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = STR_STRING;
static constexpr int32_t WH = 124;
static constexpr int32_t WW = 200;
constexpr int16_t TRACK_MINI_PREVIEW_WIDTH = 168;
constexpr int16_t TRACK_MINI_PREVIEW_HEIGHT = 78;
constexpr uint16_t TRACK_MINI_PREVIEW_SIZE = TRACK_MINI_PREVIEW_WIDTH * TRACK_MINI_PREVIEW_HEIGHT;
static constexpr StringId kWindowTitle = STR_STRING;
static constexpr ScreenSize kWindowSize = { 200, 124 };
constexpr int16_t kTrackMiniPreviewWidth = 168;
constexpr int16_t kTrackMiniPreviewHeight = 78;
constexpr uint16_t kTrackMiniPreviewSize = kTrackMiniPreviewWidth * kTrackMiniPreviewHeight;
static constexpr uint8_t kPaletteIndexColourEntrance = PaletteIndex::pi20; // White
static constexpr uint8_t kPaletteIndexColourExit = PaletteIndex::pi10; // Black
@@ -68,9 +67,9 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto _trackPlaceWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({173, 83}, { 24, 24}, WidgetType::flatBtn, WindowColour::primary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_90_TIP ),
makeWidget({173, 59}, { 24, 24}, WidgetType::flatBtn, WindowColour::primary, ImageId(SPR_MIRROR_ARROW), STR_MIRROR_IMAGE_TIP ),
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({173, 83}, { 24, 24}, WidgetType::flatBtn, WindowColour::primary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_90_TIP ),
makeWidget({173, 59}, { 24, 24}, WidgetType::flatBtn, WindowColour::primary, ImageId(SPR_MIRROR_ARROW), STR_MIRROR_IMAGE_TIP ),
makeWidget({ 4, 109}, {192, 12}, WidgetType::button, WindowColour::primary, STR_SELECT_A_DIFFERENT_DESIGN, STR_GO_BACK_TO_DESIGN_SELECTION_WINDOW_TIP),
makeWidget({ 0, 0}, { 1, 1}, WidgetType::empty, WindowColour::primary)
);
@@ -107,7 +106,7 @@ namespace OpenRCT2::Ui::Windows
gInputFlags.set(InputFlag::unk6);
WindowPushOthersRight(*this);
ShowGridlines();
_miniPreview.resize(TRACK_MINI_PREVIEW_SIZE);
_miniPreview.resize(kTrackMiniPreviewSize);
_placementCost = kMoney64Undefined;
_placementLoc.SetNull();
_currentTrackPieceDirection = (2 - GetCurrentRotation()) & 3;
@@ -347,8 +346,8 @@ namespace OpenRCT2::Ui::Windows
{
G1Element g1temp = {};
g1temp.offset = _miniPreview.data();
g1temp.width = TRACK_MINI_PREVIEW_WIDTH;
g1temp.height = TRACK_MINI_PREVIEW_HEIGHT;
g1temp.width = kTrackMiniPreviewWidth;
g1temp.height = kTrackMiniPreviewHeight;
GfxSetG1Element(SPR_TEMP, &g1temp);
DrawingEngineInvalidateImage(SPR_TEMP);
GfxDrawSprite(clippedRT, ImageId(SPR_TEMP, this->colours[0].colour), { 0, 0 });
@@ -696,7 +695,7 @@ namespace OpenRCT2::Ui::Windows
uint8_t* DrawMiniPreviewGetPixelPtr(const ScreenCoordsXY& pixel)
{
return &_miniPreview[pixel.y * TRACK_MINI_PREVIEW_WIDTH + pixel.x];
return &_miniPreview[pixel.y * kTrackMiniPreviewWidth + pixel.x];
}
GameActions::Result FindValidTrackDesignPlaceHeight(CoordsXYZ& loc, uint32_t newFlags)
@@ -732,7 +731,7 @@ namespace OpenRCT2::Ui::Windows
auto* windowMgr = Ui::GetWindowManager();
windowMgr->CloseConstructionWindows();
auto* window = windowMgr->FocusOrCreate<TrackDesignPlaceWindow>(WindowClass::TrackDesignPlace, { WW, WH }, 0);
auto* window = windowMgr->FocusOrCreate<TrackDesignPlaceWindow>(WindowClass::TrackDesignPlace, kWindowSize, 0);
if (window != nullptr)
{
window->Init(std::move(openTrackDesign));
+20 -20
View File
@@ -30,12 +30,11 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = STR_SELECT_DESIGN;
static constexpr int32_t WH = 441;
static constexpr int32_t WW = 600;
static constexpr int32_t DEBUG_PATH_HEIGHT = 12;
static constexpr int32_t ROTATE_AND_SCENERY_BUTTON_SIZE = 24;
static constexpr int32_t WINDOW_PADDING = 5;
static constexpr StringId kWindowTitle = STR_SELECT_DESIGN;
static constexpr ScreenSize kWindowSize = { 600, 441 };
static constexpr int32_t kDebugPathHeight = 12;
static constexpr int32_t kRotateAndSceneryButtonSize = 24;
static constexpr int32_t kWindowPadding = 5;
enum
{
@@ -54,15 +53,16 @@ namespace OpenRCT2::Ui::Windows
validate_global_widx(WC_TRACK_DESIGN_LIST, WIDX_ROTATE);
// clang-format off
static constexpr auto kFlatBtnSize = ScreenSize{kRotateAndSceneryButtonSize, kRotateAndSceneryButtonSize};
static constexpr auto _trackListWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ 4, 18}, {218, 13}, WidgetType::tableHeader, WindowColour::primary, STR_SELECT_OTHER_RIDE ),
makeWidget({ 4, 32}, {124, 13}, WidgetType::textBox, WindowColour::secondary ),
makeWidget({130, 32}, { 92, 13}, WidgetType::button, WindowColour::primary, STR_OBJECT_SEARCH_CLEAR ),
makeWidget({ 4, 46}, {218, 381}, WidgetType::scroll, WindowColour::primary, SCROLL_VERTICAL, STR_CLICK_ON_DESIGN_TO_BUILD_IT_TIP),
makeWidget({224, 18}, {372, 219}, WidgetType::flatBtn, WindowColour::primary ),
makeWidget({572, 405}, { ROTATE_AND_SCENERY_BUTTON_SIZE, ROTATE_AND_SCENERY_BUTTON_SIZE}, WidgetType::flatBtn, WindowColour::primary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_90_TIP ),
makeWidget({572, 381}, { ROTATE_AND_SCENERY_BUTTON_SIZE, ROTATE_AND_SCENERY_BUTTON_SIZE}, WidgetType::flatBtn, WindowColour::primary, ImageId(SPR_SCENERY), STR_TOGGLE_SCENERY_TIP )
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 4, 18}, {218, 13}, WidgetType::tableHeader, WindowColour::primary, STR_SELECT_OTHER_RIDE ),
makeWidget({ 4, 32}, {124, 13}, WidgetType::textBox, WindowColour::secondary ),
makeWidget({130, 32}, { 92, 13}, WidgetType::button, WindowColour::primary, STR_OBJECT_SEARCH_CLEAR ),
makeWidget({ 4, 46}, {218, 381}, WidgetType::scroll, WindowColour::primary, SCROLL_VERTICAL, STR_CLICK_ON_DESIGN_TO_BUILD_IT_TIP),
makeWidget({224, 18}, {372, 219}, WidgetType::flatBtn, WindowColour::primary ),
makeWidget({572, 405}, kFlatBtnSize, WidgetType::flatBtn, WindowColour::primary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_90_TIP ),
makeWidget({572, 381}, kFlatBtnSize, WidgetType::flatBtn, WindowColour::primary, ImageId(SPR_SCENERY), STR_TOGGLE_SCENERY_TIP )
);
// clang-format on
@@ -423,13 +423,13 @@ namespace OpenRCT2::Ui::Windows
}
// When debugging tools are on, shift everything up a bit to make room for displaying the path.
const int32_t bottomMargin = Config::Get().general.DebuggingTools ? (WINDOW_PADDING + DEBUG_PATH_HEIGHT)
: WINDOW_PADDING;
const int32_t bottomMargin = Config::Get().general.DebuggingTools ? (kWindowPadding + kDebugPathHeight)
: kWindowPadding;
widgets[WIDX_TRACK_LIST].bottom = height - bottomMargin;
widgets[WIDX_ROTATE].bottom = height - bottomMargin;
widgets[WIDX_ROTATE].top = widgets[WIDX_ROTATE].bottom - ROTATE_AND_SCENERY_BUTTON_SIZE;
widgets[WIDX_ROTATE].top = widgets[WIDX_ROTATE].bottom - kRotateAndSceneryButtonSize;
widgets[WIDX_TOGGLE_SCENERY].bottom = widgets[WIDX_ROTATE].top;
widgets[WIDX_TOGGLE_SCENERY].top = widgets[WIDX_TOGGLE_SCENERY].bottom - ROTATE_AND_SCENERY_BUTTON_SIZE;
widgets[WIDX_TOGGLE_SCENERY].top = widgets[WIDX_TOGGLE_SCENERY].bottom - kRotateAndSceneryButtonSize;
}
void OnUpdate() override
@@ -477,7 +477,7 @@ namespace OpenRCT2::Ui::Windows
auto ft = Formatter();
ft.Add<utf8*>(shortPath.c_str());
DrawTextBasic(
rt, windowPos + ScreenCoordsXY{ 0, height - DEBUG_PATH_HEIGHT - 3 }, STR_STRING, ft,
rt, windowPos + ScreenCoordsXY{ 0, height - kDebugPathHeight - 3 }, STR_STRING, ft,
{ colours[1] }); // TODO Check dpi
}
@@ -767,7 +767,7 @@ namespace OpenRCT2::Ui::Windows
screenPos = { 0, kTopToolbarHeight + 2 };
}
return windowMgr->Create<TrackListWindow>(WindowClass::TrackDesignList, screenPos, { WW, WH }, flags, item);
return windowMgr->Create<TrackListWindow>(WindowClass::TrackDesignList, screenPos, kWindowSize, flags, item);
}
void WindowTrackDesignListReloadTracks()
+20 -21
View File
@@ -53,33 +53,32 @@ namespace OpenRCT2::Ui::Windows
#pragma region MEASUREMENTS
static constexpr StringId WINDOW_TITLE = STR_TRANSPARENCY_OPTIONS_TITLE;
static constexpr int32_t WW = 204;
static constexpr int32_t WH = 57;
static constexpr StringId kWindowTitle = STR_TRANSPARENCY_OPTIONS_TITLE;
static constexpr ScreenSize kWindowSize = { 204, 57 };
static constexpr ScreenSize HIDE_SIZE = { 24, 24 };
static constexpr ScreenSize INVISIBLE_SIZE = { 24, 12 };
static constexpr ScreenSize kHideSize = { 24, 24 };
static constexpr ScreenSize kInvisibleSize = { 24, 12 };
#pragma endregion
// clang-format off
static constexpr auto _transparancyWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ 2, 17}, HIDE_SIZE, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_BUTTON_HIDE_VEGETATION), STR_SEE_THROUGH_VEGETATION),
makeWidget({ 27, 17}, HIDE_SIZE, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_BUTTON_HIDE_SCENERY), STR_SEE_THROUGH_SCENERY),
makeWidget({ 52, 17}, HIDE_SIZE, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_BUTTON_FOOTPATH), STR_SEE_THROUGH_PATHS),
makeWidget({ 77, 17}, HIDE_SIZE, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE), STR_SEE_THROUGH_RIDES),
makeWidget({102, 17}, HIDE_SIZE, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_BUTTON_HIDE_VEHICLES), STR_SEE_THROUGH_VEHICLES),
makeWidget({127, 17}, HIDE_SIZE, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_BUTTON_HIDE_SUPPORTS), STR_SEE_THROUGH_SUPPORTS),
makeWidget({152, 17}, HIDE_SIZE, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_GUESTS), STR_SEE_THROUGH_GUESTS),
makeWidget({177, 17}, HIDE_SIZE, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SEE_THROUGH_STAFF),
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 2, 17}, kHideSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_BUTTON_HIDE_VEGETATION), STR_SEE_THROUGH_VEGETATION),
makeWidget({ 27, 17}, kHideSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_BUTTON_HIDE_SCENERY), STR_SEE_THROUGH_SCENERY),
makeWidget({ 52, 17}, kHideSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_BUTTON_FOOTPATH), STR_SEE_THROUGH_PATHS),
makeWidget({ 77, 17}, kHideSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RIDE), STR_SEE_THROUGH_RIDES),
makeWidget({102, 17}, kHideSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_BUTTON_HIDE_VEHICLES), STR_SEE_THROUGH_VEHICLES),
makeWidget({127, 17}, kHideSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_BUTTON_HIDE_SUPPORTS), STR_SEE_THROUGH_SUPPORTS),
makeWidget({152, 17}, kHideSize, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_GUESTS), STR_SEE_THROUGH_GUESTS),
makeWidget({177, 17}, kHideSize, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SEE_THROUGH_STAFF),
makeWidget({ 2, 42}, INVISIBLE_SIZE, WidgetType::flatBtn, WindowColour::tertiary, kStringIdNone, STR_INVISIBLE_VEGETATION),
makeWidget({ 27, 42}, INVISIBLE_SIZE, WidgetType::flatBtn, WindowColour::tertiary, kStringIdNone, STR_INVISIBLE_SCENERY),
makeWidget({ 52, 42}, INVISIBLE_SIZE, WidgetType::flatBtn, WindowColour::tertiary, kStringIdNone, STR_INVISIBLE_PATHS),
makeWidget({ 77, 42}, INVISIBLE_SIZE, WidgetType::flatBtn, WindowColour::tertiary, kStringIdNone, STR_INVISIBLE_RIDES),
makeWidget({102, 42}, INVISIBLE_SIZE, WidgetType::flatBtn, WindowColour::tertiary, kStringIdNone, STR_INVISIBLE_VEHICLES),
makeWidget({127, 42}, INVISIBLE_SIZE, WidgetType::flatBtn, WindowColour::tertiary, kStringIdNone, STR_INVISIBLE_SUPPORTS)
makeWidget({ 2, 42}, kInvisibleSize, WidgetType::flatBtn, WindowColour::tertiary, kStringIdNone, STR_INVISIBLE_VEGETATION),
makeWidget({ 27, 42}, kInvisibleSize, WidgetType::flatBtn, WindowColour::tertiary, kStringIdNone, STR_INVISIBLE_SCENERY),
makeWidget({ 52, 42}, kInvisibleSize, WidgetType::flatBtn, WindowColour::tertiary, kStringIdNone, STR_INVISIBLE_PATHS),
makeWidget({ 77, 42}, kInvisibleSize, WidgetType::flatBtn, WindowColour::tertiary, kStringIdNone, STR_INVISIBLE_RIDES),
makeWidget({102, 42}, kInvisibleSize, WidgetType::flatBtn, WindowColour::tertiary, kStringIdNone, STR_INVISIBLE_VEHICLES),
makeWidget({127, 42}, kInvisibleSize, WidgetType::flatBtn, WindowColour::tertiary, kStringIdNone, STR_INVISIBLE_SUPPORTS)
);
// clang-format on
@@ -246,7 +245,7 @@ namespace OpenRCT2::Ui::Windows
auto* windowMgr = GetWindowManager();
auto* window = windowMgr->BringToFrontByClass(WindowClass::Transparency);
if (window == nullptr)
window = windowMgr->Create<TransparencyWindow>(WindowClass::Transparency, ScreenCoordsXY(32, 32), { WW, WH });
window = windowMgr->Create<TransparencyWindow>(WindowClass::Transparency, ScreenCoordsXY(32, 32), kWindowSize);
return window;
}
+12 -13
View File
@@ -48,21 +48,20 @@ namespace OpenRCT2::Ui::Windows
#pragma region Widgets
static constexpr StringId WINDOW_TITLE = STR_VIEW_CLIPPING_TITLE;
static constexpr int32_t WW = 180;
static constexpr int32_t WH = 172;
static constexpr StringId kWindowTitle = STR_VIEW_CLIPPING_TITLE;
static constexpr ScreenSize kWindowSize = { 180, 172 };
// clang-format off
static constexpr auto _viewClippingWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget ({ 11, 19}, { 159, 11}, WidgetType::checkbox, WindowColour::primary, STR_VIEW_CLIPPING_HEIGHT_ENABLE, STR_VIEW_CLIPPING_HEIGHT_ENABLE_TIP ), // clip enable/disable check box
makeWidget ({ 5, 36}, {WW - 10, 65}, WidgetType::groupbox, WindowColour::primary, STR_VIEW_CLIPPING_VERTICAL_CLIPPING ),
makeSpinnerWidgets({ 90, 51}, { 79, 12}, WidgetType::spinner, WindowColour::primary, kStringIdNone, STR_VIEW_CLIPPING_HEIGHT_VALUE_TOGGLE ), // clip height (3 widgets)
makeWidget ({ 11, 66}, { 158, 13}, WidgetType::scroll, WindowColour::primary, SCROLL_HORIZONTAL, STR_VIEW_CLIPPING_HEIGHT_SCROLL_TIP ), // clip height scrollbar
makeWidget ({ 11, 83}, { 159, 11}, WidgetType::checkbox, WindowColour::primary, STR_VIEW_CLIPPING_VERTICAL_CLIPPING_SEE_THROUGH, STR_VIEW_CLIPPING_VERTICAL_CLIPPING_SEE_THROUGH_TIP), // clip height enable/disable see-through check box
makeWidget ({ 5, 107}, {WW - 10, 60}, WidgetType::groupbox, WindowColour::primary, STR_VIEW_CLIPPING_HORIZONTAL_CLIPPING ),
makeWidget ({ 11, 122}, { 158, 17}, WidgetType::button, WindowColour::primary, STR_VIEW_CLIPPING_SELECT_AREA ), // selector
makeWidget ({ 11, 143}, { 158, 18}, WidgetType::button, WindowColour::primary, STR_VIEW_CLIPPING_CLEAR_SELECTION ) // clear
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget ({ 11, 19}, { 159, 11}, WidgetType::checkbox, WindowColour::primary, STR_VIEW_CLIPPING_HEIGHT_ENABLE, STR_VIEW_CLIPPING_HEIGHT_ENABLE_TIP ), // clip enable/disable check box
makeWidget ({ 5, 36}, {kWindowSize.width - 10, 65}, WidgetType::groupbox, WindowColour::primary, STR_VIEW_CLIPPING_VERTICAL_CLIPPING ),
makeSpinnerWidgets({ 90, 51}, { 79, 12}, WidgetType::spinner, WindowColour::primary, kStringIdNone, STR_VIEW_CLIPPING_HEIGHT_VALUE_TOGGLE ), // clip height (3 widgets)
makeWidget ({ 11, 66}, { 158, 13}, WidgetType::scroll, WindowColour::primary, SCROLL_HORIZONTAL, STR_VIEW_CLIPPING_HEIGHT_SCROLL_TIP ), // clip height scrollbar
makeWidget ({ 11, 83}, { 159, 11}, WidgetType::checkbox, WindowColour::primary, STR_VIEW_CLIPPING_VERTICAL_CLIPPING_SEE_THROUGH, STR_VIEW_CLIPPING_VERTICAL_CLIPPING_SEE_THROUGH_TIP), // clip height enable/disable see-through check box
makeWidget ({ 5, 107}, {kWindowSize.width - 10, 60}, WidgetType::groupbox, WindowColour::primary, STR_VIEW_CLIPPING_HORIZONTAL_CLIPPING ),
makeWidget ({ 11, 122}, { 158, 17}, WidgetType::button, WindowColour::primary, STR_VIEW_CLIPPING_SELECT_AREA ), // selector
makeWidget ({ 11, 143}, { 158, 18}, WidgetType::button, WindowColour::primary, STR_VIEW_CLIPPING_CLEAR_SELECTION ) // clear
);
// clang-format on
@@ -417,7 +416,7 @@ namespace OpenRCT2::Ui::Windows
auto* window = windowMgr->BringToFrontByClass(WindowClass::ViewClipping);
if (window == nullptr)
{
window = windowMgr->Create<ViewClippingWindow>(WindowClass::ViewClipping, ScreenCoordsXY(32, 32), { WW, WH });
window = windowMgr->Create<ViewClippingWindow>(WindowClass::ViewClipping, ScreenCoordsXY(32, 32), kWindowSize);
}
return window;
}
+13 -14
View File
@@ -35,9 +35,8 @@ namespace OpenRCT2::Ui::Windows
#pragma region MEASUREMENTS
static constexpr StringId WINDOW_TITLE = STR_VIEWPORT_NO;
static constexpr int32_t WW = 200;
static constexpr int32_t WH = 200;
static constexpr StringId kWindowTitle = STR_VIEWPORT_NO;
static constexpr ScreenSize kWindowSize = { 200, 200 };
static constexpr ScreenSize VIEWPORT_BUTTON = { 24, 24 };
@@ -45,13 +44,13 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto _viewportWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWidget({ 0, 14}, { WW - 1, WH - 1}, WidgetType::resize, WindowColour::secondary ), // resize
makeWidget({ 3, 17}, {WW - 26, WH - 3}, WidgetType::viewport, WindowColour::primary ), // viewport
makeWidget({WW - 25, 17}, VIEWPORT_BUTTON, WidgetType::flatBtn, WindowColour::primary , ImageId(SPR_G2_ZOOM_IN), STR_ZOOM_IN_TIP ), // zoom in
makeWidget({WW - 25, 41}, VIEWPORT_BUTTON, WidgetType::flatBtn, WindowColour::primary , ImageId(SPR_G2_ZOOM_OUT), STR_ZOOM_OUT_TIP ), // zoom out
makeWidget({WW - 25, 65}, VIEWPORT_BUTTON, WidgetType::flatBtn, WindowColour::primary , ImageId(SPR_LOCATE), STR_LOCATE_SUBJECT_TIP), // locate
makeWidget({WW - 25, 89}, VIEWPORT_BUTTON, WidgetType::flatBtn, WindowColour::primary , ImageId(SPR_ROTATE_ARROW),STR_LOCATE_SUBJECT_TIP) // rotate
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget({ 0, 14}, kWindowSize - ScreenSize( 1, 1), WidgetType::resize, WindowColour::secondary ), // resize
makeWidget({ 3, 17}, kWindowSize - ScreenSize(26, 3), WidgetType::viewport, WindowColour::primary ), // viewport
makeWidget({kWindowSize.width - 25, 17}, VIEWPORT_BUTTON, WidgetType::flatBtn, WindowColour::primary , ImageId(SPR_G2_ZOOM_IN), STR_ZOOM_IN_TIP ), // zoom in
makeWidget({kWindowSize.width - 25, 41}, VIEWPORT_BUTTON, WidgetType::flatBtn, WindowColour::primary , ImageId(SPR_G2_ZOOM_OUT), STR_ZOOM_OUT_TIP ), // zoom out
makeWidget({kWindowSize.width - 25, 65}, VIEWPORT_BUTTON, WidgetType::flatBtn, WindowColour::primary , ImageId(SPR_LOCATE), STR_LOCATE_SUBJECT_TIP), // locate
makeWidget({kWindowSize.width - 25, 89}, VIEWPORT_BUTTON, WidgetType::flatBtn, WindowColour::primary , ImageId(SPR_ROTATE_ARROW),STR_LOCATE_SUBJECT_TIP) // rotate
);
// clang-format on
@@ -97,7 +96,7 @@ namespace OpenRCT2::Ui::Windows
viewport->flags |= VIEWPORT_FLAG_SOUND_ON | VIEWPORT_FLAG_INDEPENDENT_ROTATION;
WindowSetResize(*this, { WW, WH }, { (ContextGetWidth() * 4) / 5, (ContextGetHeight() * 4) / 5 });
WindowSetResize(*this, kWindowSize, { (ContextGetWidth() * 4) / 5, (ContextGetHeight() * 4) / 5 });
}
void OnUpdate() override
@@ -175,8 +174,8 @@ namespace OpenRCT2::Ui::Windows
max_width = (screenWidth * 4) / 5;
max_height = (screenHeight * 4) / 5;
min_width = WW;
min_height = WH;
min_width = kWindowSize.width;
min_height = kWindowSize.height;
WindowSetResize(*this, { min_width, min_height }, { max_width, max_height });
}
@@ -216,6 +215,6 @@ namespace OpenRCT2::Ui::Windows
WindowBase* ViewportOpen()
{
return GetWindowManager()->Create<ViewportWindow>(WindowClass::Viewport, { WW, WH }, WF_RESIZABLE);
return GetWindowManager()->Create<ViewportWindow>(WindowClass::Viewport, kWindowSize, WF_RESIZABLE);
}
} // namespace OpenRCT2::Ui::Windows
+4 -5
View File
@@ -25,9 +25,8 @@
namespace OpenRCT2::Ui::Windows
{
static constexpr StringId WINDOW_TITLE = STR_WATER;
static constexpr int32_t WH = 77;
static constexpr int32_t WW = 76;
static constexpr StringId kWindowTitle = STR_WATER;
static constexpr ScreenSize kWindowSize = { 76, 77 };
enum WindowWaterWidgetIdx : WidgetIndex
{
@@ -41,7 +40,7 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr auto _waterWidgets = makeWidgets(
makeWindowShim(WINDOW_TITLE, { WW, WH }),
makeWindowShim(kWindowTitle, kWindowSize),
makeWidget ({16, 17}, {44, 32}, WidgetType::imgBtn, WindowColour::primary , ImageId(SPR_LAND_TOOL_SIZE_0), kStringIdNone), // preview box
makeRemapWidget({17, 18}, {16, 16}, WidgetType::trnBtn, WindowColour::tertiary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_WATER_TIP), // decrement size
makeRemapWidget({43, 32}, {16, 16}, WidgetType::trnBtn, WindowColour::tertiary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_WATER_TIP) // increment size
@@ -426,7 +425,7 @@ namespace OpenRCT2::Ui::Windows
{
auto* windowMgr = GetWindowManager();
return windowMgr->FocusOrCreate<WaterWindow>(
WindowClass::Water, ScreenCoordsXY(ContextGetWidth() - WW, 29), { WW, WH }, 0);
WindowClass::Water, ScreenCoordsXY(ContextGetWidth() - kWindowSize.width, 29), kWindowSize, 0);
}
/**
+2
View File
@@ -34,6 +34,8 @@ using ScenarioSelectCallback = void (*)(const utf8* path);
namespace OpenRCT2::Ui::Windows
{
constexpr int32_t kTabBarHeight = 43;
extern bool gWindowSceneryScatterEnabled;
extern uint16_t gWindowSceneryScatterSize;
extern ScatterToolDensity gWindowSceneryScatterDensity;
+10
View File
@@ -60,6 +60,16 @@ struct ScreenSize
{
return ScreenSize{ width / scalar, height / scalar };
}
constexpr ScreenSize operator+(const ScreenSize& other) const
{
return ScreenSize{ width + other.width, height + other.height };
}
constexpr ScreenSize operator-(const ScreenSize& other) const
{
return ScreenSize{ width - other.width, height - other.height };
}
};
struct ScreenCoordsXY