1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 00:34:46 +01:00

Merge pull request #12671 from AaronVanGeffen/refactor/tabs

MakeTab wrapper for standard tab widgets
This commit is contained in:
Michael Steenbeek
2020-08-26 12:13:36 +02:00
committed by GitHub
30 changed files with 305 additions and 289 deletions

View File

@@ -61,6 +61,8 @@ enum
constexpr uint8_t SCROLLBAR_WIDTH = 10;
constexpr const ScreenSize TAB_SIZE = { 31, 27 };
constexpr rct_widget MakeWidget(
const ScreenCoordsXY& origin, const ScreenSize& size, uint8_t type, uint8_t colour, uint32_t content = 0xFFFFFFFF,
rct_string_id tooltip = STR_NONE)
@@ -85,6 +87,16 @@ constexpr rct_widget MakeRemapWidget(
return MakeWidget(origin, size, type, colour, IMAGE_TYPE_REMAP | content, tooltip);
}
constexpr rct_widget MakeTab(const ScreenCoordsXY& origin, rct_string_id tooltip = STR_NONE)
{
const ScreenSize size = TAB_SIZE;
const uint8_t type = WWT_TAB;
const uint8_t colour = 1;
const uint32_t content = 0xFFFFFFFF;
return MakeWidget(origin, size, type, colour, content, tooltip);
}
#define MakeSpinnerWidgets(...) \
MakeWidget(__VA_ARGS__), MakeSpinnerIncreaseWidget(__VA_ARGS__), MakeSpinnerDecreaseWidget(__VA_ARGS__)