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

Make rct_windowclass strong type WindowClass

This already revealed some places where implicit conversions were done, including some where its use was nonsense (MouseInput.cpp).
The changes to the Intent class were necessary to keep things working, and this splits things up more neatly.
This commit is contained in:
Hielke Morsink
2022-08-21 18:38:25 +02:00
committed by GitHub
parent ebe38a91ce
commit 7f29e4e39c
145 changed files with 1331 additions and 1235 deletions

View File

@@ -384,7 +384,7 @@ void WindowDropdownShowTextCustomWidth(
WindowDropdownClose();
// Create the window (width/height position are set later)
auto* w = WindowCreate<DropdownWindow>(WC_DROPDOWN, width, custom_height, WF_STICK_TO_FRONT);
auto* w = WindowCreate<DropdownWindow>(WindowClass::Dropdown, width, custom_height, WF_STICK_TO_FRONT);
if (w != nullptr)
{
w->SetTextItems(screenPos, extray, colour, custom_height, flags, num_items, width);
@@ -417,7 +417,7 @@ void WindowDropdownShowImage(
WindowDropdownClose();
// Create the window (width/height position are set later)
auto* w = WindowCreate<DropdownWindow>(WC_DROPDOWN, itemWidth, itemHeight, WF_STICK_TO_FRONT);
auto* w = WindowCreate<DropdownWindow>(WindowClass::Dropdown, itemWidth, itemHeight, WF_STICK_TO_FRONT);
if (w != nullptr)
{
w->SetImageItems({ x, y }, extray, colour, numItems, itemWidth, itemHeight, numColumns);
@@ -426,7 +426,7 @@ void WindowDropdownShowImage(
void WindowDropdownClose()
{
window_close_by_class(WC_DROPDOWN);
window_close_by_class(WindowClass::Dropdown);
}
/**
@@ -435,7 +435,7 @@ void WindowDropdownClose()
*/
int32_t DropdownIndexFromPoint(const ScreenCoordsXY& loc, rct_window* w)
{
if (w->classification == WC_DROPDOWN)
if (w->classification == WindowClass::Dropdown)
{
auto* ddWnd = static_cast<DropdownWindow*>(w);
return ddWnd->GetIndexFromPoint(loc);