2019-06-15 17:01:41 +02:00
|
|
|
#include "Window_internal.h"
|
|
|
|
|
|
2021-11-24 17:19:52 +02:00
|
|
|
#include "../entity/EntityList.h"
|
2021-11-26 16:49:52 +02:00
|
|
|
#include "../entity/EntityRegistry.h"
|
2022-06-30 10:25:18 +01:00
|
|
|
#include "Cursors.h"
|
2021-05-29 06:01:32 +01:00
|
|
|
#include "Viewport.h"
|
2019-06-15 17:12:14 +02:00
|
|
|
|
2025-01-18 14:29:41 +01:00
|
|
|
namespace OpenRCT2
|
2019-06-15 17:01:41 +02:00
|
|
|
{
|
2025-01-18 14:29:41 +01:00
|
|
|
void WindowBase::SetLocation(const CoordsXYZ& coords)
|
|
|
|
|
{
|
|
|
|
|
WindowScrollToLocation(*this, coords);
|
|
|
|
|
flags &= ~WF_SCROLLING_TO_LOCATION;
|
|
|
|
|
}
|
2019-06-15 17:12:14 +02:00
|
|
|
|
2025-01-18 14:29:41 +01:00
|
|
|
void WindowBase::Invalidate()
|
|
|
|
|
{
|
|
|
|
|
GfxSetDirtyBlocks({ windowPos, windowPos + ScreenCoordsXY{ width, height } });
|
|
|
|
|
}
|
2020-09-28 23:38:58 +03:00
|
|
|
|
2025-01-18 14:29:41 +01:00
|
|
|
void WindowBase::RemoveViewport()
|
|
|
|
|
{
|
|
|
|
|
if (viewport == nullptr)
|
|
|
|
|
return;
|
2020-09-28 23:38:58 +03:00
|
|
|
|
2025-01-18 14:29:41 +01:00
|
|
|
ViewportRemove(viewport);
|
|
|
|
|
viewport = nullptr;
|
|
|
|
|
}
|
2022-06-30 10:25:18 +01:00
|
|
|
|
2025-01-18 14:29:41 +01:00
|
|
|
void WindowBase::SetWidgets(const std::span<const Widget> newWidgets)
|
|
|
|
|
{
|
|
|
|
|
widgets.clear();
|
|
|
|
|
widgets.insert(widgets.end(), newWidgets.begin(), newWidgets.end());
|
|
|
|
|
}
|
2025-01-18 14:45:17 +02:00
|
|
|
|
2025-01-18 14:29:41 +01:00
|
|
|
CursorID WindowBase::OnCursor(WidgetIndex, const ScreenCoordsXY&, CursorID)
|
|
|
|
|
{
|
|
|
|
|
return CursorID::Arrow;
|
|
|
|
|
}
|
|
|
|
|
} // namespace OpenRCT2
|