Cat_SeqCond_IsHUDOpen

#Kismet

Check if a Hud Element is open!

Use this to check if any Hud Element is turned on or not!

It's just drag and drop in your classes folder and it'll work, find it in the Pawn tab in the Kismet Conditions!

Made by CatCube, but with help from EpicYoshiMaster and Don cuz I wouldn't have figured out what was wrong without them, and also Nerketur cuz they helped with another script that I used some code from for this!

Enjoy!

Cat_SeqCond_IsHUDOpen.uc

[RAW] [Download]

class Cat_SeqCond_IsHUDOpen extends SequenceCondition;
 
var() class<Hat_HUDElement> HUDClass;
var Actor Target;
 
event Activated()
{
    local bool IsHUDOpen;
    local Hat_PlayerController PC;
 
    if (Pawn(Target) != None) Target = Pawn(Target).Controller;
    PC = Hat_PlayerController(Target);
 
    if (Hat_HUD(pc.MyHUD).IsHUDEnabled(HUDClass.Name))
    {
        IsHUDOpen = true;
    }
 
    OutputLinks[IsHUDOpen ? 0 : 1].bHasImpulse = true;
}
 
defaultproperties
{
    ObjName="Is HUD Open"
    ObjCategory="Pawn"
 
    OutputLinks(0)=(LinkDesc="True")
    OutputLinks(1)=(LinkDesc="False")
    VariableLinks(0)=(ExpectedType=class'SeqVar_Object',LinkDesc="Target",PropertyName=Target,MinVars=1,MaxVars=1)
 
    HUDClass = class'Hat_HUDElement'
}