Rename global window functions to TitleCase (#19167)

This commit is contained in:
Hielke Morsink 2023-01-16 21:13:42 +01:00 committed by GitHub
parent 7f5934cc95
commit 6dafbbfb65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
150 changed files with 1713 additions and 1720 deletions

View File

@ -93,7 +93,7 @@ void TextComposition::HandleMessage(const SDL_Event* e)
Memory::Free(newText);
console.RefreshCaret(_session.SelectionStart);
window_update_textbox();
WindowUpdateTextbox();
}
break;
case SDL_KEYDOWN:
@ -126,7 +126,7 @@ void TextComposition::HandleMessage(const SDL_Event* e)
{
Clear();
console.RefreshCaret(_session.SelectionStart);
window_update_textbox();
WindowUpdateTextbox();
}
switch (key)
@ -141,7 +141,7 @@ void TextComposition::HandleMessage(const SDL_Event* e)
Delete();
console.RefreshCaret(_session.SelectionStart);
window_update_textbox();
WindowUpdateTextbox();
}
break;
case SDLK_HOME:
@ -160,11 +160,11 @@ void TextComposition::HandleMessage(const SDL_Event* e)
_session.SelectionStart = startOffset;
Delete();
console.RefreshCaret(_session.SelectionStart);
window_update_textbox();
WindowUpdateTextbox();
break;
}
case SDLK_RETURN:
window_cancel_textbox();
WindowCancelTextbox();
break;
case SDLK_LEFT:
CursorLeft();
@ -187,7 +187,7 @@ void TextComposition::HandleMessage(const SDL_Event* e)
utf8* text = SDL_GetClipboardText();
Insert(text);
SDL_free(text);
window_update_textbox();
WindowUpdateTextbox();
}
break;
}

View File

