1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Tile Inspector Use label widgets for X/Y labels

This commit is contained in:
Gymnasiast
2025-01-10 15:39:32 +01:00
parent 8a84f225e1
commit 837fb8d992
3 changed files with 15 additions and 7 deletions

View File

@@ -3788,3 +3788,5 @@ STR_6721 :At least one mechanic peep animations object must be selected
STR_6722 :At least one security peep animations object must be selected
STR_6723 :At least one entertainer peep animations object must be selected
STR_6724 :Scenario Texts
STR_6725 :X:
STR_6726 :Y:

View File

@@ -2102,6 +2102,8 @@ namespace OpenRCT2
STR_TILE_INSPECTOR_WALL_SLOPED_LEFT = 5977,
STR_TILE_INSPECTOR_WALL_SLOPED_RIGHT = 5978,
STR_TILE_INSPECTOR_WALL_TYPE = 5979,
STR_TILE_INSPECTOR_X_LABEL = 6725,
STR_TILE_INSPECTOR_Y_LABEL = 6726,
// Window: TitleExit
STR_EXIT = 1924,

View File

@@ -79,9 +79,11 @@ namespace OpenRCT2::Ui::Windows
WIDX_TITLE,
WIDX_CLOSE,
WIDX_LIST,
WIDX_SPINNER_X_LABEL,
WIDX_SPINNER_X,
WIDX_SPINNER_X_INCREASE,
WIDX_SPINNER_X_DECREASE,
WIDX_SPINNER_Y_LABEL,
WIDX_SPINNER_Y,
WIDX_SPINNER_Y_INCREASE,
WIDX_SPINNER_Y_DECREASE,
@@ -262,8 +264,10 @@ namespace OpenRCT2::Ui::Windows
#define MAIN_TILE_INSPECTOR_WIDGETS \
WINDOW_SHIM(WINDOW_TITLE, WW, WH), \
MakeWidget({3, 57}, {WW - 6, WH - PADDING_BOTTOM - 58}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), /* Element list */ \
/* X and Y spinners */ \
/* X and Y spinners */ \
MakeWidget ({ 4, 24}, {38, 14}, WindowWidgetType::Label, WindowColour::Secondary, STR_TILE_INSPECTOR_X_LABEL), \
MakeSpinnerWidgets({20, 23}, {51, 12}, WindowWidgetType::Spinner, WindowColour::Secondary), /* Spinner X (3 widgets) */ \
MakeWidget ({74, 24}, {38, 14}, WindowWidgetType::Label, WindowColour::Secondary, STR_TILE_INSPECTOR_Y_LABEL), \
MakeSpinnerWidgets({90, 23}, {51, 12}, WindowWidgetType::Spinner, WindowColour::Secondary), /* Spinner Y (3 widgets) */ \
/* Top buttons */ \
MakeWidget(ToolbarButtonAnchor + ToolbarButtonOffsetX * 0, ToolbarButtonSize, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_DEMOLISH), STR_REMOVE_SELECTED_ELEMENT_TIP ), /* Remove button */ \
@@ -1046,25 +1050,25 @@ static uint64_t PageDisabledWidgets[] = {
ScreenCoordsXY screenCoords(windowPos.x, windowPos.y);
// Draw coordinates
DrawText(dpi, screenCoords + ScreenCoordsXY(5, 24), { colours[1] }, "X:");
DrawText(dpi, screenCoords + ScreenCoordsXY(74, 24), { colours[1] }, "Y:");
auto yOffset = widgets[WIDX_SPINNER_X_LABEL].top;
if (_tileSelected)
{
auto tileCoords = TileCoordsXY{ _toolMap };
auto ft = Formatter();
ft.Add<int32_t>(tileCoords.x);
DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 43, 24 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT });
dpi, screenCoords + ScreenCoordsXY{ 43, yOffset }, STR_FORMAT_INTEGER, ft,
{ colours[1], TextAlignment::RIGHT });
ft = Formatter();
ft.Add<int32_t>(tileCoords.y);
DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 113, 24 }, STR_FORMAT_INTEGER, ft,
dpi, screenCoords + ScreenCoordsXY{ 113, yOffset }, STR_FORMAT_INTEGER, ft,
{ colours[1], TextAlignment::RIGHT });
}
else
{
DrawText(dpi, screenCoords + ScreenCoordsXY(43 - 7, 24), { colours[1] }, "-");
DrawText(dpi, screenCoords + ScreenCoordsXY(113 - 7, 24), { colours[1] }, "-");
DrawText(dpi, screenCoords + ScreenCoordsXY(43 - 7, yOffset), { colours[1] }, "-");
DrawText(dpi, screenCoords + ScreenCoordsXY(113 - 7, yOffset), { colours[1] }, "-");
}
if (windowTileInspectorSelectedIndex != -1)