Skip to content

Commit

Permalink
Rebase fixes, cheats height fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Gymnasiast committed Jan 25, 2025
1 parent 846b606 commit cb36e98
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/openrct2-ui/interface/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ namespace OpenRCT2
widgets[1].bottom += heightDifference;
widgets[2].bottom += heightDifference;

for (auto i = 3; widgets[i].type != WindowWidgetType::Last; i++)
for (size_t i = 3; i < widgets.size(); i++)
{
widgets[i].top += heightDifference;
widgets[i].bottom += heightDifference;
Expand Down
5 changes: 2 additions & 3 deletions src/openrct2-ui/windows/Cheats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,9 +754,8 @@ static StringId window_cheats_page_titles[] = {

Invalidate();
WindowInitScrollWidgets(*this);
setHeight(maxY);
widgets[WIDX_BACKGROUND].bottom = maxY - 1;
widgets[WIDX_PAGE_BACKGROUND].bottom = maxY - 1;
bodyHeight = maxY;
ResizeFrameWithPage();
Invalidate();
}

Expand Down
6 changes: 3 additions & 3 deletions src/openrct2-ui/windows/ScenarioSelect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace OpenRCT2::Ui::Windows

// clang-format off
static constexpr Widget _scenarioSelectWidgets[] = {
WINDOW_SHIM(kWindowTitle, kWindowWidth, kWindowHeight),
WINDOW_SHIM(kWindowTitle, kWindowWidth, kWindowBodyHeight),
MakeWidget({ kTabWidth + 1, kWidgetsStart }, { kWindowWidth, 284 }, WindowWidgetType::Resize, WindowColour::Secondary), // tab content panel
MakeRemapWidget({ 3, kTabsStart + (kTabHeight * 0) }, { kTabWidth, kTabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 01
MakeRemapWidget({ 3, kTabsStart + (kTabHeight * 1) }, { kTabWidth, kTabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 02
Expand Down Expand Up @@ -779,9 +779,9 @@ namespace OpenRCT2::Ui::Windows
int32_t screenWidth = ContextGetWidth();
int32_t screenHeight = ContextGetHeight();
ScreenCoordsXY screenPos = { (screenWidth - kWindowWidth) / 2,
std::max(kTopToolbarHeight + 1, (screenHeight - kWindowHeight) / 2) };
std::max(kTopToolbarHeight + 1, (screenHeight - kWindowBodyHeight) / 2) };
window = windowMgr->Create<ScenarioSelectWindow>(
WindowClass::ScenarioSelect, screenPos, kWindowWidth, kWindowHeight, 0, callback);
WindowClass::ScenarioSelect, screenPos, kWindowWidth, kWindowBodyHeight, 0, callback);
return window;
}
} // namespace OpenRCT2::Ui::Windows

0 comments on commit cb36e98

Please sign in to comment.