KF2-Server-Extension/ServerExt/Classes/ExtMoviePlayer_HUD.uc

122 lines
4.0 KiB
Ucode
Raw Normal View History

2017-10-20 02:00:49 +00:00
Class ExtMoviePlayer_HUD extends KFGFxMoviePlayer_HUD;
function TickHud(float DeltaTime)
{
local PlayerController PC;
PC = GetPC();
2020-11-28 20:12:58 +00:00
if (PC!=none && PC.PlayerInput!=None)
2017-10-20 02:00:49 +00:00
Super.TickHud(DeltaTime);
}
2020-11-28 20:04:55 +00:00
final function ShowKillMessageX(PlayerReplicationInfo PRI1, PlayerReplicationInfo PRI2, optional string VictimStr, optional bool bDeathMessage = false, optional class<Pawn> PawnOther)
2017-10-20 02:00:49 +00:00
{
2020-11-28 19:53:57 +00:00
local GFxObject DataObject;
local bool bHumanDeath;
2023-05-14 02:49:12 +00:00
local string KilledName, KillerName, KilledIconpath, KillerIconPath;
2020-11-28 19:53:57 +00:00
local string KillerTextColor, KilledTextColor;
2023-05-14 02:49:12 +00:00
2020-11-28 20:12:58 +00:00
if (KFPC == none)
2020-11-28 19:53:57 +00:00
return;
2017-10-20 02:00:49 +00:00
2020-11-28 20:12:58 +00:00
if (KFGXHUDManager != none)
2020-11-28 19:53:57 +00:00
{
2020-11-28 20:12:58 +00:00
if (PawnOther != none)
2017-10-20 02:00:49 +00:00
{
2020-11-28 20:12:58 +00:00
if (bDeathMessage)
2017-10-20 02:00:49 +00:00
{
KillerTextColor = ZEDTeamTextColor;
KillerName = class'KFExtendedHUD'.Static.GetNameOf(PawnOther);
}
else
{
KilledName = class'KFExtendedHUD'.Static.GetNameOf(PawnOther);
bHumanDeath = false;
}
}
2020-11-28 20:12:58 +00:00
if ((PawnOther==None || !bDeathMessage) && PRI1 != none)
2017-10-20 02:00:49 +00:00
{
2020-11-28 20:12:58 +00:00
if (PRI1.GetTeamNum() == 255)
2017-10-20 02:00:49 +00:00
{
KillerTextColor = ZEDTeamTextColor;
KillerIconpath = "img://"$class'KFPerk_Monster'.static.GetPerkIconPath();
}
else
{
KillerTextColor = HumanTeamTextColor;
2020-11-28 20:12:58 +00:00
if (ExtPlayerReplicationInfo(PRI1)!=None && ExtPlayerReplicationInfo(PRI1).ECurrentPerk!=None)
2017-10-20 02:00:49 +00:00
KillerIconpath = ExtPlayerReplicationInfo(PRI1).ECurrentPerk.static.GetPerkIconPath(0);
}
2023-05-14 02:49:12 +00:00
KillerName = PRI1.PlayerName;
2017-10-20 02:00:49 +00:00
}
2020-11-28 20:12:58 +00:00
if (PRI2 != none)
2017-10-20 02:00:49 +00:00
{
2020-11-28 20:12:58 +00:00
if (PRI2.GetTeamNum() == class'KFTeamInfo_Human'.default.TeamIndex)
2017-10-20 02:00:49 +00:00
{
2023-05-14 02:49:12 +00:00
bHumanDeath = true;
2017-10-20 02:00:49 +00:00
KilledTextColor = HumanTeamTextColor;
}
else
{
KilledTextColor = ZEDTeamTextColor;
bHumanDeath = false;
}
KilledName = PRI2.PlayerName;
2020-11-28 20:12:58 +00:00
if (ExtPlayerReplicationInfo(PRI2)!=None && ExtPlayerReplicationInfo(PRI2).ECurrentPerk!=None)
2017-10-20 02:00:49 +00:00
KilledIconpath = ExtPlayerReplicationInfo(PRI2).ECurrentPerk.static.GetPerkIconPath(0);
}
2020-11-28 20:12:58 +00:00
else if (VictimStr!="")
2017-10-20 02:00:49 +00:00
{
KilledTextColor = HumanTeamTextColor;
KilledIconpath = "img://"$class'KFPerk_Monster'.static.GetPerkIconPath();
bHumanDeath = false;
KilledName = VictimStr;
}
DataObject = CreateObject("Object");
DataObject.SetBool("humanDeath", bHumanDeath);
DataObject.SetString("killedName", KilledName);
DataObject.SetString("killedTextColor", KilledTextColor);
DataObject.SetString("killedIcon", KilledIconpath);
DataObject.SetString("killerName", KillerName);
DataObject.SetString("killerTextColor", KillerTextColor);
DataObject.SetString("killerIcon", KillerIconpath);
//temp remove when rest of design catches up
DataObject.SetString("text", KillerName@KilledName);
KFGXHUDManager.SetObject("newBark", DataObject);
}
}
2022-12-24 22:31:12 +00:00
function UpdateObjectiveActive()
{
// Fix:
// ScriptWarning: Accessed None 'KFGRI'
// ExtMoviePlayer_HUD Transient.ExtMoviePlayer_HUD_0
// Function KFGame.KFGFxMoviePlayer_HUD:UpdateObjectiveActive:00B7
if (GetPC() == None || KFGameReplicationInfo(GetPC().WorldInfo.GRI) == None)
{
return;
}
2023-09-09 21:06:06 +00:00
2022-12-24 22:31:12 +00:00
Super.UpdateObjectiveActive();
}
2017-10-20 02:00:49 +00:00
defaultproperties
{
WidgetBindings.Remove((WidgetName="SpectatorInfoWidget",WidgetClass=class'KFGFxHUD_SpectatorInfo'))
WidgetBindings.Add((WidgetName="SpectatorInfoWidget",WidgetClass=class'ExtHUD_SpectatorInfo'))
WidgetBindings.Remove((WidgetName="PlayerStatWidgetMC",WidgetClass=class'KFGFxHUD_PlayerStatus'))
WidgetBindings.Add((WidgetName="PlayerStatWidgetMC",WidgetClass=class'ExtHUD_PlayerStatus'))
WidgetBindings.Remove((WidgetName="PlayerBackpackWidget",WidgetClass=class'KFGFxHUD_PlayerBackpack'))
WidgetBindings.Add((WidgetName="PlayerBackpackWidget",WidgetClass=class'ExtHUD_PlayerBackpack'))
WidgetBindings.Remove((WidgetName="WeaponSelectContainer",WidgetClass=class'KFGFxHUD_WeaponSelectWidget'))
WidgetBindings.Add((WidgetName="WeaponSelectContainer",WidgetClass=class'ExtHUD_WeaponSelectWidget'))
2022-12-24 22:31:12 +00:00
WidgetBindings.Remove((WidgetName="ObjectiveContainer",WidgetClass=class'KFGFxHUD_ObjectiveConatiner'))
WidgetBindings.Add((WidgetName="ObjectiveContainer",WidgetClass=class'ExtHUD_ObjectiveConatiner'))
2017-10-20 02:00:49 +00:00
}