@ -548,7 +548,7 @@ public:
if (abs(gesturePixels) > tolerance)
{
_gestureRadius = 0;
main_window_zoom(gesturePixels > 0, true);
MainWindowZoom(gesturePixels > 0, true);
}
}
break;
@ -783,8 +783,8 @@ private:
uint32_t flags = SDL_GetWindowFlags(_window);
if ((flags & SDL_WINDOW_MINIMIZED) == 0)
{
window_resize_gui(_width, _height);
window_relocate_windows(_width, _height);
WindowResizeGui(_width, _height);
WindowRelocateWindows(_width, _height);
}
GfxInvalidateScreen();
@ -891,7 +891,7 @@ private:
int16_t bottom, DrawWeatherFunc drawFunc)
{
rct_window* w{};
auto itStart = window_get_iterator(original_w);
auto itStart = WindowGetIterator(original_w);
for (auto it = std::next(itStart);; it++)
{
if (it == g_window_list.end())

View File

@ -314,14 +314,14 @@ public:
case INTENT_ACTION_NEW_SCENERY:
{
// Check if window is already open
auto* window = window_bring_to_front_by_class(WindowClass::Scenery);
auto* window = WindowBringToFrontByClass(WindowClass::Scenery);
if (window == nullptr)
{
auto* tlbrWindow = window_find_by_class(WindowClass::TopToolbar);
auto* tlbrWindow = WindowFindByClass(WindowClass::TopToolbar);
if (tlbrWindow != nullptr)
{
tlbrWindow->Invalidate();
if (!tool_set(*tlbrWindow, WC_TOP_TOOLBAR__WIDX_SCENERY, Tool::Arrow))
if (!ToolSet(*tlbrWindow, WC_TOP_TOOLBAR__WIDX_SCENERY, Tool::Arrow))
{
input_set_flag(INPUT_FLAG_6, true);
window = WindowSceneryOpen();
@ -383,7 +383,7 @@ public:
case INTENT_ACTION_REFRESH_RIDE_LIST:
{
auto window = window_find_by_class(WindowClass::RideList);
auto window = WindowFindByClass(WindowClass::RideList);
if (window != nullptr)
{
WindowRideListRefreshList(window);
@ -399,10 +399,10 @@ public:
case INTENT_ACTION_RIDE_CONSTRUCTION_FOCUS:
{
auto rideIndex = intent.GetUIntExtra(INTENT_EXTRA_RIDE_ID);
auto w = window_find_by_class(WindowClass::RideConstruction);
auto w = WindowFindByClass(WindowClass::RideConstruction);
if (w == nullptr || w->number != rideIndex)
{
window_close_construction_windows();
WindowCloseConstructionWindows();
_currentRideIndex = RideId::FromUnderlying(rideIndex);
OpenWindow(WindowClass::RideConstruction);
}
@ -455,7 +455,7 @@ public:
case INTENT_ACTION_INVALIDATE_VEHICLE_WINDOW:
{
auto vehicle = static_cast<Vehicle*>(intent.GetPointerExtra(INTENT_EXTRA_VEHICLE));
auto* w = window_find_by_number(WindowClass::Ride, vehicle->ride.ToUnderlying());
auto* w = WindowFindByNumber(WindowClass::Ride, vehicle->ride.ToUnderlying());
if (w == nullptr)
return;
@ -474,7 +474,7 @@ public:
case INTENT_ACTION_RIDE_PAINT_RESET_VEHICLE:
{
auto rideIndex = intent.GetUIntExtra(INTENT_EXTRA_RIDE_ID);
auto w = window_find_by_number(WindowClass::Ride, rideIndex);
auto w = WindowFindByNumber(WindowClass::Ride, rideIndex);
if (w != nullptr)
{
if (w->page == 4) // WINDOW_RIDE_PAGE_COLOUR
@ -488,19 +488,19 @@ public:
case INTENT_ACTION_UPDATE_CLIMATE:
gToolbarDirtyFlags |= BTM_TB_DIRTY_FLAG_CLIMATE;
window_invalidate_by_class(WindowClass::GuestList);
WindowInvalidateByClass(WindowClass::GuestList);
break;
case INTENT_ACTION_UPDATE_GUEST_COUNT:
gToolbarDirtyFlags |= BTM_TB_DIRTY_FLAG_PEEP_COUNT;
window_invalidate_by_class(WindowClass::GuestList);
window_invalidate_by_class(WindowClass::ParkInformation);
WindowInvalidateByClass(WindowClass::GuestList);
WindowInvalidateByClass(WindowClass::ParkInformation);
WindowGuestListRefreshList();
break;
case INTENT_ACTION_UPDATE_PARK_RATING:
gToolbarDirtyFlags |= BTM_TB_DIRTY_FLAG_PARK_RATING;
window_invalidate_by_class(WindowClass::ParkInformation);
WindowInvalidateByClass(WindowClass::ParkInformation);
break;
case INTENT_ACTION_UPDATE_DATE:
@ -508,7 +508,7 @@ public:
break;
case INTENT_ACTION_UPDATE_CASH:
window_invalidate_by_class(WindowClass::Finances);
WindowInvalidateByClass(WindowClass::Finances);
gToolbarDirtyFlags |= BTM_TB_DIRTY_FLAG_MONEY;
break;
@ -516,7 +516,7 @@ public:
{
uint8_t bannerIndex = static_cast<uint8_t>(intent.GetUIntExtra(INTENT_EXTRA_BANNER_INDEX));
rct_window* w = window_find_by_number(WindowClass::Banner, bannerIndex);
rct_window* w = WindowFindByNumber(WindowClass::Banner, bannerIndex);
if (w != nullptr)
{
w->Invalidate();
@ -524,8 +524,8 @@ public:
break;
}
case INTENT_ACTION_UPDATE_RESEARCH:
window_invalidate_by_class(WindowClass::Finances);
window_invalidate_by_class(WindowClass::Research);
WindowInvalidateByClass(WindowClass::Finances);
WindowInvalidateByClass(WindowClass::Research);
break;
case INTENT_ACTION_TRACK_DESIGN_REMOVE_PROVISIONAL:
@ -589,10 +589,10 @@ public:
void SetMainView(const ScreenCoordsXY& viewPos, ZoomLevel zoom, int32_t rotation) override
{
auto mainWindow = window_get_main();
auto mainWindow = WindowGetMain();
if (mainWindow != nullptr)
{
auto viewport = window_get_viewport(mainWindow);
auto viewport = WindowGetViewport(mainWindow);
auto zoomDifference = zoom - viewport->zoom;
mainWindow->viewport_target_sprite = EntityId::GetNull();

View File

@ -325,8 +325,8 @@ public:
{
_drawingContext->CalculcateClipping(&_bitsDPI);
window_update_all_viewports();
window_draw_all(&_bitsDPI, 0, 0, _width, _height);
WindowUpdateAllViewports();
WindowDrawAll(&_bitsDPI, 0, 0, _width, _height);
}
void PaintWeather() override

View File

@ -112,10 +112,10 @@ void InputManager::HandleViewScrolling()
return;
// Shortcut scrolling
auto mainWindow = window_get_main();
auto mainWindow = WindowGetMain();
if (mainWindow != nullptr && (_viewScroll.x != 0 || _viewScroll.y != 0))
{
window_unfollow_sprite(*mainWindow);
WindowUnfollowSprite(*mainWindow);
}
InputScrollViewport(_viewScroll);
@ -197,7 +197,7 @@ void InputManager::Process(const InputEvent& e)
if (e.DeviceKind == InputDeviceKind::Keyboard)
{
auto w = window_find_by_class(WindowClass::Textinput);
auto w = WindowFindByClass(WindowClass::Textinput);
if (w != nullptr)
{
if (e.State == InputEventState::Release)
@ -386,7 +386,7 @@ bool InputManager::HasTextInputFocus() const
if (gUsingWidgetTextBox || gChatOpen)
return true;
auto w = window_find_by_class(WindowClass::Textinput);
auto w = WindowFindByClass(WindowClass::Textinput);
if (w != nullptr)
return true;

View File

@ -103,7 +103,7 @@ static void InputUpdateTooltip(rct_window* w, WidgetIndex widgetIndex, const Scr
*/
void GameHandleInput()
{
window_visit_each([](rct_window* w) { window_event_periodic_update_call(w); });
WindowVisitEach([](rct_window* w) { WindowEventPeriodicUpdateCall(w); });
InvalidateAllWindowsAfterInput();
@ -180,7 +180,7 @@ static void InputScrollDragBegin(const ScreenCoordsXY& screenCoords, rct_window*
_dragWidget.widget_index = widgetIndex;
_ticksSinceDragStart = 0;
_dragScrollIndex = window_get_scroll_data_index(*w, widgetIndex);
_dragScrollIndex = WindowGetScrollDataIndex(*w, widgetIndex);
ContextHideCursor();
}
@ -217,7 +217,7 @@ static void InputScrollDragContinue(const ScreenCoordsXY& screenCoords, rct_wind
}
WidgetScrollUpdateThumbs(*w, widgetIndex);
window_invalidate_by_number(w->classification, w->number);
WindowInvalidateByNumber(w->classification, w->number);
ScreenCoordsXY fixedCursorPosition = { static_cast<int32_t>(std::ceil(gInputDragLast.x * gConfigGeneral.WindowScale)),
static_cast<int32_t>(std::ceil(gInputDragLast.y * gConfigGeneral.WindowScale)) };
@ -231,7 +231,7 @@ static void InputScrollDragContinue(const ScreenCoordsXY& screenCoords, rct_wind
*/
static void InputScrollRight(const ScreenCoordsXY& screenCoords, MouseState state)
{
rct_window* w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number);
rct_window* w = WindowFindByNumber(_dragWidget.window_classification, _dragWidget.window_number);
if (w == nullptr)
{
ContextShowCursor();
@ -272,8 +272,8 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState
WidgetIndex widgetIndex;
// Get window and widget under cursor position
w = window_find_from_point(screenCoords);
widgetIndex = w == nullptr ? -1 : window_find_widget_from_point(*w, screenCoords);
w = WindowFindFromPoint(screenCoords);
widgetIndex = w == nullptr ? -1 : WindowFindWidgetFromPoint(*w, screenCoords);
widget = widgetIndex == -1 ? nullptr : &w->widgets[widgetIndex];
switch (_inputState)
@ -291,11 +291,11 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState
InputWidgetLeft(screenCoords, w, widgetIndex);
break;
case MouseState::RightPress:
window_close_by_class(WindowClass::Tooltip);
WindowCloseByClass(WindowClass::Tooltip);
if (w != nullptr)
{
w = window_bring_to_front(*w);
w = WindowBringToFront(*w);
}
if (widgetIndex != -1)
@ -326,7 +326,7 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState
InputStateWidgetPressed(screenCoords, state, widgetIndex, w, widget);
break;
case InputState::PositioningWindow:
w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number);
w = WindowFindByNumber(_dragWidget.window_classification, _dragWidget.window_number);
if (w == nullptr)
{
_inputState = InputState::Reset;
@ -359,7 +359,7 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState
InputStateWidgetPressed(screenCoords, state, widgetIndex, w, widget);
break;
case InputState::ViewportLeft:
w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number);
w = WindowFindByNumber(_dragWidget.window_classification, _dragWidget.window_number);
if (w == nullptr)
{
_inputState = InputState::Reset;
@ -384,13 +384,13 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState
break;
}
w = window_find_by_number(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number);
w = WindowFindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number);
if (w == nullptr)
{
break;
}
window_event_tool_drag_call(w, gCurrentToolWidget.widget_index, screenCoords);
WindowEventToolDragCall(w, gCurrentToolWidget.widget_index, screenCoords);
break;
case MouseState::LeftRelease:
_inputState = InputState::Reset;
@ -398,11 +398,10 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState
{
if ((_inputFlags & INPUT_FLAG_TOOL_ACTIVE))
{
w = window_find_by_number(
gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number);
w = WindowFindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number);
if (w != nullptr)
{
window_event_tool_up_call(w, gCurrentToolWidget.widget_index, screenCoords);
WindowEventToolUpCall(w, gCurrentToolWidget.widget_index, screenCoords);
}
}
else if (!(_inputFlags & INPUT_FLAG_4))
@ -435,7 +434,7 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState
}
break;
case InputState::Resizing:
w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number);
w = WindowFindByNumber(_dragWidget.window_classification, _dragWidget.window_number);
if (w == nullptr)
{
_inputState = InputState::Reset;
@ -475,7 +474,7 @@ static void InputWindowPositionContinue(
int32_t snapProximity;
snapProximity = (w.flags & WF_NO_SNAPPING) ? 0 : gConfigGeneral.WindowSnapProximity;
window_move_and_snap(w, newScreenCoords - lastScreenCoords, snapProximity);
WindowMoveAndSnap(w, newScreenCoords - lastScreenCoords, snapProximity);
}
static void InputWindowPositionEnd(rct_window& w, const ScreenCoordsXY& screenCoords)
@ -483,7 +482,7 @@ static void InputWindowPositionEnd(rct_window& w, const ScreenCoordsXY& screenCo
_inputState = InputState::Normal;
gTooltipTimeout = 0;
gTooltipWidget = _dragWidget;
window_event_moved_call(&w, screenCoords);
WindowEventMovedCall(&w, screenCoords);
}
static void InputWindowResizeBegin(rct_window& w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords)
@ -505,7 +504,7 @@ static void InputWindowResizeContinue(rct_window& w, const ScreenCoordsXY& scree
int32_t targetWidth = _originalWindowWidth + differentialCoords.x - w.width;
int32_t targetHeight = _originalWindowHeight + differentialCoords.y - w.height;
window_resize(w, targetWidth, targetHeight);
WindowResize(w, targetWidth, targetHeight);
}
}
@ -534,7 +533,7 @@ static void InputViewportDragBegin(rct_window& w)
ContextHideCursor();
}
window_unfollow_sprite(w);
WindowUnfollowSprite(w);
// gInputFlags |= INPUT_FLAG_5;
}
@ -547,7 +546,7 @@ static void InputViewportDragContinue()
const CursorState* cursorState = ContextGetCursorState();
auto differentialCoords = newDragCoords - gInputDragLast;
w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number);
w = WindowFindByNumber(_dragWidget.window_classification, _dragWidget.window_number);
// #3294: Window can be closed during a drag session, so just finish
// the session if the window no longer exists
@ -624,10 +623,10 @@ static void InputScrollBegin(rct_window& w, WidgetIndex widgetIndex, const Scree
_currentScrollArea = scroll_area;
_currentScrollIndex = scroll_id;
window_event_scroll_select_call(&w, scroll_id, scroll_area);
WindowEventScrollSelectCall(&w, scroll_id, scroll_area);
if (scroll_area == SCROLL_PART_VIEW)
{
window_event_scroll_mousedown_call(&w, scroll_id, scrollCoords);
WindowEventScrollMousedownCall(&w, scroll_id, scrollCoords);
return;
}
@ -674,7 +673,7 @@ static void InputScrollBegin(rct_window& w, WidgetIndex widgetIndex, const Scree
break;
}
WidgetScrollUpdateThumbs(w, widgetIndex);
window_invalidate_by_number(w.classification, w.number);
WindowInvalidateByNumber(w.classification, w.number);
}
static void InputScrollContinue(rct_window& w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords)
@ -717,7 +716,7 @@ static void InputScrollContinue(rct_window& w, WidgetIndex widgetIndex, const Sc
switch (scroll_part)
{
case SCROLL_PART_VIEW:
window_event_scroll_mousedrag_call(&w, scroll_id, newScreenCoords);
WindowEventScrollMousedragCall(&w, scroll_id, newScreenCoords);
break;
case SCROLL_PART_HSCROLLBAR_LEFT:
InputScrollPartUpdateHLeft(w, widgetIndex, scroll_id);
@ -749,7 +748,7 @@ static void InputScrollPartUpdateHThumb(rct_window& w, WidgetIndex widgetIndex,
const auto& widget = w.widgets[widgetIndex];
auto& scroll = w.scrolls[scroll_id];
if (window_find_by_number(w.classification, w.number) != nullptr)
if (WindowFindByNumber(w.classification, w.number) != nullptr)
{
int32_t newLeft;
newLeft = scroll.h_right;
@ -775,7 +774,7 @@ static void InputScrollPartUpdateHThumb(rct_window& w, WidgetIndex widgetIndex,
newLeft = x;
scroll.h_left = newLeft;
WidgetScrollUpdateThumbs(w, widgetIndex);
widget_invalidate_by_number(w.classification, w.number, widgetIndex);
WidgetInvalidateByNumber(w.classification, w.number, widgetIndex);
}
}
@ -788,7 +787,7 @@ static void InputScrollPartUpdateVThumb(rct_window& w, WidgetIndex widgetIndex,
const auto& widget = w.widgets[widgetIndex];
auto& scroll = w.scrolls[scroll_id];
if (window_find_by_number(w.classification, w.number) != nullptr)
if (WindowFindByNumber(w.classification, w.number) != nullptr)
{
int32_t newTop;
newTop = scroll.v_bottom;
@ -814,7 +813,7 @@ static void InputScrollPartUpdateVThumb(rct_window& w, WidgetIndex widgetIndex,
newTop = y;
scroll.v_top = newTop;
WidgetScrollUpdateThumbs(w, widgetIndex);
widget_invalidate_by_number(w.classification, w.number, widgetIndex);
WidgetInvalidateByNumber(w.classification, w.number, widgetIndex);
}
}
@ -824,14 +823,14 @@ static void InputScrollPartUpdateVThumb(rct_window& w, WidgetIndex widgetIndex,
*/
static void InputScrollPartUpdateHLeft(rct_window& w, WidgetIndex widgetIndex, int32_t scroll_id)
{
if (window_find_by_number(w.classification, w.number) != nullptr)
if (WindowFindByNumber(w.classification, w.number) != nullptr)
{
auto& scroll = w.scrolls[scroll_id];
scroll.flags |= HSCROLLBAR_LEFT_PRESSED;
if (scroll.h_left >= 3)
scroll.h_left -= 3;
WidgetScrollUpdateThumbs(w, widgetIndex);
widget_invalidate_by_number(w.classification, w.number, widgetIndex);
WidgetInvalidateByNumber(w.classification, w.number, widgetIndex);
}
}
@ -842,7 +841,7 @@ static void InputScrollPartUpdateHLeft(rct_window& w, WidgetIndex widgetIndex, i
static void InputScrollPartUpdateHRight(rct_window& w, WidgetIndex widgetIndex, int32_t scroll_id)
{
const auto& widget = w.widgets[widgetIndex];
if (window_find_by_number(w.classification, w.number) != nullptr)
if (WindowFindByNumber(w.classification, w.number) != nullptr)
{
auto& scroll = w.scrolls[scroll_id];
scroll.flags |= HSCROLLBAR_RIGHT_PRESSED;
@ -857,7 +856,7 @@ static void InputScrollPartUpdateHRight(rct_window& w, WidgetIndex widgetIndex,
if (scroll.h_left > newLeft)
scroll.h_left = newLeft;
WidgetScrollUpdateThumbs(w, widgetIndex);
widget_invalidate_by_number(w.classification, w.number, widgetIndex);
WidgetInvalidateByNumber(w.classification, w.number, widgetIndex);
}
}
@ -867,14 +866,14 @@ static void InputScrollPartUpdateHRight(rct_window& w, WidgetIndex widgetIndex,
*/
static void InputScrollPartUpdateVTop(rct_window& w, WidgetIndex widgetIndex, int32_t scroll_id)
{
if (window_find_by_number(w.classification, w.number) != nullptr)
if (WindowFindByNumber(w.classification, w.number) != nullptr)
{
auto& scroll = w.scrolls[scroll_id];
scroll.flags |= VSCROLLBAR_UP_PRESSED;
if (scroll.v_top >= 3)
scroll.v_top -= 3;
WidgetScrollUpdateThumbs(w, widgetIndex);
widget_invalidate_by_number(w.classification, w.number, widgetIndex);
WidgetInvalidateByNumber(w.classification, w.number, widgetIndex);
}
}
@ -885,7 +884,7 @@ static void InputScrollPartUpdateVTop(rct_window& w, WidgetIndex widgetIndex, in
static void InputScrollPartUpdateVBottom(rct_window& w, WidgetIndex widgetIndex, int32_t scroll_id)
{
const auto& widget = w.widgets[widgetIndex];
if (window_find_by_number(w.classification, w.number) != nullptr)
if (WindowFindByNumber(w.classification, w.number) != nullptr)
{
auto& scroll = w.scrolls[scroll_id];
scroll.flags |= VSCROLLBAR_DOWN_PRESSED;
@ -900,7 +899,7 @@ static void InputScrollPartUpdateVBottom(rct_window& w, WidgetIndex widgetIndex,
if (scroll.v_top > newTop)
scroll.v_top = newTop;
WidgetScrollUpdateThumbs(w, widgetIndex);
widget_invalidate_by_number(w.classification, w.number, widgetIndex);
WidgetInvalidateByNumber(w.classification, w.number, widgetIndex);
}
}
@ -937,7 +936,7 @@ static void InputWidgetOver(const ScreenCoordsXY& screenCoords, rct_window* w, W
WindowTooltipClose();
else
{
window_event_scroll_mouseover_call(w, scrollId, newScreenCoords);
WindowEventScrollMouseoverCall(w, scrollId, newScreenCoords);
InputUpdateTooltip(w, widgetIndex, screenCoords);
}
}
@ -981,14 +980,13 @@ static void InputWidgetOverChangeCheck(WindowClass windowClass, rct_windownumber
*/
static void InputWidgetOverFlatbuttonInvalidate()
{
rct_window* w = window_find_by_number(gHoverWidget.window_classification, gHoverWidget.window_number);
rct_window* w = WindowFindByNumber(gHoverWidget.window_classification, gHoverWidget.window_number);
if (w != nullptr)
{
window_event_invalidate_call(w);
WindowEventInvalidateCall(w);
if (w->widgets[gHoverWidget.widget_index].type == WindowWidgetType::FlatBtn)
{
widget_invalidate_by_number(
gHoverWidget.window_classification, gHoverWidget.window_number, gHoverWidget.widget_index);
WidgetInvalidateByNumber(gHoverWidget.window_classification, gHoverWidget.window_number, gHoverWidget.widget_index);
}
}
}
@ -1008,22 +1006,22 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, rct_window* w, W
windowNumber = w->number;
}
window_close_by_class(WindowClass::Error);
window_close_by_class(WindowClass::Tooltip);
WindowCloseByClass(WindowClass::Error);
WindowCloseByClass(WindowClass::Tooltip);
// Window might have changed position in the list, therefore find it again
w = window_find_by_number(windowClass, windowNumber);
w = WindowFindByNumber(windowClass, windowNumber);
if (w == nullptr)
return;
w = window_bring_to_front(*w);
w = WindowBringToFront(*w);
if (widgetIndex == -1)
return;
if (windowClass != gCurrentTextBox.window.classification || windowNumber != gCurrentTextBox.window.number
|| widgetIndex != gCurrentTextBox.widget_index)
{
window_cancel_textbox();
WindowCancelTextbox();
}
const auto& widget = w->widgets[widgetIndex];
@ -1032,7 +1030,7 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, rct_window* w, W
{
case WindowWidgetType::Frame:
case WindowWidgetType::Resize:
if (window_can_resize(*w)
if (WindowCanResize(*w)
&& (screenCoords.x >= w->windowPos.x + w->width - 19 && screenCoords.y >= w->windowPos.y + w->height - 19))
InputWindowResizeBegin(*w, widgetIndex, screenCoords);
break;
@ -1043,11 +1041,11 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, rct_window* w, W
_dragWidget.window_number = windowNumber;
if (_inputFlags & INPUT_FLAG_TOOL_ACTIVE)
{
w = window_find_by_number(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number);
w = WindowFindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number);
if (w != nullptr)
{
input_set_flag(INPUT_FLAG_4, true);
window_event_tool_down_call(w, gCurrentToolWidget.widget_index, screenCoords);
WindowEventToolDownCall(w, gCurrentToolWidget.widget_index, screenCoords);
}
}
break;
@ -1090,8 +1088,8 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, rct_window* w, W
_inputState = InputState::WidgetPressed;
_clickRepeatTicks = 1;
widget_invalidate_by_number(windowClass, windowNumber, widgetIndex);
window_event_mouse_down_call(w, widgetIndex);
WidgetInvalidateByNumber(windowClass, windowNumber, widgetIndex);
WindowEventMouseDownCall(w, widgetIndex);
}
break;
}
@ -1111,11 +1109,11 @@ void ProcessMouseOver(const ScreenCoordsXY& screenCoords)
auto ft = Formatter();
ft.Add<StringId>(STR_NONE);
SetMapTooltip(ft);
window = window_find_from_point(screenCoords);
window = WindowFindFromPoint(screenCoords);
if (window != nullptr)
{
WidgetIndex widgetId = window_find_widget_from_point(*window, screenCoords);
WidgetIndex widgetId = WindowFindWidgetFromPoint(*window, screenCoords);
if (widgetId != -1)
{
switch (window->widgets[widgetId].type)
@ -1162,13 +1160,13 @@ void ProcessMouseOver(const ScreenCoordsXY& screenCoords)
break;
}
// Same as default but with scroll_x/y
cursorId = window_event_cursor_call(window, widgetId, scrollCoords);
cursorId = WindowEventCursorCall(window, widgetId, scrollCoords);
if (cursorId == CursorID::Undefined)
cursorId = CursorID::Arrow;
break;
}
default:
cursorId = window_event_cursor_call(window, widgetId, screenCoords);
cursorId = WindowEventCursorCall(window, widgetId, screenCoords);
if (cursorId == CursorID::Undefined)
cursorId = CursorID::Arrow;
break;
@ -1188,12 +1186,12 @@ void ProcessMouseTool(const ScreenCoordsXY& screenCoords)
{
if (_inputFlags & INPUT_FLAG_TOOL_ACTIVE)
{
rct_window* w = window_find_by_number(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number);
rct_window* w = WindowFindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number);
if (w == nullptr)
tool_cancel();
ToolCancel();
else if (input_get_state() != InputState::ViewportRight)
window_event_tool_update_call(w, gCurrentToolWidget.widget_index, screenCoords);
WindowEventToolUpdateCall(w, gCurrentToolWidget.widget_index, screenCoords);
}
}
@ -1210,7 +1208,7 @@ void InputStateWidgetPressed(
cursor_w_number = gPressedWidget.window_number;
WidgetIndex cursor_widgetIndex = gPressedWidget.widget_index;
rct_window* cursor_w = window_find_by_number(cursor_w_class, cursor_w_number);
rct_window* cursor_w = WindowFindByNumber(cursor_w_class, cursor_w_number);
if (cursor_w == nullptr)
{
_inputState = InputState::Reset;
@ -1256,7 +1254,7 @@ void InputStateWidgetPressed(
{
if (WidgetIsHoldable(*w, widgetIndex))
{
window_event_mouse_down_call(w, widgetIndex);
WindowEventMouseDownCall(w, widgetIndex);
}
}
}
@ -1266,13 +1264,13 @@ void InputStateWidgetPressed(
if (_inputState == InputState::DropdownActive)
{
gDropdownHighlightedIndex = gDropdownDefaultIndex;
window_invalidate_by_class(WindowClass::Dropdown);
WindowInvalidateByClass(WindowClass::Dropdown);
}
return;
}
_inputFlags |= INPUT_FLAG_WIDGET_PRESSED;
widget_invalidate_by_number(cursor_w_class, cursor_w_number, widgetIndex);
WidgetInvalidateByNumber(cursor_w_class, cursor_w_number, widgetIndex);
return;
case MouseState::LeftRelease:
case MouseState::RightPress:
@ -1314,20 +1312,20 @@ void InputStateWidgetPressed(
}
}
window_close_by_class(WindowClass::Dropdown);
WindowCloseByClass(WindowClass::Dropdown);
if (dropdownCleanup)
{
// Update w as it will be invalid after closing the dropdown window
w = window_find_by_number(wClass, wNumber);
w = WindowFindByNumber(wClass, wNumber);
}
else
{
cursor_w = window_find_by_number(cursor_w_class, cursor_w_number);
cursor_w = WindowFindByNumber(cursor_w_class, cursor_w_number);
if (_inputFlags & INPUT_FLAG_WIDGET_PRESSED)
{
_inputFlags &= ~INPUT_FLAG_WIDGET_PRESSED;
widget_invalidate_by_number(cursor_w_class, cursor_w_number, cursor_widgetIndex);
WidgetInvalidateByNumber(cursor_w_class, cursor_w_number, cursor_widgetIndex);
}
_inputState = InputState::Normal;
@ -1343,7 +1341,7 @@ void InputStateWidgetPressed(
dropdown_index = gDropdownDefaultIndex;
}
}
window_event_dropdown_call(cursor_w, cursor_widgetIndex, dropdown_index);
WindowEventDropdownCall(cursor_w, cursor_widgetIndex, dropdown_index);
}
}
}
@ -1374,8 +1372,8 @@ void InputStateWidgetPressed(
if (WidgetIsDisabled(*w, widgetIndex))
break;
widget_invalidate_by_number(cursor_w_class, cursor_w_number, widgetIndex);
window_event_mouse_up_call(w, widgetIndex);
WidgetInvalidateByNumber(cursor_w_class, cursor_w_number, widgetIndex);
WindowEventMouseUpCall(w, widgetIndex);
return;
default:
@ -1389,13 +1387,13 @@ void InputStateWidgetPressed(
if (_inputFlags & INPUT_FLAG_WIDGET_PRESSED)
{
_inputFlags &= ~INPUT_FLAG_WIDGET_PRESSED;
widget_invalidate_by_number(cursor_w_class, cursor_w_number, cursor_widgetIndex);
WidgetInvalidateByNumber(cursor_w_class, cursor_w_number, cursor_widgetIndex);
}
return;
}
gDropdownHighlightedIndex = -1;
window_invalidate_by_class(WindowClass::Dropdown);
WindowInvalidateByClass(WindowClass::Dropdown);
if (w == nullptr)
{
return;
@ -1462,7 +1460,7 @@ void InputStateWidgetPressed(
}
gDropdownHighlightedIndex = dropdown_index;
window_invalidate_by_class(WindowClass::Dropdown);
WindowInvalidateByClass(WindowClass::Dropdown);
}
else
{
@ -1502,7 +1500,7 @@ static void InputUpdateTooltip(rct_window* w, WidgetIndex widgetIndex, const Scr
gTooltipTimeout += gCurrentDeltaTime;
if (gTooltipTimeout >= 8000)
{
window_close_by_class(WindowClass::Tooltip);
WindowCloseByClass(WindowClass::Tooltip);
}
}
}
@ -1552,12 +1550,12 @@ void SetCursor(CursorID cursor_id)
*/
void InvalidateScroll()
{
rct_window* w = window_find_by_number(gPressedWidget.window_classification, gPressedWidget.window_number);
rct_window* w = WindowFindByNumber(gPressedWidget.window_classification, gPressedWidget.window_number);
if (w != nullptr)
{
// Reset to basic scroll
w->scrolls[_currentScrollIndex].flags &= 0xFF11;
window_invalidate_by_number(gPressedWidget.window_classification, gPressedWidget.window_number);
WindowInvalidateByNumber(gPressedWidget.window_classification, gPressedWidget.window_number);
}
}
@ -1586,7 +1584,7 @@ void GameHandleEdgeScroll()
rct_window* mainWindow;
int32_t scrollX, scrollY;
mainWindow = window_get_main();
mainWindow = WindowGetMain();
if (mainWindow == nullptr)
return;
if ((mainWindow->flags & WF_NO_SCROLLING) || (gScreenFlags & (SCREEN_FLAGS_TRACK_MANAGER | SCREEN_FLAGS_TITLE_DEMO)))
@ -1622,7 +1620,7 @@ bool InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER modifier)
void InputScrollViewport(const ScreenCoordsXY& scrollScreenCoords)
{
rct_window* mainWindow = window_get_main();
rct_window* mainWindow = WindowGetMain();
rct_viewport* viewport = mainWindow->viewport;
const int32_t speed = gConfigGeneral.EdgeScrollingSpeed;

View File

@ -173,7 +173,7 @@ void ShortcutManager::ProcessEvent(const InputEvent& e)
shortcut->Current.push_back(std::move(shortcutInput.value()));
}
_pendingShortcutChange.clear();
window_close_by_class(WindowClass::ChangeKeyboardShortcut);
WindowCloseByClass(WindowClass::ChangeKeyboardShortcut);
SaveUserBindings();
}
}

View File

@ -57,10 +57,10 @@ static void RotateCamera(int32_t direction)
{
if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO))
{
auto window = window_get_main();
auto window = WindowGetMain();
if (window != nullptr)
{
window_rotate_camera(*window, direction);
WindowRotateCamera(*window, direction);
}
}
}
@ -69,7 +69,7 @@ static void ToggleViewFlag(int32_t viewportFlag)
{
if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO))
{
auto window = window_get_main();
auto window = WindowGetMain();
if (window != nullptr)
{
window->viewport->flags ^= viewportFlag;
@ -84,60 +84,60 @@ static void ShortcutRotateConstructionObject()
return;
// Rotate scenery
rct_window* w = window_find_by_class(WindowClass::Scenery);
rct_window* w = WindowFindByClass(WindowClass::Scenery);
if (w != nullptr && !WidgetIsDisabled(*w, WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON)
&& w->widgets[WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type != WindowWidgetType::Empty)
{
window_event_mouse_up_call(w, WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON);
WindowEventMouseUpCall(w, WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON);
return;
}
// Rotate construction track piece
w = window_find_by_class(WindowClass::RideConstruction);
w = WindowFindByClass(WindowClass::RideConstruction);
if (w != nullptr && !WidgetIsDisabled(*w, WC_RIDE_CONSTRUCTION__WIDX_ROTATE)
&& w->widgets[WC_RIDE_CONSTRUCTION__WIDX_ROTATE].type != WindowWidgetType::Empty)
{
// Check if building a maze...
if (w->widgets[WC_RIDE_CONSTRUCTION__WIDX_ROTATE].tooltip != STR_RIDE_CONSTRUCTION_BUILD_MAZE_IN_THIS_DIRECTION_TIP)
{
window_event_mouse_up_call(w, WC_RIDE_CONSTRUCTION__WIDX_ROTATE);
WindowEventMouseUpCall(w, WC_RIDE_CONSTRUCTION__WIDX_ROTATE);
return;
}
}
// Rotate track design preview
w = window_find_by_class(WindowClass::TrackDesignList);
w = WindowFindByClass(WindowClass::TrackDesignList);
if (w != nullptr && !WidgetIsDisabled(*w, WC_TRACK_DESIGN_LIST__WIDX_ROTATE)
&& w->widgets[WC_TRACK_DESIGN_LIST__WIDX_ROTATE].type != WindowWidgetType::Empty)
{
window_event_mouse_up_call(w, WC_TRACK_DESIGN_LIST__WIDX_ROTATE);
WindowEventMouseUpCall(w, WC_TRACK_DESIGN_LIST__WIDX_ROTATE);
return;
}
// Rotate track design placement
w = window_find_by_class(WindowClass::TrackDesignPlace);
w = WindowFindByClass(WindowClass::TrackDesignPlace);
if (w != nullptr && !WidgetIsDisabled(*w, WC_TRACK_DESIGN_PLACE__WIDX_ROTATE)
&& w->widgets[WC_TRACK_DESIGN_PLACE__WIDX_ROTATE].type != WindowWidgetType::Empty)
{
window_event_mouse_up_call(w, WC_TRACK_DESIGN_PLACE__WIDX_ROTATE);
WindowEventMouseUpCall(w, WC_TRACK_DESIGN_PLACE__WIDX_ROTATE);
return;
}
// Rotate park entrance
w = window_find_by_class(WindowClass::Map);
w = WindowFindByClass(WindowClass::Map);
if (w != nullptr && !WidgetIsDisabled(*w, WC_MAP__WIDX_ROTATE_90)
&& w->widgets[WC_MAP__WIDX_ROTATE_90].type != WindowWidgetType::Empty)
{
window_event_mouse_up_call(w, WC_MAP__WIDX_ROTATE_90);
WindowEventMouseUpCall(w, WC_MAP__WIDX_ROTATE_90);
return;
}
// Rotate selected element in tile inspector
w = window_find_by_class(WindowClass::TileInspector);
w = WindowFindByClass(WindowClass::TileInspector);
if (w != nullptr && !WidgetIsDisabled(*w, WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE)
&& w->widgets[WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE].type != WindowWidgetType::Empty)
{
window_event_mouse_up_call(w, WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE);
WindowEventMouseUpCall(w, WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE);
return;
}
}
@ -146,12 +146,12 @@ static void ShortcutRemoveTopBottomToolbarToggle()
{
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
{
if (window_find_by_class(WindowClass::TitleLogo) != nullptr)
if (WindowFindByClass(WindowClass::TitleLogo) != nullptr)
{
window_close(*window_find_by_class(WindowClass::TitleLogo));
window_close(*window_find_by_class(WindowClass::TitleOptions));
window_close(*window_find_by_class(WindowClass::TitleMenu));
window_close(*window_find_by_class(WindowClass::TitleExit));
WindowClose(*WindowFindByClass(WindowClass::TitleLogo));
WindowClose(*WindowFindByClass(WindowClass::TitleOptions));
WindowClose(*WindowFindByClass(WindowClass::TitleMenu));
WindowClose(*WindowFindByClass(WindowClass::TitleExit));
title_set_hide_version_info(true);
}
else
@ -161,11 +161,11 @@ static void ShortcutRemoveTopBottomToolbarToggle()
}
else
{
if (window_find_by_class(WindowClass::TopToolbar) != nullptr)
if (WindowFindByClass(WindowClass::TopToolbar) != nullptr)
{
window_close(*window_find_by_class(WindowClass::Dropdown));
window_close(*window_find_by_class(WindowClass::TopToolbar));
window_close(*window_find_by_class(WindowClass::BottomToolbar));
WindowClose(*WindowFindByClass(WindowClass::Dropdown));
WindowClose(*WindowFindByClass(WindowClass::TopToolbar));
WindowClose(*WindowFindByClass(WindowClass::BottomToolbar));
}
else
{
@ -193,11 +193,11 @@ static void ShortcutAdjustLand()
{
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
{
rct_window* window = window_find_by_class(WindowClass::TopToolbar);
rct_window* window = WindowFindByClass(WindowClass::TopToolbar);
if (window != nullptr)
{
window->Invalidate();
window_event_mouse_up_call(window, WC_TOP_TOOLBAR__WIDX_LAND);
WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_LAND);
}
}
}
@ -212,11 +212,11 @@ static void ShortcutAdjustWater()
{
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
{
rct_window* window = window_find_by_class(WindowClass::TopToolbar);
rct_window* window = WindowFindByClass(WindowClass::TopToolbar);
if (window != nullptr)
{
window->Invalidate();
window_event_mouse_up_call(window, WC_TOP_TOOLBAR__WIDX_WATER);
WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_WATER);
}
}
}
@ -231,11 +231,11 @@ static void ShortcutBuildScenery()
{
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
{
rct_window* window = window_find_by_class(WindowClass::TopToolbar);
rct_window* window = WindowFindByClass(WindowClass::TopToolbar);
if (window != nullptr)
{
window->Invalidate();
window_event_mouse_up_call(window, WC_TOP_TOOLBAR__WIDX_SCENERY);
WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_SCENERY);
}
}
}
@ -250,11 +250,11 @@ static void ShortcutBuildPaths()
{
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
{
rct_window* window = window_find_by_class(WindowClass::TopToolbar);
rct_window* window = WindowFindByClass(WindowClass::TopToolbar);
if (window != nullptr)
{
window->Invalidate();
window_event_mouse_up_call(window, WC_TOP_TOOLBAR__WIDX_PATH);
WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_PATH);
}
}
}
@ -382,10 +382,10 @@ static void ShortcutOpenCheatWindow()
return;
// Check if window is already open
rct_window* window = window_find_by_class(WindowClass::Cheats);
rct_window* window = WindowFindByClass(WindowClass::Cheats);
if (window != nullptr)
{
window_close(*window);
WindowClose(*window);
return;
}
ContextOpenWindow(WindowClass::Cheats);
@ -408,11 +408,11 @@ static void ShortcutClearScenery()
{
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
{
rct_window* window = window_find_by_class(WindowClass::TopToolbar);
rct_window* window = WindowFindByClass(WindowClass::TopToolbar);
if (window != nullptr)
{
window->Invalidate();
window_event_mouse_up_call(window, WC_TOP_TOOLBAR__WIDX_CLEAR_SCENERY);
WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_CLEAR_SCENERY);
}
}
}
@ -423,7 +423,7 @@ static void ShortcutQuickSaveGame()
// Do a quick save in playing mode and a regular save in Scenario Editor mode. In other cases, don't do anything.
if (gScreenFlags == SCREEN_FLAGS_PLAYING)
{
tool_cancel();
ToolCancel();
save_game();
}
else if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
@ -450,23 +450,23 @@ static void ShortcutOpenSceneryPicker()
|| (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR && gEditorStep != EditorStep::LandscapeEditor))
return;
rct_window* window_scenery = window_find_by_class(WindowClass::Scenery);
rct_window* window_scenery = WindowFindByClass(WindowClass::Scenery);
if (window_scenery == nullptr)
{
rct_window* window_toolbar = window_find_by_class(WindowClass::TopToolbar);
rct_window* window_toolbar = WindowFindByClass(WindowClass::TopToolbar);
if (window_toolbar != nullptr)
{
window_toolbar->Invalidate();
window_event_mouse_up_call(window_toolbar, WC_TOP_TOOLBAR__WIDX_SCENERY);
WindowEventMouseUpCall(window_toolbar, WC_TOP_TOOLBAR__WIDX_SCENERY);
}
}
window_scenery = window_find_by_class(WindowClass::Scenery);
window_scenery = WindowFindByClass(WindowClass::Scenery);
if (window_scenery != nullptr && !WidgetIsDisabled(*window_scenery, WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON)
&& window_scenery->widgets[WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON].type != WindowWidgetType::Empty
&& !gWindowSceneryEyedropperEnabled)
{
window_event_mouse_up_call(window_scenery, WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON);
WindowEventMouseUpCall(window_scenery, WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON);
return;
}
}
@ -493,19 +493,19 @@ static void ShortcutScaleDown()
// Tile inspector shortcuts
static void TileInspectorMouseUp(WidgetIndex widgetIndex)
{
auto w = window_find_by_class(WindowClass::TileInspector);
auto w = WindowFindByClass(WindowClass::TileInspector);
if (w != nullptr && !WidgetIsDisabled(*w, widgetIndex) && w->widgets[widgetIndex].type != WindowWidgetType::Empty)
{
window_event_mouse_up_call(w, widgetIndex);
WindowEventMouseUpCall(w, widgetIndex);
}
}
static void TileInspectorMouseDown(WidgetIndex widgetIndex)
{
auto w = window_find_by_class(WindowClass::TileInspector);
auto w = WindowFindByClass(WindowClass::TileInspector);
if (w != nullptr && !WidgetIsDisabled(*w, widgetIndex) && w->widgets[widgetIndex].type != WindowWidgetType::Empty)
{
window_event_mouse_down_call(w, widgetIndex);
WindowEventMouseDownCall(w, widgetIndex);
}
}
@ -515,7 +515,7 @@ static void ShortcutToggleVisibility()
if (windowTileInspectorSelectedIndex < 0)
return;
rct_window* w = window_find_by_class(WindowClass::TileInspector);
rct_window* w = WindowFindByClass(WindowClass::TileInspector);
if (w == nullptr)
return;
@ -530,7 +530,7 @@ static void ShortcutToggleVisibility()
static void ShortcutIncreaseElementHeight()
{
rct_window* w = window_find_by_class(WindowClass::TileInspector);
rct_window* w = WindowFindByClass(WindowClass::TileInspector);
if (w != nullptr)
{
int action = -1;
@ -564,14 +564,14 @@ static void ShortcutIncreaseElementHeight()
break;
}
if (action != -1 && !WidgetIsDisabled(*w, action) && w->widgets[action].type != WindowWidgetType::Empty)
window_event_mouse_down_call(w, action);
WindowEventMouseDownCall(w, action);
return;
}
}
static void ShortcutDecreaseElementHeight()
{
rct_window* w = window_find_by_class(WindowClass::TileInspector);
rct_window* w = WindowFindByClass(WindowClass::TileInspector);
if (w != nullptr)
{
int action = -1;
@ -605,7 +605,7 @@ static void ShortcutDecreaseElementHeight()
break;
}
if (action != -1 && !WidgetIsDisabled(*w, action) && w->widgets[action].type != WindowWidgetType::Empty)
window_event_mouse_down_call(w, action);
WindowEventMouseDownCall(w, action);
return;
}
}
@ -625,7 +625,7 @@ static void ShortcutToggleConsole()
}
else if (gConfigGeneral.DebuggingTools && !ContextIsInputActive())
{
window_cancel_textbox();
WindowCancelTextbox();
console.Toggle();
}
}
@ -635,14 +635,14 @@ static void ShortcutConstructionTurnLeft()
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
return;
rct_window* window = window_find_by_class(WindowClass::Footpath);
rct_window* window = WindowFindByClass(WindowClass::Footpath);
if (window != nullptr)
{
window_footpath_keyboard_shortcut_turn_left();
WindowFootpathKeyboardShortcutTurnLeft();
}
else
{
window_ride_construction_keyboard_shortcut_turn_left();
WindowRideConstructionKeyboardShortcutTurnLeft();
}
}
@ -650,14 +650,14 @@ static void ShortcutConstructionTurnRight()
{
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
return;
rct_window* window = window_find_by_class(WindowClass::Footpath);
rct_window* window = WindowFindByClass(WindowClass::Footpath);
if (window != nullptr)
{
window_footpath_keyboard_shortcut_turn_right();
WindowFootpathKeyboardShortcutTurnRight();
}
else
{
window_ride_construction_keyboard_shortcut_turn_right();
WindowRideConstructionKeyboardShortcutTurnRight();
}
}
@ -666,14 +666,14 @@ static void ShortcutConstructionSlopeUp()
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
return;
rct_window* window = window_find_by_class(WindowClass::Footpath);
rct_window* window = WindowFindByClass(WindowClass::Footpath);
if (window != nullptr)
{
window_footpath_keyboard_shortcut_slope_up();
WindowFootpathKeyboardShortcutSlopeUp();
}
else
{
window_ride_construction_keyboard_shortcut_slope_up();
WindowRideConstructionKeyboardShortcutSlopeUp();
}
}
@ -682,14 +682,14 @@ static void ShortcutConstructionBuildCurrent()
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
return;
rct_window* window = window_find_by_class(WindowClass::Footpath);
rct_window* window = WindowFindByClass(WindowClass::Footpath);
if (window != nullptr)
{
window_footpath_keyboard_shortcut_build_current();
WindowFootpathKeyboardShortcutBuildCurrent();
}
else
{
window_ride_construction_keyboard_shortcut_build_current();
WindowRideConstructionKeyboardShortcutBuildCurrent();
}
}
@ -698,14 +698,14 @@ static void ShortcutConstructionSlopeDown()
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
return;
rct_window* window = window_find_by_class(WindowClass::Footpath);
rct_window* window = WindowFindByClass(WindowClass::Footpath);
if (window != nullptr)
{
window_footpath_keyboard_shortcut_slope_down();
WindowFootpathKeyboardShortcutSlopeDown();
}
else
{
window_ride_construction_keyboard_shortcut_slope_down();
WindowRideConstructionKeyboardShortcutSlopeDown();
}
}
@ -714,14 +714,14 @@ static void ShortcutConstructionDemolishCurrent()
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
return;
rct_window* window = window_find_by_class(WindowClass::Footpath);
rct_window* window = WindowFindByClass(WindowClass::Footpath);
if (window != nullptr)
{
window_footpath_keyboard_shortcut_demolish_current();
WindowFootpathKeyboardShortcutDemolishCurrent();
}
else
{
window_ride_construction_keyboard_shortcut_demolish_current();
WindowRideConstructionKeyboardShortcutDemolishCurrent();
}
}
@ -744,40 +744,40 @@ void ShortcutManager::RegisterDefaultShortcuts()
// clang-format off
// Interface
RegisterShortcut(ShortcutId::InterfaceCloseTop, STR_SHORTCUT_CLOSE_TOP_MOST_WINDOW, "BACKSPACE", []() { window_close_top(); });
RegisterShortcut(ShortcutId::InterfaceCloseTop, STR_SHORTCUT_CLOSE_TOP_MOST_WINDOW, "BACKSPACE", []() { WindowCloseTop(); });
RegisterShortcut(ShortcutId::InterfaceCloseAll, STR_SHORTCUT_CLOSE_ALL_FLOATING_WINDOWS, "SHIFT+BACKSPACE", []() {
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR))
{
window_close_all();
WindowCloseAll();
}
else if (gEditorStep == EditorStep::LandscapeEditor)
{
window_close_top();
WindowCloseTop();
}
});
RegisterShortcut(ShortcutId::InterfaceRotateConstruction, STR_SHORTCUT_ROTATE_CONSTRUCTION_OBJECT, "Z", []() { ShortcutRotateConstructionObject(); });
RegisterShortcut(ShortcutId::InterfaceCancelConstruction, STR_SHORTCUT_CANCEL_CONSTRUCTION_MODE, "ESCAPE", []() {
if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO))
{
auto window = window_find_by_class(WindowClass::Error);
auto window = WindowFindByClass(WindowClass::Error);
if (window != nullptr)
{
window_close(*window);
WindowClose(*window);
}
else if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
{
tool_cancel();
ToolCancel();
}
}
});
RegisterShortcut(ShortcutId::InterfacePause, STR_SHORTCUT_PAUSE_GAME, "PAUSE", []() {
if (!(gScreenFlags & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_MANAGER)))
{
auto window = window_find_by_class(WindowClass::TopToolbar);
auto window = WindowFindByClass(WindowClass::TopToolbar);
if (window != nullptr)
{
window->Invalidate();
window_event_mouse_up_call(window, WC_TOP_TOOLBAR__WIDX_PAUSE);
WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_PAUSE);
}
}
});
@ -839,8 +839,8 @@ void ShortcutManager::RegisterDefaultShortcuts()
});
// View
RegisterShortcut(ShortcutId::ViewGeneralZoomOut, STR_SHORTCUT_ZOOM_VIEW_OUT, "PAGEUP", []() { main_window_zoom(false, false); });
RegisterShortcut(ShortcutId::ViewGeneralZoomIn, STR_SHORTCUT_ZOOM_VIEW_IN, "PAGEDOWN", []() { main_window_zoom(true, false); });
RegisterShortcut(ShortcutId::ViewGeneralZoomOut, STR_SHORTCUT_ZOOM_VIEW_OUT, "PAGEUP", []() { MainWindowZoom(false, false); });
RegisterShortcut(ShortcutId::ViewGeneralZoomIn, STR_SHORTCUT_ZOOM_VIEW_IN, "PAGEDOWN", []() { MainWindowZoom(true, false); });
RegisterShortcut(ShortcutId::ViewGeneralRotateClockwise, STR_SHORTCUT_ROTATE_VIEW_CLOCKWISE, "RETURN", "MOUSE 6", []() { RotateCamera(1); });
RegisterShortcut(ShortcutId::ViewGeneralRotateAnticlockwise, STR_SHORTCUT_ROTATE_VIEW_ANTICLOCKWISE, "SHIFT+RETURN", "MOUSE 5", []() { RotateCamera(-1); });
@ -871,14 +871,14 @@ void ShortcutManager::RegisterDefaultShortcuts()
// Window
RegisterShortcut(ShortcutId::WindowRideConstructionTurnLeft, STR_SHORTCUT_CONSTRUCTION_TURN_LEFT, "NUMPAD 4", []() { ShortcutConstructionTurnLeft(); });
RegisterShortcut(ShortcutId::WindowRideConstructionTurnRight, STR_SHORTCUT_CONSTRUCTION_TURN_RIGHT, "NUMPAD 6", []() { ShortcutConstructionTurnRight(); });
RegisterShortcut(ShortcutId::WindowRideConstructionDefault, STR_SHORTCUT_CONSTRUCTION_USE_TRACK_DEFAULT, "NUMPAD 5", []() { window_ride_construction_keyboard_shortcut_use_track_default(); });
RegisterShortcut(ShortcutId::WindowRideConstructionDefault, STR_SHORTCUT_CONSTRUCTION_USE_TRACK_DEFAULT, "NUMPAD 5", []() { WindowRideConstructionKeyboardShortcutUseTrackDefault(); });
RegisterShortcut(ShortcutId::WindowRideConstructionSlopeDown, STR_SHORTCUT_CONSTRUCTION_SLOPE_DOWN, "NUMPAD 2", []() { ShortcutConstructionSlopeDown(); });
RegisterShortcut(ShortcutId::WindowRideConstructionSlopeUp, STR_SHORTCUT_CONSTRUCTION_SLOPE_UP, "NUMPAD 8", []() { ShortcutConstructionSlopeUp(); });
RegisterShortcut(ShortcutId::WindowRideConstructionChainLift, STR_SHORTCUT_CONSTRUCTION_CHAIN_LIFT_TOGGLE, "NUMPAD +", []() { window_ride_construction_keyboard_shortcut_chain_lift_toggle(); });
RegisterShortcut(ShortcutId::WindowRideConstructionBankLeft, STR_SHORTCUT_CONSTRUCTION_BANK_LEFT, "NUMPAD 1", []() { window_ride_construction_keyboard_shortcut_bank_left(); });
RegisterShortcut(ShortcutId::WindowRideConstructionBankRight, STR_SHORTCUT_CONSTRUCTION_BANK_RIGHT, "NUMPAD 3", []() { window_ride_construction_keyboard_shortcut_bank_right(); });
RegisterShortcut(ShortcutId::WindowRideConstructionPrevious, STR_SHORTCUT_CONSTRUCTION_PREVIOUS_TRACK, "NUMPAD 7", []() { window_ride_construction_keyboard_shortcut_previous_track(); });
RegisterShortcut(ShortcutId::WindowRideConstructionNext, STR_SHORTCUT_CONSTRUCTION_NEXT_TRACK, "NUMPAD 9", []() { window_ride_construction_keyboard_shortcut_next_track(); });
RegisterShortcut(ShortcutId::WindowRideConstructionChainLift, STR_SHORTCUT_CONSTRUCTION_CHAIN_LIFT_TOGGLE, "NUMPAD +", []() { WindowRideConstructionKeyboardShortcutChainLiftToggle(); });
RegisterShortcut(ShortcutId::WindowRideConstructionBankLeft, STR_SHORTCUT_CONSTRUCTION_BANK_LEFT, "NUMPAD 1", []() { WindowRideConstructionKeyboardShortcutBankLeft(); });
RegisterShortcut(ShortcutId::WindowRideConstructionBankRight, STR_SHORTCUT_CONSTRUCTION_BANK_RIGHT, "NUMPAD 3", []() { WindowRideConstructionKeyboardShortcutBankRight(); });
RegisterShortcut(ShortcutId::WindowRideConstructionPrevious, STR_SHORTCUT_CONSTRUCTION_PREVIOUS_TRACK, "NUMPAD 7", []() { WindowRideConstructionKeyboardShortcutPreviousTrack(); });
RegisterShortcut(ShortcutId::WindowRideConstructionNext, STR_SHORTCUT_CONSTRUCTION_NEXT_TRACK, "NUMPAD 9", []() { WindowRideConstructionKeyboardShortcutNextTrack(); });
RegisterShortcut(ShortcutId::WindowRideConstructionBuild, STR_SHORTCUT_CONSTRUCTION_BUILD_CURRENT, "NUMPAD 0", []() { ShortcutConstructionBuildCurrent(); });
RegisterShortcut(ShortcutId::WindowRideConstructionDemolish, STR_SHORTCUT_CONSTRUCTION_DEMOLISH_CURRENT, "NUMPAD -", []() { ShortcutConstructionDemolishCurrent(); });
@ -906,10 +906,10 @@ void ShortcutManager::RegisterDefaultShortcuts()
RegisterShortcut(ShortcutId::DebugTogglePaintDebugWindow, STR_SHORTCUT_DEBUG_PAINT_TOGGLE, []() {
if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO))
{
auto window = window_find_by_class(WindowClass::DebugPaint);
auto window = WindowFindByClass(WindowClass::DebugPaint);
if (window != nullptr)
{
window_close(*window);
WindowClose(*window);
}
else
{

View File

@ -248,10 +248,10 @@ void InGameConsole::Update()
if (_isOpen)
{
// When scrolling the map, the console pixels get copied... therefore invalidate the screen
rct_window* mainWindow = window_get_main();
rct_window* mainWindow = WindowGetMain();
if (mainWindow != nullptr)
{
rct_viewport* mainViewport = window_get_viewport(mainWindow);
rct_viewport* mainViewport = WindowGetViewport(mainWindow);
if (mainViewport != nullptr)
{
if (_lastMainViewport != mainViewport->viewPos)

View File

@ -871,7 +871,7 @@ StringId ThemeDescGetName(WindowClass wc)
void ColourSchemeUpdateAll()
{
window_visit_each([](rct_window* w) { ColourSchemeUpdate(w); });
WindowVisitEach([](rct_window* w) { ColourSchemeUpdate(w); });
}
void ColourSchemeUpdate(rct_window* window)

View File

@ -446,8 +446,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor
if (!(input_test_flag(INPUT_FLAG_6)) || !(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)))
{
if (window_find_by_class(WindowClass::RideConstruction) == nullptr
&& window_find_by_class(WindowClass::Footpath) == nullptr)
if (WindowFindByClass(WindowClass::RideConstruction) == nullptr && WindowFindByClass(WindowClass::Footpath) == nullptr)
{
info.SpriteType = ViewportInteractionItem::None;
return info;
@ -618,7 +617,7 @@ static void ViewportInteractionRemoveFootpath(TileElement* tileElement, const Co
auto z = tileElement->GetBaseZ();
w = window_find_by_class(WindowClass::Footpath);
w = WindowFindByClass(WindowClass::Footpath);
if (w != nullptr)
FootpathProvisionalUpdate();
@ -737,7 +736,7 @@ PeepDistance GetClosestPeep(const ScreenCoordsXY& viewportCoords, const int32_t
static Peep* ViewportInteractionGetClosestPeep(ScreenCoordsXY screenCoords, int32_t maxDistance)
{
auto* w = window_find_from_point(screenCoords);
auto* w = WindowFindFromPoint(screenCoords);
if (w == nullptr)
return nullptr;
@ -761,7 +760,7 @@ static Peep* ViewportInteractionGetClosestPeep(ScreenCoordsXY screenCoords, int3
*/
CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoords)
{
rct_window* window = window_find_from_point(screenCoords);
rct_window* window = WindowFindFromPoint(screenCoords);
if (window == nullptr || window->viewport == nullptr)
{
CoordsXY ret{};

View File

@ -659,7 +659,7 @@ static void WidgetCheckboxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetInde
static void WidgetScrollDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex widgetIndex)
{
// Get the widget
int32_t scrollIndex = window_get_scroll_data_index(w, widgetIndex);
int32_t scrollIndex = WindowGetScrollDataIndex(w, widgetIndex);
const auto& widget = w.widgets[widgetIndex];
const auto& scroll = w.scrolls[scrollIndex];
@ -721,7 +721,7 @@ static void WidgetScrollDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex
// Draw the scroll contents
if (scroll_dpi.width > 0 && scroll_dpi.height > 0)
window_event_scroll_paint_call(&w, &scroll_dpi, scrollIndex);
WindowEventScrollPaintCall(&w, &scroll_dpi, scrollIndex);
}
static void WidgetHScrollbarDraw(

View File

@ -224,7 +224,7 @@ rct_window* WindowCreate(
{
if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT | WF_NO_AUTO_CLOSE)))
{
window_close(*w.get());
WindowClose(*w.get());
break;
}
}
@ -377,7 +377,7 @@ static void WindowScrollWheelInput(rct_window& w, int32_t scrollIndex, int32_t w
}
WidgetScrollUpdateThumbs(w, widgetIndex);
widget_invalidate(w, widgetIndex);
WidgetInvalidate(w, widgetIndex);
}
/**
@ -415,9 +415,9 @@ static void WindowViewportWheelInput(rct_window& w, int32_t wheel)
return;
if (wheel < 0)
window_zoom_in(w, true);
WindowZoomIn(w, true);
else if (wheel > 0)
window_zoom_out(w, true);
WindowZoomOut(w, true);
}
static bool WindowOtherWheelInput(rct_window& w, WidgetIndex widgetIndex, int32_t wheel)
@ -500,7 +500,7 @@ static bool WindowOtherWheelInput(rct_window& w, WidgetIndex widgetIndex, int32_
return false;
}
window_event_mouse_down_call(&w, buttonWidgetIndex);
WindowEventMouseDownCall(&w, buttonWidgetIndex);
return true;
}
@ -523,7 +523,7 @@ void WindowAllWheelInput()
// Check window cursor is over
if (!(input_test_flag(INPUT_FLAG_5)))
{
rct_window* w = window_find_from_point(cursorState->position);
rct_window* w = WindowFindFromPoint(cursorState->position);
if (w != nullptr)
{
// Check if main window
@ -534,7 +534,7 @@ void WindowAllWheelInput()
}
// Check scroll view, cursor is over
WidgetIndex widgetIndex = window_find_widget_from_point(*w, cursorState->position);
WidgetIndex widgetIndex = WindowFindWidgetFromPoint(*w, cursorState->position);
if (widgetIndex != -1)
{
const auto& widget = w->widgets[widgetIndex];
@ -593,7 +593,7 @@ void WindowInitScrollWidgets(rct_window& w)
scroll.flags = 0;
width = 0;
height = 0;
window_get_scroll_size(&w, scroll_index, &width, &height);
WindowGetScrollSize(&w, scroll_index, &width, &height);
scroll.h_left = 0;
scroll.h_right = width + 1;
scroll.v_top = 0;
@ -682,10 +682,10 @@ static void WindowInvalidatePressedImageButton(const rct_window& w)
*/
void InvalidateAllWindowsAfterInput()
{
window_visit_each([](rct_window* w) {
window_update_scroll_widgets(*w);
WindowVisitEach([](rct_window* w) {
WindowUpdateScrollWidgets(*w);
WindowInvalidatePressedImageButton(*w);
window_event_resize_call(w);
WindowEventResizeCall(w);
});
}
@ -711,7 +711,7 @@ void Window::InitScrollWidgets()
void Window::InvalidateWidget(WidgetIndex widgetIndex)
{
widget_invalidate(*this, widgetIndex);
WidgetInvalidate(*this, widgetIndex);
}
bool Window::IsWidgetDisabled(WidgetIndex widgetIndex) const
@ -758,18 +758,18 @@ void Window::Close()
}
else
{
window_close(*this);
WindowClose(*this);
}
}
void Window::CloseOthers()
{
window_close_all_except_number_and_class(number, classification);
WindowCloseAllExceptNumberAndClass(number, classification);
}
void Window::CloseOthersOfThisClass()
{
window_close_by_class(classification);
WindowCloseByClass(classification);
}
CloseWindowModifier Window::GetCloseModifier()
@ -793,7 +793,7 @@ void Window::TextInputOpen(
WindowTextInputOpen(this, callWidget, title, description, descriptionArgs, existingText, existingArgs, maxLength);
}
void window_align_tabs(rct_window* w, WidgetIndex start_tab_id, WidgetIndex end_tab_id)
void WindowAlignTabs(rct_window* w, WidgetIndex start_tab_id, WidgetIndex end_tab_id)
{
int32_t i, x = w->widgets[start_tab_id].left;
int32_t tab_width = w->widgets[start_tab_id].width();

View File

@ -37,4 +37,4 @@ struct Window : rct_window
void WindowAllWheelInput();
void ApplyScreenSaverLockSetting();
void window_align_tabs(rct_window* w, WidgetIndex start_tab_id, WidgetIndex end_tab_id);
void WindowAlignTabs(rct_window* w, WidgetIndex start_tab_id, WidgetIndex end_tab_id);

View File

@ -255,7 +255,7 @@ void CustomListView::SetColumns(const std::vector<ListViewColumn>& columns, bool
SortItems(0, ColumnSortOrder::None);
if (!initialising)
{
window_update_scroll_widgets(*ParentWindow);
WindowUpdateScrollWidgets(*ParentWindow);
Invalidate();
}
}
@ -272,7 +272,7 @@ void CustomListView::SetItems(const std::vector<ListViewItem>& items, bool initi
SortItems(0, ColumnSortOrder::None);
if (!initialising)
{
window_update_scroll_widgets(*ParentWindow);
WindowUpdateScrollWidgets(*ParentWindow);
Invalidate();
}
}
@ -283,7 +283,7 @@ void CustomListView::SetItems(std::vector<ListViewItem>&& items, bool initialisi
SortItems(0, ColumnSortOrder::None);
if (!initialising)
{
window_update_scroll_widgets(*ParentWindow);
WindowUpdateScrollWidgets(*ParentWindow);
Invalidate();
}
}

View File

@ -110,7 +110,7 @@ namespace OpenRCT2::Scripting
{
if (ActiveCustomTool->Owner == owner)
{
tool_cancel();
ToolCancel();
}
}
@ -261,14 +261,14 @@ namespace OpenRCT2::Scripting
customTool.onUp = dukValue["onUp"];
customTool.onFinish = dukValue["onFinish"];
auto toolbarWindow = window_find_by_class(WindowClass::TopToolbar);
auto toolbarWindow = WindowFindByClass(WindowClass::TopToolbar);
if (toolbarWindow != nullptr)
{
// Use a widget that does not exist on top toolbar but also make sure it isn't -1 as that
// prevents abort from being called.
WidgetIndex widgetIndex = -2;
tool_cancel();
tool_set(*toolbarWindow, widgetIndex, static_cast<Tool>(customTool.Cursor));
ToolCancel();
ToolSet(*toolbarWindow, widgetIndex, static_cast<Tool>(customTool.Cursor));
ActiveCustomTool = std::move(customTool);
ActiveCustomTool->Start();
}

View File

@ -455,7 +455,7 @@ namespace OpenRCT2::Ui::Windows
{
frame_no = 0;
}
widget_invalidate(*this, WIDX_TAB_0 + this->page);
WidgetInvalidate(*this, WIDX_TAB_0 + this->page);
}
}
@ -537,7 +537,7 @@ namespace OpenRCT2::Ui::Windows
auto widgetIndex = GetViewportWidgetIndex();
if (WidgetIsVisible(*this, widgetIndex.value_or(false)))
{
window_draw_viewport(&dpi, *this);
WindowDrawViewport(&dpi, *this);
}
}
}
@ -576,7 +576,7 @@ namespace OpenRCT2::Ui::Windows
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*this);
WindowClose(*this);
break;
default:
{
@ -664,7 +664,7 @@ namespace OpenRCT2::Ui::Windows
else if (widgetDesc->Type == "textbox")
{
auto* text = const_cast<char*>(widgetDesc->Text.c_str());
window_start_textbox(*this, widgetIndex, STR_STRING, text, widgetDesc->MaxLength + 1);
WindowStartTextbox(*this, widgetIndex, STR_STRING, text, widgetDesc->MaxLength + 1);
}
}
}
@ -764,8 +764,8 @@ namespace OpenRCT2::Ui::Windows
RefreshWidgets();
Invalidate();
window_event_resize_call(this);
window_event_invalidate_call(this);
WindowEventResizeCall(this);
WindowEventInvalidateCall(this);
WindowInitScrollWidgets(*this);
Invalidate();
@ -1114,7 +1114,7 @@ namespace OpenRCT2::Ui::Windows
static rct_windownumber GetNewWindowNumber()
{
auto result = _nextWindowNumber++;
while (window_find_by_number(WindowClass::Custom, result) != nullptr)
while (WindowFindByNumber(WindowClass::Custom, result) != nullptr)
{
result++;
}
@ -1204,7 +1204,7 @@ namespace OpenRCT2::Ui::Windows
{
customWidgetInfo->Text = value;
w->widgets[widgetIndex].string = customWidgetInfo->Text.data();
widget_invalidate(*w, widgetIndex);
WidgetInvalidate(*w, widgetIndex);
}
}
}
@ -1238,7 +1238,7 @@ namespace OpenRCT2::Ui::Windows
{
customWidgetInfo->Colour = colour;
widget.image = GetColourButtonImage(colour);
widget_invalidate(*w, widgetIndex);
WidgetInvalidate(*w, widgetIndex);
std::vector<DukValue> args;
auto ctx = customWidgetInfo->OnChange.context();
@ -1283,7 +1283,7 @@ namespace OpenRCT2::Ui::Windows
}
customWidgetInfo->SelectedIndex = selectedIndex;
widget_invalidate(*w, widgetIndex);
WidgetInvalidate(*w, widgetIndex);
if (lastSelectedIndex != selectedIndex)
{
@ -1434,7 +1434,7 @@ namespace OpenRCT2::Ui::Windows
if (w->custom_info != nullptr)
{
auto& info = GetInfo(w);
auto scrollIndex = window_get_scroll_data_index(*w, widgetIndex);
auto scrollIndex = WindowGetScrollDataIndex(*w, widgetIndex);
if (scrollIndex < static_cast<int32_t>(info.ListViews.size()))
{
return &info.ListViews[scrollIndex];
@ -1489,7 +1489,7 @@ namespace OpenRCT2::Ui::Windows
for (auto& window : customWindows)
{
window_close(*window.get());
WindowClose(*window.get());
}
}

View File

@ -110,7 +110,7 @@ namespace OpenRCT2::Scripting
void cancel()
{
tool_cancel();
ToolCancel();
}
};
@ -188,18 +188,18 @@ namespace OpenRCT2::Scripting
{
if (id.type() == DukValue::Type::NUMBER)
{
window_close_by_number(cls, id.as_int());
WindowCloseByNumber(cls, id.as_int());
}
else
{
window_close_by_class(cls);
WindowCloseByClass(cls);
}
}
}
void closeAllWindows()
{
window_close_all();
WindowCloseAll();
}
std::shared_ptr<ScWindow> getWindow(DukValue a) const

View File

@ -122,7 +122,7 @@ namespace OpenRCT2::Scripting
{
while (get_current_rotation() != value)
{
window_rotate_camera(*w, 1);
WindowRotateCamera(*w, 1);
}
}
}
@ -143,7 +143,7 @@ namespace OpenRCT2::Scripting
if (w != nullptr)
{
auto i8Value = static_cast<int8_t>(value);
window_zoom_set(*w, ZoomLevel{ i8Value }, false);
WindowZoomSet(*w, ZoomLevel{ i8Value }, false);
}
}
@ -220,7 +220,7 @@ namespace OpenRCT2::Scripting
auto coords = GetCoordsFromObject(position);
if (coords)
{
window_scroll_to_location(*w, *coords);
WindowScrollToLocation(*w, *coords);
}
}
}
@ -245,9 +245,9 @@ namespace OpenRCT2::Scripting
rct_window* GetWindow() const
{
if (_class == WindowClass::MainWindow)
return window_get_main();
return WindowGetMain();
return window_find_by_number(_class, _number);
return WindowFindByNumber(_class, _number);
}
rct_viewport* GetViewport() const

