mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-20 06:12:57 +01:00
Move vehicle sounds update into Ui library (#21577)
* Move vehicle sounds update into Ui library * Add missing statics * Apply review comments * Sprinkle some const * Clang format accumulate
This commit is contained in:
@@ -832,3 +832,31 @@ ScreenCoordsXY WindowGetViewportSoundIconPos(WindowBase& w)
|
||||
const uint8_t buttonOffset = (gConfigInterface.WindowButtonsOnTheLeft) ? CloseButtonWidth + 2 : 0;
|
||||
return w.windowPos + ScreenCoordsXY{ 2 + buttonOffset, 2 };
|
||||
}
|
||||
|
||||
namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
WindowBase* WindowGetListening()
|
||||
{
|
||||
for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); it++)
|
||||
{
|
||||
auto& w = **it;
|
||||
if (w.flags & WF_DEAD)
|
||||
continue;
|
||||
|
||||
auto viewport = w.viewport;
|
||||
if (viewport != nullptr)
|
||||
{
|
||||
if (viewport->flags & VIEWPORT_FLAG_SOUND_ON)
|
||||
{
|
||||
return &w;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
WindowClass WindowGetClassification(const WindowBase& window)
|
||||
{
|
||||
return window.classification;
|
||||
}
|
||||
} // namespace OpenRCT2::Ui::Windows
|
||||
|
||||
Reference in New Issue
Block a user