Updated to the latest KF version
This commit is contained in:
parent
fd568e3d66
commit
245eb9e552
@ -230,7 +230,7 @@ function int AddItemByPriority( out SItemInformation WeaponInfo )
|
|||||||
return BestIndex;
|
return BestIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
function bool CanCarry( const out STraderItem Item )
|
function bool CanCarry(const out STraderItem Item, optional int OverrideLevelValue = INDEX_NONE)
|
||||||
{
|
{
|
||||||
local int Result;
|
local int Result;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -14,6 +14,7 @@ function UpdatePerk()
|
|||||||
{
|
{
|
||||||
local int CurrentPerkLevel,CurrentPerkEXP;
|
local int CurrentPerkLevel,CurrentPerkEXP;
|
||||||
local Ext_PerkBase CurrentPerk;
|
local Ext_PerkBase CurrentPerk;
|
||||||
|
local GFxObject PerkIconObject;
|
||||||
|
|
||||||
if( ExPC == none || ExPC.ActivePerkManager==None || ExPC.ActivePerkManager.CurrentPerk==None )
|
if( ExPC == none || ExPC.ActivePerkManager==None || ExPC.ActivePerkManager.CurrentPerk==None )
|
||||||
return;
|
return;
|
||||||
@ -21,12 +22,16 @@ function UpdatePerk()
|
|||||||
CurrentPerk = ExPC.ActivePerkManager.CurrentPerk;
|
CurrentPerk = ExPC.ActivePerkManager.CurrentPerk;
|
||||||
CurrentPerkLevel = CurrentPerk.CurrentLevel;
|
CurrentPerkLevel = CurrentPerk.CurrentLevel;
|
||||||
CurrentPerkEXP = CurrentPerk.CurrentEXP;
|
CurrentPerkEXP = CurrentPerk.CurrentEXP;
|
||||||
|
|
||||||
// Update the perk class.
|
// Update the perk class.
|
||||||
if( ( ExLastPerkClass != CurrentPerk.Class ) || ( LastPerkLevel != CurrentPerkLevel ) )
|
if( ( ExLastPerkClass != CurrentPerk.Class ) || ( LastPerkLevel != CurrentPerkLevel ) )
|
||||||
{
|
{
|
||||||
CurPerkPath = CurrentPerk.GetPerkIconPath(CurrentPerkLevel);
|
CurPerkPath = CurrentPerk.GetPerkIconPath(CurrentPerkLevel);
|
||||||
SetString("playerPerkIcon" , CurPerkPath);
|
|
||||||
|
PerkIconObject = CreateObject("Object");
|
||||||
|
PerkIconObject.SetString("perkIcon", CurPerkPath);
|
||||||
|
SetObject("playerPerkIcon", PerkIconObject);
|
||||||
|
|
||||||
SetInt("playerPerkXPPercent", CurrentPerk.GetProgressPercent() * 100.f );
|
SetInt("playerPerkXPPercent", CurrentPerk.GetProgressPercent() * 100.f );
|
||||||
if( LastPerkLevel != CurrentPerkLevel && ExLastPerkClass==CurrentPerk.Class )
|
if( LastPerkLevel != CurrentPerkLevel && ExLastPerkClass==CurrentPerk.Class )
|
||||||
{
|
{
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -103,8 +103,8 @@ defaultproperties
|
|||||||
WidgetBindings.Add((WidgetName="PlayerBackpackWidget",WidgetClass=class'ExtHUD_PlayerBackpack'))
|
WidgetBindings.Add((WidgetName="PlayerBackpackWidget",WidgetClass=class'ExtHUD_PlayerBackpack'))
|
||||||
WidgetBindings.Remove((WidgetName="WaveInfoContainer",WidgetClass=class'KFGFxHUD_WaveInfo'))
|
WidgetBindings.Remove((WidgetName="WaveInfoContainer",WidgetClass=class'KFGFxHUD_WaveInfo'))
|
||||||
WidgetBindings.Add((WidgetName="WaveInfoContainer",WidgetClass=class'ExtHUD_WaveInfo'))
|
WidgetBindings.Add((WidgetName="WaveInfoContainer",WidgetClass=class'ExtHUD_WaveInfo'))
|
||||||
WidgetBindings.Remove((WidgetName="bossHealthBar", WidgetClass=class'KFGFxWidget_BossHealthBar'))
|
//WidgetBindings.Remove((WidgetName="bossHealthBar", WidgetClass=class'KFGFxWidget_BossHealthBar'))
|
||||||
WidgetBindings.Add((WidgetName="bossHealthBar", WidgetClass=class'ExtWidget_BossHealthBar'))
|
//WidgetBindings.Add((WidgetName="bossHealthBar", WidgetClass=class'ExtWidget_BossHealthBar'))
|
||||||
WidgetBindings.Remove((WidgetName="WeaponSelectContainer",WidgetClass=class'KFGFxHUD_WeaponSelectWidget'))
|
WidgetBindings.Remove((WidgetName="WeaponSelectContainer",WidgetClass=class'KFGFxHUD_WeaponSelectWidget'))
|
||||||
WidgetBindings.Add((WidgetName="WeaponSelectContainer",WidgetClass=class'ExtHUD_WeaponSelectWidget'))
|
WidgetBindings.Add((WidgetName="WeaponSelectContainer",WidgetClass=class'ExtHUD_WeaponSelectWidget'))
|
||||||
}
|
}
|
@ -144,7 +144,7 @@ reliable client event ReceiveLocalizedMessage( class<LocalMessage> Message, opti
|
|||||||
Super.ReceiveLocalizedMessage(Message,Switch,RelatedPRI_1,RelatedPRI_2,OptionalObject);
|
Super.ReceiveLocalizedMessage(Message,Switch,RelatedPRI_1,RelatedPRI_2,OptionalObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
function AddZedKill( class<KFPawn_Monster> MonsterClass, byte Difficulty, class<DamageType> DT )
|
function AddZedKill( class<KFPawn_Monster> MonsterClass, byte Difficulty, class<DamageType> DT, bool bKiller )
|
||||||
{
|
{
|
||||||
// Stats.
|
// Stats.
|
||||||
if( ActivePerkManager!=None )
|
if( ActivePerkManager!=None )
|
||||||
@ -603,7 +603,7 @@ simulated function CancelConnection()
|
|||||||
else class'Engine'.Static.GetEngine().GameViewport.ConsoleCommand("Disconnect");
|
else class'Engine'.Static.GetEngine().GameViewport.ConsoleCommand("Disconnect");
|
||||||
}
|
}
|
||||||
|
|
||||||
function NotifyLevelUp(class<KFPerk> PerkClass, byte PerkLevel);
|
function NotifyLevelUp(class<KFPerk> PerkClass, byte PerkLevel, byte NewPrestigeLevel);
|
||||||
|
|
||||||
function ShowBossNameplate( KFInterface_MonsterBoss KFBoss, optional string PlayerName)
|
function ShowBossNameplate( KFInterface_MonsterBoss KFBoss, optional string PlayerName)
|
||||||
{
|
{
|
||||||
@ -1167,6 +1167,16 @@ state Dead
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exec function RequestSwitchTeam()
|
||||||
|
{
|
||||||
|
ConsoleCommand("disconnect");
|
||||||
|
}
|
||||||
|
|
||||||
|
exec function SwitchTeam()
|
||||||
|
{
|
||||||
|
ConsoleCommand("disconnect");
|
||||||
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
InputClass=Class'ExtPlayerInput'
|
InputClass=Class'ExtPlayerInput'
|
||||||
|
@ -8,15 +8,14 @@ struct FCustomCharEntry
|
|||||||
};
|
};
|
||||||
struct FMyCustomChar // Now without constant.
|
struct FMyCustomChar // Now without constant.
|
||||||
{
|
{
|
||||||
var int CharacterIndex,HeadMeshIndex,HeadSkinIndex,BodyMeshIndex,BodySkinIndex,AttachmentMeshIndices[`MAX_COSMETIC_ATTACHMENTS],AttachmentSkinIndices[`MAX_COSMETIC_ATTACHMENTS];
|
var int CharacterIndex,HeadMeshIndex,HeadSkinIndex,BodyMeshIndex,BodySkinIndex,AttachmentMeshIndices[`MAX_COSMETIC_ATTACHMENTS],AttachmentSkinIndices[`MAX_COSMETIC_ATTACHMENTS];
|
||||||
|
|
||||||
structdefaultproperties
|
structdefaultproperties
|
||||||
{
|
{
|
||||||
CharacterIndex=255
|
AttachmentMeshIndices[0]=`CLEARED_ATTACHMENT_INDEX
|
||||||
AttachmentMeshIndices[0]=255
|
AttachmentMeshIndices[1]=`CLEARED_ATTACHMENT_INDEX
|
||||||
AttachmentMeshIndices[1]=255
|
AttachmentMeshIndices[2]=`CLEARED_ATTACHMENT_INDEX
|
||||||
AttachmentMeshIndices[2]=255
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// For custom trader inventory.
|
// For custom trader inventory.
|
||||||
@ -658,7 +657,7 @@ final function SaveCustomCharacter( ExtSaveDataBase Data )
|
|||||||
c = 0;
|
c = 0;
|
||||||
for( i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i )
|
for( i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i )
|
||||||
{
|
{
|
||||||
if( CustomCharacter.AttachmentMeshIndices[i]!=255 )
|
if( CustomCharacter.AttachmentMeshIndices[i]!=`CLEARED_ATTACHMENT_INDEX )
|
||||||
++c;
|
++c;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -668,7 +667,7 @@ final function SaveCustomCharacter( ExtSaveDataBase Data )
|
|||||||
// Write attachments.
|
// Write attachments.
|
||||||
for( i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i )
|
for( i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i )
|
||||||
{
|
{
|
||||||
if( CustomCharacter.AttachmentMeshIndices[i]!=255 )
|
if( CustomCharacter.AttachmentMeshIndices[i]!=`CLEARED_ATTACHMENT_INDEX )
|
||||||
{
|
{
|
||||||
Data.SaveInt(i);
|
Data.SaveInt(i);
|
||||||
Data.SaveInt(CustomCharacter.AttachmentMeshIndices[i]);
|
Data.SaveInt(CustomCharacter.AttachmentMeshIndices[i]);
|
||||||
@ -748,6 +747,16 @@ static final function DummySaveChar( ExtSaveDataBase Data )
|
|||||||
Data.SaveStr("");
|
Data.SaveStr("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
simulated function Texture2D GetCurrentIconToDisplay()
|
||||||
|
{
|
||||||
|
if(CurrentVoiceCommsRequest == VCT_NONE && ECurrentPerk != none)
|
||||||
|
{
|
||||||
|
return ECurrentPerk.default.PerkIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
return class'KFLocalMessage_VoiceComms'.default.VoiceCommsIcons[CurrentVoiceCommsRequest];
|
||||||
|
}
|
||||||
|
|
||||||
// Set admin levels without having to hard-reference to this mod.
|
// Set admin levels without having to hard-reference to this mod.
|
||||||
event BeginState(Name N)
|
event BeginState(Name N)
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ function GFxObject RefreshSlot( int SlotIndex, KFPlayerReplicationInfo KFPRI )
|
|||||||
local bool bIsLeader;
|
local bool bIsLeader;
|
||||||
local bool bIsMyPlayer;
|
local bool bIsMyPlayer;
|
||||||
local ExtPlayerController EPC;
|
local ExtPlayerController EPC;
|
||||||
local GFxObject PlayerInfoObject;
|
local GFxObject PlayerInfoObject, PerkIconObject;
|
||||||
local ExtPlayerReplicationInfo EPRI;
|
local ExtPlayerReplicationInfo EPRI;
|
||||||
|
|
||||||
PlayerInfoObject = CreateObject("Object");
|
PlayerInfoObject = CreateObject("Object");
|
||||||
@ -42,8 +42,11 @@ function GFxObject RefreshSlot( int SlotIndex, KFPlayerReplicationInfo KFPRI )
|
|||||||
PlayerInfoObject.SetBool("myPlayer", bIsMyPlayer);
|
PlayerInfoObject.SetBool("myPlayer", bIsMyPlayer);
|
||||||
if( ExtMemberSlots[SlotIndex].PerkClass != none )
|
if( ExtMemberSlots[SlotIndex].PerkClass != none )
|
||||||
{
|
{
|
||||||
|
PerkIconObject = CreateObject("Object");
|
||||||
|
PerkIconObject.SetString("perkIcon", ExtMemberSlots[SlotIndex].PerkClass.static.GetPerkIconPath(EPRI.ECurrentPerkLevel));
|
||||||
|
PlayerInfoObject.SetObject("perkImageSource", PerkIconObject);
|
||||||
|
|
||||||
PlayerInfoObject.SetString("perkLevel", string(EPRI.ECurrentPerkLevel));
|
PlayerInfoObject.SetString("perkLevel", string(EPRI.ECurrentPerkLevel));
|
||||||
PlayerInfoObject.SetString("perkIconPath", ExtMemberSlots[SlotIndex].PerkClass.static.GetPerkIconPath(EPRI.ECurrentPerkLevel));
|
|
||||||
}
|
}
|
||||||
if( !bIsMyPlayer )
|
if( !bIsMyPlayer )
|
||||||
{
|
{
|
||||||
@ -76,5 +79,4 @@ function GFxObject RefreshSlot( int SlotIndex, KFPlayerReplicationInfo KFPRI )
|
|||||||
|
|
||||||
DefaultProperties
|
DefaultProperties
|
||||||
{
|
{
|
||||||
PlayerSlots=12
|
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ simulated final function bool IsWeaponOnPerk( KFWeapon W )
|
|||||||
|
|
||||||
simulated static function string GetPerkIconPath( int Level )
|
simulated static function string GetPerkIconPath( int Level )
|
||||||
{
|
{
|
||||||
return "img://"$PathName(Default.PerkIcon);
|
return "img://"$PathName(default.PerkIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
simulated function PostBeginPlay()
|
simulated function PostBeginPlay()
|
||||||
|
@ -446,97 +446,131 @@ final function RenderProgress()
|
|||||||
|
|
||||||
function DrawHUD()
|
function DrawHUD()
|
||||||
{
|
{
|
||||||
local KFPawn KFPH;
|
local KFPawn_Human KFPH;
|
||||||
local KFPawn_Human H;
|
local KFPawn_Scripted KFPS;
|
||||||
|
local vector ViewLocation, ViewVector, PlayerPartyInfoLocation, PawnLocation;
|
||||||
|
local rotator ViewRotation;
|
||||||
|
local array<PlayerReplicationInfo> VisibleHumanPlayers;
|
||||||
|
local array<sHiddenHumanPawnInfo> HiddenHumanPlayers;
|
||||||
local float ThisDot,DotScale;
|
local float ThisDot,DotScale;
|
||||||
|
local vector TargetLocation;
|
||||||
|
local Actor LocActor;
|
||||||
local KFPawn_Monster M;
|
local KFPawn_Monster M;
|
||||||
local vector V;
|
local vector V;
|
||||||
local bool bSpec;
|
local bool bSpec;
|
||||||
local array<PlayerReplicationInfo> VisibleHumanPlayers;
|
|
||||||
local array<sHiddenHumanPawnInfo> HiddenHumanPlayers;
|
|
||||||
local vector ViewLocation,PawnLocation;
|
|
||||||
local rotator ViewRotation;
|
|
||||||
|
|
||||||
Super(HUD).DrawHUD();
|
// Draw weapon HUD underneath everything else
|
||||||
|
if( KFPlayerOwner != none && KFPlayerOwner.Pawn != none && KFPlayerOwner.Pawn.Weapon != none )
|
||||||
// Draw the crosshair for casual mode
|
{
|
||||||
if( bDrawCrosshair || bForceDrawCrosshair || (KFPlayerOwner != none && KFPlayerOwner.GetTeamNum() == 255) )
|
KFPlayerOwner.Pawn.Weapon.DrawHUD( self, Canvas );
|
||||||
{
|
|
||||||
if( KFPlayerOwner != none && !KFPlayerOwner.bCinematicMode )
|
|
||||||
DrawCrosshair();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
super.DrawHUD();
|
||||||
|
|
||||||
|
// Cache GRI
|
||||||
|
if( KFGRI == none )
|
||||||
|
{
|
||||||
|
KFGRI = KFGameReplicationInfo( WorldInfo.GRI );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't draw canvas HUD in cinematic mode
|
||||||
|
if( KFPlayerOwner != none && KFPlayerOwner.bCinematicMode )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
LocActor = KFPlayerOwner.ViewTarget != none ? KFPlayerOwner.ViewTarget : KFPlayerOwner;
|
||||||
|
|
||||||
|
// Draw the crosshair for casual mode
|
||||||
|
if( KFPlayerOwner != none && (bDrawCrosshair || bForceDrawCrosshair || KFPlayerOwner.GetTeamNum() == 255) )
|
||||||
|
{
|
||||||
|
DrawCrosshair();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Friendly player status
|
||||||
bSpec = (PlayerOwner.PlayerReplicationInfo!=None && PlayerOwner.PlayerReplicationInfo.bOnlySpectator);
|
bSpec = (PlayerOwner.PlayerReplicationInfo!=None && PlayerOwner.PlayerReplicationInfo.bOnlySpectator);
|
||||||
if( bSpec || PlayerOwner.GetTeamNum()==0 )
|
if( bSpec || PlayerOwner.GetTeamNum()==0 )
|
||||||
{
|
{
|
||||||
//Friendly player status
|
//Friendly player status
|
||||||
if( !class'ExtPlayerController'.Default.bHideNameBeacons )
|
if( !class'ExtPlayerController'.Default.bHideNameBeacons )
|
||||||
{
|
{
|
||||||
if( KFPlayerOwner != none )
|
if( KFPlayerOwner != none )
|
||||||
{
|
{
|
||||||
KFPlayerOwner.GetPlayerViewPoint( ViewLocation, ViewRotation );
|
KFPlayerOwner.GetPlayerViewPoint( ViewLocation, ViewRotation );
|
||||||
}
|
}
|
||||||
|
ViewVector = vector(ViewRotation);
|
||||||
Canvas.EnableStencilTest(true);
|
|
||||||
foreach WorldInfo.AllPawns(class'KFPawn', KFPH)
|
|
||||||
{
|
|
||||||
if( KFPH == None )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
H = KFPawn_Human(KFPH);
|
|
||||||
if( KFPH.PlayerReplicationInfo!=None && KFPH.PlayerReplicationInfo.Team!=None && KFPH.PlayerReplicationInfo.Team.TeamIndex==0 )
|
|
||||||
{
|
|
||||||
V = KFPH.Location + KFPH.MTO_PhysSmoothOffset + KFPH.CylinderComponent.CollisionHeight * vect(0,0,1);
|
|
||||||
ThisDot = Normal(V - PLCameraLoc) dot Normal(PLCameraDir);
|
|
||||||
|
|
||||||
if( KFPH.IsAliveAndWell() && KFPH != PlayerOwner.Pawn)
|
Canvas.EnableStencilTest(true);
|
||||||
{
|
foreach WorldInfo.AllPawns( class'KFPawn_Human', KFPH )
|
||||||
if((WorldInfo.TimeSeconds - KFPH.Mesh.LastRenderTime) < 0.4f && (ThisDot > 0 && ThisDot < 1.0) )
|
{
|
||||||
{
|
if( KFPH.IsAliveAndWell() && KFPH != KFPlayerOwner.Pawn && KFPH.Mesh.SkeletalMesh != none && KFPH.Mesh.bAnimTreeInitialised )
|
||||||
if( H!=None )
|
{
|
||||||
{
|
PlayerPartyInfoLocation = KFPH.Mesh.GetPosition() + ( KFPH.CylinderComponent.CollisionHeight * vect(0,0,1) );
|
||||||
DrawFriendlyHUD(H);
|
if(`TimeSince(KFPH.Mesh.LastRenderTime) < 0.2f && Normal(PlayerPartyInfoLocation - ViewLocation) dot ViewVector > 0.f )
|
||||||
VisibleHumanPlayers.AddItem( H.PlayerReplicationInfo );
|
{
|
||||||
}
|
if( DrawFriendlyHumanPlayerInfo(KFPH) )
|
||||||
else DrawMonsterHUD(KFPH);
|
{
|
||||||
}
|
VisibleHumanPlayers.AddItem( KFPH.PlayerReplicationInfo );
|
||||||
else if( H != None )
|
}
|
||||||
{
|
else
|
||||||
HiddenHumanPlayers.Insert( 0, 1 );
|
{
|
||||||
HiddenHumanPlayers[0].HumanPawn = H;
|
HiddenHumanPlayers.Insert( 0, 1 );
|
||||||
HiddenHumanPlayers[0].HumanPRI = H.PlayerReplicationInfo;
|
HiddenHumanPlayers[0].HumanPawn = KFPH;
|
||||||
}
|
HiddenHumanPlayers[0].HumanPRI = KFPH.PlayerReplicationInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
HiddenHumanPlayers.Insert( 0, 1 );
|
||||||
|
HiddenHumanPlayers[0].HumanPawn = KFPH;
|
||||||
|
HiddenHumanPlayers[0].HumanPRI = KFPH.PlayerReplicationInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Draw hidden players
|
foreach WorldInfo.AllPawns(class'KFPawn_Scripted', KFPS)
|
||||||
CheckAndDrawHiddenPlayerIcons( VisibleHumanPlayers, HiddenHumanPlayers );
|
{
|
||||||
|
if (KFPS.ShouldShowOnHUD())
|
||||||
|
{
|
||||||
|
PlayerPartyInfoLocation = KFPS.Mesh.GetPosition() + (KFPS.CylinderComponent.CollisionHeight * vect(0,0,1));
|
||||||
|
DrawScriptedPawnInfo(KFPS, Normal(PlayerPartyInfoLocation - ViewLocation) dot ViewVector, `TimeSince(KFPS.Mesh.LastRenderTime) < 0.2f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Draw last remaining zeds
|
if( !KFGRI.bHidePawnIcons )
|
||||||
CheckAndDrawRemainingZedIcons();
|
{
|
||||||
|
// Draw hidden players
|
||||||
Canvas.EnableStencilTest(false);
|
CheckAndDrawHiddenPlayerIcons( VisibleHumanPlayers, HiddenHumanPlayers );
|
||||||
|
|
||||||
if( bSpec )
|
// Draw last remaining zeds
|
||||||
{
|
CheckAndDrawRemainingZedIcons();
|
||||||
// Draw zed health bars.
|
|
||||||
foreach WorldInfo.AllPawns(class'KFPawn_Monster', M)
|
//Draw our current objective location
|
||||||
{
|
if(KFGRI.CurrentObjective != none && KFGRI.ObjectiveInterface != none)
|
||||||
ThisDot = (PLCameraDir Dot (M.Location + M.CylinderComponent.CollisionHeight * vect(0,0,1))) - PLCameraDot;
|
{
|
||||||
if( ThisDot>0 && ThisDot<8000.f && M.IsAliveAndWell() && M.PlayerReplicationInfo!=None && M!=PlayerOwner.Pawn && (WorldInfo.TimeSeconds - M.Mesh.LastRenderTime) < 0.4f )
|
KFGRI.ObjectiveInterface.DrawHUD(self, Canvas);
|
||||||
DrawFriendlyHUDZ(M);
|
|
||||||
}
|
TargetLocation = KFGRI.ObjectiveInterface.GetIconLocation();
|
||||||
}
|
ThisDot = Normal((TargetLocation + (class'KFPawn_Human'.default.CylinderComponent.CollisionHeight * vect(0, 0, 1))) - ViewLocation) dot ViewVector;
|
||||||
}
|
|
||||||
|
if (ThisDot > 0 &&
|
||||||
|
KFGRI.ObjectiveInterface.ShouldShowObjectiveHUD() &&
|
||||||
|
(!KFGRI.ObjectiveInterFace.HasObjectiveDrawDistance() || VSizeSq(TargetLocation - LocActor.Location) < MaxDrawDistanceObjective))
|
||||||
|
{
|
||||||
|
DrawObjectiveHUD();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Canvas.EnableStencilTest(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if( KFPawn_Monster(PlayerOwner.Pawn)!=None )
|
else if( KFPawn_Monster(PlayerOwner.Pawn)!=None )
|
||||||
{
|
{
|
||||||
// Draw human health auras.
|
// Draw human health auras.
|
||||||
DotScale = Canvas.ClipX*0.2f;
|
DotScale = Canvas.ClipX*0.2f;
|
||||||
foreach WorldInfo.AllPawns(class'KFPawn_Human', H)
|
foreach WorldInfo.AllPawns(class'KFPawn_Human', KFPH)
|
||||||
{
|
{
|
||||||
PawnLocation = H.Location;
|
PawnLocation = KFPH.Location;
|
||||||
|
|
||||||
if( IsZero( PawnLocation ) )
|
if( IsZero( PawnLocation ) )
|
||||||
{
|
{
|
||||||
@ -544,12 +578,12 @@ function DrawHUD()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ThisDot = (PLCameraDir Dot PawnLocation) - PLCameraDot;
|
ThisDot = (PLCameraDir Dot PawnLocation) - PLCameraDot;
|
||||||
if( H.IsAliveAndWell() && ThisDot>0.f && ThisDot<10000.f )
|
if( KFPH.IsAliveAndWell() && ThisDot>0.f && ThisDot<10000.f )
|
||||||
{
|
{
|
||||||
V = Canvas.Project(PawnLocation);
|
V = Canvas.Project(PawnLocation);
|
||||||
if( V.X<-100 || V.X>(Canvas.SizeX+100) || V.Y<-100 || V.Y>(Canvas.SizeY+100) )
|
if( V.X<-100 || V.X>(Canvas.SizeX+100) || V.Y<-100 || V.Y>(Canvas.SizeY+100) )
|
||||||
continue;
|
continue;
|
||||||
Canvas.DrawColor = GetHPColorScale(H);
|
Canvas.DrawColor = GetHPColorScale(KFPH);
|
||||||
if( PlayerOwner.FastTrace(PawnLocation,PLCameraLoc) )
|
if( PlayerOwner.FastTrace(PawnLocation,PLCameraLoc) )
|
||||||
ThisDot*=1.75f;
|
ThisDot*=1.75f;
|
||||||
ThisDot = (DotScale/ThisDot)*350.f;
|
ThisDot = (DotScale/ThisDot)*350.f;
|
||||||
@ -560,6 +594,7 @@ function DrawHUD()
|
|||||||
|
|
||||||
if( !class'ExtPlayerController'.Default.bHideNameBeacons )
|
if( !class'ExtPlayerController'.Default.bHideNameBeacons )
|
||||||
{
|
{
|
||||||
|
Canvas.EnableStencilTest(true);
|
||||||
// Draw zed health bars.
|
// Draw zed health bars.
|
||||||
foreach WorldInfo.AllPawns(class'KFPawn_Monster', M)
|
foreach WorldInfo.AllPawns(class'KFPawn_Monster', M)
|
||||||
{
|
{
|
||||||
@ -567,52 +602,9 @@ function DrawHUD()
|
|||||||
if( ThisDot>0 && ThisDot<8000.f && M.IsAliveAndWell() && M.PlayerReplicationInfo!=None && M!=PlayerOwner.Pawn && (WorldInfo.TimeSeconds - M.Mesh.LastRenderTime) < 0.4f )
|
if( ThisDot>0 && ThisDot<8000.f && M.IsAliveAndWell() && M.PlayerReplicationInfo!=None && M!=PlayerOwner.Pawn && (WorldInfo.TimeSeconds - M.Mesh.LastRenderTime) < 0.4f )
|
||||||
DrawFriendlyHUDZ(M);
|
DrawFriendlyHUDZ(M);
|
||||||
}
|
}
|
||||||
|
Canvas.EnableStencilTest(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Canvas.Font = GetFontSizeIndex(0);
|
|
||||||
DrawActorOverlays(PLCameraLoc, PLCameraRot);
|
|
||||||
}
|
|
||||||
|
|
||||||
function DrawHiddenHumanPlayerIcon( PlayerReplicationInfo PRI, vector IconWorldLocation )
|
|
||||||
{
|
|
||||||
local vector ScreenPos;
|
|
||||||
local float IconSizeMult;
|
|
||||||
local KFPlayerReplicationInfo KFPRI;
|
|
||||||
local Texture2D PlayerIcon;
|
|
||||||
local Color PerkColor;
|
|
||||||
local ExtPlayerReplicationInfo ExtPRI;
|
|
||||||
local Texture2D HumanIcon;
|
|
||||||
|
|
||||||
KFPRI = KFPlayerReplicationInfo(PRI);
|
|
||||||
if( KFPRI == None )
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Project world pos to canvas
|
|
||||||
ScreenPos = Canvas.Project( IconWorldLocation + vect(0,0,2.2f) * class'KFPAwn_Human'.default.CylinderComponent.CollisionHeight );
|
|
||||||
|
|
||||||
// Fudge by icon size
|
|
||||||
IconSizeMult = PlayerStatusIconSize * FriendlyHudScale * 0.5f;
|
|
||||||
ScreenPos.X -= IconSizeMult;
|
|
||||||
ScreenPos.Y -= IconSizeMult;
|
|
||||||
|
|
||||||
if( ScreenPos.X < 0 || ScreenPos.X > Canvas.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.SizeY )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ExtPRI = ExtPlayerReplicationInfo(KFPRI);
|
|
||||||
if( ExtPRI == None )
|
|
||||||
return;
|
|
||||||
|
|
||||||
HumanIcon = ExtPRI.ECurrentPerk != None ? ExtPRI.ECurrentPerk.Default.PerkIcon : GenericHumanIconTexture;
|
|
||||||
PlayerIcon = PlayerOwner.GetTeamNum() == 0 ? HumanIcon : GenericHumanIconTexture;
|
|
||||||
PerkColor = ExtPRI.HUDPerkColor;
|
|
||||||
|
|
||||||
// Draw human icon
|
|
||||||
Canvas.SetDrawColor( PerkColor.R, PerkColor.G, PerkColor.B, PerkColor.A );
|
|
||||||
Canvas.SetPos( ScreenPos.X, ScreenPos.Y );
|
|
||||||
Canvas.DrawTile( PlayerIcon, PlayerStatusIconSize * FriendlyHudScale, PlayerStatusIconSize * FriendlyHudScale, 0, 0, 256, 256 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
simulated static final function color GetHPColorScale( Pawn P )
|
simulated static final function color GetHPColorScale( Pawn P )
|
||||||
@ -642,8 +634,10 @@ simulated function DrawFriendlyHUDZ( KFPawn_Monster KFPH )
|
|||||||
local vector ScreenPos, TargetLocation;
|
local vector ScreenPos, TargetLocation;
|
||||||
local FontRenderInfo MyFontRenderInfo;
|
local FontRenderInfo MyFontRenderInfo;
|
||||||
local float FontScale;
|
local float FontScale;
|
||||||
|
local byte FadeAlpha;
|
||||||
|
|
||||||
MyFontRenderInfo = Canvas.CreateFontRenderInfo( true );
|
MyFontRenderInfo = Canvas.CreateFontRenderInfo( true );
|
||||||
|
FadeAlpha = DrawToDistance(KFPH);
|
||||||
|
|
||||||
BarLength = FMin(PlayerStatusBarLengthMax * (float(Canvas.SizeX) / 1024.f), PlayerStatusBarLengthMax) * FriendlyHudScale;
|
BarLength = FMin(PlayerStatusBarLengthMax * (float(Canvas.SizeX) / 1024.f), PlayerStatusBarLengthMax) * FriendlyHudScale;
|
||||||
BarHeight = FMin(8.f * (float(Canvas.SizeX) / 1024.f), 8.f) * FriendlyHudScale;
|
BarHeight = FMin(8.f * (float(Canvas.SizeX) / 1024.f), 8.f) * FriendlyHudScale;
|
||||||
@ -656,16 +650,19 @@ simulated function DrawFriendlyHUDZ( KFPawn_Monster KFPH )
|
|||||||
|
|
||||||
//Draw health bar
|
//Draw health bar
|
||||||
Percentage = float(KFPH.Health) / float(KFPH.HealthMax);
|
Percentage = float(KFPH.Health) / float(KFPH.HealthMax);
|
||||||
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength *0.5f), ScreenPos.Y, HealthColor);
|
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength *0.5f), ScreenPos.Y, HealthColor, FadeAlpha);
|
||||||
|
|
||||||
//Draw player name (Top)
|
//Draw player name (Top)
|
||||||
FontScale = class'KFGameEngine'.Static.GetKFFontScale() * FriendlyHudScale;
|
FontScale = class'KFGameEngine'.Static.GetKFFontScale() * FriendlyHudScale;
|
||||||
Canvas.Font = class'KFGameEngine'.Static.GetKFCanvasFont();
|
Canvas.Font = class'KFGameEngine'.Static.GetKFCanvasFont();
|
||||||
Canvas.SetDrawColorStruct(DrawToDistance(KFPH, PlayerBarTextColor));
|
|
||||||
|
Canvas.DrawColor = PlayerBarTextColor;
|
||||||
|
Canvas.DrawColor.A = FadeAlpha;
|
||||||
|
|
||||||
Canvas.SetPos(ScreenPos.X - (BarLength *0.5f), ScreenPos.Y - BarHeight * 2);
|
Canvas.SetPos(ScreenPos.X - (BarLength *0.5f), ScreenPos.Y - BarHeight * 2);
|
||||||
Canvas.DrawText( KFPH.PlayerReplicationInfo.PlayerName,,FontScale,FontScale, MyFontRenderInfo );
|
Canvas.DrawText( KFPH.PlayerReplicationInfo.PlayerName,,FontScale,FontScale, MyFontRenderInfo );
|
||||||
}
|
}
|
||||||
simulated function DrawFriendlyHUD( KFPawn_Human KFPH )
|
simulated function bool DrawFriendlyHumanPlayerInfo( KFPawn_Human KFPH )
|
||||||
{
|
{
|
||||||
local float Percentage;
|
local float Percentage;
|
||||||
local float BarHeight, BarLength;
|
local float BarHeight, BarLength;
|
||||||
@ -673,91 +670,122 @@ simulated function DrawFriendlyHUD( KFPawn_Human KFPH )
|
|||||||
local ExtPlayerReplicationInfo KFPRI;
|
local ExtPlayerReplicationInfo KFPRI;
|
||||||
local FontRenderInfo MyFontRenderInfo;
|
local FontRenderInfo MyFontRenderInfo;
|
||||||
local float FontScale;
|
local float FontScale;
|
||||||
local string S;
|
local float ResModifier;
|
||||||
|
local float PerkIconPosX, PerkIconPosY, SupplyIconPosX, SupplyIconPosY, PerkIconSize;
|
||||||
|
local color CurrentArmorColor, CurrentHealthColor, TextColor;
|
||||||
|
local string S;
|
||||||
|
local byte FadeAlpha;
|
||||||
|
|
||||||
|
ResModifier = WorldInfo.static.GetResolutionBasedHUDScale() * FriendlyHudScale;
|
||||||
KFPRI = ExtPlayerReplicationInfo(KFPH.PlayerReplicationInfo);
|
KFPRI = ExtPlayerReplicationInfo(KFPH.PlayerReplicationInfo);
|
||||||
|
|
||||||
if( KFPRI == none )
|
if( KFPRI == none )
|
||||||
return;
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
FadeAlpha = DrawToDistance(KFPH);
|
||||||
MyFontRenderInfo = Canvas.CreateFontRenderInfo( true );
|
MyFontRenderInfo = Canvas.CreateFontRenderInfo( true );
|
||||||
|
BarLength = FMin(PlayerStatusBarLengthMax * (Canvas.ClipX / 1024.f), PlayerStatusBarLengthMax) * ResModifier;
|
||||||
|
BarHeight = FMin(8.f * (Canvas.ClipX / 1024.f), 8.f) * ResModifier;
|
||||||
|
|
||||||
BarLength = FMin(PlayerStatusBarLengthMax * (float(Canvas.SizeX) / 1024.f), PlayerStatusBarLengthMax) * FriendlyHudScale;
|
TargetLocation = KFPH.Mesh.GetPosition() + ( KFPH.CylinderComponent.CollisionHeight * vect(0,0,2.5f) );
|
||||||
BarHeight = FMin(8.f * (float(Canvas.SizeX) / 1024.f), 8.f) * FriendlyHudScale;
|
ScreenPos = Canvas.Project( TargetLocation );
|
||||||
|
if( ScreenPos.X < 0 || ScreenPos.X > Canvas.ClipX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.ClipY )
|
||||||
TargetLocation = KFPH.Location + vect(0,0,1) * KFPH.GetCollisionHeight() * 1.2;
|
{
|
||||||
|
return false;
|
||||||
ScreenPos = Canvas.Project(TargetLocation);
|
}
|
||||||
if( ScreenPos.X < 0 || ScreenPos.X > Canvas.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.SizeY )
|
|
||||||
return;
|
|
||||||
|
|
||||||
//Draw health bar
|
|
||||||
Percentage = FMin(float(KFPH.Health) / float(KFPH.HealthMax),1.f);
|
|
||||||
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength *0.5f), ScreenPos.Y, HealthColor, true);
|
|
||||||
|
|
||||||
//Draw armor bar
|
|
||||||
Percentage = FMin(float(KFPH.Armor) / float(KFPH.MaxArmor),1.f);
|
|
||||||
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength *0.5f), ScreenPos.Y - BarHeight, ArmorColor);
|
|
||||||
|
|
||||||
//Draw player name (Top)
|
//Draw player name (Top)
|
||||||
FontScale = class'KFGameEngine'.Static.GetKFFontScale() * FriendlyHudScale;
|
FontScale = class'KFGameEngine'.Static.GetKFFontScale() * FriendlyHudScale;
|
||||||
Canvas.Font = class'KFGameEngine'.Static.GetKFCanvasFont();
|
Canvas.Font = class'KFGameEngine'.Static.GetKFCanvasFont();
|
||||||
S = KFPRI.GetHumanReadableName();
|
|
||||||
|
// drop shadow for player name text
|
||||||
|
S = KFPRI.PlayerName;
|
||||||
if( KFPRI.bBot )
|
if( KFPRI.bBot )
|
||||||
{
|
{
|
||||||
S = S$" (Bot)";
|
S = S$" (Bot)";
|
||||||
Canvas.DrawColor = KFPRI.HUDPerkColor;
|
TextColor = KFPRI.HUDPerkColor;
|
||||||
}
|
}
|
||||||
else if( KFPRI.ShowAdminName() ) // Admin info.
|
else if( KFPRI.ShowAdminName() ) // Admin info.
|
||||||
{
|
{
|
||||||
S = S$" ("$KFPRI.GetAdminNameAbr()$")";
|
S = S$" ("$KFPRI.GetAdminNameAbr()$")";
|
||||||
Canvas.DrawColor = KFPRI.GetAdminColorC();
|
TextColor = KFPRI.GetAdminColorC();
|
||||||
}
|
}
|
||||||
else Canvas.DrawColor = WhiteColor;
|
else TextColor = PlayerBarTextColor;
|
||||||
|
|
||||||
if( bMeAdmin && KFPRI.FixedData>0 )
|
if( bMeAdmin && KFPRI.FixedData>0 )
|
||||||
{
|
{
|
||||||
Canvas.SetDrawColor(255,0,0,255);
|
TextColor = MakeColor(255,0,0,255);
|
||||||
S $= " -"$KFPRI.GetDesc();
|
S @= "-"$KFPRI.GetDesc();
|
||||||
}
|
}
|
||||||
Canvas.DrawColor = DrawToDistance(KFPH, Canvas.DrawColor);
|
|
||||||
|
TextColor.A = FadeAlpha;
|
||||||
Canvas.SetPos(ScreenPos.X - (BarLength *0.5f), ScreenPos.Y - BarHeight * 3);
|
|
||||||
Canvas.DrawText( S,,FontScale,FontScale, MyFontRenderInfo );
|
Canvas.DrawColor = PlayerBarShadowColor;
|
||||||
|
Canvas.DrawColor.A = FadeAlpha;
|
||||||
|
Canvas.SetPos(ScreenPos.X - (BarLength * 0.5f) + 1, ScreenPos.Y + 8);
|
||||||
|
Canvas.DrawText(S, , FontScale, FontScale, MyFontRenderInfo);
|
||||||
|
|
||||||
if( KFPRI.ECurrentPerk!=none )
|
Canvas.DrawColor = TextColor;
|
||||||
|
Canvas.SetPos(ScreenPos.X - (BarLength * 0.5f), ScreenPos.Y + 7);
|
||||||
|
Canvas.DrawText(S, , FontScale, FontScale, MyFontRenderInfo);
|
||||||
|
|
||||||
|
//Draw armor bar
|
||||||
|
Percentage = FMin(float(KFPH.Armor) / float(KFPH.MaxArmor), 100);
|
||||||
|
CurrentArmorColor = ClassicPlayerInfo ? ClassicArmorColor : ArmorColor;
|
||||||
|
CurrentArmorColor.A = FadeAlpha;
|
||||||
|
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength * 0.5f), ScreenPos.Y + BarHeight + (36 * FontScale * ResModifier), CurrentArmorColor, FadeAlpha);
|
||||||
|
|
||||||
|
//Draw health bar
|
||||||
|
Percentage = FMin(float(KFPH.Health) / float(KFPH.HealthMax), 100);
|
||||||
|
CurrentHealthColor = ClassicPlayerInfo ? ClassicHealthColor : HealthColor;
|
||||||
|
CurrentHealthColor.A = FadeAlpha;
|
||||||
|
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength * 0.5f), ScreenPos.Y + BarHeight * 2 + (36 * FontScale * ResModifier), CurrentHealthColor, FadeAlpha, true);
|
||||||
|
|
||||||
|
if( KFPRI.ECurrentPerk == None )
|
||||||
{
|
{
|
||||||
//draw perk icon
|
return false;
|
||||||
Canvas.DrawColor = DrawToDistance(KFPH, KFPRI.HUDPerkColor);
|
|
||||||
Canvas.SetPos(ScreenPos.X - (BarLength * 0.75), ScreenPos.Y - BarHeight * 2);
|
|
||||||
Canvas.DrawRect(PlayerStatusIconSize*FriendlyHudScale,PlayerStatusIconSize*FriendlyHudScale,KFPRI.ECurrentPerk.default.PerkIcon);
|
|
||||||
|
|
||||||
//Draw perk level and name text
|
|
||||||
Canvas.SetPos(ScreenPos.X - (BarLength *0.5f), ScreenPos.Y + BarHeight);
|
|
||||||
Canvas.DrawText( KFPRI.GetPerkLevelStr()@KFPRI.ECurrentPerk.default.PerkName,,FontScale,FontScale, MyFontRenderInfo );
|
|
||||||
|
|
||||||
if( KFPRI.HasSupplier!=None )
|
|
||||||
{
|
|
||||||
Canvas.DrawColor = DrawToDistance(KFPH, (KFPlayerOwner.Pawn==None || KFPRI.CanUseSupply(KFPlayerOwner.Pawn)) ? SupplierUsableColor : SupplierActiveColor);
|
|
||||||
Canvas.SetPos( ScreenPos.X + BarLength * 0.5f, ScreenPos.Y - BarHeight * 2 );
|
|
||||||
Canvas.DrawRect( PlayerStatusIconSize*FriendlyHudScale, PlayerStatusIconSize*FriendlyHudScale, KFPRI.HasSupplier.Default.SupplyIcon);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if( KFPRI.bBot && KFPRI.CurrentPerkClass!=none )
|
|
||||||
{
|
|
||||||
//draw perk icon
|
|
||||||
Canvas.SetPos(ScreenPos.X - (BarLength * 0.75), ScreenPos.Y - BarHeight * 2);
|
|
||||||
Canvas.DrawRect(PlayerStatusIconSize*FriendlyHudScale,PlayerStatusIconSize*FriendlyHudScale,KFPRI.CurrentPerkClass.default.PerkIcon);
|
|
||||||
|
|
||||||
//Draw name text
|
// drop shadow for perk name text
|
||||||
Canvas.SetPos(ScreenPos.X - (BarLength *0.5f), ScreenPos.Y + BarHeight);
|
Canvas.DrawColor = PlayerBarShadowColor;
|
||||||
Canvas.DrawText( KFPRI.CurrentPerkClass.default.PerkName,,FontScale,FontScale, MyFontRenderInfo );
|
Canvas.DrawColor.A = FadeAlpha;
|
||||||
}
|
Canvas.SetPos(ScreenPos.X - (BarLength * 0.5f) + 1, ScreenPos.Y + BarHeight * 3 + (36 * FontScale * ResModifier) + 1);
|
||||||
|
Canvas.DrawText(KFPRI.GetPerkLevelStr()@KFPRI.ECurrentPerk.default.PerkName, , FontScale, FontScale, MyFontRenderInfo);
|
||||||
|
|
||||||
|
//Draw perk level and name text
|
||||||
|
Canvas.DrawColor = PlayerBarTextColor;
|
||||||
|
Canvas.DrawColor.A = FadeAlpha;
|
||||||
|
Canvas.SetPos(ScreenPos.X - (BarLength * 0.5f), ScreenPos.Y + BarHeight * 3 + (36 * FontScale * ResModifier));
|
||||||
|
Canvas.DrawText(KFPRI.GetPerkLevelStr()@KFPRI.ECurrentPerk.default.PerkName, , FontScale, FontScale, MyFontRenderInfo);
|
||||||
|
|
||||||
|
// drop shadow for perk icon
|
||||||
|
Canvas.DrawColor = PlayerBarShadowColor;
|
||||||
|
Canvas.DrawColor.A = FadeAlpha;
|
||||||
|
PerkIconSize = PlayerStatusIconSize * ResModifier;
|
||||||
|
PerkIconPosX = ScreenPos.X - (BarLength * 0.5f) - PerkIconSize + 1;
|
||||||
|
PerkIconPosY = ScreenPos.Y + (36 * FontScale * ResModifier) + 1;
|
||||||
|
SupplyIconPosX = ScreenPos.X + (BarLength * 0.5f) + 1;
|
||||||
|
SupplyIconPosY = PerkIconPosY + 4 * ResModifier;
|
||||||
|
DrawPerkIcons(KFPH, PerkIconSize, PerkIconPosX, PerkIconPosY, SupplyIconPosX, SupplyIconPosY, true);
|
||||||
|
|
||||||
|
//draw perk icon
|
||||||
|
Canvas.DrawColor = PlayerBarIconColor;
|
||||||
|
Canvas.DrawColor.A = FadeAlpha;
|
||||||
|
PerkIconPosX = ScreenPos.X - (BarLength * 0.5f) - PerkIconSize;
|
||||||
|
PerkIconPosY = ScreenPos.Y + (36 * FontScale * ResModifier);
|
||||||
|
SupplyIconPosX = ScreenPos.X + (BarLength * 0.5f);
|
||||||
|
SupplyIconPosY = PerkIconPosY + 4 * ResModifier;
|
||||||
|
DrawPerkIcons(KFPH, PerkIconSize, PerkIconPosX, PerkIconPosY, SupplyIconPosX, SupplyIconPosY, false);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
simulated final function DrawPlayerInfoBar( KFPawn P, float BarPercentage, float BarLength, float BarHeight, float XPos, float YPos, Color BarColor, optional bool bDrawingHealth )
|
simulated final function DrawPlayerInfoBar( KFPawn P, float BarPercentage, float BarLength, float BarHeight, float XPos, float YPos, Color BarColor, byte FadeAlpha, optional bool bDrawingHealth )
|
||||||
{
|
{
|
||||||
//background for status bar
|
//background for status bar
|
||||||
Canvas.SetDrawColorStruct(DrawToDistance(P, PlayerBarBGColor));
|
Canvas.DrawColor = PlayerBarBGColor;
|
||||||
|
Canvas.DrawColor.A = FadeAlpha;
|
||||||
Canvas.SetPos(XPos, YPos);
|
Canvas.SetPos(XPos, YPos);
|
||||||
Canvas.DrawTileStretched(PlayerStatusBarBGTexture, BarLength, BarHeight, 0, 0, 32, 32);
|
Canvas.DrawTileStretched(PlayerStatusBarBGTexture, BarLength, BarHeight, 0, 0, 32, 32);
|
||||||
|
|
||||||
@ -767,7 +795,8 @@ simulated final function DrawPlayerInfoBar( KFPawn P, float BarPercentage, float
|
|||||||
BarHeight-=2;
|
BarHeight-=2;
|
||||||
|
|
||||||
//Forground for status bar.
|
//Forground for status bar.
|
||||||
Canvas.SetDrawColorStruct(DrawToDistance(P, BarColor));
|
Canvas.DrawColor = BarColor;
|
||||||
|
Canvas.DrawColor.A = FadeAlpha;
|
||||||
Canvas.SetPos(XPos, YPos);
|
Canvas.SetPos(XPos, YPos);
|
||||||
Canvas.DrawTileStretched(PlayerStatusBarBGTexture, BarLength * BarPercentage, BarHeight, 0, 0, 32, 32);
|
Canvas.DrawTileStretched(PlayerStatusBarBGTexture, BarLength * BarPercentage, BarHeight, 0, 0, 32, 32);
|
||||||
|
|
||||||
@ -777,11 +806,76 @@ simulated final function DrawPlayerInfoBar( KFPawn P, float BarPercentage, float
|
|||||||
XPos+=(BarLength * BarPercentage);
|
XPos+=(BarLength * BarPercentage);
|
||||||
BarPercentage = FMin(float(ExtHumanPawn(P).RepRegenHP) / float(P.HealthMax),1.f-BarPercentage);
|
BarPercentage = FMin(float(ExtHumanPawn(P).RepRegenHP) / float(P.HealthMax),1.f-BarPercentage);
|
||||||
|
|
||||||
Canvas.DrawColor = DrawToDistance(P, MakeColor(255,128,128,255));
|
Canvas.DrawColor = MakeColor(255,128,128,FadeAlpha);
|
||||||
Canvas.SetPos(XPos, YPos);
|
Canvas.SetPos(XPos, YPos);
|
||||||
Canvas.DrawTileStretched(PlayerStatusBarBGTexture, BarLength * BarPercentage, BarHeight, 0, 0, 32, 32);
|
Canvas.DrawTileStretched(PlayerStatusBarBGTexture, BarLength * BarPercentage, BarHeight, 0, 0, 32, 32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
simulated function DrawPerkIcons(KFPawn_Human KFPH, float PerkIconSize, float PerkIconPosX, float PerkIconPosY, float SupplyIconPosX, float SupplyIconPosY, bool bDropShadow)
|
||||||
|
{
|
||||||
|
local byte PrestigeLevel;
|
||||||
|
local ExtPlayerReplicationInfo KFPRI;
|
||||||
|
local color TempColor;
|
||||||
|
local float ResModifier;
|
||||||
|
|
||||||
|
KFPRI = ExtPlayerReplicationInfo(KFPH.PlayerReplicationInfo);
|
||||||
|
|
||||||
|
if (KFPRI == none)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PrestigeLevel = KFPRI.GetActivePerkPrestigeLevel();
|
||||||
|
ResModifier = WorldInfo.static.GetResolutionBasedHUDScale() * FriendlyHudScale;
|
||||||
|
|
||||||
|
if (KFPRI.CurrentVoiceCommsRequest == VCT_NONE && KFPRI.ECurrentPerk != none && PrestigeLevel > 0)
|
||||||
|
{
|
||||||
|
Canvas.SetPos(PerkIconPosX, PerkIconPosY);
|
||||||
|
Canvas.DrawTile(KFPRI.ECurrentPerk.default.BasePerk.default.PrestigeIcons[PrestigeLevel - 1], PerkIconSize, PerkIconSize, 0, 0, 256, 256);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PrestigeLevel > 0)
|
||||||
|
{ //icon slot in image is not centered
|
||||||
|
Canvas.SetPos(PerkIconPosX + (PerkIconSize * (1 - PrestigeIconScale)) / 2, PerkIconPosY + PerkIconSize * 0.05f);
|
||||||
|
Canvas.DrawTile(KFPRI.GetCurrentIconToDisplay(), PerkIconSize * PrestigeIconScale, PerkIconSize * PrestigeIconScale, 0, 0, 256, 256);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Canvas.SetPos(PerkIconPosX, PerkIconPosY);
|
||||||
|
Canvas.DrawTile(KFPRI.GetCurrentIconToDisplay(), PerkIconSize, PerkIconSize, 0, 0, 256, 256);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (KFPRI.PerkSupplyLevel > 0 && KFPRI.ECurrentPerk.default.BasePerk.static.GetInteractIcon() != none)
|
||||||
|
{
|
||||||
|
if (!bDropShadow)
|
||||||
|
{
|
||||||
|
if (KFPRI.PerkSupplyLevel == 2)
|
||||||
|
{
|
||||||
|
if (KFPRI.bPerkPrimarySupplyUsed && KFPRI.bPerkSecondarySupplyUsed)
|
||||||
|
{
|
||||||
|
TempColor = SupplierActiveColor;
|
||||||
|
}
|
||||||
|
else if (KFPRI.bPerkPrimarySupplyUsed || KFPRI.bPerkSecondarySupplyUsed)
|
||||||
|
{
|
||||||
|
TempColor = SupplierHalfUsableColor;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TempColor = SupplierUsableColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (KFPRI.PerkSupplyLevel == 1)
|
||||||
|
{
|
||||||
|
TempColor = KFPRI.bPerkPrimarySupplyUsed ? SupplierActiveColor : SupplierUsableColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
Canvas.SetDrawColorStruct(TempColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
Canvas.SetPos(SupplyIconPosX, SupplyIconPosY); //offset so that supplier icon shows up on the correct side of the player's health bar
|
||||||
|
Canvas.DrawTile(KFPRI.ECurrentPerk.default.BasePerk.static.GetInteractIcon(), (PlayerStatusIconSize * 0.75) * ResModifier, (PlayerStatusIconSize * 0.75) * ResModifier, 0, 0, 256, 256);
|
||||||
|
}
|
||||||
|
}
|
||||||
simulated function DrawMonsterHUD( KFPawn KFPH )
|
simulated function DrawMonsterHUD( KFPawn KFPH )
|
||||||
{
|
{
|
||||||
local float Percentage;
|
local float Percentage;
|
||||||
@ -790,11 +884,13 @@ simulated function DrawMonsterHUD( KFPawn KFPH )
|
|||||||
local Ext_T_MonsterPRI PRI;
|
local Ext_T_MonsterPRI PRI;
|
||||||
local FontRenderInfo MyFontRenderInfo;
|
local FontRenderInfo MyFontRenderInfo;
|
||||||
local float FontScale;
|
local float FontScale;
|
||||||
|
local byte FadeAlpha;
|
||||||
|
|
||||||
PRI = Ext_T_MonsterPRI(KFPH.PlayerReplicationInfo);
|
PRI = Ext_T_MonsterPRI(KFPH.PlayerReplicationInfo);
|
||||||
if( PRI==None )
|
if( PRI==None )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
FadeAlpha = DrawToDistance(KFPH);
|
||||||
MyFontRenderInfo = Canvas.CreateFontRenderInfo( true );
|
MyFontRenderInfo = Canvas.CreateFontRenderInfo( true );
|
||||||
|
|
||||||
BarLength = FMin(PlayerStatusBarLengthMax * (float(Canvas.SizeX) / 1024.f), PlayerStatusBarLengthMax) * FriendlyHudScale;
|
BarLength = FMin(PlayerStatusBarLengthMax * (float(Canvas.SizeX) / 1024.f), PlayerStatusBarLengthMax) * FriendlyHudScale;
|
||||||
@ -808,12 +904,12 @@ simulated function DrawMonsterHUD( KFPawn KFPH )
|
|||||||
|
|
||||||
//Draw health bar
|
//Draw health bar
|
||||||
Percentage = FMin(float(KFPH.Health) / float(KFPH.HealthMax),1.f);
|
Percentage = FMin(float(KFPH.Health) / float(KFPH.HealthMax),1.f);
|
||||||
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength *0.5f), ScreenPos.Y, HealthColor);
|
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength *0.5f), ScreenPos.Y, HealthColor, FadeAlpha);
|
||||||
|
|
||||||
//Draw player name (Top)
|
//Draw player name (Top)
|
||||||
FontScale = class'KFGameEngine'.Static.GetKFFontScale() * FriendlyHudScale;
|
FontScale = class'KFGameEngine'.Static.GetKFFontScale() * FriendlyHudScale;
|
||||||
Canvas.Font = class'KFGameEngine'.Static.GetKFCanvasFont();
|
Canvas.Font = class'KFGameEngine'.Static.GetKFCanvasFont();
|
||||||
Canvas.DrawColor = DrawToDistance(KFPH, (PRI.OwnerPRI==PlayerOwner.PlayerReplicationInfo ? MakeColor(32,250,32,255) : MakeColor(250,32,32,255)));
|
Canvas.DrawColor = PRI.OwnerPRI==PlayerOwner.PlayerReplicationInfo ? MakeColor(32,250,32,FadeAlpha) : MakeColor(250,32,32,FadeAlpha);
|
||||||
Canvas.SetPos(ScreenPos.X - (BarLength *0.5f), ScreenPos.Y - BarHeight * 3);
|
Canvas.SetPos(ScreenPos.X - (BarLength *0.5f), ScreenPos.Y - BarHeight * 3);
|
||||||
Canvas.DrawText( PRI.PlayerName,,FontScale,FontScale, MyFontRenderInfo );
|
Canvas.DrawText( PRI.PlayerName,,FontScale,FontScale, MyFontRenderInfo );
|
||||||
|
|
||||||
@ -866,18 +962,16 @@ simulated function DrawPetInfo()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Color DrawToDistance(KFPawn Pawn, Color DrawColor)
|
function byte DrawToDistance(Actor A, optional float StartAlpha=255.f, optional float MinAlpha=90.f)
|
||||||
{
|
{
|
||||||
local float Dist, fZoom;
|
local float Dist, fZoom;
|
||||||
|
|
||||||
Dist = VSize(Pawn.Location - PLCameraLoc) * 0.5;
|
Dist = VSize(A.Location - PLCameraLoc);
|
||||||
if ( Dist <= HealthBarFullVisDist || PlayerOwner.PlayerReplicationInfo.bOnlySpectator )
|
if ( Dist <= HealthBarFullVisDist || PlayerOwner.PlayerReplicationInfo.bOnlySpectator )
|
||||||
fZoom = 1.0;
|
fZoom = 1.0;
|
||||||
else fZoom = FMax(1.0 - (Dist - HealthBarFullVisDist) / (HealthBarCutoffDist - HealthBarFullVisDist), 0.0);
|
else fZoom = FMax(1.0 - (Dist - HealthBarFullVisDist) / (HealthBarCutoffDist - HealthBarFullVisDist), 0.0);
|
||||||
|
|
||||||
DrawColor.A = Clamp(255 * fZoom, 90, 255);
|
return Clamp(StartAlpha * fZoom, MinAlpha, StartAlpha);
|
||||||
|
|
||||||
return DrawColor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final function AddNumberMsg( int Amount, vector Pos, byte Type )
|
final function AddNumberMsg( int Amount, vector Pos, byte Type )
|
||||||
@ -1059,13 +1153,13 @@ simulated final function DrawItemsList()
|
|||||||
|
|
||||||
Canvas.TextSize(NewItems[i].Item,XS,YS,FontScale,FontScale);
|
Canvas.TextSize(NewItems[i].Item,XS,YS,FontScale,FontScale);
|
||||||
|
|
||||||
if( NewItems[i].Icon!=None )
|
/*if( NewItems[i].Icon!=None )
|
||||||
{
|
{
|
||||||
Canvas.SetPos(XPos-YSize,YPos);
|
Canvas.SetPos(XPos-YSize,YPos);
|
||||||
Canvas.DrawRect(YSize,YSize,NewItems[i].Icon);
|
Canvas.DrawRect(YSize,YSize,NewItems[i].Icon);
|
||||||
XS = XPos-(YSize*1.1)-XS;
|
XS = XPos-(YSize*1.1)-XS;
|
||||||
}
|
}
|
||||||
else XS = XPos-XS;
|
else */XS = XPos-XS;
|
||||||
|
|
||||||
Canvas.SetPos(XS,YPos);
|
Canvas.SetPos(XS,YPos);
|
||||||
Canvas.DrawText("New Item:",,FontScale,FontScale);
|
Canvas.DrawText("New Item:",,FontScale,FontScale);
|
||||||
|
5
ServerExt/Classes/SRPerkManager.uc
Normal file
5
ServerExt/Classes/SRPerkManager.uc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Class SRPerkManager extends ExtPerkManager;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
}
|
@ -49,6 +49,7 @@ var int LastWaveNum,NumWaveSwitches;
|
|||||||
var ExtSpawnPointHelper SpawnPointer;
|
var ExtSpawnPointHelper SpawnPointer;
|
||||||
var bool bRespawnCheck,bSpecialSpawn,bGameHasEnded,bIsPostGame;
|
var bool bRespawnCheck,bSpecialSpawn,bGameHasEnded,bIsPostGame;
|
||||||
var config bool bKillMessages,bDamageMessages,bEnableMapVote,bNoAdminCommands,bNoWebAdmin,bNoBoomstickJumping,bDumpXMLStats,bRagdollFromFall,bRagdollFromMomentum,bRagdollFromBackhit,bAddCountryTags;
|
var config bool bKillMessages,bDamageMessages,bEnableMapVote,bNoAdminCommands,bNoWebAdmin,bNoBoomstickJumping,bDumpXMLStats,bRagdollFromFall,bRagdollFromMomentum,bRagdollFromBackhit,bAddCountryTags;
|
||||||
|
var config bool bServerPerksMode;
|
||||||
|
|
||||||
function PostBeginPlay()
|
function PostBeginPlay()
|
||||||
{
|
{
|
||||||
@ -426,7 +427,7 @@ final function GT_PlayerKilled( Controller Killer, Controller Killed, class<Dama
|
|||||||
if( KFG!=None && KFPC != none && MonsterPawn!=none )
|
if( KFG!=None && KFPC != none && MonsterPawn!=none )
|
||||||
{
|
{
|
||||||
//Chris: We have to do it earlier here because we need a damage type
|
//Chris: We have to do it earlier here because we need a damage type
|
||||||
KFPC.AddZedKill( MonsterPawn.class, KFG.GameDifficulty, damageType );
|
KFPC.AddZedKill( MonsterPawn.class, KFG.GameDifficulty, damageType, false );
|
||||||
|
|
||||||
if( KFPC.ActivePerkManager!=none && KFPC.ActivePerkManager.CanEarnSmallRadiusKillXP(damageType) )
|
if( KFPC.ActivePerkManager!=none && KFPC.ActivePerkManager.CanEarnSmallRadiusKillXP(damageType) )
|
||||||
KFG.CheckForBerserkerSmallRadiusKill( MonsterPawn, KFPC );
|
KFG.CheckForBerserkerSmallRadiusKill( MonsterPawn, KFPC );
|
||||||
|
Loading…
Reference in New Issue
Block a user