View File

@ -146,19 +146,19 @@ namespace OpenRCT2::Scripting
auto buttonWidget = widget + 1;
buttonWidget->left += delta;
buttonWidget->right += delta;
widget_invalidate_by_number(_class, _number, _widgetIndex + 1);
WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1);
}
else if (widget->type == WindowWidgetType::Spinner)
{
auto upWidget = widget + 1;
upWidget->left += delta;
upWidget->right += delta;
widget_invalidate_by_number(_class, _number, _widgetIndex + 1);
WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1);
auto downWidget = widget + 2;
downWidget->left += delta;
downWidget->right += delta;
widget_invalidate_by_number(_class, _number, _widgetIndex + 2);
WidgetInvalidateByNumber(_class, _number, _widgetIndex + 2);
}
Invalidate();
@ -190,19 +190,19 @@ namespace OpenRCT2::Scripting
auto buttonWidget = widget + 1;
buttonWidget->top += delta;
buttonWidget->bottom += delta;
widget_invalidate_by_number(_class, _number, _widgetIndex + 1);
WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1);
}
else if (widget->type == WindowWidgetType::Spinner)
{
auto upWidget = widget + 1;
upWidget->top += delta;
upWidget->bottom += delta;
widget_invalidate_by_number(_class, _number, _widgetIndex + 1);
WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1);
auto downWidget = widget + 2;
downWidget->top += delta;
downWidget->bottom += delta;
widget_invalidate_by_number(_class, _number, _widgetIndex + 2);
WidgetInvalidateByNumber(_class, _number, _widgetIndex + 2);
}
Invalidate();
@ -233,19 +233,19 @@ namespace OpenRCT2::Scripting
auto buttonWidget = widget + 1;
buttonWidget->left += delta;
buttonWidget->right += delta;
widget_invalidate_by_number(_class, _number, _widgetIndex + 1);
WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1);
}
else if (widget->type == WindowWidgetType::Spinner)
{
auto upWidget = widget + 1;
upWidget->left += delta;
upWidget->right += delta;
widget_invalidate_by_number(_class, _number, _widgetIndex + 1);
WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1);
auto downWidget = widget + 2;
downWidget->left += delta;
downWidget->right += delta;
widget_invalidate_by_number(_class, _number, _widgetIndex + 2);
WidgetInvalidateByNumber(_class, _number, _widgetIndex + 2);
}
Invalidate();
@ -275,17 +275,17 @@ namespace OpenRCT2::Scripting
{
auto buttonWidget = widget + 1;
buttonWidget->bottom += delta;
widget_invalidate_by_number(_class, _number, _widgetIndex + 1);
WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1);
}
else if (widget->type == WindowWidgetType::Spinner)
{
auto upWidget = widget + 1;
upWidget->bottom += delta;
widget_invalidate_by_number(_class, _number, _widgetIndex + 1);
WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1);
auto downWidget = widget + 2;
downWidget->bottom += delta;
widget_invalidate_by_number(_class, _number, _widgetIndex + 2);
WidgetInvalidateByNumber(_class, _number, _widgetIndex + 2);
}
Invalidate();
@ -404,9 +404,9 @@ namespace OpenRCT2::Scripting
rct_window* GetWindow() const
{
if (_class == WindowClass::MainWindow)
return window_get_main();
return WindowGetMain();
return window_find_by_number(_class, _number);
return WindowFindByNumber(_class, _number);
}
Widget* GetWidget() const
@ -431,7 +431,7 @@ namespace OpenRCT2::Scripting
void Invalidate()
{
widget_invalidate_by_number(_class, _number, _widgetIndex);
WidgetInvalidateByNumber(_class, _number, _widgetIndex);
}
};

View File

@ -65,7 +65,7 @@ namespace OpenRCT2::Scripting
auto w = GetWindow();
if (w != nullptr)
{
window_set_position(*w, { value, w->windowPos.y });
WindowSetPosition(*w, { value, w->windowPos.y });
}
}
int32_t y_get() const
@ -82,7 +82,7 @@ namespace OpenRCT2::Scripting
auto w = GetWindow();
if (w != nullptr)
{
window_set_position(*w, { w->windowPos.x, value });
WindowSetPosition(*w, { w->windowPos.x, value });
}
}
int32_t width_get() const
@ -99,13 +99,13 @@ namespace OpenRCT2::Scripting
auto w = GetWindow();
if (w != nullptr)
{
if (window_can_resize(*w))
if (WindowCanResize(*w))
{
window_resize(*w, value - w->width, 0);
WindowResize(*w, value - w->width, 0);
}
else
{
window_set_resize(*w, value, w->min_height, value, w->max_height);
WindowSetResize(*w, value, w->min_height, value, w->max_height);
}
}
}
@ -123,13 +123,13 @@ namespace OpenRCT2::Scripting
auto w = GetWindow();
if (w != nullptr)
{
if (window_can_resize(*w))
if (WindowCanResize(*w))
{
window_resize(*w, 0, value - w->height);
WindowResize(*w, 0, value - w->height);
}
else
{
window_set_resize(*w, w->min_width, value, w->max_width, value);
WindowSetResize(*w, w->min_width, value, w->max_width, value);
}
}
}
@ -147,7 +147,7 @@ namespace OpenRCT2::Scripting
auto w = GetWindow();
if (w != nullptr)
{
window_set_resize(*w, value, w->min_height, w->max_width, w->max_height);
WindowSetResize(*w, value, w->min_height, w->max_width, w->max_height);
}
}
int32_t maxWidth_get() const
@ -164,7 +164,7 @@ namespace OpenRCT2::Scripting
auto w = GetWindow();
if (w != nullptr)
{
window_set_resize(*w, w->min_width, w->min_height, value, w->max_height);
WindowSetResize(*w, w->min_width, w->min_height, value, w->max_height);
}
}
int32_t minHeight_get() const
@ -181,7 +181,7 @@ namespace OpenRCT2::Scripting
auto w = GetWindow();
if (w != nullptr)
{
window_set_resize(*w, w->min_width, value, w->max_width, w->max_height);
WindowSetResize(*w, w->min_width, value, w->max_width, w->max_height);
}
}
int32_t maxHeight_get() const
@ -198,7 +198,7 @@ namespace OpenRCT2::Scripting
auto w = GetWindow();
if (w != nullptr)
{
window_set_resize(*w, w->min_width, w->min_height, w->max_width, value);
WindowSetResize(*w, w->min_width, w->min_height, w->max_width, value);
}
}
bool isSticky_get() const
@ -305,7 +305,7 @@ namespace OpenRCT2::Scripting
auto w = GetWindow();
if (w != nullptr)
{
window_close(*w);
WindowClose(*w);
}
}
@ -329,7 +329,7 @@ namespace OpenRCT2::Scripting
auto w = GetWindow();
if (w != nullptr)
{
window_bring_to_front(*w);
WindowBringToFront(*w);
w->flags |= WF_WHITE_BORDER_MASK;
}
}
@ -360,7 +360,7 @@ namespace OpenRCT2::Scripting
private:
rct_window* GetWindow() const
{
return window_find_by_number(_class, _number);
return WindowFindByNumber(_class, _number);
}
};
} // namespace OpenRCT2::Scripting

View File

