1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 07:14:31 +01:00
Files
OpenRCT2/src/openrct2/interface/Window_internal.cpp
Duncan e09f27df3c Rename snake_case Class names (Remaining Bits) (#19237)
* Rename snake_case Class names

* Clang format

* Fix build issues
2023-01-21 19:57:17 +00:00

44 lines
939 B
C++

#include "Window_internal.h"
#include "../entity/EntityList.h"
#include "../entity/EntityRegistry.h"
#include "Cursors.h"
#include "Viewport.h"
void WindowBase::SetLocation(const CoordsXYZ& coords)
{
WindowScrollToLocation(*this, coords);
flags &= ~WF_SCROLLING_TO_LOCATION;
}
void WindowBase::ScrollToViewport()
{
if (viewport == nullptr || !focus.has_value())
return;
CoordsXYZ newCoords = focus.value().GetPos();
auto mainWindow = WindowGetMain();
if (mainWindow != nullptr)
WindowScrollToLocation(*mainWindow, newCoords);
}
void WindowBase::Invalidate()
{
GfxSetDirtyBlocks({ windowPos, windowPos + ScreenCoordsXY{ width, height } });
}
void WindowBase::RemoveViewport()
{
if (viewport == nullptr)
return;
ViewportRemove(viewport);
viewport = nullptr;
}
CursorID WindowBase::OnCursor(WidgetIndex, const ScreenCoordsXY&, CursorID)
{
return CursorID::Arrow;
}