diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index e48cf5065f..ceadec4d46 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -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: diff --git a/distribution/changelog.txt b/distribution/changelog.txt index cd82606b3f..bf3503ffd9 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -7,6 +7,7 @@ - Fix: [#21794] Lay-down coaster cars reverse on first frames of downwards corkscrew. - Fix: [#23508] Simultaneous virtual floors shown for ride and footpath. - Fix: [#23581] [Plugin] Food/drink items given to guests have no consumption duration set. +- Fix: [#23591] “Install new track” button in Track Designs Manager is misaligned. 0.4.18 (2025-01-08) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/UiStringIds.h b/src/openrct2-ui/UiStringIds.h index 5ce128929e..1f22359873 100644 --- a/src/openrct2-ui/UiStringIds.h +++ b/src/openrct2-ui/UiStringIds.h @@ -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, diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index c4feb89191..4c19602a2f 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -234,7 +234,7 @@ namespace OpenRCT2::Ui::Windows MakeWidget ({ 0, 43}, {WW, 357}, WindowWidgetType::Resize, WindowColour::Secondary ), MakeWidget ({ 4, 60}, {288, 277}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL ), MakeWidget ({391, 45}, {114, 114}, WindowWidgetType::FlatBtn, WindowColour::Secondary ), - MakeWidget ({350, 22}, {122, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_INSTALL_NEW_TRACK_DESIGN, STR_INSTALL_NEW_TRACK_DESIGN_TIP ), + MakeWidget ({340, 22}, {122, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_INSTALL_NEW_TRACK_DESIGN, STR_INSTALL_NEW_TRACK_DESIGN_TIP ), MakeDropdownWidgets({470, 22}, {114, 14}, WindowWidgetType::DropdownMenu, WindowColour::Primary, STR_OBJECT_FILTER, STR_OBJECT_FILTER_TIP ), MakeWidget ({ 4, 45}, {211, 14}, WindowWidgetType::TextBox, WindowColour::Secondary ), MakeWidget ({218, 45}, { 70, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_OBJECT_SEARCH_CLEAR ), @@ -858,19 +858,20 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_LIST].bottom = height - 14; widgets[WIDX_PREVIEW].left = width - 209; widgets[WIDX_PREVIEW].right = width - 96; - ResizeDropdown(WIDX_FILTER_DROPDOWN, { width - kFilterWidth - 10, 22 }, { kFilterWidth, 14 }); - widgets[WIDX_INSTALL_TRACK].left = width - 250; - widgets[WIDX_INSTALL_TRACK].right = width - 137; widgets[WIDX_RELOAD_OBJECT].left = width - 9 - 24; widgets[WIDX_RELOAD_OBJECT].right = width - 9; + auto& dropdownWidget = widgets[WIDX_FILTER_DROPDOWN]; + ResizeDropdown(WIDX_FILTER_DROPDOWN, { width - kFilterWidth - 10, dropdownWidget.top }, { kFilterWidth, 14 }); + auto& installTrackWidget = widgets[WIDX_INSTALL_TRACK]; + installTrackWidget.moveToX(dropdownWidget.left - installTrackWidget.width() - 10); + // Set pressed widgets pressed_widgets |= 1uLL << WIDX_PREVIEW; SetPressedTab(); // Set window title and buttons auto& titleWidget = widgets[WIDX_TITLE]; - auto& installTrackWidget = widgets[WIDX_INSTALL_TRACK]; if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) { titleWidget.text = STR_TRACK_DESIGNS_MANAGER_SELECT_RIDE_TYPE; diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 459c139826..cb705a3800 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -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(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(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) diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 6527957ad4..72c8446e25 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -140,6 +140,16 @@ struct Widget moveDown(coords.y - top); } + void moveToX(int16_t x) + { + moveRight(x - left); + } + + void moveToY(int16_t y) + { + moveDown(y - top); + } + bool IsVisible() const { return !(flags & OpenRCT2::WIDGET_FLAGS::IS_HIDDEN); @@ -322,17 +332,17 @@ constexpr int32_t WC_TRACK_DESIGN_PLACE__WIDX_ROTATE = 3; constexpr int32_t WC_EDITOR_PARK_ENTRANCE__WIDX_ROTATE_ENTRANCE_BUTTON = 6; constexpr int32_t WC_EDITOR_OBJECT_SELECTION__WIDX_TAB_1 = 22; constexpr int32_t WC_STAFF__WIDX_PICKUP = 9; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE = 13; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_COPY = 16; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_PASTE = 15; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_SORT = 14; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_REMOVE = 10; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_UP = 11; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_DOWN = 12; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_X_INCREASE = 5; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_X_DECREASE = 6; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_Y_INCREASE = 8; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_Y_DECREASE = 9; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE = 15; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_COPY = 18; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_PASTE = 17; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_SORT = 16; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_REMOVE = 12; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_UP = 13; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_DOWN = 14; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_X_INCREASE = 6; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_X_DECREASE = 7; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_Y_INCREASE = 10; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_Y_DECREASE = 11; constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_SURFACE = EnumValue(TileInspectorPage::Surface); constexpr int32_t WC_TILE_INSPECTOR__WIDX_SURFACE_SPINNER_HEIGHT_INCREASE = 27; constexpr int32_t WC_TILE_INSPECTOR__WIDX_SURFACE_SPINNER_HEIGHT_DECREASE = 28;