@ -352,26 +352,26 @@ namespace OpenRCT2::Title
void CloseParkSpecificWindows()
{
window_close_by_class(WindowClass::ConstructRide);
window_close_by_class(WindowClass::DemolishRidePrompt);
window_close_by_class(WindowClass::EditorInventionListDrag);
window_close_by_class(WindowClass::EditorInventionList);
window_close_by_class(WindowClass::EditorObjectSelection);
window_close_by_class(WindowClass::EditorObjectiveOptions);
window_close_by_class(WindowClass::EditorScenarioOptions);
window_close_by_class(WindowClass::Finances);
window_close_by_class(WindowClass::FirePrompt);
window_close_by_class(WindowClass::GuestList);
window_close_by_class(WindowClass::InstallTrack);
window_close_by_class(WindowClass::Peep);
window_close_by_class(WindowClass::Ride);
window_close_by_class(WindowClass::RideConstruction);
window_close_by_class(WindowClass::RideList);
window_close_by_class(WindowClass::Scenery);
window_close_by_class(WindowClass::Staff);
window_close_by_class(WindowClass::TrackDeletePrompt);
window_close_by_class(WindowClass::TrackDesignList);
window_close_by_class(WindowClass::TrackDesignPlace);
WindowCloseByClass(WindowClass::ConstructRide);
WindowCloseByClass(WindowClass::DemolishRidePrompt);
WindowCloseByClass(WindowClass::EditorInventionListDrag);
WindowCloseByClass(WindowClass::EditorInventionList);
WindowCloseByClass(WindowClass::EditorObjectSelection);
WindowCloseByClass(WindowClass::EditorObjectiveOptions);
WindowCloseByClass(WindowClass::EditorScenarioOptions);
WindowCloseByClass(WindowClass::Finances);
WindowCloseByClass(WindowClass::FirePrompt);
WindowCloseByClass(WindowClass::GuestList);
WindowCloseByClass(WindowClass::InstallTrack);
WindowCloseByClass(WindowClass::Peep);
WindowCloseByClass(WindowClass::Ride);
WindowCloseByClass(WindowClass::RideConstruction);
WindowCloseByClass(WindowClass::RideList);
WindowCloseByClass(WindowClass::Scenery);
WindowCloseByClass(WindowClass::Staff);
WindowCloseByClass(WindowClass::TrackDeletePrompt);
WindowCloseByClass(WindowClass::TrackDesignList);
WindowCloseByClass(WindowClass::TrackDesignPlace);
}
void PrepareParkForPlayback()
@ -392,7 +392,7 @@ namespace OpenRCT2::Title
void StoreCurrentViewLocation()
{
rct_window* w = window_get_main();
rct_window* w = WindowGetMain();
if (w != nullptr && w->viewport_smart_follow_sprite.IsNull())
{
_previousWindowWidth = w->width;
@ -406,7 +406,7 @@ namespace OpenRCT2::Title
*/
void RestoreViewLocationIfResized()
{
rct_window* w = window_get_main();
rct_window* w = WindowGetMain();
if (w != nullptr && w->viewport_smart_follow_sprite.IsNull())
{
if (w->width != _previousWindowWidth || w->height != _previousWindowHeight)

View File

@ -206,7 +206,7 @@ public:
break;
case WIDX_BANNER_NO_ENTRY:
{
textinput_cancel();
TextinputCancel();
auto bannerSetStyle = BannerSetStyleAction(
BannerSetStyleType::NoEntry, GetBannerIndex(), banner->flags ^ BANNER_FLAG_NO_ENTRY);
GameActions::Execute(&bannerSetStyle);
@ -260,7 +260,7 @@ public:
if (viewport != nullptr)
{
window_draw_viewport(&dpi, *this);
WindowDrawViewport(&dpi, *this);
}
}
@ -300,7 +300,7 @@ public:
*/
rct_window* WindowBannerOpen(rct_windownumber number)
{
auto w = static_cast<BannerWindow*>(window_bring_to_front_by_number(WindowClass::Banner, number));
auto w = static_cast<BannerWindow*>(WindowBringToFrontByNumber(WindowClass::Banner, number));
if (w != nullptr)
return w;

View File

@ -314,7 +314,7 @@ private:
rct_window* WindowChangelogOpen(int personality)
{
auto* window = window_bring_to_front_by_class(WindowClass::Changelog);
auto* window = WindowBringToFrontByClass(WindowClass::Changelog);
if (window == nullptr)
{
// Create a new centred window

View File

@ -750,14 +750,14 @@ private:
{
auto setDateAction = ParkSetDateAction(_yearSpinnerValue, _monthSpinnerValue, _daySpinnerValue);
GameActions::Execute(&setDateAction);
window_invalidate_by_class(WindowClass::BottomToolbar);
WindowInvalidateByClass(WindowClass::BottomToolbar);
break;
}
case WIDX_DATE_RESET:
{
auto setDateAction = ParkSetDateAction(1, 1, 1);
GameActions::Execute(&setDateAction);
window_invalidate_by_class(WindowClass::BottomToolbar);
WindowInvalidateByClass(WindowClass::BottomToolbar);
InvalidateWidget(WIDX_YEAR_BOX);
InvalidateWidget(WIDX_MONTH_BOX);
InvalidateWidget(WIDX_DAY_BOX);
@ -1113,7 +1113,7 @@ private:
rct_window* WindowCheatsOpen()
{
auto* window = window_bring_to_front_by_class(WindowClass::Cheats);
auto* window = WindowBringToFrontByClass(WindowClass::Cheats);
if (window == nullptr)
{
window = WindowCreate<CheatsWindow>(WindowClass::Cheats, ScreenCoordsXY(32, 32), WW, WH);

View File

@ -66,7 +66,7 @@ public:
widgets = window_clear_scenery_widgets;
hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT);
WindowInitScrollWidgets(*this);
window_push_others_below(*this);
WindowPushOthersBelow(*this);
gLandToolSize = 2;
gClearSceneryCost = MONEY64_UNDEFINED;
@ -81,7 +81,7 @@ public:
void OnClose() override
{
if (ClearSceneryToolIsActive())
tool_cancel();
ToolCancel();
}
void OnMouseUp(const WidgetIndex widgetIndex) override
@ -199,7 +199,7 @@ public:
rct_window* WindowClearSceneryOpen()
{
auto* w = static_cast<CleanSceneryWindow*>(window_bring_to_front_by_class(WindowClass::ClearScenery));
auto* w = static_cast<CleanSceneryWindow*>(WindowBringToFrontByClass(WindowClass::ClearScenery));
if (w != nullptr)
return w;

View File

@ -72,7 +72,7 @@ public:
CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate += 1;
gConfigGeneral.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate;
ConfigSaveDefault();
window_invalidate_all();
WindowInvalidateAll();
break;
case WIDX_RATE_DOWN:
if (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate > 1)
@ -80,7 +80,7 @@ public:
CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate -= 1;
gConfigGeneral.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate;
ConfigSaveDefault();
window_invalidate_all();
WindowInvalidateAll();
}
break;
case WIDX_AFFIX_DROPDOWN_BUTTON:
@ -146,7 +146,7 @@ public:
gConfigGeneral.CustomCurrencyAffix = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode;
ConfigSaveDefault();
window_invalidate_all();
WindowInvalidateAll();
}
}
@ -167,7 +167,7 @@ public:
gConfigGeneral.CustomCurrencySymbol = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode;
ConfigSaveDefault();
window_invalidate_all();
WindowInvalidateAll();
break;
case WIDX_RATE:
@ -178,7 +178,7 @@ public:
CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate = rate;
gConfigGeneral.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate;
ConfigSaveDefault();
window_invalidate_all();
WindowInvalidateAll();
}
break;
}

View File

@ -55,7 +55,7 @@ public:
widgets = window_debug_paint_widgets;
InitScrollWidgets();
window_push_others_below(*this);
WindowPushOthersBelow(*this);
colours[0] = TRANSLUCENT(COLOUR_BLACK);
colours[1] = COLOUR_GREY;

View File

@ -97,11 +97,11 @@ rct_window* WindowRideDemolishPromptOpen(const Ride& ride)
rct_window* w;
DemolishRidePromptWindow* newWindow;
w = window_find_by_class(WindowClass::DemolishRidePrompt);
w = WindowFindByClass(WindowClass::DemolishRidePrompt);
if (w != nullptr)
{
auto windowPos = w->windowPos;
window_close(*w);
WindowClose(*w);
newWindow = WindowCreate<DemolishRidePromptWindow>(WindowClass::DemolishRidePrompt, windowPos, WW, WH, WF_TRANSPARENT);
}
else

View File

@ -425,7 +425,7 @@ void WindowDropdownShowImage(
void WindowDropdownClose()
{
window_close_by_class(WindowClass::Dropdown);
WindowCloseByClass(WindowClass::Dropdown);
}
/**

View File

@ -148,14 +148,14 @@ public:
private:
void JumpBackToObjectSelection() const
{
window_close_all();
WindowCloseAll();
gEditorStep = EditorStep::ObjectSelection;
GfxInvalidateScreen();
}
void JumpBackToLandscapeEditor() const
{
window_close_all();
WindowCloseAll();
set_all_scenery_items_invented();
ScenerySetDefaultPlacementConfiguration();
gEditorStep = EditorStep::LandscapeEditor;
@ -165,7 +165,7 @@ private:
void JumpBackToInventionListSetUp() const
{
window_close_all();
WindowCloseAll();
ContextOpenWindow(WindowClass::EditorInventionList);
gEditorStep = EditorStep::InventionsListSetUp;
GfxInvalidateScreen();
@ -173,7 +173,7 @@ private:
void JumpBackToOptionsSelection() const
{
window_close_all();
WindowCloseAll();
ContextOpenWindow(WindowClass::EditorScenarioOptions);
gEditorStep = EditorStep::OptionsSelection;
GfxInvalidateScreen();
@ -186,16 +186,16 @@ private:
auto [missingObjectType, errorString] = Editor::CheckObjectSelection();
if (missingObjectType == ObjectType::None)
{
window_close_by_class(WindowClass::EditorObjectSelection);
WindowCloseByClass(WindowClass::EditorObjectSelection);
return true;
}
ContextShowError(STR_INVALID_SELECTION_OF_OBJECTS, errorString, {});
w = window_find_by_class(WindowClass::EditorObjectSelection);
w = WindowFindByClass(WindowClass::EditorObjectSelection);
if (w != nullptr)
{
// Click tab with missing object
window_event_mouse_up_call(w, WC_EDITOR_OBJECT_SELECTION__WIDX_TAB_1 + EnumValue(missingObjectType));
WindowEventMouseUpCall(w, WC_EDITOR_OBJECT_SELECTION__WIDX_TAB_1 + EnumValue(missingObjectType));
}
return false;
}
@ -221,7 +221,7 @@ private:
auto [checksPassed, errorString] = Editor::CheckPark();
if (checksPassed)
{
window_close_all();
WindowCloseAll();
ContextOpenWindow(WindowClass::EditorInventionList);
gEditorStep = EditorStep::InventionsListSetUp;
}
@ -235,7 +235,7 @@ private:
void JumpForwardToOptionsSelection() const
{
window_close_all();
WindowCloseAll();
ContextOpenWindow(WindowClass::EditorScenarioOptions);
gEditorStep = EditorStep::OptionsSelection;
GfxInvalidateScreen();
@ -243,7 +243,7 @@ private:
void JumpForwardToObjectiveSelection() const
{
window_close_all();
WindowCloseAll();
ContextOpenWindow(WindowClass::EditorObjectiveOptions);
gEditorStep = EditorStep::ObjectiveSelection;
GfxInvalidateScreen();
@ -259,7 +259,7 @@ private:
return;
}
window_close_all();
WindowCloseAll();
auto intent = Intent(WindowClass::Loadsave);
intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO);
intent.putExtra(INTENT_EXTRA_PATH, gScenarioName);

View File

@ -209,7 +209,7 @@ public:
{
frame_no++;
OnPrepareDraw();
widget_invalidate(*this, WIDX_TAB_1);
WidgetInvalidate(*this, WIDX_TAB_1);
if (WindowEditorInventionsListDragGetItem() != nullptr)
return;
@ -476,7 +476,7 @@ public:
if (windowPos.x <= screenCoords.x && windowPos.y < screenCoords.y && windowPos.x + width > screenCoords.x
&& windowPos.y + height > screenCoords.y)
{
WidgetIndex widgetIndex = window_find_widget_from_point(*this, screenCoords);
WidgetIndex widgetIndex = WindowFindWidgetFromPoint(*this, screenCoords);
auto& widget = widgets[widgetIndex];
if (widgetIndex == WIDX_PRE_RESEARCHED_SCROLL || widgetIndex == WIDX_RESEARCH_ORDER_SCROLL)
{
@ -596,7 +596,7 @@ public:
CursorID OnCursor(const WidgetIndex widx, const ScreenCoordsXY& screenCoords, const CursorID defaultCursor) override
{
auto* inventionListWindow = static_cast<InventionListWindow*>(window_find_by_class(WindowClass::EditorInventionList));
auto* inventionListWindow = static_cast<InventionListWindow*>(WindowFindByClass(WindowClass::EditorInventionList));
if (inventionListWindow != nullptr)
{
auto res = inventionListWindow->GetResearchItemAt(screenCoords);
@ -613,7 +613,7 @@ public:
void OnMoved(const ScreenCoordsXY& screenCoords) override
{
auto* inventionListWindow = static_cast<InventionListWindow*>(window_find_by_class(WindowClass::EditorInventionList));
auto* inventionListWindow = static_cast<InventionListWindow*>(WindowFindByClass(WindowClass::EditorInventionList));
if (inventionListWindow == nullptr)
{
Close();
@ -632,7 +632,7 @@ public:
inventionListWindow->MoveResearchItem(_draggedItem, res->research, res->isInvented);
}
window_invalidate_by_class(WindowClass::EditorInventionList);
WindowInvalidateByClass(WindowClass::EditorInventionList);
Close();
}
@ -667,7 +667,7 @@ public:
static void WindowEditorInventionsListDragOpen(
ResearchItem* researchItem, const ScreenCoordsXY& editorPos, int objectSelectionScrollWidth)
{
window_close_by_class(WindowClass::EditorInventionListDrag);
WindowCloseByClass(WindowClass::EditorInventionListDrag);
auto* wnd = WindowCreate<InventionDragWindow>(
WindowClass::EditorInventionListDrag, 10, 14, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_SNAPPING);
if (wnd != nullptr)
@ -678,7 +678,7 @@ static void WindowEditorInventionsListDragOpen(
static const ResearchItem* WindowEditorInventionsListDragGetItem()
{
auto* wnd = static_cast<InventionDragWindow*>(window_find_by_class(WindowClass::EditorInventionListDrag));
auto* wnd = static_cast<InventionDragWindow*>(WindowFindByClass(WindowClass::EditorInventionListDrag));
if (wnd == nullptr)
{
return nullptr;

View File

@ -326,8 +326,8 @@ public:
{
if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number)
{
window_update_textbox_caret();
widget_invalidate(*this, WIDX_FILTER_TEXT_BOX);
WindowUpdateTextboxCaret();
WidgetInvalidate(*this, WIDX_FILTER_TEXT_BOX);
}
for (WidgetIndex i = WIDX_FILTER_RIDE_TAB_TRANSPORT; i <= WIDX_FILTER_RIDE_TAB_STALL; i++)
@ -339,7 +339,7 @@ public:
if (frame_no >= window_editor_object_selection_animation_loops[i - WIDX_FILTER_RIDE_TAB_TRANSPORT])
frame_no = 0;
widget_invalidate(*this, i);
WidgetInvalidate(*this, i);
break;
}
}
@ -353,7 +353,7 @@ public:
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*this);
WindowClose(*this);
if (gScreenFlags & SCREEN_FLAGS_EDITOR)
{
finish_object_selection();
@ -416,7 +416,7 @@ public:
break;
}
case WIDX_FILTER_TEXT_BOX:
window_start_textbox(*this, widgetIndex, STR_STRING, _filter_string, sizeof(_filter_string));
WindowStartTextbox(*this, widgetIndex, STR_STRING, _filter_string, sizeof(_filter_string));
break;
case WIDX_FILTER_CLEAR_BUTTON:
std::fill_n(_filter_string, sizeof(_filter_string), 0x00);
@ -461,7 +461,7 @@ public:
void OnResize() override
{
window_set_resize(*this, WW, WH, 1200, 1000);
WindowSetResize(*this, WW, WH, 1200, 1000);
}
void OnMouseDown(WidgetIndex widgetIndex) override
@ -576,7 +576,7 @@ public:
{
// Used for in-game object selection cheat to prevent crashing the game
// when windows attempt to draw objects that don't exist any more
window_close_all_except_class(WindowClass::EditorObjectSelection);
WindowCloseAllExceptClass(WindowClass::EditorObjectSelection);
int32_t selected_object = GetObjectFromObjectSelection(GetSelectedObjectType(), screenCoords.y);
if (selected_object == -1)
@ -600,7 +600,7 @@ public:
return;
// Close any other open windows such as options/colour schemes to prevent a crash.
window_close_all();
WindowCloseAll();
// window_close(*w);
// This function calls window_track_list_open

View File

@ -198,7 +198,7 @@ rct_window* WindowEditorObjectiveOptionsOpen()
{
rct_window* w;
w = window_bring_to_front_by_class(WindowClass::EditorObjectiveOptions);
w = WindowBringToFrontByClass(WindowClass::EditorObjectiveOptions);
if (w != nullptr)
return w;
@ -273,8 +273,8 @@ static void WindowEditorObjectiveOptionsSetPage(rct_window* w, int32_t page)
w->widgets = window_editor_objective_options_widgets[page];
w->Invalidate();
WindowEditorObjectiveOptionsUpdateDisabledWidgets(w);
window_event_resize_call(w);
window_event_invalidate_call(w);
WindowEventResizeCall(w);
WindowEventInvalidateCall(w);
WindowInitScrollWidgets(*w);
w->Invalidate();
}
@ -334,7 +334,7 @@ static void WindowEditorObjectiveOptionsMainMouseup(rct_window* w, WidgetIndex w
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -366,7 +366,7 @@ static void WindowEditorObjectiveOptionsMainMouseup(rct_window* w, WidgetIndex w
*/
static void WindowEditorObjectiveOptionsMainResize(rct_window* w)
{
window_set_resize(*w, 450, 229, 450, 229);
WindowSetResize(*w, 450, 229, 450, 229);
}
static void WindowEditorObjectiveOptionsShowObjectiveDropdown(rct_window* w)
@ -649,8 +649,8 @@ static void WindowEditorObjectiveOptionsMainUpdate(rct_window* w)
uint8_t objectiveType;
w->frame_no++;
window_event_invalidate_call(w);
widget_invalidate(*w, WIDX_TAB_1);
WindowEventInvalidateCall(w);
WidgetInvalidate(*w, WIDX_TAB_1);
parkFlags = gParkFlags;
objectiveType = gScenarioObjective.Type;
@ -911,7 +911,7 @@ static void WindowEditorObjectiveOptionsRidesMouseup(rct_window* w, WidgetIndex
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -926,7 +926,7 @@ static void WindowEditorObjectiveOptionsRidesMouseup(rct_window* w, WidgetIndex
*/
static void WindowEditorObjectiveOptionsRidesResize(rct_window* w)
{
window_set_resize(*w, 380, 224, 380, 224);
WindowSetResize(*w, 380, 224, 380, 224);
}
/**
@ -936,9 +936,9 @@ static void WindowEditorObjectiveOptionsRidesResize(rct_window* w)
static void WindowEditorObjectiveOptionsRidesUpdate(rct_window* w)
{
w->frame_no++;
window_event_invalidate_call(w);
window_event_resize_call(w);
widget_invalidate(*w, WIDX_TAB_2);
WindowEventInvalidateCall(w);
WindowEventResizeCall(w);
WidgetInvalidate(*w, WIDX_TAB_2);
auto numItems = 0;
for (auto& ride : GetRideManager())

View File

@ -371,7 +371,7 @@ private:
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*this);
WindowClose(*this);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -399,7 +399,7 @@ private:
void FinancialResize()
{
window_set_resize(*this, 280, 149, 280, 149);
WindowSetResize(*this, 280, 149, 280, 149);
}
void ShowClimateDropdown()
@ -531,8 +531,8 @@ private:
if (gScreenFlags == SCREEN_FLAGS_PLAYING)
{
window_invalidate_by_class(WindowClass::Finances);
window_invalidate_by_class(WindowClass::BottomToolbar);
WindowInvalidateByClass(WindowClass::Finances);
WindowInvalidateByClass(WindowClass::BottomToolbar);
}
}
@ -540,7 +540,7 @@ private:
{
frame_no++;
FinancialPrepareDraw();
widget_invalidate(*this, WIDX_TAB_1);
WidgetInvalidate(*this, WIDX_TAB_1);
}
void FinancialPrepareDraw()
@ -652,7 +652,7 @@ private:
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*this);
WindowClose(*this);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -680,7 +680,7 @@ private:
void GuestsResize()
{
window_set_resize(*this, 380, 149, 380, 149);
WindowSetResize(*this, 380, 149, 380, 149);
}
void GuestsMouseDown(WidgetIndex widgetIndex)
@ -798,7 +798,7 @@ private:
{
frame_no++;
GuestsPrepareDraw();
widget_invalidate(*this, WIDX_TAB_2);
WidgetInvalidate(*this, WIDX_TAB_2);
}
void GuestsPrepareDraw()
@ -898,7 +898,7 @@ private:
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*this);
WindowClose(*this);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -951,7 +951,7 @@ private:
void ParkResize()
{
window_set_resize(*this, 400, 200, 400, 200);
WindowSetResize(*this, 400, 200, 400, 200);
}
void ParkMouseDown(WidgetIndex widgetIndex)
@ -1097,7 +1097,7 @@ private:
{
frame_no++;
ParkPrepareDraw();
widget_invalidate(*this, WIDX_TAB_3);
WidgetInvalidate(*this, WIDX_TAB_3);
}
void ParkPrepareDraw()

View File

@ -109,7 +109,7 @@ public:
rct_window* WindowErrorOpen(std::string_view title, std::string_view message)
{
window_close_by_class(WindowClass::Error);
WindowCloseByClass(WindowClass::Error);
std::string buffer = "{BLACK}";
buffer.append(title);

View File

@ -461,8 +461,8 @@ public:
width = WW_OTHER_TABS;
height = WH_OTHER_TABS;
}
window_event_resize_call(this);
window_event_invalidate_call(this);
WindowEventResizeCall(this);
WindowEventInvalidateCall(this);
WindowInitScrollWidgets(*this);

View File

@ -167,12 +167,12 @@ public:
widgets = window_footpath_widgets;
WindowInitScrollWidgets(*this);
window_push_others_right(*this);
WindowPushOthersRight(*this);
show_gridlines();
tool_cancel();
ToolCancel();
_footpathConstructionMode = PATH_CONSTRUCTION_MODE_LAND;
tool_set(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown);
ToolSet(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown);
input_set_flag(INPUT_FLAG_6, true);
_footpathErrorOccured = false;
WindowFootpathSetEnabledAndPressedWidgets();
@ -184,13 +184,13 @@ public:
viewport_set_visibility(0);
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
hide_gridlines();
}
void OnUpdate() override
{
widget_invalidate(*this, WIDX_CONSTRUCT);
WidgetInvalidate(*this, WIDX_CONSTRUCT);
WindowFootpathUpdateProvisionalPathForBridgeMode();
// #2502: The camera might have changed rotation, so we need to update which directional buttons are pressed
@ -291,12 +291,12 @@ public:
}
_windowFootpathCost = MONEY32_UNDEFINED;
tool_cancel();
ToolCancel();
FootpathProvisionalUpdate();
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
_footpathConstructionMode = PATH_CONSTRUCTION_MODE_LAND;
tool_set(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown);
ToolSet(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown);
input_set_flag(INPUT_FLAG_6, true);
_footpathErrorOccured = false;
WindowFootpathSetEnabledAndPressedWidgets();
@ -308,12 +308,12 @@ public:
}
_windowFootpathCost = MONEY32_UNDEFINED;
tool_cancel();
ToolCancel();
FootpathProvisionalUpdate();
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
_footpathConstructionMode = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL;
tool_set(*this, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL, Tool::Crosshair);
ToolSet(*this, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL, Tool::Crosshair);
input_set_flag(INPUT_FLAG_6, true);
_footpathErrorOccured = false;
WindowFootpathSetEnabledAndPressedWidgets();
@ -540,7 +540,7 @@ private:
auto pathConstructFlags = FootpathCreateConstructFlags(type);
_windowFootpathCost = FootpathProvisionalSet(type, railings, footpathLoc, slope, pathConstructFlags);
widget_invalidate(*this, WIDX_CONSTRUCT);
WidgetInvalidate(*this, WIDX_CONSTRUCT);
}
auto curTime = Platform::GetTicks();
@ -841,7 +841,7 @@ private:
auto constructFlags = FootpathCreateConstructFlags(pathType);
_windowFootpathCost = FootpathProvisionalSet(
pathType, gFootpathSelection.Railings, { info.Loc, z }, slope, constructFlags);
window_invalidate_by_class(WindowClass::Footpath);
WindowInvalidateByClass(WindowClass::Footpath);
}
}
@ -1004,7 +1004,7 @@ private:
}
}
tool_cancel();
ToolCancel();
gFootpathConstructFromPosition = { mapCoords, z };
_footpathConstructDirection = direction;
gProvisionalFootpath.Flags = 0;
@ -1422,9 +1422,9 @@ void WindowFootpathResetSelectedPath()
gFootpathSelection = {};
}
void window_footpath_keyboard_shortcut_turn_left()
void WindowFootpathKeyboardShortcutTurnLeft()
{
rct_window* w = window_find_by_class(WindowClass::Footpath);
rct_window* w = WindowFindByClass(WindowClass::Footpath);
if (w != nullptr)
{
auto* footpathWindow = static_cast<FootpathWindow*>(w);
@ -1435,9 +1435,9 @@ void window_footpath_keyboard_shortcut_turn_left()
}
}
void window_footpath_keyboard_shortcut_turn_right()
void WindowFootpathKeyboardShortcutTurnRight()
{
rct_window* w = window_find_by_class(WindowClass::Footpath);
rct_window* w = WindowFindByClass(WindowClass::Footpath);
if (w != nullptr)
{
auto* footpathWindow = static_cast<FootpathWindow*>(w);
@ -1448,9 +1448,9 @@ void window_footpath_keyboard_shortcut_turn_right()
}
}
void window_footpath_keyboard_shortcut_slope_down()
void WindowFootpathKeyboardShortcutSlopeDown()
{
rct_window* w = window_find_by_class(WindowClass::Footpath);
rct_window* w = WindowFindByClass(WindowClass::Footpath);
if (w != nullptr)
{
auto* footpathWindow = static_cast<FootpathWindow*>(w);
@ -1461,9 +1461,9 @@ void window_footpath_keyboard_shortcut_slope_down()
}
}
void window_footpath_keyboard_shortcut_slope_up()
void WindowFootpathKeyboardShortcutSlopeUp()
{
rct_window* w = window_find_by_class(WindowClass::Footpath);
rct_window* w = WindowFindByClass(WindowClass::Footpath);
if (w != nullptr)
{
auto* footpathWindow = static_cast<FootpathWindow*>(w);
@ -1474,9 +1474,9 @@ void window_footpath_keyboard_shortcut_slope_up()
}
}
void window_footpath_keyboard_shortcut_demolish_current()
void WindowFootpathKeyboardShortcutDemolishCurrent()
{
rct_window* w = window_find_by_class(WindowClass::Footpath);
rct_window* w = WindowFindByClass(WindowClass::Footpath);
if (w != nullptr)
{
auto* footpathWindow = static_cast<FootpathWindow*>(w);
@ -1487,9 +1487,9 @@ void window_footpath_keyboard_shortcut_demolish_current()
}
}
void window_footpath_keyboard_shortcut_build_current()
void WindowFootpathKeyboardShortcutBuildCurrent()
{
rct_window* w = window_find_by_class(WindowClass::Footpath);
rct_window* w = WindowFindByClass(WindowClass::Footpath);
if (w != nullptr)
{
auto* footpathWindow = static_cast<FootpathWindow*>(w);

View File

@ -176,9 +176,9 @@ static void WindowGameBottomToolbarMouseup(rct_window* w, WidgetIndex widgetInde
if (!subjectLoc.has_value())
break;
rct_window* mainWindow = window_get_main();
rct_window* mainWindow = WindowGetMain();
if (mainWindow != nullptr)
window_scroll_to_location(*mainWindow, subjectLoc.value());
WindowScrollToLocation(*mainWindow, subjectLoc.value());
}
break;
case WIDX_RIGHT_OUTSET:
@ -338,7 +338,7 @@ void WindowGameBottomToolbarInvalidateNewsItem()
{
if (gScreenFlags == SCREEN_FLAGS_PLAYING)
{
widget_invalidate_by_class(WindowClass::BottomToolbar, WIDX_MIDDLE_OUTSET);
WidgetInvalidateByClass(WindowClass::BottomToolbar, WIDX_MIDDLE_OUTSET);
}
}
@ -733,30 +733,30 @@ static void WindowGameBottomToolbarInvalidateDirtyWidgets(rct_window* w)
if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_MONEY)
{
gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_MONEY;
widget_invalidate(*w, WIDX_LEFT_INSET);
WidgetInvalidate(*w, WIDX_LEFT_INSET);
}
if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_DATE)
{
gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_DATE;
widget_invalidate(*w, WIDX_RIGHT_INSET);
WidgetInvalidate(*w, WIDX_RIGHT_INSET);
}
if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_PEEP_COUNT)
{
gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_PEEP_COUNT;
widget_invalidate(*w, WIDX_LEFT_INSET);
WidgetInvalidate(*w, WIDX_LEFT_INSET);
}
if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_CLIMATE)
{
gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_CLIMATE;
widget_invalidate(*w, WIDX_RIGHT_INSET);
WidgetInvalidate(*w, WIDX_RIGHT_INSET);
}
if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_PARK_RATING)
{
gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_PARK_RATING;
widget_invalidate(*w, WIDX_LEFT_INSET);
WidgetInvalidate(*w, WIDX_LEFT_INSET);
}
}

View File

@ -196,7 +196,7 @@ public:
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
{
if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number)
tool_cancel();
ToolCancel();
}
}
@ -419,7 +419,7 @@ private:
}
maxWidth = std::max(minWidth, maxWidth);
window_set_resize(*this, minWidth, minHeight, maxWidth, maxHeight);
WindowSetResize(*this, minWidth, minHeight, maxWidth, maxHeight);
}
void OnPrepareDrawCommon()
@ -442,7 +442,7 @@ private:
ResizeFrameWithPage();
window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7);
WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7);
}
void DisableWidgets()
@ -481,7 +481,7 @@ private:
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
{
if (number == gCurrentToolWidget.window_number && classification == gCurrentToolWidget.window_classification)
tool_cancel();
ToolCancel();
}
int32_t listen = 0;
if (newPage == WINDOW_GUEST_OVERVIEW && page == WINDOW_GUEST_OVERVIEW && viewport != nullptr)
@ -581,7 +581,7 @@ private:
DisableWidgets();
OnPrepareDraw();
widget_invalidate(*this, WIDX_MARQUEE);
WidgetInvalidate(*this, WIDX_MARQUEE);
OnResizeCommon();
@ -624,10 +624,10 @@ private:
pickupAction.SetCallback([peepnum = number](const GameAction* ga, const GameActions::Result* result) {
if (result->Error != GameActions::Status::Ok)
return;
rct_window* wind = window_find_by_number(WindowClass::Peep, peepnum);
rct_window* wind = WindowFindByNumber(WindowClass::Peep, peepnum);
if (wind != nullptr)
{
tool_set(*wind, WC_PEEP__WIDX_PICKUP, Tool::Picker);
ToolSet(*wind, WC_PEEP__WIDX_PICKUP, Tool::Picker);
}
});
GameActions::Execute(&pickupAction);
@ -691,8 +691,8 @@ private:
void GuestFollow()
{
rct_window* main = window_get_main();
window_follow_sprite(*main, EntityId::FromUnderlying(number));
rct_window* main = WindowGetMain();
WindowFollowSprite(*main, EntityId::FromUnderlying(number));
}
void OnViewportRotateOverview()
@ -751,7 +751,7 @@ private:
// Draw the viewport no sound sprite
if (viewport != nullptr)
{
window_draw_viewport(&dpi, *this);
WindowDrawViewport(&dpi, *this);
if (viewport->flags & VIEWPORT_FLAG_SOUND_ON)
{
GfxDrawSprite(&dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 });
@ -854,8 +854,8 @@ private:
newAnimationFrame %= 24;
_guestAnimationFrame = newAnimationFrame;
widget_invalidate(*this, WIDX_TAB_1);
widget_invalidate(*this, WIDX_TAB_2);
WidgetInvalidate(*this, WIDX_TAB_1);
WidgetInvalidate(*this, WIDX_TAB_2);
const auto peep = GetGuest();
if (peep == nullptr)
@ -865,7 +865,7 @@ private:
if (peep->WindowInvalidateFlags & PEEP_INVALIDATE_PEEP_ACTION)
{
peep->WindowInvalidateFlags &= ~PEEP_INVALIDATE_PEEP_ACTION;
widget_invalidate(*this, WIDX_ACTION_LBL);
WidgetInvalidate(*this, WIDX_ACTION_LBL);
}
_marqueePosition += 2;
@ -964,7 +964,7 @@ private:
pickupAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) {
if (result->Error != GameActions::Status::Ok)
return;
tool_cancel();
ToolCancel();
gPickupPeepImage = ImageId();
});
GameActions::Execute(&pickupAction);
@ -1225,8 +1225,8 @@ private:
{
frame_no++;
widget_invalidate(*this, WIDX_TAB_2);
widget_invalidate(*this, WIDX_TAB_3);
WidgetInvalidate(*this, WIDX_TAB_2);
WidgetInvalidate(*this, WIDX_TAB_3);
const auto guest = GetGuest();
if (guest == nullptr)
@ -1400,8 +1400,8 @@ private:
{
frame_no++;
widget_invalidate(*this, WIDX_TAB_2);
widget_invalidate(*this, WIDX_TAB_4);
WidgetInvalidate(*this, WIDX_TAB_2);
WidgetInvalidate(*this, WIDX_TAB_4);
}
void OnDrawFinance(rct_drawpixelinfo& dpi)
@ -1538,8 +1538,8 @@ private:
{
frame_no++;
widget_invalidate(*this, WIDX_TAB_2);
widget_invalidate(*this, WIDX_TAB_5);
WidgetInvalidate(*this, WIDX_TAB_2);
WidgetInvalidate(*this, WIDX_TAB_5);
auto peep = GetGuest();
if (peep == nullptr)
@ -1613,8 +1613,8 @@ private:
{
frame_no++;
widget_invalidate(*this, WIDX_TAB_2);
widget_invalidate(*this, WIDX_TAB_6);
WidgetInvalidate(*this, WIDX_TAB_2);
WidgetInvalidate(*this, WIDX_TAB_6);
auto peep = GetGuest();
if (peep == nullptr)
@ -1918,8 +1918,7 @@ rct_window* WindowGuestOpen(Peep* peep)
return WindowStaffOpen(peep);
}
auto* window = static_cast<GuestWindow*>(
window_bring_to_front_by_number(WindowClass::Peep, peep->sprite_index.ToUnderlying()));
auto* window = static_cast<GuestWindow*>(WindowBringToFrontByNumber(WindowClass::Peep, peep->sprite_index.ToUnderlying()));
if (window == nullptr)
{
int32_t windowWidth = 192;

View File

@ -956,7 +956,7 @@ private:
rct_window* WindowGuestListOpen()
{
auto* window = window_bring_to_front_by_class(WindowClass::GuestList);
auto* window = WindowBringToFrontByClass(WindowClass::GuestList);
if (window == nullptr)
{
window = WindowCreate<GuestListWindow>(WindowClass::GuestList, 350, 330, WF_10 | WF_RESIZABLE);
@ -979,7 +979,7 @@ rct_window* WindowGuestListOpenWithFilter(GuestListFilterType type, int32_t inde
void WindowGuestListRefreshList()
{
auto* w = window_find_by_class(WindowClass::GuestList);
auto* w = WindowFindByClass(WindowClass::GuestList);
if (w != nullptr)
{
static_cast<GuestListWindow*>(w)->RefreshList();

View File

@ -85,7 +85,7 @@ public:
track_list.track_list_being_updated = false;
WindowInitScrollWidgets(*this);
window_push_others_right(*this);
WindowPushOthersRight(*this);
}
void OnClose() override
@ -130,7 +130,7 @@ public:
_trackName = std::string(text);
window_event_mouse_up_call(this, WIDX_INSTALL);
WindowEventMouseUpCall(this, WIDX_INSTALL);
}
void OnPrepareDraw() override
@ -422,8 +422,8 @@ rct_window* WindowInstallTrackOpen(const utf8* path)
return nullptr;
}
window_close_by_class(WindowClass::EditorObjectSelection);
window_close_construction_windows();
WindowCloseByClass(WindowClass::EditorObjectSelection);
WindowCloseConstructionWindows();
gTrackDesignSceneryToggle = false;
_currentTrackPieceDirection = 2;

View File

@ -72,7 +72,7 @@ public:
widgets = window_land_widgets;
hold_down_widgets = (1uLL << WIDX_DECREMENT) | (1uLL << WIDX_INCREMENT);
WindowInitScrollWidgets(*this);
window_push_others_below(*this);
WindowPushOthersBelow(*this);
gLandToolSize = 1;
gLandToolTerrainSurface = OBJECT_ENTRY_INDEX_NULL;
@ -89,7 +89,7 @@ public:
{
// If the tool wasn't changed, turn tool off
if (LandToolIsActive())
tool_cancel();
ToolCancel();
}
void OnMouseUp(WidgetIndex widgetIndex) override

View File

@ -60,14 +60,14 @@ public:
widgets = window_land_rights_widgets;
hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT);
WindowInitScrollWidgets(*this);
window_push_others_below(*this);
WindowPushOthersBelow(*this);
_landRightsMode = LAND_RIGHTS_MODE_BUY_LAND;
pressed_widgets = (1uLL << WIDX_BUY_LAND_RIGHTS);
gLandToolSize = 1;
show_gridlines();
tool_set(*this, WIDX_BUY_LAND_RIGHTS, Tool::UpArrow);
ToolSet(*this, WIDX_BUY_LAND_RIGHTS, Tool::UpArrow);
input_set_flag(INPUT_FLAG_6, true);
show_land_rights();
@ -88,7 +88,7 @@ public:
// If the tool wasn't changed, turn tool off
if (LandRightsToolIsActive())
tool_cancel();
ToolCancel();
}
void OnMouseUp(WidgetIndex widgetIndex) override
@ -104,7 +104,7 @@ public:
case WIDX_BUY_LAND_RIGHTS:
if (_landRightsMode != LAND_RIGHTS_MODE_BUY_LAND)
{
tool_set(*this, WIDX_BUY_LAND_RIGHTS, Tool::UpArrow);
ToolSet(*this, WIDX_BUY_LAND_RIGHTS, Tool::UpArrow);
_landRightsMode = LAND_RIGHTS_MODE_BUY_LAND;
show_land_rights();
Invalidate();
@ -113,7 +113,7 @@ public:
case WIDX_BUY_CONSTRUCTION_RIGHTS:
if (_landRightsMode != LAND_RIGHTS_MODE_BUY_CONSTRUCTION_RIGHTS)
{
tool_set(*this, WIDX_BUY_CONSTRUCTION_RIGHTS, Tool::UpArrow);
ToolSet(*this, WIDX_BUY_CONSTRUCTION_RIGHTS, Tool::UpArrow);
_landRightsMode = LAND_RIGHTS_MODE_BUY_CONSTRUCTION_RIGHTS;
show_construction_rights();
Invalidate();
@ -247,7 +247,7 @@ public:
if (_landRightsCost != MONEY32_UNDEFINED)
{
_landRightsCost = MONEY32_UNDEFINED;
window_invalidate_by_class(WindowClass::ClearScenery);
WindowInvalidateByClass(WindowClass::ClearScenery);
}
return;
}

View File

@ -272,7 +272,7 @@ static void Select(const char* path)
if (OpenRCT2::GetContext()->LoadParkFromFile(pathBuffer))
{
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
window_close_by_class(WindowClass::Loadsave);
WindowCloseByClass(WindowClass::Loadsave);
GfxInvalidateScreen();
}
else
@ -292,7 +292,7 @@ static void Select(const char* path)
gIsAutosaveLoaded = false;
gFirstTimeSaving = false;
window_close_by_class(WindowClass::Loadsave);
WindowCloseByClass(WindowClass::Loadsave);
GfxInvalidateScreen();
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
@ -326,7 +326,7 @@ static void Select(const char* path)
if (scenario_save(pathBuffer, gConfigGeneral.SavePluginData ? 3 : 2))
{
gCurrentLoadedPath = pathBuffer;
window_close_by_class(WindowClass::Loadsave);
WindowCloseByClass(WindowClass::Loadsave);
GfxInvalidateScreen();
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
}
@ -349,7 +349,7 @@ static void Select(const char* path)
if (success)
{
window_close_by_class(WindowClass::Loadsave);
WindowCloseByClass(WindowClass::Loadsave);
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
title_load();
}
@ -368,7 +368,7 @@ static void Select(const char* path)
auto intent = Intent(WindowClass::InstallTrack);
intent.putExtra(INTENT_EXTRA_PATH, std::string{ pathBuffer });
ContextOpenIntent(&intent);
window_close_by_class(WindowClass::Loadsave);
WindowCloseByClass(WindowClass::Loadsave);
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
break;
}
@ -386,7 +386,7 @@ static void Select(const char* path)
if (success)
{
window_close_by_class(WindowClass::Loadsave);
WindowCloseByClass(WindowClass::Loadsave);
WindowRideMeasurementsDesignCancel();
InvokeCallback(MODAL_RESULT_OK, path);
}
@ -399,7 +399,7 @@ static void Select(const char* path)
}
case (LOADSAVETYPE_LOAD | LOADSAVETYPE_HEIGHTMAP):
window_close_by_class(WindowClass::Loadsave);
WindowCloseByClass(WindowClass::Loadsave);
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
break;
}
@ -703,7 +703,7 @@ public:
void OnClose() override
{
_listItems.clear();
window_close_by_class(WindowClass::LoadsaveOverwritePrompt);
WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt);
}
void OnResize() override
@ -1057,7 +1057,7 @@ rct_window* WindowLoadsaveOpen(
const u8string path = GetDir(type);
auto* w = static_cast<LoadSaveWindow*>(window_bring_to_front_by_class(WindowClass::Loadsave));
auto* w = static_cast<LoadSaveWindow*>(WindowBringToFrontByClass(WindowClass::Loadsave));
if (w == nullptr)
{
w = WindowCreate<LoadSaveWindow>(
@ -1133,7 +1133,7 @@ static rct_window* WindowOverwritePromptOpen(const char* name, const char* path)
{
rct_window* w;
window_close_by_class(WindowClass::LoadsaveOverwritePrompt);
WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt);
w = WindowCreateCentred(
OVERWRITE_WW, OVERWRITE_WH, &window_overwrite_prompt_events, WindowClass::LoadsaveOverwritePrompt, WF_STICK_TO_FRONT);
@ -1160,13 +1160,13 @@ static void WindowOverwritePromptMouseup(rct_window* w, WidgetIndex widgetIndex)
// As the LoadSaveWindow::Select function can change the order of the
// windows we can't use window_close(w).
window_close_by_class(WindowClass::LoadsaveOverwritePrompt);
WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt);
break;
}
case WIDX_OVERWRITE_CANCEL:
case WIDX_OVERWRITE_CLOSE:
window_close(*w);
WindowClose(*w);
break;
}
}

View File

@ -174,7 +174,7 @@ public:
if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == classification
&& gCurrentToolWidget.window_number == number)
{
tool_cancel();
ToolCancel();
}
}
@ -196,7 +196,7 @@ public:
break;
case WIDX_SET_LAND_RIGHTS:
Invalidate();
if (tool_set(*this, widgetIndex, Tool::UpArrow))
if (ToolSet(*this, widgetIndex, Tool::UpArrow))
break;
_activeTool = 2;
// Prevent mountain tool size.
@ -239,7 +239,7 @@ public:
break;
case WIDX_BUILD_PARK_ENTRANCE:
Invalidate();
if (tool_set(*this, widgetIndex, Tool::UpArrow))
if (ToolSet(*this, widgetIndex, Tool::UpArrow))
break;
gParkEntranceGhostExists = false;
@ -253,7 +253,7 @@ public:
gWindowSceneryRotation = (gWindowSceneryRotation + 1) & 3;
break;
case WIDX_PEOPLE_STARTING_POSITION:
if (tool_set(*this, widgetIndex, Tool::UpArrow))
if (ToolSet(*this, widgetIndex, Tool::UpArrow))
break;
show_gridlines();
@ -650,10 +650,10 @@ public:
auto mapCoords = CoordsXY{ std::clamp(c.x, 0, MAXIMUM_MAP_SIZE_BIG - 1), std::clamp(c.y, 0, MAXIMUM_MAP_SIZE_BIG - 1) };
auto mapZ = TileElementHeight(mapCoords);
rct_window* mainWindow = window_get_main();
rct_window* mainWindow = WindowGetMain();
if (mainWindow != nullptr)
{
window_scroll_to_location(*mainWindow, { mapCoords, mapZ });
WindowScrollToLocation(*mainWindow, { mapCoords, mapZ });
}
if (LandToolIsActive())
@ -928,7 +928,7 @@ private:
void CentreMapOnViewPoint()
{
rct_window* mainWindow = window_get_main();
rct_window* mainWindow = WindowGetMain();
int16_t ax, bx, cx, dx;
int16_t bp, di;
@ -1243,7 +1243,7 @@ private:
*/
void PaintHudRectangle(rct_drawpixelinfo* dpi)
{
rct_window* mainWindow = window_get_main();
rct_window* mainWindow = WindowGetMain();
if (mainWindow == nullptr)
return;
@ -1461,7 +1461,7 @@ void WindowMapReset()
rct_window* w;
// Check if window is even opened
w = window_bring_to_front_by_class(WindowClass::Map);
w = WindowBringToFrontByClass(WindowClass::Map);
if (w == nullptr)
{
return;

View File

@ -421,7 +421,7 @@ static void WindowMapgenChangeMapSize(int32_t sizeOffset)
rct_window* WindowMapgenOpen()
{
rct_window* w = window_bring_to_front_by_class(WindowClass::Mapgen);
rct_window* w = WindowBringToFrontByClass(WindowClass::Mapgen);
if (w != nullptr)
{
return w;
@ -455,7 +455,7 @@ static void WindowMapgenSharedMouseup(rct_window* w, WidgetIndex widgetIndex)
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -620,7 +620,7 @@ static void WindowMapgenBaseUpdate(rct_window* w)
// Tab animation
if (++w->frame_no >= TabAnimationLoops[w->page])
w->frame_no = 0;
widget_invalidate(*w, WIDX_TAB_1);
WidgetInvalidate(*w, WIDX_TAB_1);
}
static void WindowMapgenTextinput(rct_window* w, WidgetIndex widgetIndex, char* text)
@ -809,7 +809,7 @@ static void WindowMapgenRandomUpdate(rct_window* w)
// Tab animation
if (++w->frame_no >= TabAnimationLoops[w->page])
w->frame_no = 0;
widget_invalidate(*w, WIDX_TAB_2);
WidgetInvalidate(*w, WIDX_TAB_2);
}
static void WindowMapgenRandomInvalidate(rct_window* w)
@ -1007,7 +1007,7 @@ static void WindowMapgenSimplexUpdate(rct_window* w)
// Tab animation
if (++w->frame_no >= TabAnimationLoops[w->page])
w->frame_no = 0;
widget_invalidate(*w, WIDX_TAB_3);
WidgetInvalidate(*w, WIDX_TAB_3);
}
static void WindowMapgenSimplexInvalidate(rct_window* w)
@ -1120,37 +1120,37 @@ static void WindowMapgenHeightmapMousedown(rct_window* w, WidgetIndex widgetInde
{
case WIDX_HEIGHTMAP_STRENGTH_UP:
_heightmapSmoothStrength = std::min(_heightmapSmoothStrength + 1, MAX_SMOOTH_ITERATIONS);
widget_invalidate(*w, WIDX_HEIGHTMAP_STRENGTH);
WidgetInvalidate(*w, WIDX_HEIGHTMAP_STRENGTH);
break;
case WIDX_HEIGHTMAP_STRENGTH_DOWN:
_heightmapSmoothStrength = std::max(_heightmapSmoothStrength - 1, 1);
widget_invalidate(*w, WIDX_HEIGHTMAP_STRENGTH);
WidgetInvalidate(*w, WIDX_HEIGHTMAP_STRENGTH);
break;
case WIDX_HEIGHTMAP_LOW_UP:
_heightmapLow = std::min(_heightmapLow + 1, 142 - 1);
_heightmapHigh = std::max(_heightmapHigh, _heightmapLow + 1);
widget_invalidate(*w, WIDX_HEIGHTMAP_LOW);
WidgetInvalidate(*w, WIDX_HEIGHTMAP_LOW);
break;
case WIDX_HEIGHTMAP_LOW_DOWN:
_heightmapLow = std::max(_heightmapLow - 1, 2);
widget_invalidate(*w, WIDX_HEIGHTMAP_LOW);
WidgetInvalidate(*w, WIDX_HEIGHTMAP_LOW);
break;
case WIDX_HEIGHTMAP_HIGH_UP:
_heightmapHigh = std::min(_heightmapHigh + 1, 142);
widget_invalidate(*w, WIDX_HEIGHTMAP_HIGH);
WidgetInvalidate(*w, WIDX_HEIGHTMAP_HIGH);
break;
case WIDX_HEIGHTMAP_HIGH_DOWN:
_heightmapHigh = std::max(_heightmapHigh - 1, 2 + 1);
_heightmapLow = std::min(_heightmapLow, _heightmapHigh - 1);
widget_invalidate(*w, WIDX_HEIGHTMAP_HIGH);
WidgetInvalidate(*w, WIDX_HEIGHTMAP_HIGH);
break;
case WIDX_HEIGHTMAP_WATER_LEVEL_UP:
_waterLevel = std::min(_waterLevel + MINIMUM_WATER_HEIGHT, MINIMUM_WATER_HEIGHT + MAXIMUM_WATER_HEIGHT);
widget_invalidate(*w, WIDX_HEIGHTMAP_WATER_LEVEL);
WidgetInvalidate(*w, WIDX_HEIGHTMAP_WATER_LEVEL);
break;
case WIDX_HEIGHTMAP_WATER_LEVEL_DOWN:
_waterLevel = std::max(_waterLevel - MINIMUM_WATER_HEIGHT, 0);
widget_invalidate(*w, WIDX_HEIGHTMAP_WATER_LEVEL);
WidgetInvalidate(*w, WIDX_HEIGHTMAP_WATER_LEVEL);
break;
}
}
@ -1216,18 +1216,18 @@ static void WindowMapgenHeightmapMouseup(rct_window* w, WidgetIndex widgetIndex)
WidgetSetEnabled(*w, WIDX_HEIGHTMAP_STRENGTH, _heightmapSmoothMap);
WidgetSetEnabled(*w, WIDX_HEIGHTMAP_STRENGTH_UP, _heightmapSmoothMap);
WidgetSetEnabled(*w, WIDX_HEIGHTMAP_STRENGTH_DOWN, _heightmapSmoothMap);
widget_invalidate(*w, WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP);
widget_invalidate(*w, WIDX_HEIGHTMAP_STRENGTH);
WidgetInvalidate(*w, WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP);
WidgetInvalidate(*w, WIDX_HEIGHTMAP_STRENGTH);
break;
case WIDX_HEIGHTMAP_NORMALIZE:
_heightmapNormalize = !_heightmapNormalize;
WidgetSetCheckboxValue(*w, WIDX_HEIGHTMAP_NORMALIZE, _heightmapNormalize);
widget_invalidate(*w, WIDX_HEIGHTMAP_NORMALIZE);
WidgetInvalidate(*w, WIDX_HEIGHTMAP_NORMALIZE);
break;
case WIDX_HEIGHTMAP_SMOOTH_TILES:
_heightmapSmoothTiles = !_heightmapSmoothTiles;
WidgetSetCheckboxValue(*w, WIDX_HEIGHTMAP_SMOOTH_TILES, _heightmapSmoothTiles);
widget_invalidate(*w, WIDX_HEIGHTMAP_SMOOTH_TILES);
WidgetInvalidate(*w, WIDX_HEIGHTMAP_SMOOTH_TILES);
break;
}

View File

@ -61,7 +61,7 @@ void WindowMapTooltipUpdateVisibility()
if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)
{
// The map tooltip is drawn by the bottom toolbar
window_invalidate_by_class(WindowClass::BottomToolbar);
WindowInvalidateByClass(WindowClass::BottomToolbar);
return;
}
@ -84,9 +84,9 @@ void WindowMapTooltipUpdateVisibility()
if (_cursorHoldDuration < 25 || stringId == STR_NONE
|| InputTestPlaceObjectModifier(
static_cast<PLACE_OBJECT_MODIFIER>(PLACE_OBJECT_MODIFIER_COPY_Z | PLACE_OBJECT_MODIFIER_SHIFT_Z))
|| window_find_by_class(WindowClass::Error) != nullptr)
|| WindowFindByClass(WindowClass::Error) != nullptr)
{
window_close_by_class(WindowClass::MapTooltip);
WindowCloseByClass(WindowClass::MapTooltip);
}
else
{
@ -107,7 +107,7 @@ static void WindowMapTooltipOpen()
const CursorState* state = ContextGetCursorState();
ScreenCoordsXY pos = { state->position.x - (width / 2), state->position.y + 15 };
w = window_find_by_class(WindowClass::MapTooltip);
w = WindowFindByClass(WindowClass::MapTooltip);
if (w == nullptr)
{
w = WindowCreate(

View File

@ -115,7 +115,7 @@ public:
// In order to cancel the yellow arrow correctly the
// selection tool should be cancelled.
tool_cancel();
ToolCancel();
hide_gridlines();
@ -185,7 +185,7 @@ public:
{
if ((disabledWidgets & (1uLL << i)) != (currentDisabledWidgets & (1uLL << i)))
{
widget_invalidate(*this, i);
WidgetInvalidate(*this, i);
}
}
disabled_widgets = disabledWidgets;
@ -244,7 +244,7 @@ public:
if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
&& gCurrentToolWidget.window_classification == WindowClass::RideConstruction)
{
tool_cancel();
ToolCancel();
}
break;
default:
@ -258,11 +258,11 @@ public:
switch (widgetIndex)
{
case WIDX_MAZE_DIRECTION_GROUPBOX:
ride_construction_toolupdate_construct(screenCoords);
RideConstructionToolupdateConstruct(screenCoords);
break;
case WIDX_MAZE_ENTRANCE:
case WIDX_MAZE_EXIT:
ride_construction_toolupdate_entrance_exit(screenCoords);
RideConstructionToolupdateEntranceExit(screenCoords);
break;
}
}
@ -272,7 +272,7 @@ public:
switch (widgetIndex)
{
case WIDX_MAZE_DIRECTION_GROUPBOX:
ride_construction_tooldown_construct(screenCoords);
RideConstructionTooldownConstruct(screenCoords);
break;
case WIDX_MAZE_ENTRANCE:
case WIDX_MAZE_EXIT:
@ -305,7 +305,7 @@ public:
private:
void WindowMazeConstructionEntranceMouseup(WidgetIndex widgetIndex)
{
if (tool_set(*this, widgetIndex, Tool::Crosshair))
if (ToolSet(*this, widgetIndex, Tool::Crosshair))
return;
gRideEntranceExitPlaceType = widgetIndex == WIDX_MAZE_ENTRANCE ? ENTRANCE_TYPE_RIDE_ENTRANCE : ENTRANCE_TYPE_RIDE_EXIT;
@ -328,7 +328,7 @@ private:
{
if (_rideConstructionState == RideConstructionState::EntranceExit)
{
tool_cancel();
ToolCancel();
}
_rideConstructionState = rideConstructionState;
WindowMazeConstructionUpdatePressedWidgets();
@ -365,14 +365,14 @@ private:
auto currentRide = get_ride(rideIndex);
if (currentRide != nullptr && ride_are_all_possible_entrances_and_exits_built(*currentRide).Successful)
{
tool_cancel();
ToolCancel();
if (currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
window_close_by_class(WindowClass::RideConstruction);
WindowCloseByClass(WindowClass::RideConstruction);
}
else
{
gRideEntranceExitPlaceType = gRideEntranceExitPlaceType ^ 1;
window_invalidate_by_class(WindowClass::RideConstruction);
WindowInvalidateByClass(WindowClass::RideConstruction);
gCurrentToolWidget.widget_index = (gRideEntranceExitPlaceType == ENTRANCE_TYPE_RIDE_ENTRANCE)
? WIDX_MAZE_ENTRANCE
: WIDX_MAZE_EXIT;
@ -438,7 +438,7 @@ void WindowMazeConstructionUpdatePressedWidgets()
{
rct_window* w;
w = window_find_by_class(WindowClass::RideConstruction);
w = WindowFindByClass(WindowClass::RideConstruction);
if (w == nullptr)
return;

View File

@ -232,7 +232,7 @@ static ScreenCoordsXY _windowInformationSize;
rct_window* WindowMultiplayerOpen()
{
// Check if window is already open
rct_window* window = window_bring_to_front_by_class(WindowClass::Multiplayer);
rct_window* window = WindowBringToFrontByClass(WindowClass::Multiplayer);
if (window == nullptr)
{
window = WindowCreateAutoPos(
@ -258,8 +258,8 @@ static void WindowMultiplayerSetPage(rct_window* w, int32_t page)
w->widgets = window_multiplayer_page_widgets[page];
w->widgets[WIDX_TITLE].text = WindowMultiplayerPageTitles[page];
window_event_resize_call(w);
window_event_invalidate_call(w);
WindowEventResizeCall(w);
WindowEventInvalidateCall(w);
WindowInitScrollWidgets(*w);
w->Invalidate();
}
@ -313,7 +313,7 @@ static void WindowMultiplayerInformationMouseup(rct_window* w, WidgetIndex widge
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB1:
case WIDX_TAB2:
@ -380,20 +380,20 @@ static ScreenCoordsXY WindowMultiplayerInformationGetSize()
static void WindowMultiplayerInformationResize(rct_window* w)
{
auto size = WindowMultiplayerInformationGetSize();
window_set_resize(*w, size.x, size.y, size.x, size.y);
WindowSetResize(*w, size.x, size.y, size.x, size.y);
}
static void WindowMultiplayerInformationUpdate(rct_window* w)
{
w->frame_no++;
widget_invalidate(*w, WIDX_TAB1 + w->page);
WidgetInvalidate(*w, WIDX_TAB1 + w->page);
}
static void WindowMultiplayerInformationInvalidate(rct_window* w)
{
WindowMultiplayerSetPressedTab(w);
WindowMultiplayerAnchorBorderWidgets(w);
window_align_tabs(w, WIDX_TAB1, WIDX_TAB4);
WindowAlignTabs(w, WIDX_TAB1, WIDX_TAB4);
}
static void WindowMultiplayerInformationPaint(rct_window* w, rct_drawpixelinfo* dpi)
@ -468,7 +468,7 @@ static void WindowMultiplayerPlayersMouseup(rct_window* w, WidgetIndex widgetInd
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB1:
case WIDX_TAB2:
@ -484,7 +484,7 @@ static void WindowMultiplayerPlayersMouseup(rct_window* w, WidgetIndex widgetInd
static void WindowMultiplayerPlayersResize(rct_window* w)
{
window_set_resize(*w, 420, 124, 500, 450);
WindowSetResize(*w, 420, 124, 500, 450);
w->no_list_items = (IsServerPlayerInvisible() ? network_get_num_visible_players() : network_get_num_players());
w->list_item_positions[0] = 0;
@ -498,7 +498,7 @@ static void WindowMultiplayerPlayersResize(rct_window* w)
static void WindowMultiplayerPlayersUpdate(rct_window* w)
{
w->frame_no++;
widget_invalidate(*w, WIDX_TAB1 + w->page);
WidgetInvalidate(*w, WIDX_TAB1 + w->page);
}
static void WindowMultiplayerPlayersScrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height)
@ -555,7 +555,7 @@ static void WindowMultiplayerPlayersInvalidate(rct_window* w)
WindowMultiplayerAnchorBorderWidgets(w);
window_multiplayer_players_widgets[WIDX_LIST].right = w->width - 4;
window_multiplayer_players_widgets[WIDX_LIST].bottom = w->height - 0x0F;
window_align_tabs(w, WIDX_TAB1, WIDX_TAB4);
WindowAlignTabs(w, WIDX_TAB1, WIDX_TAB4);
}
static void WindowMultiplayerPlayersPaint(rct_window* w, rct_drawpixelinfo* dpi)
@ -682,7 +682,7 @@ static void WindowMultiplayerGroupsMouseup(rct_window* w, WidgetIndex widgetInde
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB1:
case WIDX_TAB2:
@ -715,7 +715,7 @@ static void WindowMultiplayerGroupsMouseup(rct_window* w, WidgetIndex widgetInde
static void WindowMultiplayerGroupsResize(rct_window* w)
{
window_set_resize(*w, 320, 200, 320, 500);
WindowSetResize(*w, 320, 200, 320, 500);
w->no_list_items = network_get_num_actions();
w->list_item_positions[0] = 0;
@ -764,7 +764,7 @@ static void WindowMultiplayerGroupsDropdown(rct_window* w, WidgetIndex widgetInd
static void WindowMultiplayerGroupsUpdate(rct_window* w)
{
w->frame_no++;
widget_invalidate(*w, WIDX_TAB1 + w->page);
WidgetInvalidate(*w, WIDX_TAB1 + w->page);
}
static void WindowMultiplayerGroupsScrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height)
@ -834,7 +834,7 @@ static void WindowMultiplayerGroupsInvalidate(rct_window* w)
WindowMultiplayerAnchorBorderWidgets(w);
window_multiplayer_groups_widgets[WIDX_PERMISSIONS_LIST].right = w->width - 4;
window_multiplayer_groups_widgets[WIDX_PERMISSIONS_LIST].bottom = w->height - 0x0F;
window_align_tabs(w, WIDX_TAB1, WIDX_TAB4);
WindowAlignTabs(w, WIDX_TAB1, WIDX_TAB4);
// select other group if one is removed
while (network_get_group_index(_selectedGroup) == -1 && _selectedGroup > 0)
@ -940,7 +940,7 @@ static void WindowMultiplayerOptionsMouseup(rct_window* w, WidgetIndex widgetInd
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB1:
case WIDX_TAB2:
@ -968,20 +968,20 @@ static void WindowMultiplayerOptionsMouseup(rct_window* w, WidgetIndex widgetInd
static void WindowMultiplayerOptionsResize(rct_window* w)
{
window_set_resize(*w, 300, 100, 300, 100);
WindowSetResize(*w, 300, 100, 300, 100);
}
static void WindowMultiplayerOptionsUpdate(rct_window* w)
{
w->frame_no++;
widget_invalidate(*w, WIDX_TAB1 + w->page);
WidgetInvalidate(*w, WIDX_TAB1 + w->page);
}
static void WindowMultiplayerOptionsInvalidate(rct_window* w)
{
WindowMultiplayerSetPressedTab(w);
WindowMultiplayerAnchorBorderWidgets(w);
window_align_tabs(w, WIDX_TAB1, WIDX_TAB4);
WindowAlignTabs(w, WIDX_TAB1, WIDX_TAB4);
if (network_get_mode() == NETWORK_MODE_CLIENT)
{

View File

@ -142,7 +142,7 @@ rct_window* WindowNetworkStatusOpen(const std::string& text, close_callback onCl
// force close
void WindowNetworkStatusClose()
{
auto window = window_find_by_class(WindowClass::NetworkStatus);
auto window = WindowFindByClass(WindowClass::NetworkStatus);
if (window == nullptr)
{
return;

View File

@ -260,7 +260,7 @@ public:
gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) {
if (result->Error == GameActions::Status::Ok)
{
window_close_by_class(WindowClass::NewCampaign);
WindowCloseByClass(WindowClass::NewCampaign);
}
});
GameActions::Execute(&gameAction);
@ -373,13 +373,13 @@ public:
rct_window* WindowNewCampaignOpen(int16_t campaignType)
{
auto w = static_cast<NewCampaignWindow*>(window_bring_to_front_by_class(WindowClass::NewCampaign));
auto w = static_cast<NewCampaignWindow*>(WindowBringToFrontByClass(WindowClass::NewCampaign));
if (w != nullptr)
{
if (w->campaign.campaign_type == campaignType)
return w;
window_close(*w);
WindowClose(*w);
}
w = WindowCreate<NewCampaignWindow>(WindowClass::NewCampaign, WW, WH, 0);
@ -392,7 +392,7 @@ rct_window* WindowNewCampaignOpen(int16_t campaignType)
void WindowCampaignRefreshRides()
{
auto w = static_cast<NewCampaignWindow*>(window_find_by_class(WindowClass::NewCampaign));
auto w = static_cast<NewCampaignWindow*>(WindowFindByClass(WindowClass::NewCampaign));
if (w != nullptr)
{
w->RefreshRides();

View File

@ -307,7 +307,7 @@ public:
if (frame_no >= TabAnimationLoops[_currentTab])
frame_no = 0;
widget_invalidate(*this, WIDX_TAB_1 + static_cast<int32_t>(_currentTab));
WidgetInvalidate(*this, WIDX_TAB_1 + static_cast<int32_t>(_currentTab));
if (new_ride.SelectedRide.Type != RIDE_TYPE_NULL && new_ride.selected_ride_countdown-- == 0)
{
@ -324,7 +324,7 @@ public:
if (!WidgetIsHighlighted(*this, WIDX_RIDE_LIST))
{
new_ride.HighlightedRide = { RIDE_TYPE_NULL, OBJECT_ENTRY_INDEX_NULL };
widget_invalidate(*this, WIDX_RIDE_LIST);
WidgetInvalidate(*this, WIDX_RIDE_LIST);
}
}
}
@ -522,7 +522,7 @@ private:
}
Close();
window_close_construction_windows();
WindowCloseConstructionWindows();
auto count = GetNumTrackDesigns(item);
if (count > 0)
@ -811,7 +811,7 @@ private:
// Get maximum scroll height
int32_t scrollWidth = 0;
int32_t scrollHeight = 0;
window_get_scroll_size(this, 0, &scrollWidth, &scrollHeight);
WindowGetScrollSize(this, 0, &scrollWidth, &scrollHeight);
const Widget& listWidget = widgets[WIDX_RIDE_LIST];
const int32_t listWidgetHeight = listWidget.bottom - listWidget.top - 1;
@ -950,14 +950,14 @@ rct_window* WindowNewRideOpen()
{
rct_window* window;
window = window_bring_to_front_by_class(WindowClass::ConstructRide);
window = WindowBringToFrontByClass(WindowClass::ConstructRide);
if (window)
{
return window;
}
window_close_by_class(WindowClass::TrackDesignList);
window_close_by_class(WindowClass::TrackDesignPlace);
WindowCloseByClass(WindowClass::TrackDesignList);
WindowCloseByClass(WindowClass::TrackDesignPlace);
window = WindowCreate<NewRideWindow>(WindowClass::ConstructRide, WindowWidth, WindowHeight, WF_10 | WF_AUTO_POSITION);
return window;
@ -976,7 +976,7 @@ rct_window* WindowNewRideOpenResearch()
*/
void WindowNewRideFocus(RideSelection rideItem)
{
auto w = static_cast<NewRideWindow*>(window_find_by_class(WindowClass::ConstructRide));
auto w = static_cast<NewRideWindow*>(WindowFindByClass(WindowClass::ConstructRide));
if (!w)
{
return;

View File

@ -62,7 +62,7 @@ public:
int32_t w = 0, h = 0;
Widget* widget = &widgets[WIDX_SCROLL];
window_get_scroll_size(this, 0, &w, &h);
WindowGetScrollSize(this, 0, &w, &h);
scrolls[0].v_top = std::max(0, h - (widget->height() - 1));
WidgetScrollUpdateThumbs(*this, WIDX_SCROLL);
}
@ -112,9 +112,9 @@ public:
{
static rct_window* _mainWindow;
auto subjectLoc = News::GetSubjectLocation(newsItem.Type, newsItem.Assoc);
if (subjectLoc.has_value() && (_mainWindow = window_get_main()) != nullptr)
if (subjectLoc.has_value() && (_mainWindow = WindowGetMain()) != nullptr)
{
window_scroll_to_location(*_mainWindow, subjectLoc.value());
WindowScrollToLocation(*_mainWindow, subjectLoc.value());
}
}
}

View File

@ -384,7 +384,7 @@ private:
{
selected_list_item = index;
}
widget_invalidate(*this, WIDX_SCROLL);
WidgetInvalidate(*this, WIDX_SCROLL);
}
public:
@ -409,7 +409,7 @@ public:
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*this);
WindowClose(*this);
return;
case WIDX_COPY_CURRENT:
if (selected_list_item > -1 && selected_list_item < no_list_items)
@ -437,7 +437,7 @@ public:
if (!WidgetIsHighlighted(*this, WIDX_SCROLL))
{
_highlightedIndex = -1;
widget_invalidate(*this, WIDX_SCROLL);
WidgetInvalidate(*this, WIDX_SCROLL);
}
#ifndef DISABLE_HTTP
@ -480,7 +480,7 @@ public:
else
_highlightedIndex = selectedItem;
widget_invalidate(*this, WIDX_SCROLL);
WidgetInvalidate(*this, WIDX_SCROLL);
}
void OnDraw(rct_drawpixelinfo& dpi) override
@ -564,7 +564,7 @@ public:
rct_window* WindowObjectLoadErrorOpen(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects)
{
// Check if window is already open
auto* window = window_bring_to_front_by_class(WindowClass::ObjectLoadError);
auto* window = WindowBringToFrontByClass(WindowClass::ObjectLoadError);
if (window == nullptr)
{
window = WindowCreate<ObjectLoadErrorWindow>(WindowClass::ObjectLoadError, WW, WH, 0);

View File

@ -622,7 +622,7 @@ private:
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*this);
WindowClose(*this);
break;
case WIDX_TAB_DISPLAY:
case WIDX_TAB_RENDERING:
@ -934,7 +934,7 @@ private:
gConfigGeneral.AlwaysShowGridlines ^= 1;
ConfigSaveDefault();
GfxInvalidateScreen();
rct_window* mainWindow = window_get_main();
rct_window* mainWindow = WindowGetMain();
if (mainWindow != nullptr)
{
if (gConfigGeneral.AlwaysShowGridlines)
@ -1304,7 +1304,7 @@ private:
OpenRCT2::Audio::Pause();
else
OpenRCT2::Audio::Resume();
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
ConfigSaveDefault();
Invalidate();
break;
@ -1552,43 +1552,43 @@ private:
gConfigInterface.ToolbarShowFinances ^= 1;
ConfigSaveDefault();
Invalidate();
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
break;
case WIDX_TOOLBAR_SHOW_RESEARCH:
gConfigInterface.ToolbarShowResearch ^= 1;
ConfigSaveDefault();
Invalidate();
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
break;
case WIDX_TOOLBAR_SHOW_CHEATS:
gConfigInterface.ToolbarShowCheats ^= 1;
ConfigSaveDefault();
Invalidate();
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
break;
case WIDX_TOOLBAR_SHOW_NEWS:
gConfigInterface.ToolbarShowNews ^= 1;
ConfigSaveDefault();
Invalidate();
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
break;
case WIDX_TOOLBAR_SHOW_MUTE:
gConfigInterface.ToolbarShowMute ^= 1;
ConfigSaveDefault();
Invalidate();
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
break;
case WIDX_TOOLBAR_SHOW_CHAT:
gConfigInterface.ToolbarShowChat ^= 1;
ConfigSaveDefault();
Invalidate();
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
break;
case WIDX_TOOLBAR_SHOW_ZOOM:
gConfigInterface.ToolbarShowZoom ^= 1;
ConfigSaveDefault();
Invalidate();
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
break;
case WIDX_INVERT_DRAG:
gConfigGeneral.InvertViewportDrag ^= 1;
@ -1682,7 +1682,7 @@ private:
case WIDX_SCENARIO_UNLOCKING:
gConfigGeneral.ScenarioUnlockingEnabled ^= 1;
ConfigSaveDefault();
window_close_by_class(WindowClass::ScenarioSelect);
WindowCloseByClass(WindowClass::ScenarioSelect);
break;
case WIDX_AUTO_OPEN_SHOPS:
gConfigGeneral.AutoOpenShops = !gConfigGeneral.AutoOpenShops;
@ -1801,7 +1801,7 @@ private:
gConfigInterface.ScenarioselectLastTab = 0;
ConfigSaveDefault();
Invalidate();
window_close_by_class(WindowClass::ScenarioSelect);
WindowCloseByClass(WindowClass::ScenarioSelect);
}
break;
}
@ -2047,8 +2047,8 @@ private:
widgets = window_options_page_widgets[page];
Invalidate();
window_event_resize_call(this);
window_event_invalidate_call(this);
WindowEventResizeCall(this);
WindowEventInvalidateCall(this);
InitScrollWidgets();
Invalidate();
}

View File

@ -210,7 +210,7 @@ public:
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE) && classification == gCurrentToolWidget.window_classification
&& number == gCurrentToolWidget.window_number)
{
tool_cancel();
ToolCancel();
}
}
@ -437,7 +437,7 @@ private:
void OnResizeEntrance()
{
flags |= WF_RESIZABLE;
window_set_resize(*this, 230, 174 + 9, 230 * 3, (274 + 9) * 3);
WindowSetResize(*this, 230, 174 + 9, 230 * 3, (274 + 9) * 3);
InitViewport();
}
@ -487,7 +487,7 @@ private:
void OnUpdateEntrance()
{
frame_no++;
widget_invalidate(*this, WIDX_TAB_1);
WidgetInvalidate(*this, WIDX_TAB_1);
}
void OnTextInputEntrance(WidgetIndex widgetIndex, std::string_view text)
@ -533,7 +533,7 @@ private:
else
widgets[WIDX_BUY_LAND_RIGHTS].type = WindowWidgetType::FlatBtn;
window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7);
WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7);
AnchorBorderWidgets();
// Anchor entrance page specific widgets
@ -593,7 +593,7 @@ private:
// Draw viewport
if (viewport != nullptr)
{
window_draw_viewport(&dpi, *this);
WindowDrawViewport(&dpi, *this);
if (viewport->flags & VIEWPORT_FLAG_SOUND_ON)
GfxDrawSprite(&dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 });
}
@ -632,7 +632,7 @@ private:
}
// Call invalidate event
window_event_invalidate_call(this);
WindowEventInvalidateCall(this);
focus = newFocus;
@ -660,13 +660,13 @@ private:
#pragma region Rating page
void OnResizeRating()
{
window_set_resize(*this, 255, 182, 255, 182);
WindowSetResize(*this, 255, 182, 255, 182);
}
void OnUpdateRating()
{
frame_no++;
widget_invalidate(*this, WIDX_TAB_2);
WidgetInvalidate(*this, WIDX_TAB_2);
}
void OnPrepareDrawRating()
@ -681,7 +681,7 @@ private:
SetPressedTab();
PrepareWindowTitleText();
window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7);
WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7);
AnchorBorderWidgets();
}
@ -732,14 +732,14 @@ private:
#pragma region Guests page
void OnResizeGuests()
{
window_set_resize(*this, 255, 182, 255, 182);
WindowSetResize(*this, 255, 182, 255, 182);
}
void OnUpdateGuests()
{
frame_no++;
_peepAnimationFrame = (_peepAnimationFrame + 1) % 24;
widget_invalidate(*this, WIDX_TAB_3);
WidgetInvalidate(*this, WIDX_TAB_3);
}
void OnPrepareDrawGuests()
@ -754,7 +754,7 @@ private:
SetPressedTab();
PrepareWindowTitleText();
window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7);
WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7);
AnchorBorderWidgets();
}
@ -818,7 +818,7 @@ private:
#pragma region Price page
void OnResizePrice()
{
window_set_resize(*this, 230, 124, 230, 124);
WindowSetResize(*this, 230, 124, 230, 124);
}
void OnMouseDownPrice(WidgetIndex widgetIndex)
@ -845,7 +845,7 @@ private:
void OnUpdatePrice()
{
frame_no++;
widget_invalidate(*this, WIDX_TAB_4);
WidgetInvalidate(*this, WIDX_TAB_4);
}
void OnPrepareDrawPrice()
@ -884,7 +884,7 @@ private:
widgets[WIDX_DECREASE_PRICE].type = WindowWidgetType::Button;
}
window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7);
WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7);
AnchorBorderWidgets();
}
@ -911,20 +911,20 @@ private:
#pragma region Stats page
void OnResizeStats()
{
window_set_resize(*this, 230, 119, 230, 119);
WindowSetResize(*this, 230, 119, 230, 119);
}
void OnUpdateStats()
{
frame_no++;
widget_invalidate(*this, WIDX_TAB_5);
WidgetInvalidate(*this, WIDX_TAB_5);
// Invalidate ride count if changed
const auto rideCount = ride_get_count();
if (_numberOfRides != rideCount)
{
_numberOfRides = rideCount;
widget_invalidate(*this, WIDX_PAGE_BACKGROUND);
WidgetInvalidate(*this, WIDX_PAGE_BACKGROUND);
}
// Invalidate number of staff if changed
@ -932,7 +932,7 @@ private:
if (_numberOfStaff != staffCount)
{
_numberOfStaff = staffCount;
widget_invalidate(*this, WIDX_PAGE_BACKGROUND);
WidgetInvalidate(*this, WIDX_PAGE_BACKGROUND);
}
}
@ -948,7 +948,7 @@ private:
SetPressedTab();
PrepareWindowTitleText();
window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7);
WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7);
AnchorBorderWidgets();
}
@ -1020,16 +1020,16 @@ private:
{
#ifndef NO_TTF
if (gCurrentTTFFontSet != nullptr)
window_set_resize(*this, 230, 270, 230, 270);
WindowSetResize(*this, 230, 270, 230, 270);
else
#endif
window_set_resize(*this, 230, 226, 230, 226);
WindowSetResize(*this, 230, 226, 230, 226);
}
void OnUpdateObjective()
{
frame_no++;
widget_invalidate(*this, WIDX_TAB_6);
WidgetInvalidate(*this, WIDX_TAB_6);
}
void OnTextInputObjective(WidgetIndex widgetIndex, std::string_view text)
@ -1057,7 +1057,7 @@ private:
else
widgets[WIDX_ENTER_NAME].type = WindowWidgetType::Empty;
window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7);
WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7);
AnchorBorderWidgets();
}
@ -1126,13 +1126,13 @@ private:
#pragma region Awards page
void OnResizeAwards()
{
window_set_resize(*this, 230, 182, 230, 182);
WindowSetResize(*this, 230, 182, 230, 182);
}
void OnUpdateAwards()
{
frame_no++;
widget_invalidate(*this, WIDX_TAB_7);
WidgetInvalidate(*this, WIDX_TAB_7);
}
void OnPrepareDrawAwards()
@ -1147,7 +1147,7 @@ private:
SetPressedTab();
PrepareWindowTitleText();
window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7);
WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7);
AnchorBorderWidgets();
}
@ -1177,7 +1177,7 @@ private:
{
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number)
tool_cancel();
ToolCancel();
// Set listen only to viewport
bool listen = false;
@ -1194,9 +1194,9 @@ private:
SetDisabledTabs();
Invalidate();
window_event_resize_call(this);
window_event_invalidate_call(this);
window_event_update_call(this);
WindowEventResizeCall(this);
WindowEventInvalidateCall(this);
WindowEventUpdateCall(this);
if (listen && viewport != nullptr)
viewport->flags |= VIEWPORT_FLAG_SOUND_ON;
}

