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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user