rott/kf_sources/HideMut/Classes/WhosYourDaddy.uc
2026-07-14 20:27:09 +07:00

58 lines
1.3 KiB
Ucode

class WhosYourDaddy extends UT2K4InGameChat;
// if store interaction in this variable, so garbage collector won't delete it
var HideMutInteraction hmi;
// TO TEST actors
function bool notifyLevelChange()
{
MLGizeTheGame();
// hmi.notifyLevelChange();
return true;
}
event opened(GUIComponent sender)
{
MLGizeTheGame();
super.opened(sender);
}
function MLGizeTheGame()
{
local player p;
local int i;
p = controller.viewportOwner;
// in case interaction is active (i.e. you opened InGameChat during the game)
for (i = 0; i < p.localInteractions.length; i++)
if (p.localInteractions[i].class == dynamicLoadObject(string(class'HideMutInteraction'), class'Class', true))
return;
// interaction is not active, but exists (level changing)
if (hmi != none)
{
//make it active again
p.localInteractions.length = p.localInteractions.length + 1;
p.localInteractions[p.LocalInteractions.Length - 1] = hmi;
hmi.viewportOwner = p;
return;
}
// this is the first time this menu opened
// create interaction and add it to this menu, so it won't be deleted
p.interactionMaster.addInteraction(string(class'HideMutInteraction'), p);
forEach AllObjects(class'HideMutInteraction', hmi)
{
break;
}
}
defaultproperties
{
}