View File

@ -57,7 +57,7 @@ public:
widgets = PatrolAreaWidgets;
hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT);
WindowInitScrollWidgets(*this);
window_push_others_below(*this);
WindowPushOthersBelow(*this);
gLandToolSize = 4;
}
@ -65,7 +65,7 @@ public:
{
// If the tool wasn't changed, turn tool off
if (PatrolAreaToolIsActive())
tool_cancel();
ToolCancel();
}
void OnMouseUp(WidgetIndex widgetIndex) override
@ -244,7 +244,7 @@ private:
}
else
{
if (!tool_set(*this, 0, Tool::WalkDown))
if (!ToolSet(*this, 0, Tool::WalkDown))
{
show_gridlines();
input_set_flag(INPUT_FLAG_6, true);
@ -274,7 +274,7 @@ private:
bool IsStaffWindowOpen()
{
// If staff window for this patrol area was closed, tool is no longer active
auto staffWindow = window_find_by_number(WindowClass::Peep, _staffId);
auto staffWindow = WindowFindByNumber(WindowClass::Peep, _staffId);
return staffWindow != nullptr;
}
@ -298,6 +298,6 @@ rct_window* WindowPatrolAreaOpen(EntityId staffId)
EntityId WindowPatrolAreaGetCurrentStaffId()
{
auto current = reinterpret_cast<PatrolAreaWindow*>(window_find_by_class(WindowClass::PatrolArea));
auto current = reinterpret_cast<PatrolAreaWindow*>(WindowFindByClass(WindowClass::PatrolArea));
return current != nullptr ? current->GetStaffId() : EntityId::GetNull();
}

View File

@ -137,7 +137,7 @@ rct_window* WindowPlayerOpen(uint8_t id)
{
rct_window* window;
window = window_bring_to_front_by_number(WindowClass::Player, id);
window = WindowBringToFrontByNumber(WindowClass::Player, id);
if (window == nullptr)
{
window = WindowCreateAutoPos(240, 170, &window_player_overview_events, WindowClass::Player, WF_RESIZABLE);
@ -205,7 +205,7 @@ void WindowPlayerOverviewMouseUp(rct_window* w, WidgetIndex widgetIndex)
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -213,7 +213,7 @@ void WindowPlayerOverviewMouseUp(rct_window* w, WidgetIndex widgetIndex)
break;
case WIDX_LOCATE:
{
rct_window* mainWindow = window_get_main();
rct_window* mainWindow = WindowGetMain();
if (mainWindow != nullptr)
{
int32_t player = network_get_player_index(static_cast<uint8_t>(w->number));
@ -224,7 +224,7 @@ void WindowPlayerOverviewMouseUp(rct_window* w, WidgetIndex widgetIndex)
auto coord = network_get_player_last_action_coord(player);
if (coord.x || coord.y || coord.z)
{
window_scroll_to_location(*mainWindow, coord);
WindowScrollToLocation(*mainWindow, coord);
}
}
}
@ -266,7 +266,7 @@ void WindowPlayerOverviewDropdown(rct_window* w, WidgetIndex widgetIndex, int32_
playerSetGroupAction.SetCallback([windowHandle](const GameAction* ga, const GameActions::Result* result) {
if (result->Error == GameActions::Status::Ok)
{
window_invalidate_by_number(windowHandle.first, windowHandle.second);
WindowInvalidateByNumber(windowHandle.first, windowHandle.second);
}
});
GameActions::Execute(&playerSetGroupAction);
@ -274,17 +274,17 @@ void WindowPlayerOverviewDropdown(rct_window* w, WidgetIndex widgetIndex, int32_
void WindowPlayerOverviewResize(rct_window* w)
{
window_set_resize(*w, 240, 170, 500, 300);
WindowSetResize(*w, 240, 170, 500, 300);
}
void WindowPlayerOverviewUpdate(rct_window* w)
{
w->frame_no++;
widget_invalidate(*w, WIDX_TAB_1 + w->page);
WidgetInvalidate(*w, WIDX_TAB_1 + w->page);
if (network_get_player_index(static_cast<uint8_t>(w->number)) == -1)
{
window_close(*w);
WindowClose(*w);
return;
}
@ -355,7 +355,7 @@ void WindowPlayerOverviewPaint(rct_window* w, rct_drawpixelinfo* dpi)
if (w->viewport != nullptr && w->var_492 != -1)
{
window_draw_viewport(dpi, *w);
WindowDrawViewport(dpi, *w);
}
}
@ -393,7 +393,7 @@ void WindowPlayerOverviewInvalidate(rct_window* w)
w->widgets[WIDX_GROUP_DROPDOWN].left = w->widgets[WIDX_GROUP].right - 10;
w->widgets[WIDX_GROUP_DROPDOWN].right = w->widgets[WIDX_GROUP].right;
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_2);
WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_2);
rct_viewport* viewport = w->viewport;
if (viewport != nullptr)
@ -427,7 +427,7 @@ void WindowPlayerStatisticsMouseUp(rct_window* w, WidgetIndex widgetIndex)
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -438,17 +438,17 @@ void WindowPlayerStatisticsMouseUp(rct_window* w, WidgetIndex widgetIndex)
void WindowPlayerStatisticsResize(rct_window* w)
{
window_set_resize(*w, 210, 80, 210, 80);
WindowSetResize(*w, 210, 80, 210, 80);
}
void WindowPlayerStatisticsUpdate(rct_window* w)
{
w->frame_no++;
widget_invalidate(*w, WIDX_TAB_1 + w->page);
WidgetInvalidate(*w, WIDX_TAB_1 + w->page);
if (network_get_player_index(static_cast<uint8_t>(w->number)) == -1)
{
window_close(*w);
WindowClose(*w);
}
}
@ -468,7 +468,7 @@ void WindowPlayerStatisticsInvalidate(rct_window* w)
w->ResizeFrameWithPage();
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_2);
WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_2);
}
void WindowPlayerStatisticsPaint(rct_window* w, rct_drawpixelinfo* dpi)
@ -511,8 +511,8 @@ static void WindowPlayerSetPage(rct_window* w, int32_t page)
w->pressed_widgets = 0;
w->widgets = window_player_page_widgets[page];
w->Invalidate();
window_event_resize_call(w);
window_event_invalidate_call(w);
WindowEventResizeCall(w);
WindowEventInvalidateCall(w);
WindowInitScrollWidgets(*w);
w->Invalidate();
@ -523,12 +523,12 @@ static void WindowPlayerSetPage(rct_window* w, int32_t page)
const auto focus = Focus(TileCoordsXYZ(128, 128, 0).ToCoordsXYZ());
viewport_create(w, w->windowPos, w->width, w->height, focus);
w->flags |= WF_NO_SCROLLING;
window_event_invalidate_call(w);
WindowEventInvalidateCall(w);
WindowPlayerUpdateViewport(w, false);
}
else if (originalPage != page)
{
window_event_invalidate_call(w);
WindowEventInvalidateCall(w);
WindowPlayerUpdateViewport(w, false);
}
}
@ -599,7 +599,7 @@ static void WindowPlayerUpdateViewport(rct_window* w, bool scroll)
{
w->viewport->viewPos = centreLoc.value();
}
widget_invalidate(*w, WIDX_VIEWPORT);
WidgetInvalidate(*w, WIDX_VIEWPORT);
}
// Draw the viewport

View File

@ -96,11 +96,11 @@ rct_window* WindowRideRefurbishPromptOpen(const Ride& ride)
rct_window* w;
RefurbishRidePromptWindow* newWindow;
w = window_find_by_class(WindowClass::DemolishRidePrompt);
w = WindowFindByClass(WindowClass::DemolishRidePrompt);
if (w != nullptr)
{
auto windowPos = w->windowPos;
window_close(*w);
WindowClose(*w);
newWindow = WindowCreate<RefurbishRidePromptWindow>(WindowClass::DemolishRidePrompt, windowPos, WW, WH, WF_TRANSPARENT);
}
else

View File

