56 lines
1.3 KiB
Ucode
56 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;
|
|
|
|
|
|
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("HideMut.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("HideMut.HideMutInteraction", p);
|
|
|
|
forEach AllObjects(class'HideMutInteraction', hmi)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
defaultproperties{} |