more readability
This commit is contained in:
parent
f9947ca798
commit
8b15531abd
@ -17,9 +17,9 @@ var KFPlayerController OwnerPC;
|
|||||||
var Color PingColor;
|
var Color PingColor;
|
||||||
var float PingBars,IdealPing,MaxPing;
|
var float PingBars,IdealPing,MaxPing;
|
||||||
|
|
||||||
// Groups
|
// Ranks
|
||||||
var array<PlayerGroupEntry> PlayerGroups;
|
var array<RankInfo> PlayerRanks;
|
||||||
var array<UIDInfoEntry> PlayerInfos;
|
var array<UIDRankRelation> PlayerInfos;
|
||||||
|
|
||||||
var string SystemAdminRank;
|
var string SystemAdminRank;
|
||||||
var ColorRGB SystemAdminColor;
|
var ColorRGB SystemAdminColor;
|
||||||
@ -325,46 +325,46 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
|||||||
local bool bIsZED;
|
local bool bIsZED;
|
||||||
local int Ping;
|
local int Ping;
|
||||||
|
|
||||||
local PlayerGroupEntry Group;
|
local RankInfo CurrentRank;
|
||||||
local bool HasGroup;
|
local bool HasRank;
|
||||||
local int PlayerInfoIndex, PlayerGroupIndex;
|
local int PlayerInfoIndex, PlayerRankIndex;
|
||||||
|
|
||||||
YOffset *= 1.05;
|
YOffset *= 1.05;
|
||||||
KFPRI = KFPRIArray[Index];
|
KFPRI = KFPRIArray[Index];
|
||||||
|
|
||||||
HasGroup = false;
|
HasRank = false;
|
||||||
PlayerInfoIndex = PlayerInfos.Find('UID', KFPRI.UniqueId);
|
PlayerInfoIndex = PlayerInfos.Find('UID', KFPRI.UniqueId);
|
||||||
if (PlayerInfoIndex != INDEX_NONE )
|
if (PlayerInfoIndex != INDEX_NONE )
|
||||||
{
|
{
|
||||||
PlayerGroupIndex = PlayerGroups.Find('ID', PlayerInfos[PlayerInfoIndex].GroupID);
|
PlayerRankIndex = PlayerRanks.Find('ID', PlayerInfos[PlayerInfoIndex].RankID);
|
||||||
if (PlayerGroupIndex != INDEX_NONE)
|
if (PlayerRankIndex != INDEX_NONE)
|
||||||
{
|
{
|
||||||
HasGroup = true;
|
HasRank = true;
|
||||||
Group = PlayerGroups[PlayerGroupIndex];
|
CurrentRank = PlayerRanks[PlayerRankIndex];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (KFPRI.bAdmin)
|
if (KFPRI.bAdmin)
|
||||||
{
|
{
|
||||||
if (!HasGroup || (HasGroup && !Group.OverrideAdminRank))
|
if (!HasRank || (HasRank && !CurrentRank.OverrideAdminRank))
|
||||||
{
|
{
|
||||||
Group.Rank = SystemAdminRank;
|
CurrentRank.Rank = SystemAdminRank;
|
||||||
Group.TextColor = SystemAdminColor;
|
CurrentRank.TextColor = SystemAdminColor;
|
||||||
Group.ApplyColorToFields = SystemAdminApplyColorToFields;
|
CurrentRank.ApplyColorToFields = SystemAdminApplyColorToFields;
|
||||||
HasGroup = true;
|
HasRank = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // Player
|
else // Player
|
||||||
{
|
{
|
||||||
if (!HasGroup)
|
if (!HasRank)
|
||||||
{
|
{
|
||||||
Group.Rank = SystemPlayerRank;
|
CurrentRank.Rank = SystemPlayerRank;
|
||||||
Group.TextColor = SystemPlayerColor;
|
CurrentRank.TextColor = SystemPlayerColor;
|
||||||
Group.ApplyColorToFields = SystemPlayerApplyColorToFields;
|
CurrentRank.ApplyColorToFields = SystemPlayerApplyColorToFields;
|
||||||
HasGroup = true;
|
HasRank = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Now all players belongs to 'Group'
|
// Now all players belongs to 'Rank'
|
||||||
|
|
||||||
if( KFGRI.bVersusGame )
|
if( KFGRI.bVersusGame )
|
||||||
bIsZED = KFTeamInfo_Zeds(KFPRI.Team) != None;
|
bIsZED = KFTeamInfo_Zeds(KFPRI.Team) != None;
|
||||||
@ -436,9 +436,9 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
|||||||
C.SetDrawColor(250,250,250,255);
|
C.SetDrawColor(250,250,250,255);
|
||||||
|
|
||||||
// Rank
|
// Rank
|
||||||
if (Group.ApplyColorToFields.Rank)
|
if (CurrentRank.ApplyColorToFields.Rank)
|
||||||
C.SetDrawColor(Group.TextColor.R,Group.TextColor.G,Group.TextColor.B,255);
|
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255);
|
||||||
S = Group.Rank;
|
S = CurrentRank.Rank;
|
||||||
DrawTextShadowHLeftVCenter(S, RankXPos, TextYOffset, FontScalar);
|
DrawTextShadowHLeftVCenter(S, RankXPos, TextYOffset, FontScalar);
|
||||||
C.SetDrawColor(250,250,250,255);
|
C.SetDrawColor(250,250,250,255);
|
||||||
|
|
||||||
@ -446,8 +446,8 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
|||||||
if( bIsZED )
|
if( bIsZED )
|
||||||
{
|
{
|
||||||
C.SetDrawColor(255,0,0,255);
|
C.SetDrawColor(255,0,0,255);
|
||||||
if (Group.ApplyColorToFields.Perk)
|
if (CurrentRank.ApplyColorToFields.Perk)
|
||||||
C.SetDrawColor(Group.TextColor.R,Group.TextColor.G,Group.TextColor.B,255);
|
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255);
|
||||||
C.SetPos (PerkXPos, YOffset - ((Height-5) * 0.5f));
|
C.SetPos (PerkXPos, YOffset - ((Height-5) * 0.5f));
|
||||||
C.DrawRect (Height-5, Height-5, Texture2D'UI_Widgets.MenuBarWidget_SWF_IF');
|
C.DrawRect (Height-5, Height-5, Texture2D'UI_Widgets.MenuBarWidget_SWF_IF');
|
||||||
|
|
||||||
@ -482,16 +482,16 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
|||||||
}
|
}
|
||||||
|
|
||||||
C.SetDrawColor(250,250,250,255);
|
C.SetDrawColor(250,250,250,255);
|
||||||
if (Group.ApplyColorToFields.Perk)
|
if (CurrentRank.ApplyColorToFields.Perk)
|
||||||
C.SetDrawColor(Group.TextColor.R,Group.TextColor.G,Group.TextColor.B,255);
|
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255);
|
||||||
S = Level@KFPRI.CurrentPerkClass.default.PerkName;
|
S = Level@KFPRI.CurrentPerkClass.default.PerkName;
|
||||||
DrawTextShadowHLeftVCenter(S, PerkXPos, TextYOffset, FontScalar);
|
DrawTextShadowHLeftVCenter(S, PerkXPos, TextYOffset, FontScalar);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
C.SetDrawColor(250,250,250,255);
|
C.SetDrawColor(250,250,250,255);
|
||||||
if (Group.ApplyColorToFields.Perk)
|
if (CurrentRank.ApplyColorToFields.Perk)
|
||||||
C.SetDrawColor(Group.TextColor.R,Group.TextColor.G,Group.TextColor.B,255);
|
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255);
|
||||||
S = "No Perk";
|
S = "No Perk";
|
||||||
DrawTextShadowHLeftVCenter(S, PerkXPos, TextYOffset, FontScalar);
|
DrawTextShadowHLeftVCenter(S, PerkXPos, TextYOffset, FontScalar);
|
||||||
}
|
}
|
||||||
@ -514,8 +514,8 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
|||||||
C.SetDrawColor(250,250,250,255);
|
C.SetDrawColor(250,250,250,255);
|
||||||
|
|
||||||
// Player
|
// Player
|
||||||
if (Group.ApplyColorToFields.Player)
|
if (CurrentRank.ApplyColorToFields.Player)
|
||||||
C.SetDrawColor(Group.TextColor.R,Group.TextColor.G,Group.TextColor.B,255);
|
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255);
|
||||||
if( Len(KFPRI.PlayerName) > 25 )
|
if( Len(KFPRI.PlayerName) > 25 )
|
||||||
S = Left(KFPRI.PlayerName, 25);
|
S = Left(KFPRI.PlayerName, 25);
|
||||||
else S = KFPRI.PlayerName;
|
else S = KFPRI.PlayerName;
|
||||||
@ -524,14 +524,14 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
|||||||
C.SetDrawColor(250,250,250,255);
|
C.SetDrawColor(250,250,250,255);
|
||||||
|
|
||||||
// Kill
|
// Kill
|
||||||
if (Group.ApplyColorToFields.Kills)
|
if (CurrentRank.ApplyColorToFields.Kills)
|
||||||
C.SetDrawColor(Group.TextColor.R,Group.TextColor.G,Group.TextColor.B,255);
|
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255);
|
||||||
DrawTextShadowHVCenter(string (KFPRI.Kills), KillsXPos, TextYOffset, KillsWBox, FontScalar);
|
DrawTextShadowHVCenter(string (KFPRI.Kills), KillsXPos, TextYOffset, KillsWBox, FontScalar);
|
||||||
C.SetDrawColor(250,250,250,255);
|
C.SetDrawColor(250,250,250,255);
|
||||||
|
|
||||||
// Assist
|
// Assist
|
||||||
if (Group.ApplyColorToFields.Assists)
|
if (CurrentRank.ApplyColorToFields.Assists)
|
||||||
C.SetDrawColor(Group.TextColor.R,Group.TextColor.G,Group.TextColor.B,255);
|
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255);
|
||||||
DrawTextShadowHVCenter(string (KFPRI.Assists), AssistXPos, TextYOffset, AssistWBox, FontScalar);
|
DrawTextShadowHVCenter(string (KFPRI.Assists), AssistXPos, TextYOffset, AssistWBox, FontScalar);
|
||||||
C.SetDrawColor(250,250,250,255);
|
C.SetDrawColor(250,250,250,255);
|
||||||
|
|
||||||
@ -546,8 +546,8 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
|||||||
C.SetDrawColor(250, 250, 100, 255);
|
C.SetDrawColor(250, 250, 100, 255);
|
||||||
StrValue = GetNiceSize(int(KFPRI.Score));
|
StrValue = GetNiceSize(int(KFPRI.Score));
|
||||||
}
|
}
|
||||||
if (Group.ApplyColorToFields.Dosh)
|
if (CurrentRank.ApplyColorToFields.Dosh)
|
||||||
C.SetDrawColor(Group.TextColor.R,Group.TextColor.G,Group.TextColor.B,255);
|
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255);
|
||||||
DrawTextShadowHVCenter(StrValue, CashXPos, TextYOffset, CashWBox, FontScalar);
|
DrawTextShadowHVCenter(StrValue, CashXPos, TextYOffset, CashWBox, FontScalar);
|
||||||
|
|
||||||
C.SetDrawColor(250,250,250,255);
|
C.SetDrawColor(250,250,250,255);
|
||||||
@ -585,8 +585,8 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
|||||||
S = string (KFPRI.PlayerHealth) @"HP";
|
S = string (KFPRI.PlayerHealth) @"HP";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Group.ApplyColorToFields.Health)
|
if (CurrentRank.ApplyColorToFields.Health)
|
||||||
C.SetDrawColor(Group.TextColor.R,Group.TextColor.G,Group.TextColor.B,255);
|
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255);
|
||||||
DrawTextShadowHVCenter(S, HealthXPos, TextYOffset, HealthWBox, FontScalar);
|
DrawTextShadowHVCenter(S, HealthXPos, TextYOffset, HealthWBox, FontScalar);
|
||||||
|
|
||||||
C.SetDrawColor(250,250,250,255);
|
C.SetDrawColor(250,250,250,255);
|
||||||
@ -608,8 +608,8 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
|||||||
}
|
}
|
||||||
|
|
||||||
C.TextSize(MaxPing, XL, YL, FontScalar, FontScalar);
|
C.TextSize(MaxPing, XL, YL, FontScalar, FontScalar);
|
||||||
if (Group.ApplyColorToFields.Ping)
|
if (CurrentRank.ApplyColorToFields.Ping)
|
||||||
C.SetDrawColor(Group.TextColor.R,Group.TextColor.G,Group.TextColor.B,255);
|
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255);
|
||||||
DrawTextShadowHVCenter(S, PingXPos, TextYOffset, PingWBox/2, FontScalar);
|
DrawTextShadowHVCenter(S, PingXPos, TextYOffset, PingWBox/2, FontScalar);
|
||||||
C.SetDrawColor(250,250,250,255);
|
C.SetDrawColor(250,250,250,255);
|
||||||
|
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
class PlayerGroups extends Object
|
|
||||||
dependson(Types)
|
|
||||||
config(ScoreboardExt);
|
|
||||||
|
|
||||||
var config array<PlayerGroupEntry> PlayerGroup;
|
|
@ -2,4 +2,4 @@ class PlayerInfos extends Object
|
|||||||
dependson(Types)
|
dependson(Types)
|
||||||
config(ScoreboardExt);
|
config(ScoreboardExt);
|
||||||
|
|
||||||
var config array<PlayerInfoEntry> PlayerInfo;
|
var config array<PlayerRankRelation> PlayerInfo;
|
||||||
|
5
ScoreboardExt/Classes/PlayerRanks.uc
Normal file
5
ScoreboardExt/Classes/PlayerRanks.uc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class PlayerRanks extends Object
|
||||||
|
dependson(Types)
|
||||||
|
config(ScoreboardExt);
|
||||||
|
|
||||||
|
var config array<RankInfo> PlayerRank;
|
@ -1,5 +1,5 @@
|
|||||||
class ScoreboardExtMut extends KFMutator
|
class ScoreboardExtMut extends KFMutator
|
||||||
dependson(PlayerGroups, PlayerInfos)
|
dependson(PlayerRanks, PlayerInfos)
|
||||||
config(ScoreboardExt);
|
config(ScoreboardExt);
|
||||||
|
|
||||||
const SteamIDLen = 17;
|
const SteamIDLen = 17;
|
||||||
@ -17,7 +17,7 @@ struct SClient
|
|||||||
|
|
||||||
var private array<SClient> RepClients;
|
var private array<SClient> RepClients;
|
||||||
|
|
||||||
var private array<UIDInfoEntry> UIDInfos;
|
var private array<UIDRankRelation> UIDInfos;
|
||||||
|
|
||||||
function PostBeginPlay()
|
function PostBeginPlay()
|
||||||
{
|
{
|
||||||
@ -41,9 +41,9 @@ function NotifyLogout(Controller C)
|
|||||||
|
|
||||||
private function InitConfig()
|
private function InitConfig()
|
||||||
{
|
{
|
||||||
local PlayerGroupEntry ExampleGroup;
|
local RankInfo ExampleRank;
|
||||||
local PlayerInfoEntry ExamplePlayer;
|
local PlayerRankRelation ExamplePlayer;
|
||||||
local SteamGroupEntry ExampleSteamGroup;
|
local SteamGroupRankRelation ExampleSteamGroup;
|
||||||
|
|
||||||
// Update from config version to current version if needed
|
// Update from config version to current version if needed
|
||||||
switch (ConfigVersion)
|
switch (ConfigVersion)
|
||||||
@ -52,48 +52,48 @@ private function InitConfig()
|
|||||||
SaveConfig(); // because I want the main settings to be at the beginning of the config :)
|
SaveConfig(); // because I want the main settings to be at the beginning of the config :)
|
||||||
|
|
||||||
// Default admin rank
|
// Default admin rank
|
||||||
class'SystemAdminGroup'.default.Rank = "Admin";
|
class'SystemAdminRank'.default.Rank = "Admin";
|
||||||
class'SystemAdminGroup'.default.TextColor.R = 250;
|
class'SystemAdminRank'.default.TextColor.R = 250;
|
||||||
class'SystemAdminGroup'.default.TextColor.G = 0;
|
class'SystemAdminRank'.default.TextColor.G = 0;
|
||||||
class'SystemAdminGroup'.default.TextColor.B = 0;
|
class'SystemAdminRank'.default.TextColor.B = 0;
|
||||||
|
|
||||||
// Default player rank
|
// Default player rank
|
||||||
class'SystemPlayerGroup'.default.Rank = "Player";
|
class'SystemPlayerRank'.default.Rank = "Player";
|
||||||
class'SystemPlayerGroup'.default.TextColor.R = 250;
|
class'SystemPlayerRank'.default.TextColor.R = 250;
|
||||||
class'SystemPlayerGroup'.default.TextColor.G = 250;
|
class'SystemPlayerRank'.default.TextColor.G = 250;
|
||||||
class'SystemPlayerGroup'.default.TextColor.B = 250;
|
class'SystemPlayerRank'.default.TextColor.B = 250;
|
||||||
|
|
||||||
// Example rank for player(s)
|
// Example rank for player(s)
|
||||||
ExampleGroup.ID = 0;
|
ExampleRank.ID = 0;
|
||||||
ExampleGroup.Rank = "SCE Creator";
|
ExampleRank.Rank = "SCE Creator";
|
||||||
ExampleGroup.TextColor.R = 130;
|
ExampleRank.TextColor.R = 130;
|
||||||
ExampleGroup.TextColor.G = 250;
|
ExampleRank.TextColor.G = 250;
|
||||||
ExampleGroup.TextColor.B = 235;
|
ExampleRank.TextColor.B = 235;
|
||||||
ExampleGroup.OverrideAdminRank = true;
|
ExampleRank.OverrideAdminRank = true;
|
||||||
class'PlayerGroups'.default.PlayerGroup.AddItem(ExampleGroup);
|
class'PlayerRanks'.default.PlayerRank.AddItem(ExampleRank);
|
||||||
|
|
||||||
// Example player
|
// Example player
|
||||||
ExamplePlayer.PlayerID = "76561198001617867"; // GenZmeY SteamID64
|
ExamplePlayer.PlayerID = "76561198001617867"; // GenZmeY SteamID64
|
||||||
ExamplePlayer.GroupID = ExampleGroup.ID;
|
ExamplePlayer.RankID = ExampleRank.ID;
|
||||||
class'PlayerInfos'.default.PlayerInfo.AddItem(ExamplePlayer);
|
class'PlayerInfos'.default.PlayerInfo.AddItem(ExamplePlayer);
|
||||||
|
|
||||||
// Example rank for steam group members
|
// Example rank for steam group members
|
||||||
ExampleGroup.ID = 1;
|
ExampleRank.ID = 1;
|
||||||
ExampleGroup.Rank = "[MSK-GS]";
|
ExampleRank.Rank = "[MSK-GS]";
|
||||||
ExampleGroup.TextColor.R = 130;
|
ExampleRank.TextColor.R = 130;
|
||||||
ExampleGroup.TextColor.G = 250;
|
ExampleRank.TextColor.G = 250;
|
||||||
ExampleGroup.TextColor.B = 130;
|
ExampleRank.TextColor.B = 130;
|
||||||
ExampleGroup.OverrideAdminRank = false;
|
ExampleRank.OverrideAdminRank = false;
|
||||||
class'PlayerGroups'.default.PlayerGroup.AddItem(ExampleGroup);
|
class'PlayerRanks'.default.PlayerRank.AddItem(ExampleRank);
|
||||||
|
|
||||||
// Example steam group
|
// Example steam group
|
||||||
ExampleSteamGroup.SteamGroupID = "103582791465384046"; // MSK-GS SteamID64
|
ExampleSteamGroup.SteamGroupID = "103582791465384046"; // MSK-GS SteamID64
|
||||||
ExampleSteamGroup.GroupID = ExampleGroup.ID;
|
ExampleSteamGroup.RankID = ExampleRank.ID;
|
||||||
class'SteamGroups'.default.SteamGroup.AddItem(ExampleSteamGroup);
|
class'SteamGroups'.default.SteamGroup.AddItem(ExampleSteamGroup);
|
||||||
|
|
||||||
class'SystemAdminGroup'.static.StaticSaveConfig();
|
class'SystemAdminRank'.static.StaticSaveConfig();
|
||||||
class'SystemPlayerGroup'.static.StaticSaveConfig();
|
class'SystemPlayerRank'.static.StaticSaveConfig();
|
||||||
class'PlayerGroups'.static.StaticSaveConfig();
|
class'PlayerRanks'.static.StaticSaveConfig();
|
||||||
class'PlayerInfos'.static.StaticSaveConfig();
|
class'PlayerInfos'.static.StaticSaveConfig();
|
||||||
class'SteamGroups'.static.StaticSaveConfig();
|
class'SteamGroups'.static.StaticSaveConfig();
|
||||||
|
|
||||||
@ -119,15 +119,15 @@ private function InitConfig()
|
|||||||
|
|
||||||
private function LoadGroupPlayers()
|
private function LoadGroupPlayers()
|
||||||
{
|
{
|
||||||
local PlayerInfoEntry Player;
|
local PlayerRankRelation Player;
|
||||||
local OnlineSubsystem steamworks;
|
local OnlineSubsystem steamworks;
|
||||||
local UIDInfoEntry UIDInfo;
|
local UIDRankRelation UIDInfo;
|
||||||
|
|
||||||
steamworks = class'GameEngine'.static.GetOnlineSubsystem();
|
steamworks = class'GameEngine'.static.GetOnlineSubsystem();
|
||||||
|
|
||||||
foreach class'PlayerInfos'.default.PlayerInfo(Player)
|
foreach class'PlayerInfos'.default.PlayerInfo(Player)
|
||||||
{
|
{
|
||||||
UIDInfo.GroupID = Player.GroupID;
|
UIDInfo.RankID = Player.RankID;
|
||||||
if (Len(Player.PlayerID) == UniqueIDLen && steamworks.StringToUniqueNetId(Player.PlayerID, UIDInfo.UID))
|
if (Len(Player.PlayerID) == UniqueIDLen && steamworks.StringToUniqueNetId(Player.PlayerID, UIDInfo.UID))
|
||||||
{
|
{
|
||||||
if (UIDInfos.Find('Uid', UIDInfo.UID) == INDEX_NONE)
|
if (UIDInfos.Find('Uid', UIDInfo.UID) == INDEX_NONE)
|
||||||
@ -157,13 +157,13 @@ function AddPlayerInfo(Controller C)
|
|||||||
RepClients.AddItem(RepClient);
|
RepClients.AddItem(RepClient);
|
||||||
|
|
||||||
RepClient.RepInfo.PlayerInfos = UIDInfos;
|
RepClient.RepInfo.PlayerInfos = UIDInfos;
|
||||||
RepClient.RepInfo.PlayerGroups = class'PlayerGroups'.default.PlayerGroup;
|
RepClient.RepInfo.PlayerRanks = class'PlayerRanks'.default.PlayerRank;
|
||||||
RepClient.RepInfo.SystemAdminRank = class'SystemAdminGroup'.default.Rank;
|
RepClient.RepInfo.SystemAdminRank = class'SystemAdminRank'.default.Rank;
|
||||||
RepClient.RepInfo.SystemAdminColor = class'SystemAdminGroup'.default.TextColor;
|
RepClient.RepInfo.SystemAdminColor = class'SystemAdminRank'.default.TextColor;
|
||||||
RepClient.RepInfo.SystemAdminApplyColorToFields = class'SystemAdminGroup'.default.ApplyColorToFields;
|
RepClient.RepInfo.SystemAdminApplyColorToFields = class'SystemAdminRank'.default.ApplyColorToFields;
|
||||||
RepClient.RepInfo.SystemPlayerRank = class'SystemPlayerGroup'.default.Rank;
|
RepClient.RepInfo.SystemPlayerRank = class'SystemPlayerRank'.default.Rank;
|
||||||
RepClient.RepInfo.SystemPlayerColor = class'SystemPlayerGroup'.default.TextColor;
|
RepClient.RepInfo.SystemPlayerColor = class'SystemPlayerRank'.default.TextColor;
|
||||||
RepClient.RepInfo.SystemPlayerApplyColorToFields = class'SystemPlayerGroup'.default.ApplyColorToFields;
|
RepClient.RepInfo.SystemPlayerApplyColorToFields = class'SystemPlayerRank'.default.ApplyColorToFields;
|
||||||
|
|
||||||
RepClient.RepInfo.ClientStartReplication();
|
RepClient.RepInfo.ClientStartReplication();
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
class ScoreboardExtRepInfo extends ReplicationInfo;
|
class ScoreboardExtRepInfo extends ReplicationInfo;
|
||||||
|
|
||||||
var public array<UIDInfoEntry> PlayerInfos;
|
var public array<UIDRankRelation> PlayerInfos;
|
||||||
var public array<PlayerGroupEntry> PlayerGroups;
|
var public array<RankInfo> PlayerRanks;
|
||||||
|
|
||||||
var public string SystemAdminRank;
|
var public string SystemAdminRank;
|
||||||
var public ColorRGB SystemAdminColor;
|
var public ColorRGB SystemAdminColor;
|
||||||
@ -11,12 +11,12 @@ var public string SystemPlayerRank;
|
|||||||
var public ColorRGB SystemPlayerColor;
|
var public ColorRGB SystemPlayerColor;
|
||||||
var public Fields SystemPlayerApplyColorToFields;
|
var public Fields SystemPlayerApplyColorToFields;
|
||||||
|
|
||||||
var private bool SystemFinished, GroupsFinished, InfosFinished;
|
var private bool InitFinished, RanksFinished, InfosFinished;
|
||||||
var private int InfosReplicateProgress, GroupsReplicateProgress;
|
var private int InfosReplicateProgress, RanksReplicateProgress;
|
||||||
|
|
||||||
var private KFScoreBoard SC;
|
var private KFScoreBoard SC;
|
||||||
|
|
||||||
public final function ClientStartReplication()
|
public function ClientStartReplication()
|
||||||
{
|
{
|
||||||
GetScoreboard();
|
GetScoreboard();
|
||||||
|
|
||||||
@ -28,25 +28,25 @@ public final function ClientStartReplication()
|
|||||||
SystemPlayerColor,
|
SystemPlayerColor,
|
||||||
SystemPlayerApplyColorToFields);
|
SystemPlayerApplyColorToFields);
|
||||||
|
|
||||||
SetTimer(0.01f, true, nameof(ClientReplicateGroups));
|
SetTimer(0.01f, true, nameof(ClientReplicateRanks));
|
||||||
SetTimer(0.01f, true, nameof(ClientReplicateInfos));
|
SetTimer(0.01f, true, nameof(ClientReplicateInfos));
|
||||||
}
|
}
|
||||||
|
|
||||||
public final function ClientReplicateGroups()
|
public function ClientReplicateRanks()
|
||||||
{
|
{
|
||||||
if (GroupsReplicateProgress < PlayerGroups.Length)
|
if (RanksReplicateProgress < PlayerRanks.Length)
|
||||||
{
|
{
|
||||||
ClientAddPlayerGroup(PlayerGroups[GroupsReplicateProgress]);
|
ClientAddPlayerRank(PlayerRanks[RanksReplicateProgress]);
|
||||||
++GroupsReplicateProgress;
|
++RanksReplicateProgress;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClearTimer(nameof(ClientReplicateGroups));
|
ClearTimer(nameof(ClientReplicateRanks));
|
||||||
GroupReplicationFinished();
|
RankReplicationFinished();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final function ClientReplicateInfos()
|
public function ClientReplicateInfos()
|
||||||
{
|
{
|
||||||
if (InfosReplicateProgress < PlayerInfos.Length)
|
if (InfosReplicateProgress < PlayerInfos.Length)
|
||||||
{
|
{
|
||||||
@ -60,7 +60,7 @@ public final function ClientReplicateInfos()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private reliable client final function GetScoreboard()
|
private reliable client function GetScoreboard()
|
||||||
{
|
{
|
||||||
if (SC != None)
|
if (SC != None)
|
||||||
{
|
{
|
||||||
@ -72,29 +72,29 @@ private reliable client final function GetScoreboard()
|
|||||||
SetTimer(0.1f, false, nameof(GetScoreboard));
|
SetTimer(0.1f, false, nameof(GetScoreboard));
|
||||||
}
|
}
|
||||||
|
|
||||||
private reliable client final function ClientAddPlayerGroup(PlayerGroupEntry Group)
|
private reliable client function ClientAddPlayerRank(RankInfo Rank)
|
||||||
{
|
{
|
||||||
PlayerGroups.AddItem(Group);
|
PlayerRanks.AddItem(Rank);
|
||||||
}
|
}
|
||||||
|
|
||||||
private reliable client final function ClientAddPlayerInfo(UIDInfoEntry PlayerInfo)
|
private reliable client function ClientAddPlayerInfo(UIDRankRelation PlayerInfo)
|
||||||
{
|
{
|
||||||
PlayerInfos.AddItem(PlayerInfo);
|
PlayerInfos.AddItem(PlayerInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private reliable client final function GroupReplicationFinished()
|
private reliable client function RankReplicationFinished()
|
||||||
{
|
{
|
||||||
GroupsFinished = true;
|
RanksFinished = true;
|
||||||
ClientGroupsApply();
|
ClientRanksApply();
|
||||||
}
|
}
|
||||||
|
|
||||||
private reliable client final function InfosReplicationFinished()
|
private reliable client function InfosReplicationFinished()
|
||||||
{
|
{
|
||||||
InfosFinished = true;
|
InfosFinished = true;
|
||||||
ClientInfosApply();
|
ClientInfosApply();
|
||||||
}
|
}
|
||||||
|
|
||||||
private reliable client final function ClientInitSystem(
|
private reliable client function ClientInitSystem(
|
||||||
string _SystemAdminRank,
|
string _SystemAdminRank,
|
||||||
ColorRGB _SystemAdminColor,
|
ColorRGB _SystemAdminColor,
|
||||||
Fields _SystemAdminApplyColorToFields,
|
Fields _SystemAdminApplyColorToFields,
|
||||||
@ -112,7 +112,7 @@ private reliable client final function ClientInitSystem(
|
|||||||
ClientSystemApply();
|
ClientSystemApply();
|
||||||
}
|
}
|
||||||
|
|
||||||
private reliable client final function ClientSystemApply()
|
private reliable client function ClientSystemApply()
|
||||||
{
|
{
|
||||||
if (SC == None)
|
if (SC == None)
|
||||||
{
|
{
|
||||||
@ -127,24 +127,24 @@ private reliable client final function ClientSystemApply()
|
|||||||
SC.SystemPlayerColor = SystemPlayerColor;
|
SC.SystemPlayerColor = SystemPlayerColor;
|
||||||
SC.SystemPlayerApplyColorToFields = SystemPlayerApplyColorToFields;
|
SC.SystemPlayerApplyColorToFields = SystemPlayerApplyColorToFields;
|
||||||
|
|
||||||
SystemFinished = true;
|
InitFinished = true;
|
||||||
Finished();
|
Finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
private reliable client final function ClientGroupsApply()
|
private reliable client function ClientRanksApply()
|
||||||
{
|
{
|
||||||
if (SC == None)
|
if (SC == None)
|
||||||
{
|
{
|
||||||
SetTimer(0.1f, false, nameof(ClientGroupsApply));
|
SetTimer(0.1f, false, nameof(ClientRanksApply));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SC.PlayerGroups = PlayerGroups;
|
SC.PlayerRanks = PlayerRanks;
|
||||||
GroupsFinished = true;
|
RanksFinished = true;
|
||||||
Finished();
|
Finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
private reliable client final function ClientInfosApply()
|
private reliable client function ClientInfosApply()
|
||||||
{
|
{
|
||||||
if (SC == None)
|
if (SC == None)
|
||||||
{
|
{
|
||||||
@ -153,22 +153,22 @@ private reliable client final function ClientInfosApply()
|
|||||||
}
|
}
|
||||||
|
|
||||||
SC.PlayerInfos = PlayerInfos;
|
SC.PlayerInfos = PlayerInfos;
|
||||||
GroupsFinished = true;
|
RanksFinished = true;
|
||||||
Finished();
|
Finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
private reliable client final function Finished()
|
private reliable client function Finished()
|
||||||
{
|
{
|
||||||
if (SystemFinished && GroupsFinished && InfosFinished)
|
if (InitFinished && RanksFinished && InfosFinished)
|
||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
InfosReplicateProgress=0
|
InfosReplicateProgress=0
|
||||||
GroupsReplicateProgress=0
|
RanksReplicateProgress=0
|
||||||
|
|
||||||
SystemFinished=false
|
InitFinished=false
|
||||||
GroupsFinished=false
|
RanksFinished=false
|
||||||
InfosFinished=false
|
InfosFinished=false
|
||||||
}
|
}
|
@ -2,7 +2,7 @@ class SteamGroups extends Object
|
|||||||
dependson(Types)
|
dependson(Types)
|
||||||
config(ScoreboardExt);
|
config(ScoreboardExt);
|
||||||
|
|
||||||
var config array<SteamGroupEntry> SteamGroup;
|
var config array<SteamGroupRankRelation> SteamGroup;
|
||||||
|
|
||||||
DefaultProperties
|
DefaultProperties
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
class SystemAdminGroup extends Object
|
class SystemAdminRank extends Object
|
||||||
dependson(Types)
|
dependson(Types)
|
||||||
config(ScoreboardExt);
|
config(ScoreboardExt);
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
class SystemPlayerGroup extends Object
|
class SystemPlayerRank extends Object
|
||||||
dependson(Types)
|
dependson(Types)
|
||||||
config(ScoreboardExt);
|
config(ScoreboardExt);
|
||||||
|
|
@ -49,7 +49,7 @@ struct Fields
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PlayerGroupEntry
|
struct RankInfo
|
||||||
{
|
{
|
||||||
var int ID;
|
var int ID;
|
||||||
var string Rank;
|
var string Rank;
|
||||||
@ -58,20 +58,20 @@ struct PlayerGroupEntry
|
|||||||
var Fields ApplyColorToFields;
|
var Fields ApplyColorToFields;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SteamGroupEntry
|
struct SteamGroupRankRelation
|
||||||
{
|
{
|
||||||
var string SteamGroupID;
|
var string SteamGroupID;
|
||||||
var int GroupID;
|
var int RankID;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PlayerInfoEntry
|
struct PlayerRankRelation
|
||||||
{
|
{
|
||||||
var string PlayerID;
|
var string PlayerID;
|
||||||
var int GroupID;
|
var int RankID;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct UIDInfoEntry
|
struct UIDRankRelation
|
||||||
{
|
{
|
||||||
var UniqueNetId UID;
|
var UniqueNetId UID;
|
||||||
var int GroupID;
|
var int RankID;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user