@ -162,7 +162,7 @@ rct_window* WindowResearchOpen()
{
rct_window* w;
w = window_bring_to_front_by_class(WindowClass::Research);
w = WindowBringToFrontByClass(WindowClass::Research);
if (w == nullptr)
{
w = WindowCreateAutoPos(WW_FUNDING, WH_FUNDING, window_research_page_events[0], WindowClass::Research, WF_10);
@ -201,7 +201,7 @@ static void WindowResearchDevelopmentMouseup(rct_window* w, WidgetIndex widgetIn
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -222,7 +222,7 @@ static void WindowResearchDevelopmentUpdate(rct_window* w)
// Tab animation
if (++w->frame_no >= window_research_tab_animation_loops[w->page])
w->frame_no = 0;
widget_invalidate(*w, WIDX_TAB_1);
WidgetInvalidate(*w, WIDX_TAB_1);
}
/**
@ -396,7 +396,7 @@ static void WindowResearchFundingMouseup(rct_window* w, WidgetIndex widgetIndex)
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -465,7 +465,7 @@ static void WindowResearchFundingUpdate(rct_window* w)
// Tab animation
if (++w->frame_no >= window_research_tab_animation_loops[w->page])
w->frame_no = 0;
widget_invalidate(*w, WIDX_TAB_2);
WidgetInvalidate(*w, WIDX_TAB_2);
}
/**
@ -578,8 +578,8 @@ static void WindowResearchSetPage(rct_window* w, int32_t page)
w->width = WW_FUNDING;
w->height = WH_FUNDING;
}
window_event_resize_call(w);
window_event_invalidate_call(w);
WindowEventResizeCall(w);
WindowEventInvalidateCall(w);
WindowInitScrollWidgets(*w);
w->Invalidate();

View File

@ -1192,7 +1192,7 @@ rct_window* WindowRideMainOpen(const Ride& ride)
return nullptr;
}
rct_window* w = window_bring_to_front_by_number(WindowClass::Ride, ride.id.ToUnderlying());
rct_window* w = WindowBringToFrontByNumber(WindowClass::Ride, ride.id.ToUnderlying());
if (w == nullptr)
{
w = WindowRideOpen(ride);
@ -1208,7 +1208,7 @@ rct_window* WindowRideMainOpen(const Ride& ride)
{
if (w->classification == gCurrentToolWidget.window_classification && w->number == gCurrentToolWidget.window_number)
{
tool_cancel();
ToolCancel();
}
}
@ -1233,7 +1233,7 @@ static rct_window* WindowRideOpenStation(const Ride& ride, StationIndex stationI
if (ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
return WindowRideMainOpen(ride);
auto w = window_bring_to_front_by_number(WindowClass::Ride, ride.id.ToUnderlying());
auto w = WindowBringToFrontByNumber(WindowClass::Ride, ride.id.ToUnderlying());
if (w == nullptr)
{
w = WindowRideOpen(ride);
@ -1243,7 +1243,7 @@ static rct_window* WindowRideOpenStation(const Ride& ride, StationIndex stationI
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == w->classification
&& gCurrentToolWidget.window_number == w->number)
{
tool_cancel();
ToolCancel();
}
w->page = WINDOW_RIDE_PAGE_MAIN;
@ -1338,7 +1338,7 @@ rct_window* WindowRideOpenVehicle(Vehicle* vehicle)
view++;
}
rct_window* w = window_find_by_number(WindowClass::Ride, ride->id.ToUnderlying());
rct_window* w = WindowFindByNumber(WindowClass::Ride, ride->id.ToUnderlying());
if (w != nullptr)
{
w->Invalidate();
@ -1346,7 +1346,7 @@ rct_window* WindowRideOpenVehicle(Vehicle* vehicle)
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == w->classification
&& gCurrentToolWidget.window_number == w->number)
{
tool_cancel();
ToolCancel();
}
int32_t openedPeepWindow = 0;
@ -1360,7 +1360,7 @@ rct_window* WindowRideOpenVehicle(Vehicle* vehicle)
continue;
numPeepsLeft--;
rct_window* w2 = window_find_by_number(WindowClass::Peep, vehicle->peep[i]);
rct_window* w2 = WindowFindByNumber(WindowClass::Peep, vehicle->peep[i]);
if (w2 == nullptr)
{
auto intent = Intent(WindowClass::Peep);
@ -1373,8 +1373,8 @@ rct_window* WindowRideOpenVehicle(Vehicle* vehicle)
}
}
w = openedPeepWindow ? window_find_by_number(WindowClass::Ride, ride->id.ToUnderlying())
: window_bring_to_front_by_number(WindowClass::Ride, ride->id.ToUnderlying());
w = openedPeepWindow ? WindowFindByNumber(WindowClass::Ride, ride->id.ToUnderlying())
: WindowBringToFrontByNumber(WindowClass::Ride, ride->id.ToUnderlying());
}
if (w == nullptr)
@ -1412,14 +1412,14 @@ static void WindowRideSetPage(rct_window* w, int32_t page)
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
if (w->classification == gCurrentToolWidget.window_classification && w->number == gCurrentToolWidget.window_number)
tool_cancel();
ToolCancel();
if (page == WINDOW_RIDE_PAGE_VEHICLE)
{
auto constructionWindow = window_find_by_class(WindowClass::RideConstruction);
auto constructionWindow = WindowFindByClass(WindowClass::RideConstruction);
if (constructionWindow != nullptr && constructionWindow->number == w->number)
{
window_close_by_class(WindowClass::RideConstruction);
WindowCloseByClass(WindowClass::RideConstruction);
// Closing the construction window sets the tab to the first page, which we don't want here,
// as user just clicked the Vehicle page
WindowRideSetPage(w, WINDOW_RIDE_PAGE_VEHICLE);
@ -1449,8 +1449,8 @@ static void WindowRideSetPage(rct_window* w, int32_t page)
WindowRideDisableTabs(w);
w->Invalidate();
window_event_resize_call(w);
window_event_invalidate_call(w);
WindowEventResizeCall(w);
WindowEventInvalidateCall(w);
WindowInitScrollWidgets(*w);
w->Invalidate();
@ -1571,7 +1571,7 @@ static void WindowRideInitViewport(rct_window* w)
viewport_flags |= VIEWPORT_FLAG_GRIDLINES;
}
window_event_invalidate_call(w);
WindowEventInvalidateCall(w);
w->focus = focus;
@ -1620,7 +1620,7 @@ static void WindowRideMainMouseup(rct_window* w, WidgetIndex widgetIndex)
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -1640,9 +1640,9 @@ static void WindowRideMainMouseup(rct_window* w, WidgetIndex widgetIndex)
if (ride != nullptr)
{
RideConstructionStart(*ride);
if (window_find_by_number(WindowClass::RideConstruction, ride->id.ToUnderlying()) != nullptr)
if (WindowFindByNumber(WindowClass::RideConstruction, ride->id.ToUnderlying()) != nullptr)
{
window_close(*w);
WindowClose(*w);
}
}
break;
@ -1718,7 +1718,7 @@ static void WindowRideMainResize(rct_window* w)
}
w->flags |= WF_RESIZABLE;
window_set_resize(*w, 316, minHeight, 500, 450);
WindowSetResize(*w, 316, minHeight, 500, 450);
// Unlike with other windows, the focus needs to be recentred so its best to just reset it.
w->focus = std::nullopt;
WindowRideInitViewport(w);
@ -1977,8 +1977,8 @@ static void WindowRideMainFollowRide(rct_window* w)
if (vehicle != nullptr)
{
auto headVehicleSpriteIndex = vehicle->sprite_index;
rct_window* w_main = window_get_main();
window_follow_sprite(*w_main, headVehicleSpriteIndex);
rct_window* w_main = WindowGetMain();
WindowFollowSprite(*w_main, headVehicleSpriteIndex);
}
}
}
@ -2218,8 +2218,8 @@ static void WindowRideMainUpdate(rct_window* w)
{
// Update tab animation
w->frame_no++;
window_event_invalidate_call(w);
widget_invalidate(*w, WIDX_TAB_1);
WindowEventInvalidateCall(w);
WidgetInvalidate(*w, WIDX_TAB_1);
// Update status
auto ride = get_ride(w->rideId);
@ -2245,7 +2245,7 @@ static void WindowRideMainUpdate(rct_window* w)
}
ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_MAIN;
}
widget_invalidate(*w, WIDX_STATUS);
WidgetInvalidate(*w, WIDX_STATUS);
}
/**
@ -2364,7 +2364,7 @@ static void WindowRideMainInvalidate(rct_window* w)
window_ride_main_widgets[WIDX_RIDE_TYPE_DROPDOWN].type = WindowWidgetType::Button;
}
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10);
WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10);
if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_RIDE)
{
@ -2569,7 +2569,7 @@ static void WindowRideMainPaint(rct_window* w, rct_drawpixelinfo* dpi)
// Viewport and ear icon
if (w->viewport != nullptr)
{
window_draw_viewport(dpi, *w);
WindowDrawViewport(dpi, *w);
if (w->viewport->flags & VIEWPORT_FLAG_SOUND_ON)
GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), w->windowPos + ScreenCoordsXY{ 2, 2 });
}
@ -2625,7 +2625,7 @@ static void WindowRideVehicleMouseup(rct_window* w, WidgetIndex widgetIndex)
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -2648,7 +2648,7 @@ static void WindowRideVehicleMouseup(rct_window* w, WidgetIndex widgetIndex)
*/
static void WindowRideVehicleResize(rct_window* w)
{
window_set_resize(*w, 316, 214, 316, 214);
WindowSetResize(*w, 316, 214, 316, 214);
}
/**
@ -2717,8 +2717,8 @@ static void WindowRideVehicleDropdown(rct_window* w, WidgetIndex widgetIndex, in
static void WindowRideVehicleUpdate(rct_window* w)
{
w->frame_no++;
window_event_invalidate_call(w);
widget_invalidate(*w, WIDX_TAB_2);
WindowEventInvalidateCall(w);
WidgetInvalidate(*w, WIDX_TAB_2);
}
static OpenRCT2String WindowRideVehicleTooltip(rct_window* const w, const WidgetIndex widgetIndex, StringId fallback)
@ -2849,7 +2849,7 @@ static void WindowRideVehicleInvalidate(rct_window* w)
ride->FormatNameTo(ft);
WindowRideAnchorBorderWidgets(w);
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10);
WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10);
if (abs(ride->num_cars_per_train - rideEntry->zero_cars) == 1)
{
@ -3156,7 +3156,7 @@ static void WindowRideOperatingMouseup(rct_window* w, WidgetIndex widgetIndex)
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -3196,7 +3196,7 @@ static void WindowRideOperatingMouseup(rct_window* w, WidgetIndex widgetIndex)
*/
static void WindowRideOperatingResize(rct_window* w)
{
window_set_resize(*w, 316, 186, 316, 186);
WindowSetResize(*w, 316, 186, 316, 186);
}
/**
@ -3395,8 +3395,8 @@ static void WindowRideOperatingDropdown(rct_window* w, WidgetIndex widgetIndex,
static void WindowRideOperatingUpdate(rct_window* w)
{
w->frame_no++;
window_event_invalidate_call(w);
widget_invalidate(*w, WIDX_TAB_3);
WindowEventInvalidateCall(w);
WidgetInvalidate(*w, WIDX_TAB_3);
auto ride = get_ride(w->rideId);
if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_OPERATING)
@ -3695,7 +3695,7 @@ static void WindowRideOperatingInvalidate(rct_window* w)
}
WindowRideAnchorBorderWidgets(w);
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10);
WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10);
}
/**
@ -3791,7 +3791,7 @@ static void WindowRideMaintenanceMouseup(rct_window* w, WidgetIndex widgetIndex)
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -3820,7 +3820,7 @@ static void WindowRideMaintenanceMouseup(rct_window* w, WidgetIndex widgetIndex)
*/
static void WindowRideMaintenanceResize(rct_window* w)
{
window_set_resize(*w, 316, 135, 316, 135);
WindowSetResize(*w, 316, 135, 316, 135);
}
/**
@ -3986,7 +3986,7 @@ static void WindowRideMaintenanceDropdown(rct_window* w, WidgetIndex widgetIndex
break;
}
ride->lifecycle_flags &= ~(RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN);
window_invalidate_by_number(WindowClass::Ride, w->number);
WindowInvalidateByNumber(WindowClass::Ride, w->number);
break;
}
if (ride->lifecycle_flags
@ -4036,8 +4036,8 @@ static void WindowRideMaintenanceDropdown(rct_window* w, WidgetIndex widgetIndex
static void WindowRideMaintenanceUpdate(rct_window* w)
{
w->frame_no++;
window_event_invalidate_call(w);
widget_invalidate(*w, WIDX_TAB_4);
WindowEventInvalidateCall(w);
WidgetInvalidate(*w, WIDX_TAB_4);
auto ride = get_ride(w->rideId);
if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAINTENANCE)
@ -4072,7 +4072,7 @@ static void WindowRideMaintenanceInvalidate(rct_window* w)
window_ride_maintenance_widgets[WIDX_INSPECTION_INTERVAL].text = RideInspectionIntervalNames[ride->inspection_interval];
WindowRideAnchorBorderWidgets(w);
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10);
WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10);
if (gConfigGeneral.DebuggingTools && network_get_mode() == NETWORK_MODE_NONE)
{
@ -4281,7 +4281,7 @@ static void WindowRideColourClose(rct_window* w)
if (gCurrentToolWidget.window_number != w->number)
return;
tool_cancel();
ToolCancel();
}
/**
@ -4293,7 +4293,7 @@ static void WindowRideColourMouseup(rct_window* w, WidgetIndex widgetIndex)
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -4308,7 +4308,7 @@ static void WindowRideColourMouseup(rct_window* w, WidgetIndex widgetIndex)
WindowRideSetPage(w, widgetIndex - WIDX_TAB_1);
break;
case WIDX_PAINT_INDIVIDUAL_AREA:
tool_set(*w, WIDX_PAINT_INDIVIDUAL_AREA, Tool::PaintDown);
ToolSet(*w, WIDX_PAINT_INDIVIDUAL_AREA, Tool::PaintDown);
break;
case WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX:
auto ride = get_ride(w->rideId);
@ -4329,7 +4329,7 @@ static void WindowRideColourMouseup(rct_window* w, WidgetIndex widgetIndex)
*/
static void WindowRideColourResize(rct_window* w)
{
window_set_resize(*w, 316, 207, 316, 207);
WindowSetResize(*w, 316, 207, 316, 207);
}
/**
@ -4579,9 +4579,9 @@ static void WindowRideColourDropdown(rct_window* w, WidgetIndex widgetIndex, int
static void WindowRideColourUpdate(rct_window* w)
{
w->frame_no++;
window_event_invalidate_call(w);
widget_invalidate(*w, WIDX_TAB_5);
widget_invalidate(*w, WIDX_VEHICLE_PREVIEW);
WindowEventInvalidateCall(w);
WidgetInvalidate(*w, WIDX_TAB_5);
WidgetInvalidate(*w, WIDX_VEHICLE_PREVIEW);
}
/**
@ -4851,7 +4851,7 @@ static void WindowRideColourInvalidate(rct_window* w)
ft.Add<StringId>(ColourSchemeNames[colourScheme]);
WindowRideAnchorBorderWidgets(w);
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10);
WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10);
}
/**
@ -5044,7 +5044,7 @@ static void WindowRideMusicMouseup(rct_window* w, WidgetIndex widgetIndex)
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -5071,7 +5071,7 @@ static void WindowRideMusicMouseup(rct_window* w, WidgetIndex widgetIndex)
static void WindowRideMusicResize(rct_window* w)
{
w->flags |= WF_RESIZABLE;
window_set_resize(*w, 316, 81, 316, 81);
WindowSetResize(*w, 316, 81, 316, 81);
}
static std::string GetMusicString(ObjectEntryIndex musicObjectIndex)
@ -5182,8 +5182,8 @@ static void WindowRideMusicDropdown(rct_window* w, WidgetIndex widgetIndex, int3
static void WindowRideMusicUpdate(rct_window* w)
{
w->frame_no++;
window_event_invalidate_call(w);
widget_invalidate(*w, WIDX_TAB_6);
WindowEventInvalidateCall(w);
WidgetInvalidate(*w, WIDX_TAB_6);
}
/**
@ -5234,7 +5234,7 @@ static void WindowRideMusicInvalidate(rct_window* w)
}
WindowRideAnchorBorderWidgets(w);
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10);
WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10);
}
/**
@ -5267,14 +5267,14 @@ static void CancelScenerySelection()
gTrackDesignSaveMode = false;
OpenRCT2::Audio::Resume();
rct_window* main_w = window_get_main();
rct_window* main_w = WindowGetMain();
if (main_w != nullptr)
{
main_w->viewport->flags &= ~(VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE);
}
GfxInvalidateScreen();
tool_cancel();
ToolCancel();
}
/**
@ -5288,7 +5288,7 @@ static void SetupScenerySelection(rct_window* w)
CancelScenerySelection();
}
while (tool_set(*w, WIDX_BACKGROUND, Tool::Crosshair))
while (ToolSet(*w, WIDX_BACKGROUND, Tool::Crosshair))
;
gTrackDesignSaveRideIndex = w->rideId;
@ -5299,7 +5299,7 @@ static void SetupScenerySelection(rct_window* w)
OpenRCT2::Audio::StopAll();
rct_window* w_main = window_get_main();
rct_window* w_main = WindowGetMain();
if (w_main != nullptr)
{
w_main->viewport->flags |= (VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE);
@ -5404,7 +5404,7 @@ static void WindowRideMeasurementsMouseup(rct_window* w, WidgetIndex widgetIndex
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -5439,7 +5439,7 @@ static void WindowRideMeasurementsMouseup(rct_window* w, WidgetIndex widgetIndex
*/
static void WindowRideMeasurementsResize(rct_window* w)
{
window_set_resize(*w, 316, 234, 316, 234);
WindowSetResize(*w, 316, 234, 316, 234);
}
/**
@ -5497,8 +5497,8 @@ static void WindowRideMeasurementsDropdown(rct_window* w, WidgetIndex widgetInde
static void WindowRideMeasurementsUpdate(rct_window* w)
{
w->frame_no++;
window_event_invalidate_call(w);
widget_invalidate(*w, WIDX_TAB_7);
WindowEventInvalidateCall(w);
WidgetInvalidate(*w, WIDX_TAB_7);
}
/**
@ -5614,7 +5614,7 @@ static void WindowRideMeasurementsInvalidate(rct_window* w)
}
WindowRideAnchorBorderWidgets(w);
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10);
WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10);
}
/**
@ -5897,7 +5897,7 @@ static void WindowRideGraphsMouseup(rct_window* w, WidgetIndex widgetIndex)
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -5920,7 +5920,7 @@ static void WindowRideGraphsMouseup(rct_window* w, WidgetIndex widgetIndex)
*/
static void WindowRideGraphsResize(rct_window* w)
{
window_set_resize(*w, 316, 182, 500, 450);
WindowSetResize(*w, 316, 182, 500, 450);
}
/**
@ -5956,10 +5956,10 @@ static void WindowRideGraphsUpdate(rct_window* w)
int32_t x;
w->frame_no++;
window_event_invalidate_call(w);
widget_invalidate(*w, WIDX_TAB_8);
window_event_invalidate_call(w);
widget_invalidate(*w, WIDX_GRAPH);
WindowEventInvalidateCall(w);
WidgetInvalidate(*w, WIDX_TAB_8);
WindowEventInvalidateCall(w);
WidgetInvalidate(*w, WIDX_GRAPH);
widget = &window_ride_graphs_widgets[WIDX_GRAPH];
x = w->scrolls[0].h_left;
@ -5984,7 +5984,7 @@ static void WindowRideGraphsUpdate(rct_window* w)
*/
static void WindowRideGraphsScrollgetheight(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height)
{
window_event_invalidate_call(w);
WindowEventInvalidateCall(w);
// Set minimum size
*width = window_ride_graphs_widgets[WIDX_GRAPH].width() - 2;
@ -6101,7 +6101,7 @@ static void WindowRideGraphsInvalidate(rct_window* w)
window_ride_graphs_widgets[WIDX_GRAPH_LATERAL].bottom = y;
WindowRideAnchorBorderWidgets(w);
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10);
WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10);
}
/**
@ -6486,7 +6486,7 @@ static void WindowRideIncomeMouseup(rct_window* w, WidgetIndex widgetIndex)
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -6539,7 +6539,7 @@ static void WindowRideIncomeMouseup(rct_window* w, WidgetIndex widgetIndex)
*/
static void WindowRideIncomeResize(rct_window* w)
{
window_set_resize(*w, 316, 194, 316, 194);
WindowSetResize(*w, 316, 194, 316, 194);
}
/**
@ -6572,8 +6572,8 @@ static void WindowRideIncomeMousedown(rct_window* w, WidgetIndex widgetIndex, Wi
static void WindowRideIncomeUpdate(rct_window* w)
{
w->frame_no++;
window_event_invalidate_call(w);
widget_invalidate(*w, WIDX_TAB_9);
WindowEventInvalidateCall(w);
WidgetInvalidate(*w, WIDX_TAB_9);
auto ride = get_ride(w->rideId);
if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_INCOME)
@ -6718,7 +6718,7 @@ static void WindowRideIncomeInvalidate(rct_window* w)
}
WindowRideAnchorBorderWidgets(w);
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10);
WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10);
}
/**
@ -6838,7 +6838,7 @@ static void WindowRideCustomerMouseup(rct_window* w, WidgetIndex widgetIndex)
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_TAB_1:
case WIDX_TAB_2:
@ -6886,7 +6886,7 @@ static void WindowRideCustomerMouseup(rct_window* w, WidgetIndex widgetIndex)
static void WindowRideCustomerResize(rct_window* w)
{
w->flags |= WF_RESIZABLE;
window_set_resize(*w, 316, 163, 316, 163);
WindowSetResize(*w, 316, 163, 316, 163);
}
/**
@ -6899,8 +6899,8 @@ static void WindowRideCustomerUpdate(rct_window* w)
if (w->picked_peep_frame >= 24)
w->picked_peep_frame = 0;
window_event_invalidate_call(w);
widget_invalidate(*w, WIDX_TAB_10);
WindowEventInvalidateCall(w);
WidgetInvalidate(*w, WIDX_TAB_10);
auto ride = get_ride(w->rideId);
if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_CUSTOMER)
@ -6944,7 +6944,7 @@ static void WindowRideCustomerInvalidate(rct_window* w)
}
WindowRideAnchorBorderWidgets(w);
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10);
WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -217,7 +217,7 @@ public:
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*this);
WindowClose(*this);
break;
case WIDX_SORT:
list_information_type = _windowRideListInformationType;
@ -360,7 +360,7 @@ public:
void OnUpdate() override
{
frame_no = (frame_no + 1) % 64;
widget_invalidate(*this, WIDX_TAB_1 + page);
WidgetInvalidate(*this, WIDX_TAB_1 + page);
if (_windowRideListInformationType != INFORMATION_TYPE_STATUS)
Invalidate();
}
@ -957,7 +957,7 @@ private:
rct_window* WindowRideListOpen()
{
// Check if window is already open
auto* window = window_bring_to_front_by_class(WindowClass::RideList);
auto* window = WindowBringToFrontByClass(WindowClass::RideList);
if (window == nullptr)
{
window = WindowCreate<RideListWindow>(WindowClass::RideList, ScreenCoordsXY(32, 32), WW, WH, WF_10 | WF_RESIZABLE);

View File

@ -106,7 +106,7 @@ public:
OpenRCT2::Audio::StopAll();
}
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
StringId stringId = window_save_prompt_labels[EnumValue(_promptMode)][0];
if (stringId == STR_LOAD_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
@ -130,7 +130,7 @@ public:
OpenRCT2::Audio::Resume();
}
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
}
void OnMouseUp(WidgetIndex widgetIndex) override
@ -218,10 +218,10 @@ rct_window* WindowSavePromptOpen()
}
// Check if window is already open
rct_window* window = window_bring_to_front_by_class(WindowClass::SavePrompt);
rct_window* window = WindowBringToFrontByClass(WindowClass::SavePrompt);
if (window != nullptr)
{
window_close(*window);
WindowClose(*window);
}
if (EnumValue(prompt_mode) >= std::size(window_save_prompt_labels))

View File

@ -158,10 +158,10 @@ rct_window* WindowScenarioselectOpen(scenarioselect_callback callback, bool titl
if (_titleEditor != titleEditor)
{
_titleEditor = titleEditor;
window_close_by_class(WindowClass::ScenarioSelect);
WindowCloseByClass(WindowClass::ScenarioSelect);
}
auto window = window_bring_to_front_by_class(WindowClass::ScenarioSelect);
auto window = WindowBringToFrontByClass(WindowClass::ScenarioSelect);
if (window != nullptr)
return window;
@ -264,7 +264,7 @@ static void WindowScenarioselectMouseup(rct_window* w, WidgetIndex widgetIndex)
{
if (widgetIndex == WIDX_CLOSE)
{
window_close(*w);
WindowClose(*w);
}
}
@ -278,8 +278,8 @@ static void WindowScenarioselectMousedown(rct_window* w, WidgetIndex widgetIndex
ConfigSaveDefault();
InitialiseListItems(w);
w->Invalidate();
window_event_resize_call(w);
window_event_invalidate_call(w);
WindowEventResizeCall(w);
WindowEventInvalidateCall(w);
WindowInitScrollWidgets(*w);
w->Invalidate();
}
@ -344,7 +344,7 @@ static void WindowScenarioselectScrollmousedown(rct_window* w, int32_t scrollInd
_callback(listItem.scenario.scenario->path);
if (_titleEditor)
{
window_close(*w);
WindowClose(*w);
}
}
break;

View File

@ -160,8 +160,8 @@ public:
_activeTabIndex = 0;
}
window_move_position(*this, { ContextGetWidth() - GetRequiredWidth(), 0x1D });
window_push_others_below(*this);
WindowMovePosition(*this, { ContextGetWidth() - GetRequiredWidth(), 0x1D });
WindowPushOthersBelow(*this);
}
void OnClose() override
@ -171,10 +171,10 @@ public:
viewport_set_visibility(0);
if (gWindowSceneryScatterEnabled)
window_close_by_class(WindowClass::SceneryScatter);
WindowCloseByClass(WindowClass::SceneryScatter);
if (scenery_tool_is_active())
tool_cancel();
if (SceneryToolIsActive())
ToolCancel();
}
void OnMouseUp(WidgetIndex widgetIndex) override
@ -194,14 +194,14 @@ public:
gWindowSceneryPaintEnabled ^= 1;
gWindowSceneryEyedropperEnabled = false;
if (gWindowSceneryScatterEnabled)
window_close_by_class(WindowClass::SceneryScatter);
WindowCloseByClass(WindowClass::SceneryScatter);
Invalidate();
break;
case WIDX_SCENERY_EYEDROPPER_BUTTON:
gWindowSceneryPaintEnabled = 0;
gWindowSceneryEyedropperEnabled = !gWindowSceneryEyedropperEnabled;
if (gWindowSceneryScatterEnabled)
window_close_by_class(WindowClass::SceneryScatter);
WindowCloseByClass(WindowClass::SceneryScatter);
SceneryRemoveGhostToolPlacement();
Invalidate();
break;
@ -209,7 +209,7 @@ public:
gWindowSceneryPaintEnabled = 0;
gWindowSceneryEyedropperEnabled = false;
if (gWindowSceneryScatterEnabled)
window_close_by_class(WindowClass::SceneryScatter);
WindowCloseByClass(WindowClass::SceneryScatter);
else if (
network_get_mode() != NETWORK_MODE_CLIENT
|| network_can_perform_command(network_get_current_player_group_index(), -2))
@ -247,7 +247,7 @@ public:
height = min_height;
Invalidate();
// HACK: For some reason invalidate has not been called
window_event_invalidate_call(this);
WindowEventInvalidateCall(this);
ContentUpdateScroll();
}
@ -257,7 +257,7 @@ public:
height = max_height;
Invalidate();
// HACK: For some reason invalidate has not been called
window_event_invalidate_call(this);
WindowEventInvalidateCall(this);
ContentUpdateScroll();
}
}
@ -314,7 +314,7 @@ public:
{
// Find out what scenery the cursor is over
const CursorState* state = ContextGetCursorState();
WidgetIndex widgetIndex = window_find_widget_from_point(*this, state->position);
WidgetIndex widgetIndex = WindowFindWidgetFromPoint(*this, state->position);
if (widgetIndex == WIDX_SCENERY_LIST)
{
ScreenCoordsXY scrollPos = {};
@ -341,14 +341,14 @@ public:
void OnUpdate() override
{
const CursorState* state = ContextGetCursorState();
rct_window* other = window_find_from_point(state->position);
rct_window* other = WindowFindFromPoint(state->position);
if (other == this)
{
ScreenCoordsXY window = state->position - ScreenCoordsXY{ windowPos.x - 26, windowPos.y };
if (window.y < 44 || window.x <= width)
{
WidgetIndex widgetIndex = window_find_widget_from_point(*this, state->position);
WidgetIndex widgetIndex = WindowFindWidgetFromPoint(*this, state->position);
if (widgetIndex >= WIDX_SCENERY_TAB_CONTENT_PANEL)
{
_hoverCounter++;
@ -388,7 +388,7 @@ public:
Invalidate();
if (!scenery_tool_is_active())
if (!SceneryToolIsActive())
{
Close();
return;
@ -828,7 +828,7 @@ public:
SortTabs();
PrepareWidgets();
window_invalidate_by_class(WindowClass::Scenery);
WindowInvalidateByClass(WindowClass::Scenery);
}
int32_t GetRequiredWidth() const
@ -1349,7 +1349,7 @@ private:
rct_window* WindowSceneryOpen()
{
auto* w = static_cast<SceneryWindow*>(window_bring_to_front_by_class(WindowClass::Scenery));
auto* w = static_cast<SceneryWindow*>(WindowBringToFrontByClass(WindowClass::Scenery));
if (w == nullptr)
{
w = WindowCreate<SceneryWindow>(WindowClass::Scenery);
@ -1361,7 +1361,7 @@ void WindowScenerySetSelectedItem(
const ScenerySelection& scenery, const std::optional<colour_t> primary, const std::optional<colour_t> secondary,
const std::optional<colour_t> tertiary, const std::optional<colour_t> rotation)
{
auto* w = static_cast<SceneryWindow*>(window_bring_to_front_by_class(WindowClass::Scenery));
auto* w = static_cast<SceneryWindow*>(WindowBringToFrontByClass(WindowClass::Scenery));
if (w != nullptr)
{
w->SetSelectedItem(scenery, primary, secondary, tertiary, rotation);
@ -1371,7 +1371,7 @@ void WindowScenerySetSelectedItem(
void WindowScenerySetSelectedTab(const ObjectEntryIndex sceneryGroupIndex)
{
// Should this bring to front?
auto* w = static_cast<SceneryWindow*>(window_find_by_class(WindowClass::Scenery));
auto* w = static_cast<SceneryWindow*>(WindowFindByClass(WindowClass::Scenery));
if (w != nullptr)
{
return w->SetSelectedTab(sceneryGroupIndex);
@ -1397,7 +1397,7 @@ void WindowScenerySetDefaultPlacementConfiguration()
const ScenerySelection WindowSceneryGetTabSelection()
{
auto* w = static_cast<SceneryWindow*>(window_find_by_class(WindowClass::Scenery));
auto* w = static_cast<SceneryWindow*>(WindowFindByClass(WindowClass::Scenery));
if (w != nullptr)
{
return w->GetTabSelection();
@ -1410,7 +1410,7 @@ const ScenerySelection WindowSceneryGetTabSelection()
void WindowSceneryInit()
{
auto* w = static_cast<SceneryWindow*>(window_find_by_class(WindowClass::Scenery));
auto* w = static_cast<SceneryWindow*>(WindowFindByClass(WindowClass::Scenery));
if (w != nullptr)
{
w->Init();

View File

@ -60,7 +60,7 @@ public:
widgets = window_scenery_scatter_widgets;
hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT);
WindowInitScrollWidgets(*this);
window_push_others_below(*this);
WindowPushOthersBelow(*this);
gWindowSceneryScatterEnabled = true;
gWindowSceneryScatterSize = 16;
@ -93,7 +93,7 @@ public:
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*this);
WindowClose(*this);
break;
case WIDX_PREVIEW:
@ -195,7 +195,7 @@ public:
rct_window* WindowSceneryScatterOpen()
{
// Check if window is already open
auto* window = window_find_by_class(WindowClass::SceneryScatter);
auto* window = WindowFindByClass(WindowClass::SceneryScatter);
if (window == nullptr)
{
window = WindowCreate<SceneryScatterWindow>(WindowClass::SceneryScatter, 86, 100);

View File

@ -121,7 +121,7 @@ rct_window* WindowServerListOpen()
rct_window* window;
// Check if window is already open
window = window_bring_to_front_by_class(WindowClass::ServerList);
window = WindowBringToFrontByClass(WindowClass::ServerList);
if (window != nullptr)
return window;
@ -142,7 +142,7 @@ rct_window* WindowServerListOpen()
window->page = 0;
window->list_information_type = 0;
window_set_resize(*window, WWIDTH_MIN, WHEIGHT_MIN, WWIDTH_MAX, WHEIGHT_MAX);
WindowSetResize(*window, WWIDTH_MIN, WHEIGHT_MIN, WWIDTH_MAX, WHEIGHT_MAX);
safe_strcpy(_playerName, gConfigNetwork.PlayerName.c_str(), sizeof(_playerName));
@ -164,10 +164,10 @@ static void WindowServerListMouseup(rct_window* w, WidgetIndex widgetIndex)
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*w);
WindowClose(*w);
break;
case WIDX_PLAYER_NAME_INPUT:
window_start_textbox(*w, widgetIndex, STR_STRING, _playerName, 63);
WindowStartTextbox(*w, widgetIndex, STR_STRING, _playerName, 63);
break;
case WIDX_LIST:
{
@ -202,7 +202,7 @@ static void WindowServerListMouseup(rct_window* w, WidgetIndex widgetIndex)
static void WindowServerListResize(rct_window* w)
{
window_set_resize(*w, WWIDTH_MIN, WHEIGHT_MIN, WWIDTH_MAX, WHEIGHT_MAX);
WindowSetResize(*w, WWIDTH_MIN, WHEIGHT_MIN, WWIDTH_MAX, WHEIGHT_MAX);
}
static void WindowServerListDropdown(rct_window* w, WidgetIndex widgetIndex, int32_t dropdownIndex)
@ -239,8 +239,8 @@ static void WindowServerListUpdate(rct_window* w)
{
if (gCurrentTextBox.window.classification == w->classification && gCurrentTextBox.window.number == w->number)
{
window_update_textbox_caret();
widget_invalidate(*w, WIDX_PLAYER_NAME_INPUT);
WindowUpdateTextboxCaret();
WidgetInvalidate(*w, WIDX_PLAYER_NAME_INPUT);
}
ServerListFetchServersCheck(w);
}
@ -326,7 +326,7 @@ static void WindowServerListTextinput(rct_window* w, WidgetIndex widgetIndex, ch
ConfigSaveDefault();
}
widget_invalidate(*w, WIDX_PLAYER_NAME_INPUT);
WidgetInvalidate(*w, WIDX_PLAYER_NAME_INPUT);
break;
case WIDX_ADD_SERVER:

View File

@ -97,19 +97,19 @@ public:
Close();
break;
case WIDX_PORT_INPUT:
window_start_textbox(*this, widgetIndex, STR_STRING, _port, 6);
WindowStartTextbox(*this, widgetIndex, STR_STRING, _port, 6);
break;
case WIDX_NAME_INPUT:
window_start_textbox(*this, widgetIndex, STR_STRING, _name, 64);
WindowStartTextbox(*this, widgetIndex, STR_STRING, _name, 64);
break;
case WIDX_DESCRIPTION_INPUT:
window_start_textbox(*this, widgetIndex, STR_STRING, _description, MAX_SERVER_DESCRIPTION_LENGTH);
WindowStartTextbox(*this, widgetIndex, STR_STRING, _description, MAX_SERVER_DESCRIPTION_LENGTH);
break;
case WIDX_GREETING_INPUT:
window_start_textbox(*this, widgetIndex, STR_STRING, _greeting, CHAT_INPUT_SIZE);
WindowStartTextbox(*this, widgetIndex, STR_STRING, _greeting, CHAT_INPUT_SIZE);
break;
case WIDX_PASSWORD_INPUT:
window_start_textbox(*this, widgetIndex, STR_STRING, _password, 32);
WindowStartTextbox(*this, widgetIndex, STR_STRING, _password, 32);
break;
case WIDX_MAXPLAYERS_INCREASE:
if (gConfigNetwork.Maxplayers < 255)
@ -158,11 +158,11 @@ public:
{
if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number)
{
window_update_textbox_caret();
widget_invalidate(*this, WIDX_NAME_INPUT);
widget_invalidate(*this, WIDX_DESCRIPTION_INPUT);
widget_invalidate(*this, WIDX_GREETING_INPUT);
widget_invalidate(*this, WIDX_PASSWORD_INPUT);
WindowUpdateTextboxCaret();
WidgetInvalidate(*this, WIDX_NAME_INPUT);
WidgetInvalidate(*this, WIDX_DESCRIPTION_INPUT);
WidgetInvalidate(*this, WIDX_GREETING_INPUT);
WidgetInvalidate(*this, WIDX_PASSWORD_INPUT);
}
}
void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override
@ -187,7 +187,7 @@ public:
gConfigNetwork.DefaultPort = atoi(_port);
ConfigSaveDefault();
widget_invalidate(*this, WIDX_NAME_INPUT);
WidgetInvalidate(*this, WIDX_NAME_INPUT);
break;
case WIDX_NAME_INPUT:
if (strcmp(_name, temp.c_str()) == 0)
@ -205,7 +205,7 @@ public:
ConfigSaveDefault();
}
widget_invalidate(*this, WIDX_NAME_INPUT);
WidgetInvalidate(*this, WIDX_NAME_INPUT);
break;
case WIDX_DESCRIPTION_INPUT:
if (strcmp(_description, temp.c_str()) == 0)
@ -223,7 +223,7 @@ public:
ConfigSaveDefault();
}
widget_invalidate(*this, WIDX_DESCRIPTION_INPUT);
WidgetInvalidate(*this, WIDX_DESCRIPTION_INPUT);
break;
case WIDX_GREETING_INPUT:
if (strcmp(_greeting, temp.c_str()) == 0)
@ -241,7 +241,7 @@ public:
ConfigSaveDefault();
}
widget_invalidate(*this, WIDX_GREETING_INPUT);
WidgetInvalidate(*this, WIDX_GREETING_INPUT);
break;
case WIDX_PASSWORD_INPUT:
if (strcmp(_password, temp.c_str()) == 0)
@ -253,7 +253,7 @@ public:
safe_strcpy(_password, temp.c_str(), sizeof(_password));
}
widget_invalidate(*this, WIDX_PASSWORD_INPUT);
WidgetInvalidate(*this, WIDX_PASSWORD_INPUT);
break;
}
}

View File

@ -78,7 +78,7 @@ public:
auto registeredShortcut = shortcutManager.GetShortcut(shortcutId);
if (registeredShortcut != nullptr)
{
window_close_by_class(WindowClass::ChangeKeyboardShortcut);
WindowCloseByClass(WindowClass::ChangeKeyboardShortcut);
auto w = WindowCreate<ChangeShortcutWindow>(
WindowClass::ChangeKeyboardShortcut, CHANGE_WW, CHANGE_WH, WF_CENTRE_SCREEN);
if (w != nullptr)
@ -195,7 +195,7 @@ public:
void OnResize() override
{
window_set_resize(*this, min_width, min_height, max_width, max_height);
WindowSetResize(*this, min_width, min_height, max_width, max_height);
}
void OnUpdate() override
@ -239,7 +239,7 @@ public:
widgets[WIDX_SCROLL].bottom = height - 19;
widgets[WIDX_RESET].top = height - 16;
widgets[WIDX_RESET].bottom = height - 5;
window_align_tabs(this, WIDX_TAB_0, static_cast<WidgetIndex>(WIDX_TAB_0 + _tabs.size()));
WindowAlignTabs(this, WIDX_TAB_0, static_cast<WidgetIndex>(WIDX_TAB_0 + _tabs.size()));
// Set selected tab
for (size_t i = 0; i < _tabs.size(); i++)
@ -540,7 +540,7 @@ private:
void ChangeShortcutWindow::NotifyShortcutKeysWindow()
{
auto w = window_find_by_class(WindowClass::KeyboardShortcutList);
auto w = WindowFindByClass(WindowClass::KeyboardShortcutList);
if (w != nullptr)
{
static_cast<ShortcutKeysWindow*>(w)->RefreshBindings();
@ -549,7 +549,7 @@ void ChangeShortcutWindow::NotifyShortcutKeysWindow()
rct_window* WindowShortcutKeysOpen()
{
auto w = window_bring_to_front_by_class(WindowClass::KeyboardShortcutList);
auto w = WindowBringToFrontByClass(WindowClass::KeyboardShortcutList);
if (w == nullptr)
{
w = WindowCreate<ShortcutKeysWindow>(WindowClass::KeyboardShortcutList, WW, WH, WF_RESIZABLE);

View File

@ -285,7 +285,7 @@ public:
if (viewport != nullptr)
{
window_draw_viewport(&dpi, *this);
WindowDrawViewport(&dpi, *this);
}
}
@ -318,7 +318,7 @@ public:
*/
rct_window* WindowSignOpen(rct_windownumber number)
{
auto* w = static_cast<SignWindow*>(window_bring_to_front_by_number(WindowClass::Banner, number));
auto* w = static_cast<SignWindow*>(WindowBringToFrontByNumber(WindowClass::Banner, number));
if (w != nullptr)
return w;
@ -341,7 +341,7 @@ rct_window* WindowSignOpen(rct_windownumber number)
*/
rct_window* WindowSignSmallOpen(rct_windownumber number)
{
auto* w = static_cast<SignWindow*>(window_bring_to_front_by_number(WindowClass::Banner, number));
auto* w = static_cast<SignWindow*>(WindowBringToFrontByNumber(WindowClass::Banner, number));
if (w != nullptr)
return w;

View File

@ -344,7 +344,7 @@ private:
void CommonPrepareDrawAfter()
{
window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_3);
WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_3);
}
#pragma endregion
@ -369,10 +369,10 @@ private:
pickupAction.SetCallback([peepnum = number](const GameAction* ga, const GameActions::Result* result) {
if (result->Error != GameActions::Status::Ok)
return;
rct_window* wind = window_find_by_number(WindowClass::Peep, peepnum);
rct_window* wind = WindowFindByNumber(WindowClass::Peep, peepnum);
if (wind != nullptr)
{
tool_set(*wind, WC_STAFF__WIDX_PICKUP, Tool::Picker);
ToolSet(*wind, WC_STAFF__WIDX_PICKUP, Tool::Picker);
}
});
GameActions::Execute(&pickupAction);
@ -458,7 +458,7 @@ private:
return;
}
window_close_by_class(WindowClass::PatrolArea);
WindowCloseByClass(WindowClass::PatrolArea);
auto staffSetPatrolAreaAction = StaffSetPatrolAreaAction(
staff->sprite_index, {}, StaffSetPatrolAreaMode::ClearAll);
@ -469,7 +469,7 @@ private:
auto staffId = EntityId::FromUnderlying(number);
if (WindowPatrolAreaGetCurrentStaffId() == staffId)
{
window_close_by_class(WindowClass::PatrolArea);
WindowCloseByClass(WindowClass::PatrolArea);
}
else
{
@ -519,7 +519,7 @@ private:
// Draw the viewport no sound sprite
if (viewport != nullptr)
{
window_draw_viewport(dpi, *this);
WindowDrawViewport(dpi, *this);
if (viewport->flags & VIEWPORT_FLAG_SOUND_ON)
{
@ -697,7 +697,7 @@ private:
pickupAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) {
if (result->Error != GameActions::Status::Ok)
return;
tool_cancel();
ToolCancel();
gPickupPeepImage = ImageId();
});
GameActions::Execute(&pickupAction);
@ -1065,7 +1065,7 @@ private:
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
{
if (number == gCurrentToolWidget.window_number && classification == gCurrentToolWidget.window_classification)
tool_cancel();
ToolCancel();
}
}
@ -1089,8 +1089,8 @@ private:
RemoveViewport();
Invalidate();
window_event_resize_call(this);
window_event_invalidate_call(this);
WindowEventResizeCall(this);
WindowEventInvalidateCall(this);
InitScrollWidgets();
ViewportInit();
Invalidate();
@ -1153,7 +1153,7 @@ private:
viewport_flags |= VIEWPORT_FLAG_GRIDLINES;
}
window_event_invalidate_call(this);
WindowEventInvalidateCall(this);
focus = tempFocus;
@ -1190,8 +1190,8 @@ private:
void FollowPeep()
{
rct_window* main = window_get_main();
window_follow_sprite(*main, EntityId::FromUnderlying(number));
rct_window* main = WindowGetMain();
WindowFollowSprite(*main, EntityId::FromUnderlying(number));
}
void DrawTabImages(rct_drawpixelinfo* dpi)
@ -1236,7 +1236,7 @@ private:
rct_window* WindowStaffOpen(Peep* peep)
{
auto w = static_cast<StaffWindow*>(window_bring_to_front_by_number(WindowClass::Peep, peep->sprite_index.ToUnderlying()));
auto w = static_cast<StaffWindow*>(WindowBringToFrontByNumber(WindowClass::Peep, peep->sprite_index.ToUnderlying()));
if (w != nullptr)
return w;

View File

@ -139,7 +139,7 @@ public:
break;
}
case WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON:
if (!tool_set(*this, WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON, Tool::Crosshair))
if (!ToolSet(*this, WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON, Tool::Crosshair))
{
show_gridlines();
SetPatrolAreaToRender(GetSelectedStaffType());
@ -184,7 +184,7 @@ public:
InvalidateWidget(WIDX_STAFF_LIST_HANDYMEN_TAB + _selectedTab);
// Enable highlighting of these staff members in map window
if (window_find_by_class(WindowClass::Map) != nullptr)
if (WindowFindByClass(WindowClass::Map) != nullptr)
{
gWindowMapFlashingFlags |= MapFlashingFlags::StaffListOpen;
for (auto peep : EntityList<Staff>())
@ -453,9 +453,9 @@ public:
auto closestStaffMember = GetClosestStaffMemberTo(screenCoords);
if (closestStaffMember != nullptr)
{
tool_cancel();
ToolCancel();
auto* staffWindow = WindowStaffOpen(closestStaffMember);
window_event_dropdown_call(staffWindow, WC_PEEP__WIDX_PATROL, 0);
WindowEventDropdownCall(staffWindow, WC_PEEP__WIDX_PATROL, 0);
}
else
{
@ -471,7 +471,7 @@ public:
if (widgetIndex == WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON)
{
hide_gridlines();
tool_cancel();
ToolCancel();
ClearPatrolAreaToRender();
GfxInvalidateScreen();
}
@ -581,7 +581,7 @@ private:
{
if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number)
{
tool_cancel();
ToolCancel();
}
}
}
@ -710,7 +710,7 @@ rct_window* WindowStaffListOpen()
void WindowStaffListRefresh()
{
auto* window = window_find_by_class(WindowClass::StaffList);
auto* window = WindowFindByClass(WindowClass::StaffList);
if (window != nullptr)
{
static_cast<StaffListWindow*>(window)->RefreshList();

View File

@ -135,7 +135,7 @@ public:
auto parentWindow = GetParentWindow();
if (parentWindow == nullptr)
{
window_close(*this);
WindowClose(*this);
return;
}
}
@ -156,12 +156,12 @@ public:
case WIDX_CLOSE:
ContextStopTextInput();
ExecuteCallback(false);
window_close(*this);
WindowClose(*this);
break;
case WIDX_OKAY:
ContextStopTextInput();
ExecuteCallback(true);
window_close(*this);
WindowClose(*this);
}
}
@ -171,7 +171,7 @@ public:
int32_t newHeight = CalculateWindowHeight(_buffer.data());
if (newHeight != height)
{
window_set_resize(*this, WW, newHeight, WW, newHeight);
WindowSetResize(*this, WW, newHeight, WW, newHeight);
}
widgets[WIDX_OKAY].top = newHeight - 22;
@ -300,7 +300,7 @@ public:
{
ContextStopTextInput();
ExecuteCallback(true);
window_close(*this);
WindowClose(*this);
}
static int32_t CalculateWindowHeight(std::string_view text)
@ -337,7 +337,7 @@ private:
if (w != nullptr)
{
auto value = hasValue ? _buffer.data() : nullptr;
window_event_textinput_call(w, _parentWidget.widget_index, value);
WindowEventTextinputCall(w, _parentWidget.widget_index, value);
}
}
else
@ -366,7 +366,7 @@ private:
rct_window* GetParentWindow() const
{
return HasParentWindow() ? window_find_by_number(_parentWidget.window.classification, _parentWidget.window.number)
return HasParentWindow() ? WindowFindByNumber(_parentWidget.window.classification, _parentWidget.window.number)
: nullptr;
}
};
@ -375,7 +375,7 @@ void WindowTextInputRawOpen(
rct_window* call_w, WidgetIndex call_widget, StringId title, StringId description, const Formatter& descriptionArgs,
const_utf8string existing_text, int32_t maxLength)
{
window_close_by_class(WindowClass::Textinput);
WindowCloseByClass(WindowClass::Textinput);
auto height = TextInputWindow::CalculateWindowHeight(existing_text);
auto w = WindowCreate<TextInputWindow>(WindowClass::Textinput, WW, height, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT);
@ -425,7 +425,7 @@ void WindowTextInputKey(rct_window* w, uint32_t keycode)
}
// The window can be potentially closed within a callback, we need to check if its still alive.
w = window_find_by_number(wndClass, wndNumber);
w = WindowFindByNumber(wndClass, wndNumber);
if (w != nullptr)
w->Invalidate();
}

