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

83 lines
2.1 KiB
Ucode
Raw Normal View History

2017-10-19 21:00:49 -05:00
class ExtWidget_PartyInGame extends KFGFxWidget_PartyInGame;
var class<Ext_PerkBase> PPerkSlots[6];
var byte PPerkLevels[6];
struct ExtMemberSlotStruct
{
var class<Ext_PerkBase> PerkClass;
2023-05-14 05:49:12 +03:00
structdefaultproperties
{
PerkClass=none
}
};
var ExtMemberSlotStruct ExtMemberSlots[13];
2020-11-28 23:04:55 +03:00
function GFxObject RefreshSlot(int SlotIndex, KFPlayerReplicationInfo KFPRI)
2017-10-19 21:00:49 -05:00
{
2023-05-14 05:49:12 +03:00
local string PlayerName;
2017-10-19 21:00:49 -05:00
local UniqueNetId AdminId;
local bool bIsLeader;
local bool bIsMyPlayer;
local ExtPlayerController EPC;
2020-01-09 05:05:13 -06:00
local GFxObject PlayerInfoObject, PerkIconObject;
2017-10-19 21:00:49 -05:00
local ExtPlayerReplicationInfo EPRI;
PlayerInfoObject = CreateObject("Object");
EPC = ExtPlayerController(GetPC());
2023-05-14 05:49:12 +03:00
2020-11-28 23:12:58 +03:00
if (KFPRI != none)
{
EPRI = ExtPlayerReplicationInfo(KFPRI);
}
2020-11-28 23:12:58 +03:00
if (OnlineLobby != none)
2017-10-19 21:00:49 -05:00
{
2020-11-28 23:04:55 +03:00
OnlineLobby.GetLobbyAdmin(OnlineLobby.GetCurrentLobbyId(), AdminId);
2017-10-19 21:00:49 -05:00
}
bIsLeader = EPRI.UniqueId == AdminId;
2017-10-19 21:00:49 -05:00
PlayerInfoObject.SetBool("bLeader", bIsLeader);
bIsMyPlayer = EPC.PlayerReplicationInfo.UniqueId == KFPRI.UniqueId;
ExtMemberSlots[SlotIndex].PerkClass = EPRI.ECurrentPerk;
2017-10-19 21:00:49 -05:00
PlayerInfoObject.SetBool("myPlayer", bIsMyPlayer);
2020-11-28 23:12:58 +03:00
if (ExtMemberSlots[SlotIndex].PerkClass != none)
2017-10-19 21:00:49 -05:00
{
2020-01-09 05:05:13 -06:00
PerkIconObject = CreateObject("Object");
PerkIconObject.SetString("perkIcon", ExtMemberSlots[SlotIndex].PerkClass.static.GetPerkIconPath(EPRI.ECurrentPerkLevel));
PlayerInfoObject.SetObject("perkImageSource", PerkIconObject);
2023-05-14 05:49:12 +03:00
PlayerInfoObject.SetString("perkLevel", string(EPRI.ECurrentPerkLevel));
2017-10-19 21:00:49 -05:00
}
2020-11-28 23:12:58 +03:00
if (!bIsMyPlayer)
2017-10-19 21:00:49 -05:00
{
2023-05-14 05:49:12 +03:00
PlayerInfoObject.SetBool("muted", EPC.IsPlayerMuted(EPRI.UniqueId));
2017-10-19 21:00:49 -05:00
}
2020-11-28 23:12:58 +03:00
if (class'WorldInfo'.static.IsE3Build())
2017-10-19 21:00:49 -05:00
{
PlayerName = EPRI.PlayerName;
2017-10-19 21:00:49 -05:00
}
else
{
PlayerName = EPRI.PlayerName;
2017-10-19 21:00:49 -05:00
}
PlayerInfoObject.SetString("playerName", PlayerName);
2020-11-28 23:12:58 +03:00
if (class'WorldInfo'.static.IsConsoleBuild(CONSOLE_Orbis))
2017-10-19 21:00:49 -05:00
{
PlayerInfoObject.SetString("profileImageSource", "img://"$KFPC.GetPS4Avatar(PlayerName));
2017-10-19 21:00:49 -05:00
}
else
{
PlayerInfoObject.SetString("profileImageSource", "img://"$KFPC.GetSteamAvatar(EPRI.UniqueId));
2023-05-14 05:49:12 +03:00
}
2020-11-28 23:12:58 +03:00
if (KFGRI != none)
2017-10-19 21:00:49 -05:00
{
PlayerInfoObject.SetBool("ready", EPRI.bReadyToPlay && !KFGRI.bMatchHasBegun);
2017-10-19 21:00:49 -05:00
}
2023-05-14 05:49:12 +03:00
return PlayerInfoObject;
}
2022-09-02 16:08:18 +03:00
defaultproperties
{
2017-10-19 21:00:49 -05:00
}