1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-20 06:12:57 +01:00

Move WindowInvalidate and WidgetInvalidate families into WindowManager (#23692)

* Move WindowInvalidate and WidgetInvalidate families into WindowManager

* Use InvalidateWidget shorthand in more places

* Cut back on UiContext includes

* Cut back on Window.h includes

* Remove outdated parameter comments
This commit is contained in:
Aaron van Geffen
2025-01-25 13:46:08 +01:00
committed by GitHub
parent da0a772e4d
commit cf448753c1
127 changed files with 554 additions and 499 deletions

View File

@@ -28,7 +28,6 @@
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/sprites.h>
#include <openrct2/ui/UiContext.h>
#include <openrct2/ui/WindowManager.h>
#include <openrct2/world/Location.hpp>
@@ -112,7 +111,9 @@ namespace OpenRCT2
}
WidgetScrollUpdateThumbs(w, widgetIndex);
WidgetInvalidate(w, widgetIndex);
auto* windowMgr = Ui::GetWindowManager();
windowMgr->InvalidateWidget(w, widgetIndex);
}
/**
@@ -361,7 +362,8 @@ namespace OpenRCT2
void Window::InvalidateWidget(WidgetIndex widgetIndex)
{
WidgetInvalidate(*this, widgetIndex);
auto* windowMgr = Ui::GetWindowManager();
windowMgr->InvalidateWidget(*this, widgetIndex);
}
bool Window::IsWidgetDisabled(WidgetIndex widgetIndex) const
@@ -625,7 +627,7 @@ namespace OpenRCT2::Ui::Windows
_usingWidgetTextBox = false;
if (w != nullptr)
{
WidgetInvalidate(*w, _currentTextBox.widget_index);
windowMgr->InvalidateWidget(*w, _currentTextBox.widget_index);
}
_currentTextBox.widget_index = kWidgetIndexNull;
}
@@ -645,7 +647,7 @@ namespace OpenRCT2::Ui::Windows
_textBoxFrameNo = 0;
auto* windowMgr = GetWindowManager();
WindowBase* w = windowMgr->FindByNumber(_currentTextBox.window.classification, _currentTextBox.window.number);
WidgetInvalidate(*w, _currentTextBox.widget_index);
windowMgr->InvalidateWidget(*w, _currentTextBox.widget_index);
w->OnTextInput(_currentTextBox.widget_index, _textBoxInput);
}
}