View File

@ -358,7 +358,7 @@ public:
if (frame_no >= window_themes_tab_animation_loops[_selected_tab])
frame_no = 0;
widget_invalidate(*this, WIDX_THEMES_SETTINGS_TAB + _selected_tab);
WidgetInvalidate(*this, WIDX_THEMES_SETTINGS_TAB + _selected_tab);
}
void OnPrepareDraw() override
@ -371,7 +371,7 @@ public:
pressed_widgets = pressedWidgets | (1 << widgetIndex);
if (window_find_by_class(WindowClass::Dropdown) == nullptr)
if (WindowFindByClass(WindowClass::Dropdown) == nullptr)
{
_colour_index_1 = -1;
_colour_index_2 = -1;
@ -494,7 +494,7 @@ public:
_selected_tab = static_cast<uint8_t>(newSelectedTab);
scrolls[0].v_top = 0;
frame_no = 0;
window_event_resize_call(this);
WindowEventResizeCall(this);
Invalidate();
break;
case WIDX_THEMES_PRESETS_DROPDOWN:
@ -523,7 +523,7 @@ public:
{
ThemeSetFlags(ThemeGetFlags() ^ UITHEME_FLAG_USE_LIGHTS_RIDE);
ThemeSave();
window_invalidate_all();
WindowInvalidateAll();
}
break;
case WIDX_THEMES_RCT1_PARK_LIGHTS:
@ -535,7 +535,7 @@ public:
{
ThemeSetFlags(ThemeGetFlags() ^ static_cast<uint8_t>(UITHEME_FLAG_USE_LIGHTS_PARK));
ThemeSave();
window_invalidate_all();
WindowInvalidateAll();
}
break;
case WIDX_THEMES_RCT1_SCENARIO_FONT:
@ -547,7 +547,7 @@ public:
{
ThemeSetFlags(ThemeGetFlags() ^ static_cast<uint8_t>(UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT));
ThemeSave();
window_invalidate_all();
WindowInvalidateAll();
}
break;
case WIDX_THEMES_RCT1_BOTTOM_TOOLBAR:
@ -559,7 +559,7 @@ public:
{
ThemeSetFlags(ThemeGetFlags() ^ static_cast<uint8_t>(UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR));
ThemeSave();
window_invalidate_all();
WindowInvalidateAll();
}
}
}
@ -620,7 +620,7 @@ public:
colour = (colour & COLOUR_FLAG_TRANSLUCENT) | selectedIndex;
ThemeSetColour(wc, _colour_index_2, colour);
ColourSchemeUpdateAll();
window_invalidate_all();
WindowInvalidateAll();
_colour_index_1 = -1;
_colour_index_2 = -1;
}
@ -727,7 +727,7 @@ public:
uint8_t colour = ThemeGetColour(wc, _colour_index_2);
WindowDropdownShowColour(
this, &(window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK]), colours[1], colour);
widget_invalidate(*this, WIDX_THEMES_LIST);
WidgetInvalidate(*this, WIDX_THEMES_LIST);
}
}
else if (
@ -751,7 +751,7 @@ public:
}
ThemeSetColour(wc, _colour_index_2, colour);
ColourSchemeUpdateAll();
window_invalidate_all();
WindowInvalidateAll();
}
}
}
@ -887,7 +887,7 @@ rct_window* WindowThemesOpen()
rct_window* window;
// Check if window is already open
window = window_bring_to_front_by_class(WindowClass::Themes);
window = WindowBringToFrontByClass(WindowClass::Themes);
if (window != nullptr)
return window;

View File

