Added RenderUnderlay.

- Works exactly like RenderOverlay, but is drawn behind the status bar/huds instead.
This commit is contained in:
Major Cooke 2019-06-22 20:02:35 -05:00 committed by Christoph Oelckers
commit 7b698b4a0e
4 changed files with 26 additions and 0 deletions

View file

@ -491,6 +491,14 @@ void EventManager::RenderOverlay(EHudState state)
handler->RenderOverlay(state);
}
void EventManager::RenderUnderlay(EHudState state)
{
if (ShouldCallStatic(false)) staticEventManager.RenderUnderlay(state);
for (DStaticEventHandler* handler = FirstEventHandler; handler; handler = handler->next)
handler->RenderUnderlay(state);
}
bool EventManager::CheckUiProcessors()
{
if (ShouldCallStatic(false))
@ -960,6 +968,19 @@ void DStaticEventHandler::RenderOverlay(EHudState state)
}
}
void DStaticEventHandler::RenderUnderlay(EHudState state)
{
IFVIRTUAL(DStaticEventHandler, RenderUnderlay)
{
// don't create excessive DObjects if not going to be processed anyway
if (isEmpty(func)) return;
FRenderEvent e = owner->SetupRenderEvent();
e.HudState = int(state);
VMValue params[2] = { (DStaticEventHandler*)this, &e };
VMCall(func, params, 2, nullptr, 0);
}
}
void DStaticEventHandler::PlayerEntered(int num, bool fromhub)
{
IFVIRTUAL(DStaticEventHandler, PlayerEntered)