KF2-Server-Extension/ServerExt/Classes/ExtWidget_PartyInGame.uc
Forrest Keller 88f2c71e54 Added perk changing without dying
Fixed scoreboard avatars not working
Added the ServerExt perk menu to the lobby
Made the perk buttons look better (Reset, Unload, Prestige)
Added a better damage popup system
Added a better pet info hud system
Made player info bars fade out with distance
Added missing traits from most of the perks
Made lobby menu support 12 players
Medic Pistol from the trait can't be dropped, sold and has infinite ammo
9mm Pistol now has infinite ammo
Pet sirens do not blow up grenades
Unlocked all cosmetics and emotes
Hide bad cosmetics that were debug
Hans pet no longer forces the camera on his death
Custom weapons in the trader now support the proper weapon names
Updated character info system to support alot of added items
2017-10-20 02:02:53 -05:00

81 lines
2.0 KiB
Ucode

class ExtWidget_PartyInGame extends KFGFxWidget_PartyInGame;
var class<Ext_PerkBase> PPerkSlots[6];
var byte PPerkLevels[6];
struct ExtMemberSlotStruct
{
var class<Ext_PerkBase> PerkClass;
structdefaultproperties
{
PerkClass=none
}
};
var ExtMemberSlotStruct ExtMemberSlots[13];
function GFxObject RefreshSlot( int SlotIndex, KFPlayerReplicationInfo KFPRI )
{
local string PlayerName;
local UniqueNetId AdminId;
local bool bIsLeader;
local bool bIsMyPlayer;
local ExtPlayerController EPC;
local GFxObject PlayerInfoObject;
local ExtPlayerReplicationInfo EPRI;
PlayerInfoObject = CreateObject("Object");
EPC = ExtPlayerController(GetPC());
if( KFPRI != none )
{
EPRI = ExtPlayerReplicationInfo(KFPRI);
}
if( OnlineLobby != none )
{
OnlineLobby.GetLobbyAdmin( OnlineLobby.GetCurrentLobbyId(), AdminId);
}
bIsLeader = EPRI.UniqueId == AdminId;
PlayerInfoObject.SetBool("bLeader", bIsLeader);
bIsMyPlayer = EPC.PlayerReplicationInfo.UniqueId == KFPRI.UniqueId;
ExtMemberSlots[SlotIndex].PerkClass = EPRI.ECurrentPerk;
PlayerInfoObject.SetBool("myPlayer", bIsMyPlayer);
if( ExtMemberSlots[SlotIndex].PerkClass != none )
{
PlayerInfoObject.SetString("perkLevel", string(EPRI.ECurrentPerkLevel));
PlayerInfoObject.SetString("perkIconPath", ExtMemberSlots[SlotIndex].PerkClass.static.GetPerkIconPath(EPRI.ECurrentPerkLevel));
}
if( !bIsMyPlayer )
{
PlayerInfoObject.SetBool("muted", EPC.IsPlayerMuted(EPRI.UniqueId));
}
if( class'WorldInfo'.static.IsE3Build() )
{
PlayerName = EPRI.PlayerName;
}
else
{
PlayerName = EPRI.PlayerName;
}
PlayerInfoObject.SetString("playerName", PlayerName);
if( class'WorldInfo'.static.IsConsoleBuild(CONSOLE_Orbis) )
{
PlayerInfoObject.SetString("profileImageSource", "img://"$KFPC.GetPS4Avatar(PlayerName));
}
else
{
PlayerInfoObject.SetString("profileImageSource", "img://"$KFPC.GetSteamAvatar(EPRI.UniqueId));
}
if( KFGRI != none )
{
PlayerInfoObject.SetBool("ready", EPRI.bReadyToPlay && !KFGRI.bMatchHasBegun);
}
return PlayerInfoObject;
}
DefaultProperties
{
PlayerSlots=12
}