@ -492,7 +492,7 @@ public:
WindowInitScrollWidgets(*this);
_tileSelected = false;
tool_set(*this, WIDX_BACKGROUND, Tool::Crosshair);
ToolSet(*this, WIDX_BACKGROUND, Tool::Crosshair);
}
void OnUpdate() override
@ -512,7 +512,7 @@ public:
switch (widgetIndex)
{
case WIDX_CLOSE:
tool_cancel();
ToolCancel();
Close();
return;
@ -2340,7 +2340,7 @@ private:
rct_window* WindowTileInspectorOpen()
{
rct_window* window = window_bring_to_front_by_class(WindowClass::TileInspector);
rct_window* window = WindowBringToFrontByClass(WindowClass::TileInspector);
if (window == nullptr)
window = WindowCreate<TileInspector>(WindowClass::TileInspector, ScreenCoordsXY(0, 29), WW, WH, WF_RESIZABLE);
return window;
@ -2348,7 +2348,7 @@ rct_window* WindowTileInspectorOpen()
void WindowTileInspectorClearClipboard()
{
auto* window = window_find_by_class(WindowClass::TileInspector);
auto* window = WindowFindByClass(WindowClass::TileInspector);
if (window != nullptr)
static_cast<TileInspector*>(window)->ClearClipboard();
}

View File

@ -67,7 +67,7 @@ public:
rct_window* WindowTitleLogoOpen()
{
auto* window = window_bring_to_front_by_class(WindowClass::TitleLogo);
auto* window = WindowBringToFrontByClass(WindowClass::TitleLogo);
if (window == nullptr)
{
window = WindowCreate<TitleLogoWindow>(

View File

@ -125,42 +125,42 @@ public:
switch (widgetIndex)
{
case WIDX_START_NEW_GAME:
windowToOpen = window_find_by_class(WindowClass::ScenarioSelect);
windowToOpen = WindowFindByClass(WindowClass::ScenarioSelect);
if (windowToOpen != nullptr)
{
window_bring_to_front(*windowToOpen);
WindowBringToFront(*windowToOpen);
}
else
{
window_close_by_class(WindowClass::Loadsave);
window_close_by_class(WindowClass::ServerList);
WindowCloseByClass(WindowClass::Loadsave);
WindowCloseByClass(WindowClass::ServerList);
WindowScenarioselectOpen(WindowTitleMenuScenarioselectCallback, false);
}
break;
case WIDX_CONTINUE_SAVED_GAME:
windowToOpen = window_find_by_class(WindowClass::Loadsave);
windowToOpen = WindowFindByClass(WindowClass::Loadsave);
if (windowToOpen != nullptr)
{
window_bring_to_front(*windowToOpen);
WindowBringToFront(*windowToOpen);
}
else
{
window_close_by_class(WindowClass::ScenarioSelect);
window_close_by_class(WindowClass::ServerList);
WindowCloseByClass(WindowClass::ScenarioSelect);
WindowCloseByClass(WindowClass::ServerList);
auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt);
GameActions::Execute(&loadOrQuitAction);
}
break;
case WIDX_MULTIPLAYER:
windowToOpen = window_find_by_class(WindowClass::ServerList);
windowToOpen = WindowFindByClass(WindowClass::ServerList);
if (windowToOpen != nullptr)
{
window_bring_to_front(*windowToOpen);
WindowBringToFront(*windowToOpen);
}
else
{
window_close_by_class(WindowClass::ScenarioSelect);
window_close_by_class(WindowClass::Loadsave);
WindowCloseByClass(WindowClass::ScenarioSelect);
WindowCloseByClass(WindowClass::Loadsave);
ContextOpenWindow(WindowClass::ServerList);
}
break;

View File

@ -55,7 +55,7 @@ public:
*/
rct_window* WindowTitleOptionsOpen()
{
auto* window = window_bring_to_front_by_class(WindowClass::TitleOptions);
auto* window = WindowBringToFrontByClass(WindowClass::TitleOptions);
if (window == nullptr)
{
window = WindowCreate<TitleOptionsWindow>(

View File

@ -134,7 +134,7 @@ void WindowTooltipReset(const ScreenCoordsXY& screenCoords)
void WindowTooltipShow(const OpenRCT2String& message, ScreenCoordsXY screenCoords)
{
auto* w = window_find_by_class(WindowClass::Error);
auto* w = WindowFindByClass(WindowClass::Error);
if (w != nullptr)
return;
@ -151,7 +151,7 @@ void WindowTooltipOpen(rct_window* widgetWindow, WidgetIndex widgetIndex, const
return;
auto widget = &widgetWindow->widgets[widgetIndex];
window_event_invalidate_call(widgetWindow);
WindowEventInvalidateCall(widgetWindow);
OpenRCT2String result;
if (widget->flags & WIDGET_FLAGS::TOOLTIP_IS_STRING)
@ -177,7 +177,7 @@ void WindowTooltipOpen(rct_window* widgetWindow, WidgetIndex widgetIndex, const
gTooltipWidget.window_classification = widgetWindow->classification;
gTooltipWidget.window_number = widgetWindow->number;
gTooltipWidget.widget_index = widgetIndex;
result = window_event_tooltip_call(widgetWindow, widgetIndex, stringId);
result = WindowEventTooltipCall(widgetWindow, widgetIndex, stringId);
if (result.str == STR_NONE)
return;
}
@ -187,7 +187,7 @@ void WindowTooltipOpen(rct_window* widgetWindow, WidgetIndex widgetIndex, const
void WindowTooltipClose()
{
window_close_by_class(WindowClass::Tooltip);
WindowCloseByClass(WindowClass::Tooltip);
gTooltipTimeout = 0;
gTooltipWidget.window_classification = WindowClass::Null;
}

View File

@ -365,12 +365,12 @@ static void WindowTopToolbarMouseup(rct_window* w, WidgetIndex widgetIndex)
}
break;
case WIDX_ZOOM_OUT:
if ((mainWindow = window_get_main()) != nullptr)
window_zoom_out(*mainWindow, false);
if ((mainWindow = WindowGetMain()) != nullptr)
WindowZoomOut(*mainWindow, false);
break;
case WIDX_ZOOM_IN:
if ((mainWindow = window_get_main()) != nullptr)
window_zoom_in(*mainWindow, false);
if ((mainWindow = WindowGetMain()) != nullptr)
WindowZoomIn(*mainWindow, false);
break;
case WIDX_CLEAR_SCENERY:
ToggleClearSceneryWindow(w, WIDX_CLEAR_SCENERY);
@ -382,7 +382,7 @@ static void WindowTopToolbarMouseup(rct_window* w, WidgetIndex widgetIndex)
ToggleWaterWindow(w, WIDX_WATER);
break;
case WIDX_SCENERY:
if (!tool_set(*w, WIDX_SCENERY, Tool::Arrow))
if (!ToolSet(*w, WIDX_SCENERY, Tool::Arrow))
{
input_set_flag(INPUT_FLAG_6, true);
ContextOpenWindow(WindowClass::Scenery);
@ -575,7 +575,7 @@ static void WindowTopToolbarDropdown(rct_window* w, WidgetIndex widgetIndex, int
break;
}
case DDIDX_SAVE_GAME:
tool_cancel();
ToolCancel();
save_game();
break;
case DDIDX_SAVE_GAME_AS:
@ -588,7 +588,7 @@ static void WindowTopToolbarDropdown(rct_window* w, WidgetIndex widgetIndex, int
}
else
{
tool_cancel();
ToolCancel();
save_game_as();
}
break;
@ -618,8 +618,8 @@ static void WindowTopToolbarDropdown(rct_window* w, WidgetIndex widgetIndex, int
break;
case DDIDX_QUIT_TO_MENU:
{
window_close_by_class(WindowClass::ManageTrackDesign);
window_close_by_class(WindowClass::TrackDeletePrompt);
WindowCloseByClass(WindowClass::ManageTrackDesign);
WindowCloseByClass(WindowClass::TrackDeletePrompt);
auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt, PromptMode::SaveBeforeQuit);
GameActions::Execute(&loadOrQuitAction);
break;
@ -815,7 +815,7 @@ static void WindowTopToolbarInvalidate(rct_window* w)
}
// Footpath button pressed down
if (window_find_by_class(WindowClass::Footpath) == nullptr)
if (WindowFindByClass(WindowClass::Footpath) == nullptr)
w->pressed_widgets &= ~(1uLL << WIDX_PATH);
else
w->pressed_widgets |= (1uLL << WIDX_PATH);
@ -845,7 +845,7 @@ static void WindowTopToolbarInvalidate(rct_window* w)
}
// Zoomed out/in disable. Not sure where this code is in the original.
const auto* mainWindow = window_get_main();
const auto* mainWindow = WindowGetMain();
if (mainWindow == nullptr || mainWindow->viewport == nullptr)
{
log_error("mainWindow or mainWindow->viewport is null!");
@ -1211,7 +1211,7 @@ static void Sub6E1F34UpdateScreenCoordsAndButtonsPressed(bool canRaiseItem, Scre
// SHIFT pressed
gSceneryShiftPressZOffset = (gSceneryShiftPressY - screenPos.y + 4);
// Scale delta by zoom to match mouse position.
auto* mainWnd = window_get_main();
auto* mainWnd = WindowGetMain();
if (mainWnd != nullptr && mainWnd->viewport != nullptr)
{
gSceneryShiftPressZOffset = mainWnd->viewport->zoom.ApplyTo(gSceneryShiftPressZOffset);
@ -1234,7 +1234,7 @@ static void Sub6E1F34SmallScenery(
const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, uint8_t* outQuadrant,
Direction* outRotation)
{
rct_window* w = window_find_by_class(WindowClass::Scenery);
rct_window* w = WindowFindByClass(WindowClass::Scenery);
if (w == nullptr)
{
@ -1430,7 +1430,7 @@ static void Sub6E1F34SmallScenery(
static void Sub6E1F34PathItem(
const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, int32_t* outZ)
{
rct_window* w = window_find_by_class(WindowClass::Scenery);
rct_window* w = WindowFindByClass(WindowClass::Scenery);
if (w == nullptr)
{
@ -1463,7 +1463,7 @@ static void Sub6E1F34PathItem(
static void Sub6E1F34Wall(
const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, uint8_t* outEdges)
{
rct_window* w = window_find_by_class(WindowClass::Scenery);
rct_window* w = WindowFindByClass(WindowClass::Scenery);
if (w == nullptr)
{
@ -1552,7 +1552,7 @@ static void Sub6E1F34Wall(
static void Sub6E1F34LargeScenery(
const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, Direction* outDirection)
{
rct_window* w = window_find_by_class(WindowClass::Scenery);
rct_window* w = WindowFindByClass(WindowClass::Scenery);
if (w == nullptr)
{
@ -1652,7 +1652,7 @@ static void Sub6E1F34Banner(
const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, int32_t* outZ,
Direction* outDirection)
{
rct_window* w = window_find_by_class(WindowClass::Scenery);
rct_window* w = WindowFindByClass(WindowClass::Scenery);
if (w == nullptr)
{
@ -2012,7 +2012,7 @@ static uint8_t TopToolbarToolUpdateLandPaint(const ScreenCoordsXY& screenPos)
if (gClearSceneryCost != MONEY64_UNDEFINED)
{
gClearSceneryCost = MONEY64_UNDEFINED;
window_invalidate_by_class(WindowClass::ClearScenery);
WindowInvalidateByClass(WindowClass::ClearScenery);
}
return state_changed;
}
@ -2083,7 +2083,7 @@ static void TopToolbarToolUpdateSceneryClear(const ScreenCoordsXY& screenPos)
if (gClearSceneryCost != cost)
{
gClearSceneryCost = cost;
window_invalidate_by_class(WindowClass::ClearScenery);
WindowInvalidateByClass(WindowClass::ClearScenery);
}
}
@ -2109,7 +2109,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos)
{
gLandToolRaiseCost = raise_cost;
gLandToolLowerCost = lower_cost;
window_invalidate_by_class(WindowClass::Land);
WindowInvalidateByClass(WindowClass::Land);
}
return;
}
@ -2135,7 +2135,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos)
{
gLandToolRaiseCost = raise_cost;
gLandToolLowerCost = lower_cost;
window_invalidate_by_class(WindowClass::Land);
WindowInvalidateByClass(WindowClass::Land);
}
return;
}
@ -2195,7 +2195,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos)
{
gLandToolRaiseCost = raise_cost;
gLandToolLowerCost = lower_cost;
window_invalidate_by_class(WindowClass::Land);
WindowInvalidateByClass(WindowClass::Land);
}
return;
}
@ -2212,7 +2212,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos)
{
gLandToolRaiseCost = raise_cost;
gLandToolLowerCost = lower_cost;
window_invalidate_by_class(WindowClass::Land);
WindowInvalidateByClass(WindowClass::Land);
}
return;
}
@ -2321,7 +2321,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos)
{
gLandToolRaiseCost = raise_cost;
gLandToolLowerCost = lower_cost;
window_invalidate_by_class(WindowClass::Land);
WindowInvalidateByClass(WindowClass::Land);
}
}
@ -2353,7 +2353,7 @@ static void TopToolbarToolUpdateWater(const ScreenCoordsXY& screenPos)
{
gWaterToolRaiseCost = raiseCost;
gWaterToolLowerCost = lowerCost;
window_invalidate_by_class(WindowClass::Water);
WindowInvalidateByClass(WindowClass::Water);
}
return;
}
@ -2369,7 +2369,7 @@ static void TopToolbarToolUpdateWater(const ScreenCoordsXY& screenPos)
{
gWaterToolRaiseCost = MONEY64_UNDEFINED;
gWaterToolLowerCost = MONEY64_UNDEFINED;
window_invalidate_by_class(WindowClass::Water);
WindowInvalidateByClass(WindowClass::Water);
}
return;
}
@ -2445,7 +2445,7 @@ static void TopToolbarToolUpdateWater(const ScreenCoordsXY& screenPos)
{
gWaterToolRaiseCost = raiseCost;
gWaterToolLowerCost = lowerCost;
window_invalidate_by_class(WindowClass::Water);
WindowInvalidateByClass(WindowClass::Water);
}
}
@ -3060,10 +3060,10 @@ static money64 SelectionLowerLand(uint8_t flags)
*/
static void WindowTopToolbarLandToolDrag(const ScreenCoordsXY& screenPos)
{
rct_window* window = window_find_from_point(screenPos);
rct_window* window = WindowFindFromPoint(screenPos);
if (window == nullptr)
return;
WidgetIndex widget_index = window_find_widget_from_point(*window, screenPos);
WidgetIndex widget_index = WindowFindWidgetFromPoint(*window, screenPos);
if (widget_index == -1)
return;
const auto& widget = window->widgets[widget_index];
@ -3103,10 +3103,10 @@ static void WindowTopToolbarLandToolDrag(const ScreenCoordsXY& screenPos)
*/
static void WindowTopToolbarWaterToolDrag(const ScreenCoordsXY& screenPos)
{
rct_window* window = window_find_from_point(screenPos);
rct_window* window = WindowFindFromPoint(screenPos);
if (!window)
return;
WidgetIndex widget_index = window_find_widget_from_point(*window, screenPos);
WidgetIndex widget_index = WindowFindWidgetFromPoint(*window, screenPos);
if (widget_index == -1)
return;
const auto& widget = window->widgets[widget_index];
@ -3159,7 +3159,7 @@ static void WindowTopToolbarToolDrag(rct_window* w, WidgetIndex widgetIndex, con
switch (widgetIndex)
{
case WIDX_CLEAR_SCENERY:
if (window_find_by_class(WindowClass::Error) == nullptr && (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE))
if (WindowFindByClass(WindowClass::Error) == nullptr && (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE))
{
auto action = GetClearAction();
GameActions::Execute(&action);
@ -3405,7 +3405,7 @@ static void TopToolbarInitFastforwardMenu(rct_window* w, Widget* widget)
static void TopToolbarFastforwardMenuDropdown(int16_t dropdownIndex)
{
rct_window* w = window_get_main();
rct_window* w = WindowGetMain();
if (w)
{
if (dropdownIndex >= 0 && dropdownIndex <= 5)
@ -3431,17 +3431,17 @@ static void TopToolbarInitRotateMenu(rct_window* w, Widget* widget)
static void TopToolbarRotateMenuDropdown(int16_t dropdownIndex)
{
rct_window* w = window_get_main();
rct_window* w = WindowGetMain();
if (w)
{
if (dropdownIndex == 0)
{
window_rotate_camera(*w, 1);
WindowRotateCamera(*w, 1);
w->Invalidate();
}
else if (dropdownIndex == 1)
{
window_rotate_camera(*w, -1);
WindowRotateCamera(*w, -1);
w->Invalidate();
}
}
@ -3515,7 +3515,7 @@ static void TopToolbarCheatsMenuDropdown(int16_t dropdownIndex)
ContextOpenWindow(WindowClass::TileInspector);
break;
case DDIDX_OBJECT_SELECTION:
window_close_all();
WindowCloseAll();
ContextOpenWindow(WindowClass::EditorObjectSelection);
break;
case DDIDX_INVENTIONS_LIST:
@ -3550,7 +3550,7 @@ static void TopToolbarInitDebugMenu(rct_window* w, Widget* widget)
{ w->windowPos.x + widget->left, w->windowPos.y + widget->top }, widget->height() + 1, w->colours[0] | 0x80,
Dropdown::Flag::StayOpen, TOP_TOOLBAR_DEBUG_COUNT);
Dropdown::SetChecked(DDIDX_DEBUG_PAINT, window_find_by_class(WindowClass::DebugPaint) != nullptr);
Dropdown::SetChecked(DDIDX_DEBUG_PAINT, WindowFindByClass(WindowClass::DebugPaint) != nullptr);
}
static void TopToolbarInitNetworkMenu(rct_window* w, Widget* widget)
@ -3569,7 +3569,7 @@ static void TopToolbarInitNetworkMenu(rct_window* w, Widget* widget)
static void TopToolbarDebugMenuDropdown(int16_t dropdownIndex)
{
rct_window* w = window_get_main();
rct_window* w = WindowGetMain();
if (w != nullptr)
{
switch (dropdownIndex)
@ -3581,13 +3581,13 @@ static void TopToolbarDebugMenuDropdown(int16_t dropdownIndex)
break;
}
case DDIDX_DEBUG_PAINT:
if (window_find_by_class(WindowClass::DebugPaint) == nullptr)
if (WindowFindByClass(WindowClass::DebugPaint) == nullptr)
{
ContextOpenWindow(WindowClass::DebugPaint);
}
else
{
window_close_by_class(WindowClass::DebugPaint);
WindowCloseByClass(WindowClass::DebugPaint);
}
break;
}
@ -3596,7 +3596,7 @@ static void TopToolbarDebugMenuDropdown(int16_t dropdownIndex)
static void TopToolbarNetworkMenuDropdown(int16_t dropdownIndex)
{
rct_window* w = window_get_main();
rct_window* w = WindowGetMain();
if (w != nullptr)
{
switch (dropdownIndex)
@ -3652,7 +3652,7 @@ static void TopToolbarInitViewMenu(rct_window* w, Widget* widget)
TOP_TOOLBAR_VIEW_MENU_COUNT);
// Set checkmarks
rct_viewport* mainViewport = window_get_main()->viewport;
rct_viewport* mainViewport = WindowGetMain()->viewport;
if (mainViewport->flags & VIEWPORT_FLAG_UNDERGROUND_INSIDE)
Dropdown::SetChecked(DDIDX_UNDERGROUND_INSIDE, true);
if (gConfigGeneral.TransparentWater)
@ -3703,7 +3703,7 @@ static void TopToolbarInitViewMenu(rct_window* w, Widget* widget)
*/
static void TopToolbarViewMenuDropdown(int16_t dropdownIndex)
{
rct_window* w = window_get_main();
rct_window* w = WindowGetMain();
if (w != nullptr)
{
switch (dropdownIndex)
@ -3755,7 +3755,7 @@ static void TopToolbarViewMenuDropdown(int16_t dropdownIndex)
w->viewport->flags ^= VIEWPORT_FLAG_PATH_HEIGHTS;
break;
case DDIDX_VIEW_CLIPPING:
if (window_find_by_class(WindowClass::ViewClipping) == nullptr)
if (WindowFindByClass(WindowClass::ViewClipping) == nullptr)
{
ContextOpenWindow(WindowClass::ViewClipping);
}
@ -3784,14 +3784,14 @@ static void TopToolbarViewMenuDropdown(int16_t dropdownIndex)
*/
static void ToggleFootpathWindow()
{
if (window_find_by_class(WindowClass::Footpath) == nullptr)
if (WindowFindByClass(WindowClass::Footpath) == nullptr)
{
ContextOpenWindow(WindowClass::Footpath);
}
else
{
tool_cancel();
window_close_by_class(WindowClass::Footpath);
ToolCancel();
WindowCloseByClass(WindowClass::Footpath);
}
}
@ -3804,13 +3804,13 @@ static void ToggleLandWindow(rct_window* topToolbar, WidgetIndex widgetIndex)
if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar
&& gCurrentToolWidget.widget_index == WIDX_LAND)
{
tool_cancel();
ToolCancel();
}
else
{
_landToolBlocked = false;
show_gridlines();
tool_set(*topToolbar, widgetIndex, Tool::DigDown);
ToolSet(*topToolbar, widgetIndex, Tool::DigDown);
input_set_flag(INPUT_FLAG_6, true);
ContextOpenWindow(WindowClass::Land);
}
@ -3825,12 +3825,12 @@ static void ToggleClearSceneryWindow(rct_window* topToolbar, WidgetIndex widgetI
if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar
&& gCurrentToolWidget.widget_index == WIDX_CLEAR_SCENERY))
{
tool_cancel();
ToolCancel();
}
else
{
show_gridlines();
tool_set(*topToolbar, widgetIndex, Tool::Crosshair);
ToolSet(*topToolbar, widgetIndex, Tool::Crosshair);
input_set_flag(INPUT_FLAG_6, true);
ContextOpenWindow(WindowClass::ClearScenery);
}
@ -3845,13 +3845,13 @@ static void ToggleWaterWindow(rct_window* topToolbar, WidgetIndex widgetIndex)
if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar
&& gCurrentToolWidget.widget_index == WIDX_WATER)
{
tool_cancel();
ToolCancel();
}
else
{
_landToolBlocked = false;
show_gridlines();
tool_set(*topToolbar, widgetIndex, Tool::WaterDown);
ToolSet(*topToolbar, widgetIndex, Tool::WaterDown);
input_set_flag(INPUT_FLAG_6, true);
ContextOpenWindow(WindowClass::Water);
}

View File

@ -91,7 +91,7 @@ static void WindowTrackDesignListReloadTracks();
*/
rct_window* WindowTrackManageOpen(TrackDesignFileRef* tdFileRef)
{
window_close_by_class(WindowClass::ManageTrackDesign);
WindowCloseByClass(WindowClass::ManageTrackDesign);
auto trackDesignManageWindow = std::make_unique<TrackDesignManageWindow>(tdFileRef);
auto* window = WindowCreate(
std::move(trackDesignManageWindow), WindowClass::ManageTrackDesign, {}, WW, WH,
@ -105,7 +105,7 @@ void TrackDesignManageWindow::OnOpen()
widgets = window_track_manage_widgets;
WindowInitScrollWidgets(*this);
auto* trackDesignListWindow = window_find_by_class(WindowClass::TrackDesignList);
auto* trackDesignListWindow = WindowFindByClass(WindowClass::TrackDesignList);
if (trackDesignListWindow != nullptr)
{
trackDesignListWindow->track_list.track_list_being_updated = true;
@ -114,7 +114,7 @@ void TrackDesignManageWindow::OnOpen()
void TrackDesignManageWindow::OnClose()
{
rct_window* trackDesignListWindow = window_find_by_class(WindowClass::TrackDesignList);
rct_window* trackDesignListWindow = WindowFindByClass(WindowClass::TrackDesignList);
if (trackDesignListWindow != nullptr)
{
trackDesignListWindow->track_list.track_list_being_updated = false;
@ -126,7 +126,7 @@ void TrackDesignManageWindow::OnMouseUp(WidgetIndex widgetIndex)
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close_by_class(WindowClass::TrackDeletePrompt);
WindowCloseByClass(WindowClass::TrackDeletePrompt);
Close();
break;
case WIDX_RENAME:
@ -159,7 +159,7 @@ void TrackDesignManageWindow::OnTextInput(WidgetIndex widgetIndex, std::string_v
if (track_repository_rename(_trackDesignFileReference->path, std::string(text)))
{
window_close_by_class(WindowClass::TrackDeletePrompt);
WindowCloseByClass(WindowClass::TrackDeletePrompt);
Close();
WindowTrackDesignListReloadTracks();
}
@ -181,7 +181,7 @@ void TrackDesignManageWindow::OnDraw(rct_drawpixelinfo& dpi)
*/
static void WindowTrackDeletePromptOpen(TrackDesignFileRef* tdFileRef)
{
window_close_by_class(WindowClass::TrackDeletePrompt);
WindowCloseByClass(WindowClass::TrackDeletePrompt);
int32_t screenWidth = ContextGetWidth();
int32_t screenHeight = ContextGetHeight();
@ -212,7 +212,7 @@ void TrackDeletePromptWindow::OnMouseUp(WidgetIndex widgetIndex)
Close();
if (track_repository_delete(tdPath))
{
window_close_by_class(WindowClass::ManageTrackDesign);
WindowCloseByClass(WindowClass::ManageTrackDesign);
WindowTrackDesignListReloadTracks();
}
else
@ -236,7 +236,7 @@ void TrackDeletePromptWindow::OnDraw(rct_drawpixelinfo& dpi)
static void WindowTrackDesignListReloadTracks()
{
rct_window* trackListWindow = window_find_by_class(WindowClass::TrackDesignList);
rct_window* trackListWindow = WindowFindByClass(WindowClass::TrackDesignList);
if (trackListWindow != nullptr)
{
trackListWindow->track_list.reload_track_designs = true;

View File

@ -79,9 +79,9 @@ public:
{
widgets = window_track_place_widgets;
WindowInitScrollWidgets(*this);
tool_set(*this, WIDX_PRICE, Tool::Crosshair);
ToolSet(*this, WIDX_PRICE, Tool::Crosshair);
input_set_flag(INPUT_FLAG_6, true);
window_push_others_right(*this);
WindowPushOthersRight(*this);
show_gridlines();
_miniPreview.resize(TRACK_MINI_PREVIEW_SIZE);
_placementCost = MONEY32_UNDEFINED;
@ -200,7 +200,7 @@ public:
if (cost != _placementCost)
{
_placementCost = cost;
widget_invalidate(*this, WIDX_PRICE);
WidgetInvalidate(*this, WIDX_PRICE);
}
TrackDesignPreviewDrawOutlines(tds, _trackDesign.get(), *GetOrAllocateRide(PreviewRideId), trackLoc);
@ -233,7 +233,7 @@ public:
auto getRide = get_ride(rideId);
if (getRide != nullptr)
{
window_close_by_class(WindowClass::Error);
WindowCloseByClass(WindowClass::Error);
OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, trackLoc);
_currentRideIndex = rideId;
@ -242,14 +242,14 @@ public:
auto intent = Intent(WindowClass::Ride);
intent.putExtra(INTENT_EXTRA_RIDE_ID, rideId.ToUnderlying());
ContextOpenIntent(&intent);
auto wnd = window_find_by_class(WindowClass::TrackDesignPlace);
window_close(*wnd);
auto wnd = WindowFindByClass(WindowClass::TrackDesignPlace);
WindowClose(*wnd);
}
else
{
ride_initialise_construction_window(*getRide);
auto wnd = window_find_by_class(WindowClass::RideConstruction);
window_event_mouse_up_call(wnd, WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE);
auto wnd = WindowFindByClass(WindowClass::RideConstruction);
WindowEventMouseUpCall(wnd, WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE);
}
}
}
@ -621,7 +621,7 @@ rct_window* WindowTrackPlaceOpen(const TrackDesignFileRef* tdFileRef)
return nullptr;
}
window_close_construction_windows();
WindowCloseConstructionWindows();
auto* window = WindowFocusOrCreate<TrackDesignPlaceWindow>(WindowClass::TrackDesignPlace, WW, WH, 0);
if (window != nullptr)
@ -633,7 +633,7 @@ rct_window* WindowTrackPlaceOpen(const TrackDesignFileRef* tdFileRef)
void TrackPlaceClearProvisionalTemporarily()
{
auto* trackPlaceWnd = static_cast<TrackDesignPlaceWindow*>(window_find_by_class(WindowClass::TrackDesignPlace));
auto* trackPlaceWnd = static_cast<TrackDesignPlaceWindow*>(WindowFindByClass(WindowClass::TrackDesignPlace));
if (trackPlaceWnd != nullptr)
{
trackPlaceWnd->ClearProvisionalTemporarily();
@ -642,7 +642,7 @@ void TrackPlaceClearProvisionalTemporarily()
void TrackPlaceRestoreProvisional()
{
auto* trackPlaceWnd = static_cast<TrackDesignPlaceWindow*>(window_find_by_class(WindowClass::TrackDesignPlace));
auto* trackPlaceWnd = static_cast<TrackDesignPlaceWindow*>(WindowFindByClass(WindowClass::TrackDesignPlace));
if (trackPlaceWnd != nullptr)
{
trackPlaceWnd->RestoreProvisional();

View File

@ -224,7 +224,7 @@ public:
selected_list_item = 1;
}
gTrackDesignSceneryToggle = false;
window_push_others_right(*this);
WindowPushOthersRight(*this);
_currentTrackPieceDirection = 2;
_trackDesignPreviewPixels.resize(4 * TRACK_PREVIEW_IMAGE_SIZE);
@ -249,8 +249,8 @@ public:
// try to load the track manager again, and an infinite loop will result.
if ((gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && gScreenAge != 0)
{
window_close_by_number(WindowClass::ManageTrackDesign, number);
window_close_by_number(WindowClass::TrackDeletePrompt, number);
WindowCloseByNumber(WindowClass::ManageTrackDesign, number);
WindowCloseByNumber(WindowClass::TrackDeletePrompt, number);
Editor::LoadTrackManager();
}
}
@ -280,8 +280,7 @@ public:
}
break;
case WIDX_FILTER_STRING:
window_start_textbox(
*this, widgetIndex, STR_STRING, _filterString, sizeof(_filterString)); // TODO check this out
WindowStartTextbox(*this, widgetIndex, STR_STRING, _filterString, sizeof(_filterString)); // TODO check this out
break;
case WIDX_FILTER_CLEAR:
// Keep the highlighted item selected
@ -421,8 +420,8 @@ public:
{
if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number)
{
window_update_textbox_caret();
widget_invalidate(*this, WIDX_FILTER_STRING); // TODO Check this
WindowUpdateTextboxCaret();
WidgetInvalidate(*this, WIDX_FILTER_STRING); // TODO Check this
}
if (track_list.reload_track_designs)
@ -746,7 +745,7 @@ public:
rct_window* WindowTrackListOpen(const RideSelection item)
{
window_close_construction_windows();
WindowCloseConstructionWindows();
ScreenCoordsXY screenPos{};
if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)
{

View File

@ -93,9 +93,9 @@ public:
void OnOpen() override
{
widgets = window_transparency_main_widgets;
window_push_others_below(*this);
WindowPushOthersBelow(*this);
auto* w = window_get_main();
auto* w = WindowGetMain();
if (w != nullptr)
windowPos.x = ((w->width / 2) - (width / 2));
}
@ -116,7 +116,7 @@ public:
void OnPrepareDraw() override
{
uint32_t wflags = 0;
rct_window* w = window_get_main();
rct_window* w = WindowGetMain();
pressed_widgets = 0;
disabled_widgets = 0;
@ -170,7 +170,7 @@ private:
void ToggleViewportFlag(WidgetIndex widgetIndex)
{
uint32_t wflags = 0;
rct_window* w = window_get_main();
rct_window* w = WindowGetMain();
if (w == nullptr)
return;
@ -246,7 +246,7 @@ private:
rct_window* WindowTransparencyOpen()
{
auto* window = window_bring_to_front_by_class(WindowClass::Transparency);
auto* window = WindowBringToFrontByClass(WindowClass::Transparency);
if (window == nullptr)
window = WindowCreate<TransparencyWindow>(WindowClass::Transparency, ScreenCoordsXY(32, 32), WW, WH);

View File

@ -86,12 +86,12 @@ public:
switch (widgetIndex)
{
case WIDX_CLOSE:
window_close(*this);
WindowClose(*this);
break;
case WIDX_CLIP_CHECKBOX_ENABLE:
{
// Toggle height clipping.
rct_window* mainWindow = window_get_main();
rct_window* mainWindow = WindowGetMain();
if (mainWindow != nullptr)
{
mainWindow->viewport->flags ^= VIEWPORT_FLAG_CLIP_VIEW;
@ -114,7 +114,7 @@ public:
break;
case WIDX_CLIP_SELECTOR:
// Activate the selection tool
tool_set(*this, WIDX_BACKGROUND, Tool::Crosshair);
ToolSet(*this, WIDX_BACKGROUND, Tool::Crosshair);
_toolActive = true;
_dragging = false;
@ -129,7 +129,7 @@ public:
if (IsActive())
{
_toolActive = false;
tool_cancel();
ToolCancel();
}
gClipSelectionA = { 0, 0 };
gClipSelectionB = { MAXIMUM_MAP_SIZE_BIG - 1, MAXIMUM_MAP_SIZE_BIG - 1 };
@ -147,14 +147,14 @@ public:
case WIDX_CLIP_HEIGHT_INCREASE:
if (gClipHeight < 255)
SetClipHeight(gClipHeight + 1);
mainWindow = window_get_main();
mainWindow = WindowGetMain();
if (mainWindow != nullptr)
mainWindow->Invalidate();
break;
case WIDX_CLIP_HEIGHT_DECREASE:
if (gClipHeight > 0)
SetClipHeight(gClipHeight - 1);
mainWindow = window_get_main();
mainWindow = WindowGetMain();
if (mainWindow != nullptr)
mainWindow->Invalidate();
break;
@ -173,7 +173,7 @@ public:
gClipHeight = clip_height;
// Update the main window accordingly.
rct_window* mainWindow = window_get_main();
rct_window* mainWindow = WindowGetMain();
if (mainWindow != nullptr)
{
mainWindow->Invalidate();
@ -188,7 +188,7 @@ public:
gClipSelectionB = _previousClipSelectionB;
}
widget_invalidate(*this, WIDX_CLIP_HEIGHT_SLIDER);
WidgetInvalidate(*this, WIDX_CLIP_HEIGHT_SLIDER);
}
void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override
@ -248,7 +248,7 @@ public:
gClipSelectionA = gMapSelectPositionA;
gClipSelectionB = gMapSelectPositionB;
_toolActive = false;
tool_cancel();
ToolCancel();
GfxInvalidateScreen();
}
@ -256,7 +256,7 @@ public:
{
WidgetScrollUpdateThumbs(*this, WIDX_CLIP_HEIGHT_SLIDER);
rct_window* mainWindow = window_get_main();
rct_window* mainWindow = WindowGetMain();
if (mainWindow != nullptr)
{
WidgetSetCheckboxValue(*this, WIDX_CLIP_CHECKBOX_ENABLE, mainWindow->viewport->flags & VIEWPORT_FLAG_CLIP_VIEW);
@ -352,10 +352,10 @@ public:
// Initialise the clip height slider from the current clip height value.
this->SetClipHeight(gClipHeight);
window_push_others_below(*this);
WindowPushOthersBelow(*this);
// Get the main viewport to set the view clipping flag.
rct_window* mainWindow = window_get_main();
rct_window* mainWindow = WindowGetMain();
// Turn on view clipping when the window is opened.
if (mainWindow != nullptr)
@ -369,7 +369,7 @@ private:
void OnClose() override
{
// Turn off view clipping when the window is closed.
rct_window* mainWindow = window_get_main();
rct_window* mainWindow = WindowGetMain();
if (mainWindow != nullptr)
{
mainWindow->viewport->flags &= ~VIEWPORT_FLAG_CLIP_VIEW;
@ -398,7 +398,7 @@ private:
rct_window* WindowViewClippingOpen()
{
auto* window = window_bring_to_front_by_class(WindowClass::ViewClipping);
auto* window = WindowBringToFrontByClass(WindowClass::ViewClipping);
if (window == nullptr)
{
window = WindowCreate<ViewClippingWindow>(WindowClass::ViewClipping, ScreenCoordsXY(32, 32), WW, WH);

View File

@ -59,7 +59,7 @@ private:
void GetFreeViewportNumber()
{
number = 1;
window_visit_each([&](rct_window* w) {
WindowVisitEach([&](rct_window* w) {
if (w != nullptr && w != this && w->classification == WindowClass::Viewport)
{
if (w->number >= number)
@ -84,7 +84,7 @@ public:
return;
}
auto* mainWindow = window_get_main();
auto* mainWindow = WindowGetMain();
if (mainWindow != nullptr)
{
rct_viewport* mainViewport = mainWindow->viewport;
@ -103,7 +103,7 @@ public:
void OnUpdate() override
{
auto* mainWindow = window_get_main();
auto* mainWindow = WindowGetMain();
if (mainWindow == nullptr)
return;
@ -139,12 +139,12 @@ public:
}
break;
case WIDX_LOCATE:
auto* mainWindow = window_get_main();
auto* mainWindow = WindowGetMain();
if (mainWindow != nullptr)
{
auto info = get_map_coordinates_from_pos(
{ windowPos.x + (width / 2), windowPos.y + (height / 2) }, ViewportInteractionItemAll);
window_scroll_to_location(*mainWindow, { info.Loc, TileElementHeight(info.Loc) });
WindowScrollToLocation(*mainWindow, { info.Loc, TileElementHeight(info.Loc) });
}
break;
}
@ -156,7 +156,7 @@ public:
// Draw viewport
if (viewport != nullptr)
window_draw_viewport(&dpi, *this);
WindowDrawViewport(&dpi, *this);
}
void OnResize() override
@ -170,7 +170,7 @@ public:
min_width = WW;
min_height = WH;
window_set_resize(*this, min_width, min_height, max_width, max_height);
WindowSetResize(*this, min_width, min_height, max_width, max_height);
}
void OnPrepareDraw() override

View File

@ -48,7 +48,7 @@ public:
widgets = window_water_widgets;
hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT);
WindowInitScrollWidgets(*this);
window_push_others_below(*this);
WindowPushOthersBelow(*this);
gLandToolSize = 1;
gWaterToolRaiseCost = MONEY64_UNDEFINED;
@ -60,7 +60,7 @@ public:
// If the tool wasn't changed, turn tool off
if (WaterToolIsActive())
{
tool_cancel();
ToolCancel();
}
}

View File

@ -185,7 +185,7 @@ namespace OpenRCT2
#ifndef DISABLE_NETWORK
_network.Close();
#endif
window_close_all();
WindowCloseAll();
// Unload objects after closing all windows, this is to overcome windows like
// the object selection window which loads objects when closed.
@ -546,7 +546,7 @@ namespace OpenRCT2
}
}
window_check_all_valid_zoom();
WindowCheckAllValidZoom();
}
void DisposeDrawingEngine() final override
@ -1114,7 +1114,7 @@ namespace OpenRCT2
Tick();
// Always run this at a fixed rate, Update can cause multiple ticks if the game is speed up.
window_update_all();
WindowUpdateAll();
_ticksAccumulator -= GAME_UPDATE_TIME_MS;
}
@ -1143,7 +1143,7 @@ namespace OpenRCT2
Tick();
// Always run this at a fixed rate, Update can cause multiple ticks if the game is speed up.
window_update_all();
WindowUpdateAll();
_ticksAccumulator -= GAME_UPDATE_TIME_MS;

View File

@ -124,7 +124,7 @@ namespace Editor
*/
void ConvertSaveToScenario()
{
tool_cancel();
ToolCancel();
auto intent = Intent(WindowClass::Loadsave);
intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME);
intent.putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast<void*>(ConvertSaveToScenarioCallback));
@ -221,7 +221,7 @@ namespace Editor
{
// #4996: Make sure the object selection window closes here to prevent unload objects
// after we have loaded a new park.
window_close_all();
WindowCloseAll();
auto extension = get_file_extension_type(path);
switch (extension)
@ -362,12 +362,12 @@ namespace Editor
switch (gEditorStep)
{
case EditorStep::ObjectSelection:
if (window_find_by_class(WindowClass::EditorObjectSelection) != nullptr)
if (WindowFindByClass(WindowClass::EditorObjectSelection) != nullptr)
{
return;
}
if (window_find_by_class(WindowClass::InstallTrack) != nullptr)
if (WindowFindByClass(WindowClass::InstallTrack) != nullptr)
{
return;
}
@ -380,7 +380,7 @@ namespace Editor
ContextOpenWindow(WindowClass::EditorObjectSelection);
break;
case EditorStep::InventionsListSetUp:
if (window_find_by_class(WindowClass::EditorInventionList) != nullptr)
if (WindowFindByClass(WindowClass::EditorInventionList) != nullptr)
{
return;
}
@ -388,7 +388,7 @@ namespace Editor
ContextOpenWindow(WindowClass::EditorInventionList);
break;
case EditorStep::OptionsSelection:
if (window_find_by_class(WindowClass::EditorScenarioOptions) != nullptr)
if (WindowFindByClass(WindowClass::EditorScenarioOptions) != nullptr)
{
return;
}
@ -396,7 +396,7 @@ namespace Editor
ContextOpenWindow(WindowClass::EditorScenarioOptions);
break;
case EditorStep::ObjectiveSelection:
if (window_find_by_class(WindowClass::EditorObjectiveOptions) != nullptr)
if (WindowFindByClass(WindowClass::EditorObjectiveOptions) != nullptr)
{
return;
}

View File

@ -97,7 +97,7 @@ using namespace OpenRCT2;
void game_reset_speed()
{
gGameSpeed = 1;
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
}
void game_increase_game_speed()
@ -105,7 +105,7 @@ void game_increase_game_speed()
gGameSpeed = std::min(gConfigGeneral.DebuggingTools ? 5 : 4, gGameSpeed + 1);
if (gGameSpeed == 5)
gGameSpeed = 8;
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
}
void game_reduce_game_speed()
@ -113,7 +113,7 @@ void game_reduce_game_speed()
gGameSpeed = std::max(1, gGameSpeed - 1);
if (gGameSpeed == 7)
gGameSpeed = 4;
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
}
/**
@ -125,7 +125,7 @@ void game_create_windows()
ContextOpenWindow(WindowClass::MainWindow);
ContextOpenWindow(WindowClass::TopToolbar);
ContextOpenWindow(WindowClass::BottomToolbar);
window_resize_gui(ContextGetWidth(), ContextGetHeight());
WindowResizeGui(ContextGetWidth(), ContextGetHeight());
}
enum
@ -302,7 +302,7 @@ void update_palette_effects()
void pause_toggle()
{
gGamePaused ^= GAME_PAUSED_NORMAL;
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
if (gGamePaused & GAME_PAUSED_NORMAL)
{
OpenRCT2::Audio::StopAll();
@ -471,8 +471,8 @@ void game_load_init()
}
else
{
auto* mainWindow = window_get_main();
window_unfollow_sprite(*mainWindow);
auto* mainWindow = WindowGetMain();
WindowUnfollowSprite(*mainWindow);
}
auto windowManager = GetContext()->GetUiContext()->GetWindowManager();
@ -497,7 +497,7 @@ void game_load_init()
{
intent = Intent(INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD);
ContextBroadcastIntent(&intent);
window_update_all();
WindowUpdateAll();
}
OpenRCT2::Audio::StopTitleMusic();
@ -727,7 +727,7 @@ static void game_load_or_quit_no_save_prompt_callback(int32_t result, const utf8
{
game_notify_map_change();
game_unload_scripts();
window_close_by_class(WindowClass::EditorObjectSelection);
WindowCloseByClass(WindowClass::EditorObjectSelection);
GetContext()->LoadParkFromFile(path);
game_load_scripts();
game_notify_map_changed();
@ -738,7 +738,7 @@ static void game_load_or_quit_no_save_prompt_callback(int32_t result, const utf8
static void NewGameWindowCallback(const utf8* path)
{
window_close_by_class(WindowClass::EditorObjectSelection);
WindowCloseByClass(WindowClass::EditorObjectSelection);
game_notify_map_change();
GetContext()->LoadParkFromFile(path, false, true);
game_load_scripts();
@ -757,7 +757,7 @@ void game_load_or_quit_no_save_prompt()
{
auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::CloseSavePrompt);
GameActions::Execute(&loadOrQuitAction);
tool_cancel();
ToolCancel();
if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
{
load_landscape();
@ -775,7 +775,7 @@ void game_load_or_quit_no_save_prompt()
{
auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::CloseSavePrompt);
GameActions::Execute(&loadOrQuitAction);
tool_cancel();
ToolCancel();
if (input_test_flag(INPUT_FLAG_5))
{
input_set_flag(INPUT_FLAG_5, false);
@ -791,7 +791,7 @@ void game_load_or_quit_no_save_prompt()
{
auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::CloseSavePrompt);
GameActions::Execute(&loadOrQuitAction);
tool_cancel();
ToolCancel();
auto intent = Intent(WindowClass::ScenarioSelect);
intent.putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast<void*>(NewGameWindowCallback));
ContextOpenIntent(&intent);

View File

@ -240,7 +240,7 @@ void GameState::Tick()
scenario_autosave_check();
}
window_dispatch_update_all();
WindowDispatchUpdateAll();
if (didRunSingleFrame && game_is_not_paused() && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO))
{

View File

@ -853,9 +853,9 @@ namespace OpenRCT2
// Focus camera on event.
if (isPositionValid && !result.Position.IsNull())
{
auto* mainWindow = window_get_main();
auto* mainWindow = WindowGetMain();
if (mainWindow != nullptr)
window_scroll_to_location(*mainWindow, result.Position);
WindowScrollToLocation(*mainWindow, result.Position);
}
replayQueue.erase(replayQueue.begin());

View File

@ -92,13 +92,13 @@ GameActions::Result CheatSetAction::Execute() const
{
case CheatType::SandboxMode:
gCheatsSandboxMode = _param1 != 0;
window_invalidate_by_class(WindowClass::Map);
window_invalidate_by_class(WindowClass::Footpath);
WindowInvalidateByClass(WindowClass::Map);
WindowInvalidateByClass(WindowClass::Footpath);
break;
case CheatType::DisableClearanceChecks:
gCheatsDisableClearanceChecks = _param1 != 0;
// Required to update the clearance checks overlay on the Cheats button.
window_invalidate_by_class(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
break;
case CheatType::DisableSupportLimits:
gCheatsDisableSupportLimits = _param1 != 0;
@ -217,7 +217,7 @@ GameActions::Result CheatSetAction::Execute() const
break;
case CheatType::AllowArbitraryRideTypeChanges:
gCheatsAllowArbitraryRideTypeChanges = _param1 != 0;
window_invalidate_by_class(WindowClass::Ride);
WindowInvalidateByClass(WindowClass::Ride);
break;
case CheatType::OwnAllLand:
OwnAllLand();
@ -256,7 +256,7 @@ GameActions::Result CheatSetAction::Execute() const
ConfigSaveDefault();
}
window_invalidate_by_class(WindowClass::Cheats);
WindowInvalidateByClass(WindowClass::Cheats);
return GameActions::Result();
}
@ -468,7 +468,7 @@ void CheatSetAction::RenewRides() const
{
ride.Renew();
}
window_invalidate_by_class(WindowClass::Ride);
WindowInvalidateByClass(WindowClass::Ride);
}
void CheatSetAction::MakeDestructible() const
@ -478,7 +478,7 @@ void CheatSetAction::MakeDestructible() const
ride.lifecycle_flags &= ~RIDE_LIFECYCLE_INDESTRUCTIBLE;
ride.lifecycle_flags &= ~RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK;
}
window_invalidate_by_class(WindowClass::Ride);
WindowInvalidateByClass(WindowClass::Ride);
}
void CheatSetAction::ResetRideCrashStatus() const
@ -489,7 +489,7 @@ void CheatSetAction::ResetRideCrashStatus() const
ride.lifecycle_flags &= ~RIDE_LIFECYCLE_CRASHED;
ride.last_crash_type = RIDE_CRASH_TYPE_NONE;
}
window_invalidate_by_class(WindowClass::Ride);
WindowInvalidateByClass(WindowClass::Ride);
}
void CheatSetAction::Set10MinuteInspection() const
@ -499,7 +499,7 @@ void CheatSetAction::Set10MinuteInspection() const
// Set inspection interval to 10 minutes
ride.inspection_interval = RIDE_INSPECTION_EVERY_10_MINUTES;
}
window_invalidate_by_class(WindowClass::Ride);
WindowInvalidateByClass(WindowClass::Ride);
}
void CheatSetAction::SetScenarioNoMoney(bool enabled) const
@ -513,29 +513,29 @@ void CheatSetAction::SetScenarioNoMoney(bool enabled) const
gParkFlags &= ~PARK_FLAGS_NO_MONEY;
}
// Invalidate all windows that have anything to do with finance
window_invalidate_by_class(WindowClass::Ride);
window_invalidate_by_class(WindowClass::Peep);
window_invalidate_by_class(WindowClass::ParkInformation);
window_invalidate_by_class(WindowClass::Finances);
window_invalidate_by_class(WindowClass::BottomToolbar);
window_invalidate_by_class(WindowClass::TopToolbar);
window_invalidate_by_class(WindowClass::Cheats);
WindowInvalidateByClass(WindowClass::Ride);
WindowInvalidateByClass(WindowClass::Peep);
WindowInvalidateByClass(WindowClass::ParkInformation);
WindowInvalidateByClass(WindowClass::Finances);
WindowInvalidateByClass(WindowClass::BottomToolbar);
WindowInvalidateByClass(WindowClass::TopToolbar);
WindowInvalidateByClass(WindowClass::Cheats);
}
void CheatSetAction::SetMoney(money64 amount) const
{
gCash = amount;
window_invalidate_by_class(WindowClass::Finances);
window_invalidate_by_class(WindowClass::BottomToolbar);
WindowInvalidateByClass(WindowClass::Finances);
WindowInvalidateByClass(WindowClass::BottomToolbar);
}
void CheatSetAction::AddMoney(money64 amount) const
{
gCash = add_clamp_money64(gCash, amount);
window_invalidate_by_class(WindowClass::Finances);
window_invalidate_by_class(WindowClass::BottomToolbar);
WindowInvalidateByClass(WindowClass::Finances);
WindowInvalidateByClass(WindowClass::BottomToolbar);
}
void CheatSetAction::ClearLoan() const
@ -555,7 +555,7 @@ void CheatSetAction::GenerateGuests(int32_t count) const
{
park.GenerateGuest();
}
window_invalidate_by_class(WindowClass::BottomToolbar);
WindowInvalidateByClass(WindowClass::BottomToolbar);
}
void CheatSetAction::SetGuestParameter(int32_t parameter, int32_t value) const
@ -626,7 +626,7 @@ void CheatSetAction::GiveObjectToGuests(int32_t object) const
break;
}
}
window_invalidate_by_class(WindowClass::Peep);
WindowInvalidateByClass(WindowClass::Peep);
}
void CheatSetAction::RemoveAllGuests() const
@ -673,7 +673,7 @@ void CheatSetAction::RemoveAllGuests() const
guest->Remove();
}
window_invalidate_by_class(WindowClass::Ride);
WindowInvalidateByClass(WindowClass::Ride);
GfxInvalidateScreen();
}

View File

@ -51,7 +51,7 @@ GameActions::Result LoadOrQuitAction::Execute() const
ContextOpenWindow(WindowClass::SavePrompt);
break;
case LoadOrQuitModes::CloseSavePrompt:
window_close_by_class(WindowClass::SavePrompt);
WindowCloseByClass(WindowClass::SavePrompt);
break;
default:
game_load_or_quit_no_save_prompt();

View File

@ -55,6 +55,6 @@ GameActions::Result ParkSetEntranceFeeAction::Query() const
GameActions::Result ParkSetEntranceFeeAction::Execute() const
{
gParkEntranceFee = _fee;
window_invalidate_by_class(WindowClass::ParkInformation);
WindowInvalidateByClass(WindowClass::ParkInformation);
return GameActions::Result();
}

View File

@ -57,19 +57,19 @@ GameActions::Result ParkSetParameterAction::Execute() const
if (gParkFlags & PARK_FLAGS_PARK_OPEN)
{
gParkFlags &= ~PARK_FLAGS_PARK_OPEN;
window_invalidate_by_class(WindowClass::ParkInformation);
WindowInvalidateByClass(WindowClass::ParkInformation);
}
break;
case ParkParameter::Open:
if (!(gParkFlags & PARK_FLAGS_PARK_OPEN))
{
gParkFlags |= PARK_FLAGS_PARK_OPEN;
window_invalidate_by_class(WindowClass::ParkInformation);
WindowInvalidateByClass(WindowClass::ParkInformation);
}
break;
case ParkParameter::SamePriceInPark:
gSamePriceThroughoutPark = _value;
window_invalidate_by_class(WindowClass::Ride);
WindowInvalidateByClass(WindowClass::Ride);
break;
default:
return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);

View File

@ -200,5 +200,5 @@ void PeepPickupAction::CancelConcurrentPickups(Peep* pickedPeep) const
// By assigning the peep to null before calling tool_cancel we can avoid
// resetting the peep to the initial position.
network_set_pickup_peep(currentPlayerId, nullptr);
tool_cancel();
ToolCancel();
}

View File

@ -319,7 +319,7 @@ GameActions::Result RideCreateAction::Execute() const
ride->MinCarsPerTrain = rideEntry->min_cars_in_train;
ride->MaxCarsPerTrain = rideEntry->max_cars_in_train;
ride_set_vehicle_colours_to_random_preset(*ride, _colour2);
window_invalidate_by_class(WindowClass::RideList);
WindowInvalidateByClass(WindowClass::RideList);
res.Expenditure = ExpenditureType::RideConstruction;
res.SetData(RideId{ rideIndex });

Some files were not shown because too many files have changed in this diff Show More