From 5f1eec0e00a11bfaf4dd98c25322fd6859b7f9a4 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 27 Feb 2025 14:41:21 -0600 Subject: [PATCH] expand playgui callbacks to also allow game modes to inject element layers --- .../game/data/gameUI/GUIs/playGui.tscript | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Templates/BaseGame/game/data/gameUI/GUIs/playGui.tscript b/Templates/BaseGame/game/data/gameUI/GUIs/playGui.tscript index 82ce8a552..88202095d 100644 --- a/Templates/BaseGame/game/data/gameUI/GUIs/playGui.tscript +++ b/Templates/BaseGame/game/data/gameUI/GUIs/playGui.tscript @@ -37,12 +37,18 @@ function PlayGui::onWake(%this) if(isObject(moveMap)) moveMap.push(); - callOnModules("Playgui_onWake"); + %modulesIDList = getModulesAndGameModesList(true, "Game"); + %numModsNeedingLoaded = getNumCanCallOnObjectList("Playgui_onWake", %modulesIDList); + if (%numModsNeedingLoaded) + callOnObjectList("Playgui_onWake", %modulesIdList); } function PlayGui::onSleep(%this) { - callOnModules("Playgui_onSleep"); + %modulesIDList = getModulesAndGameModesList(true, "Game"); + %numModsNeedingLoaded = getNumCanCallOnObjectList("Playgui_onSleep", %modulesIDList); + if (%numModsNeedingLoaded) + callOnObjectList("Playgui_onSleep", %modulesIdList); // pop the keymaps if(isObject(moveMap)) @@ -51,7 +57,11 @@ function PlayGui::onSleep(%this) function PlayGui::clearHud( %this ) { - callOnModules("Playgui_clearHud"); + %modulesIDList = getModulesAndGameModesList(true, "Game"); + %numModsNeedingLoaded = getNumCanCallOnObjectList("Playgui_clearHud", %modulesIDList); + if (%numModsNeedingLoaded) + callOnObjectList("Playgui_clearHud", %modulesIdList); + Canvas.popDialog( MainChatHud ); while ( %this.getCount() > 0 )