add logger

This commit is contained in:
GenZmeY 2021-06-12 23:11:37 +03:00
parent 9d18ad1f39
commit 7cbf4833db
57 changed files with 320 additions and 35 deletions

2
ScoreboardExt/Build.uci Normal file
View File

@ -0,0 +1,2 @@
`define bEnableCallstack true
`define CurrentVersion 1

View File

@ -1,5 +1,8 @@
Class ClassicStyle extends KF2Style;
`include(Build.uci)
`include(Logger.uci)
function RenderFramedWindow( KFGUI_FloatingWindow P )
{
local int XS,YS,TitleHeight;

View File

@ -2,4 +2,7 @@ class CustomRanks extends Object
dependson(Types)
config(ScoreboardExt);
`include(Build.uci)
`include(Logger.uci)
var config array<RankInfo> Rank;

View File

@ -2,6 +2,9 @@ class DynamicLevelColor extends Object
dependson(Types)
config(ScoreboardExt);
`include(Build.uci)
`include(Logger.uci)
var config bool bEnabled;
var config int Normal_Low;
var config int Normal_High;
@ -15,6 +18,9 @@ var config int HellOnEarth_High;
public static function SCESettingsLevel DefaultSettings()
{
local SCESettingsLevel Settings;
`callstack_static("DefaultSettings");
return Settings;
}
@ -22,6 +28,8 @@ public static function SCESettingsLevel Settings()
{
local SCESettingsLevel Settings;
`callstack_static("Settings");
Settings.Dynamic = default.bEnabled;
Settings.Low[0] = default.Normal_Low;
Settings.High[0] = default.Normal_High;
@ -37,6 +45,8 @@ public static function SCESettingsLevel Settings()
public static function WriteSettings(SCESettingsLevel Settings)
{
`callstack_static("WriteSettings");
default.bEnabled = Settings.Dynamic;
default.Normal_Low = Settings.Low[0];
default.Normal_High = Settings.High[0];

View File

@ -2,6 +2,9 @@ class DynamicPingColor extends Object
dependson(Types)
config(ScoreboardExt);
`include(Build.uci)
`include(Logger.uci)
var config bool bEnabled;
var config int Low;
var config int High;
@ -10,6 +13,9 @@ var config bool bShowPingBars;
public static function SCESettingsPing DefaultSettings()
{
local SCESettingsPing Settings;
`callstack_static("DefaultSettings");
return Settings;
}
@ -17,6 +23,8 @@ public static function SCESettingsPing Settings()
{
local SCESettingsPing Settings;
`callstack_static("Settings");
Settings.Dynamic = default.bEnabled;
Settings.Low = default.Low;
Settings.High = default.High;
@ -27,6 +35,8 @@ public static function SCESettingsPing Settings()
public static function WriteSettings(SCESettingsPing Settings)
{
`callstack_static("WriteSettings");
default.bEnabled = Settings.Dynamic;
default.Low = Settings.Low;
default.High = Settings.High;

View File

@ -2,6 +2,9 @@ class DynamicStateColor extends Object
dependson(Types)
config(ScoreboardExt);
`include(Build.uci)
`include(Logger.uci)
var config bool bEnabled;
var config int Low;
var config int High;
@ -9,6 +12,9 @@ var config int High;
public static function SCESettingsState DefaultSettings()
{
local SCESettingsState Settings;
`callstack_static("DefaultSettings");
return Settings;
}
@ -16,6 +22,8 @@ public static function SCESettingsState Settings()
{
local SCESettingsState Settings;
`callstack_static("Settings");
Settings.Dynamic = default.bEnabled;
Settings.Low = default.Low;
Settings.High = default.High;
@ -25,6 +33,8 @@ public static function SCESettingsState Settings()
public static function WriteSettings(SCESettingsState Settings)
{
`callstack_static("WriteSettings");
default.bEnabled = Settings.Dynamic;
default.Low = Settings.Low;
default.High = Settings.High;

View File

@ -1,6 +1,9 @@
Class GUIStyleBase extends Object
abstract;
`include(Build.uci)
`include(Logger.uci)
var Texture2D ItemTex;
var array<Texture2D> BorderTextures, ArrowTextures, ButtonTextures, TabTextures, ItemBoxTextures, PerkBox, CheckBoxTextures, ProgressBarTextures, SliderTextures;
var Texture2D ScrollTexture,FavoriteIcon,BankNoteIcon;

View File

@ -1,6 +1,9 @@
Class KF2GUIController extends Info
transient;
`include(Build.uci)
`include(Logger.uci)
var() class<GUIStyleBase> DefaultStyle;
var PlayerController PlayerOwner;

View File

@ -1,6 +1,10 @@
// Input while in a menu.
class KF2GUIInput extends KFPlayerInput;
`include(Build.uci)
`include(Logger.uci)
var KF2GUIController ControllerOwner;
var PlayerInput BaseInput;

View File

@ -1,5 +1,8 @@
Class KF2Style extends GUIStyleBase;
`include(Build.uci)
`include(Logger.uci)
var Texture2D LoadedTex[2];
const TOOLTIP_BORDER=4;

View File

@ -2,6 +2,10 @@
class KFColorHelper extends Object
transient;
`include(Build.uci)
`include(Logger.uci)
struct HSVColour
{
var() float H, S, V, A;

View File

@ -1,6 +1,9 @@
// Ugly hack to draw ontop of flash UI!
Class KFGUIConsoleHack extends Console;
`include(Build.uci)
`include(Logger.uci)
var KF2GUIController OutputObject;
function PostRender_Console(Canvas Canvas)

View File

@ -2,6 +2,10 @@
Class KFGUI_Base extends Object
abstract;
`include(Build.uci)
`include(Logger.uci)
var KF2GUIController Owner;
var ScoreboardExtHUD HUDOwner;
var KFGUI_Base ParentComponent; // Parent component if any.

View File

@ -1,5 +1,9 @@
Class KFGUI_Button extends KFGUI_Clickable;
`include(Build.uci)
`include(Logger.uci)
var() Canvas.CanvasIcon OverlayTexture;
var() string ButtonText,GamepadButtonName;
var() color TextColor;

View File

@ -1,5 +1,9 @@
class KFGUI_CategoryButton extends KFGUI_Button;
`include(Build.uci)
`include(Logger.uci)
var transient bool bOpened;
var Texture2D Icon;
var Color IconColor;

View File

@ -1,5 +1,9 @@
class KFGUI_CategoryList extends KFGUI_ComponentList;
`include(Build.uci)
`include(Logger.uci)
// Broken, does not work correctly when closing a menu and re-opening it if a category is open
struct FCategoryItems
{

View File

@ -1,5 +1,9 @@
Class KFGUI_CheckBox extends KFGUI_EditControl;
`include(Build.uci)
`include(Logger.uci)
var() Texture CheckMark,CheckDisabled,CheckIdle,CheckFocus,CheckClicked;
var() bool bForceUniform,bChecked;

View File

@ -1,6 +1,10 @@
Class KFGUI_Clickable extends KFGUI_Base
abstract;
`include(Build.uci)
`include(Logger.uci)
var() int IntIndex; // More user variables.
var() string ToolTip;

View File

@ -1,5 +1,8 @@
class KFGUI_ColorSlider extends KFGUI_MultiComponent;
`include(Build.uci)
`include(Logger.uci)
var KFGUI_Slider RSlider,GSlider,BSlider,ASlider;
var KFGUI_TextLable TextLable,RedLabel,GreenLabel,BlueLabel,AlphaLabel,RedValue,GreenValue,BlueValue,AlphaValue;
var KFGUI_ComponentList SettingsBox;

View File

@ -1,6 +1,9 @@
// Columned list box (only for text lines).
Class KFGUI_ColumnList extends KFGUI_List;
`include(Build.uci)
`include(Logger.uci)
struct FColumnItem
{
var() string Text;

View File

@ -1,6 +1,9 @@
// Do not use this on your own, it is used by ColumnList
Class KFGUI_ColumnTop extends KFGUI_Base;
`include(Build.uci)
`include(Logger.uci)
var() float ColumnMinSize; // Minimum pixels width allowed.
var KFGUI_ColumnList ListOwner;

View File

@ -1,5 +1,8 @@
Class KFGUI_ComboBox extends KFGUI_EditControl;
`include(Build.uci)
`include(Logger.uci)
var KFGUI_ComboSelector Selection;
var float BorderSize;

View File

@ -1,5 +1,8 @@
Class KFGUI_ComboSelector extends KFGUI_Clickable;
`include(Build.uci)
`include(Logger.uci)
var KFGUI_ComboBox Combo;
var int CurrentRow,OldRow;

View File

@ -1,6 +1,9 @@
// List box with components as items.
Class KFGUI_ComponentList extends KFGUI_List;
`include(Build.uci)
`include(Logger.uci)
var int VisRange[2];
var() int NumColumns;
var array<KFGUI_Base> ItemComponents;

View File

@ -1,5 +1,8 @@
Class KFGUI_EditBox extends KFGUI_Clickable;
`include(Build.uci)
`include(Logger.uci)
var enum eTextCase
{
TXTC_None,

View File

@ -1,5 +1,8 @@
Class KFGUI_EditControl extends KFGUI_Clickable;
`include(Build.uci)
`include(Logger.uci)
var export editinline KFGUI_TextLable TextLable;
var transient float TextHeight,TextScale;
var transient Font TextFont;

View File

@ -1,6 +1,9 @@
Class KFGUI_FloatingWindow extends KFGUI_Page
abstract;
`include(Build.uci)
`include(Logger.uci)
var() string WindowTitle; // Title of this window.
var float DragOffset[2], OpenAnimSpeed;
var KFGUI_FloatingWindowHeader HeaderComp;

View File

@ -1,5 +1,8 @@
Class KFGUI_FloatingWindowHeader extends KFGUI_Base;
`include(Build.uci)
`include(Logger.uci)
var bool bDragWindow;
function PreDraw()

View File

@ -1,5 +1,8 @@
Class KFGUI_Frame extends KFGUI_FloatingWindow;
`include(Build.uci)
`include(Logger.uci)
var() float EdgeSize[4]; // Pixels wide for edges (left, top, right, bottom).
var() float HeaderSize[2]; // Pixels wide for edges (left, top).
var() Texture FrameTex;

View File

@ -1,5 +1,8 @@
Class KFGUI_Image extends KFGUI_Base;
`include(Build.uci)
`include(Logger.uci)
var enum eImageStyle
{
ISTY_Normal,

View File

@ -1,6 +1,9 @@
// List box with custom render code for the items.
Class KFGUI_List extends KFGUI_MultiComponent;
`include(Build.uci)
`include(Logger.uci)
var() bool bDrawBackground, bHideScrollbar, bUseFocusSound;
var() protectedwrite int ListCount;
var() int ListItemsPerPage;

View File

@ -1,5 +1,8 @@
Class KFGUI_ListHorz extends KFGUI_MultiComponent;
`include(Build.uci)
`include(Logger.uci)
var() bool bDrawBackground, bHideScrollbar, bUseFocusSound;
var() protected int ListCount;
var() int ListItemsPerPage;

View File

@ -1,6 +1,9 @@
Class KFGUI_ListItem extends Object
transient;
`include(Build.uci)
`include(Logger.uci)
var KFGUI_ListItem Next;
var array<string> Columns,SortColumns;
var int Index,Value;

View File

@ -1,5 +1,8 @@
Class KFGUI_MultiComponent extends KFGUI_Base;
`include(Build.uci)
`include(Logger.uci)
var() export editinline array<KFGUI_Base> Components;
function InitMenu()

View File

@ -1,6 +1,9 @@
Class KFGUI_Page extends KFGUI_MultiComponent
abstract;
`include(Build.uci)
`include(Logger.uci)
var() byte FrameOpacity; // Transperancy of the frame.
var() bool bPersistant, // Reuse the same menu object throughout the level.
bUnique, // If calling OpenMenu multiple times with same menu class, only open one instance of it.

View File

@ -1,5 +1,8 @@
class KFGUI_ProgressBar extends KFGUI_Base;
`include(Build.uci)
`include(Logger.uci)
var Texture BarBack;
var Texture BarTop;
var Color BarColor;

View File

@ -1,5 +1,8 @@
Class KFGUI_RightClickMenu extends KFGUI_Clickable;
`include(Build.uci)
`include(Logger.uci)
struct FRowItem
{
var string Text,ToolTip;

View File

@ -1,6 +1,9 @@
Class KFGUI_ScrollBarBase extends KFGUI_Clickable
abstract;
`include(Build.uci)
`include(Logger.uci)
var() int MinRange,MaxRange,ScrollStride,PageStep;
var() float ButtonScale; // Button width (scaled by default font height).
var int CurrentScroll;

View File

@ -1,5 +1,8 @@
Class KFGUI_ScrollBarH extends KFGUI_ScrollBarBase;
`include(Build.uci)
`include(Logger.uci)
defaultproperties
{
bVertical=false

View File

@ -1,5 +1,8 @@
Class KFGUI_ScrollBarV extends KFGUI_ScrollBarBase;
`include(Build.uci)
`include(Logger.uci)
defaultproperties
{
bVertical=true

View File

@ -1,5 +1,8 @@
class KFGUI_Slider extends KFGUI_MultiComponent;
`include(Build.uci)
`include(Logger.uci)
var KFGUI_ScrollBarH ScrollBar;
var int MinValue,MaxValue;

View File

@ -1,6 +1,9 @@
// Same as SwitchComponent, but with buttons.
Class KFGUI_SwitchMenuBar extends KFGUI_MultiComponent;
`include(Build.uci)
`include(Logger.uci)
var array<KFGUI_Base> SubPages;
var() byte ButtonPosition; // 0 = top, 1 = bottom, 2 = left, 3 = right
var() float BorderWidth,ButtonAxisSize; // Width for buttons.

View File

@ -1,5 +1,8 @@
Class KFGUI_TextField extends KFGUI_MultiComponent;
`include(Build.uci)
`include(Logger.uci)
enum ETextFieldStyles
{
TEXT_FIELD_NONE,

View File

@ -1,5 +1,8 @@
Class KFGUI_TextLable extends KFGUI_Base;
`include(Build.uci)
`include(Logger.uci)
var() protected string Text;
var() color TextColor;
var() Canvas.FontRenderInfo TextFontInfo;

View File

@ -1,5 +1,8 @@
Class KFGUI_TextScroll extends KFGUI_TextField;
`include(Build.uci)
`include(Logger.uci)
var float ScrollSpeed;
var transient float CharStartTime;

View File

@ -1,5 +1,8 @@
Class KFGUI_Tooltip extends KFGUI_Base;
`include(Build.uci)
`include(Logger.uci)
var() array<string> Lines;
var() Canvas.FontRenderInfo TextFontInfo;
var byte CurrentAlpha;

View File

@ -1,6 +1,9 @@
class KFScoreBoard extends KFGUI_Page
dependson(Types);
`include(Build.uci)
`include(Logger.uci)
var transient float RankXPos, PerkXPos, PlayerXPos, HealthXPos, TimeXPos, KillsXPos, AssistXPos, CashXPos, DeathXPos, PingXPos;
var transient float StatusWBox, PlayerWBox, PerkWBox, CashWBox, KillsWBox, AssistWBox, HealthWBox, PingWBox;
var transient float NextScoreboardRefresh;

View File

@ -2,4 +2,7 @@ class PlayerRankRelations extends Object
dependson(Types)
config(ScoreboardExt);
`include(Build.uci)
`include(Logger.uci)
var config array<RankRelation> Relation;

View File

@ -1,6 +1,9 @@
class ScoreboardExtHUD extends KFGFxHudWrapper
config(ScoreboardExtMut);
`include(Build.uci)
`include(Logger.uci)
const HUDBorderSize = 3;
var float ScaledBorderSize;

View File

@ -2,10 +2,8 @@ class ScoreboardExtMut extends KFMutator
dependson(Types)
config(ScoreboardExt);
const SteamIDLen = 17;
const UniqueIDLen = 18;
const CurrentVersion = 1;
`include(Build.uci)
`include(Logger.uci)
var config int ConfigVersion;
@ -25,6 +23,8 @@ var private SCESettings Settings;
function PostBeginPlay()
{
`callstack();
Super.PostBeginPlay();
WorldInfo.Game.HUDType = class'ScoreboardExtHUD';
@ -44,22 +44,35 @@ function PostBeginPlay()
function NotifyLogin(Controller C)
{
`callstack();
AddPlayer(C);
Super.NotifyLogin(C);
}
function NotifyLogout(Controller C)
{
`callstack();
RemovePlayer(C);
Super.NotifyLogout(C);
}
private function bool IsUID(String ID)
{
`callstack();
return (Left(ID, 2) ~= "0x");
}
private function InitConfig()
{
local RankInfo ExampleRank;
local RankRelation ExamplePlayer;
local RankRelation ExampleSteamGroup;
`callstack();
// Update from config version to current version if needed
switch (ConfigVersion)
{
@ -106,23 +119,23 @@ private function InitConfig()
class'SteamGroupRankRelations'.static.StaticSaveConfig();
case 2147483647:
`log("[ScoreboardExt] Config updated to version"@CurrentVersion);
`info("Config updated to version"@`CurrentVersion);
break;
case CurrentVersion:
`log("[ScoreboardExt] Config is up-to-date");
case `CurrentVersion:
`info("Config is up-to-date");
break;
default:
`log("[ScoreboardExt] Warn: The config version is higher than the current version (are you using an old mutator?)");
`log("[ScoreboardExt] Warn: Config version is"@ConfigVersion@"but current version is"@CurrentVersion);
`log("[ScoreboardExt] Warn: The config version will be changed to "@CurrentVersion);
`warning("The config version is higher than the current version (are you using an old mutator?)");
`warning("Config version is"@ConfigVersion@"but current version is"@`CurrentVersion);
`warning("The config version will be changed to "@`CurrentVersion);
break;
}
if (ConfigVersion != CurrentVersion)
if (ConfigVersion != `CurrentVersion)
{
ConfigVersion = CurrentVersion;
ConfigVersion = `CurrentVersion;
SaveConfig();
}
}
@ -132,31 +145,38 @@ private function LoadRelations()
local RankRelation Player, SteamGroup;
local UIDRankRelation UIDInfo;
`callstack();
foreach class'PlayerRankRelations'.default.Relation(Player)
{
UIDInfo.RankID = Player.RankID;
if (Len(Player.ObjectID) == UniqueIDLen && Steamworks.StringToUniqueNetId(Player.ObjectID, UIDInfo.UID))
if (IsUID(Player.ObjectID) && Steamworks.StringToUniqueNetId(Player.ObjectID, UIDInfo.UID))
{
if (UIDRankRelationsPlayers.Find('Uid', UIDInfo.UID) == INDEX_NONE)
UIDRankRelationsPlayers.AddItem(UIDInfo);
}
else if (Len(Player.ObjectID) == SteamIDLen && Steamworks.Int64ToUniqueNetId(Player.ObjectID, UIDInfo.UID))
else if (Steamworks.Int64ToUniqueNetId(Player.ObjectID, UIDInfo.UID))
{
if (UIDRankRelationsPlayers.Find('Uid', UIDInfo.UID) == INDEX_NONE)
UIDRankRelationsPlayers.AddItem(UIDInfo);
}
else `Log("[ScoreboardExt] WARN: Can't add player:"@Player.ObjectID);
else `warning("Can't add player:"@Player.ObjectID);
}
foreach class'SteamGroupRankRelations'.default.Relation(SteamGroup)
{
UIDInfo.RankID = SteamGroup.RankID;
if (Steamworks.Int64ToUniqueNetId(SteamGroup.ObjectID, UIDInfo.UID))
if (IsUID(SteamGroup.ObjectID) && Steamworks.StringToUniqueNetId(SteamGroup.ObjectID, UIDInfo.UID))
{
if (UIDRankRelationsPlayers.Find('Uid', UIDInfo.UID) == INDEX_NONE)
UIDRankRelationsPlayers.AddItem(UIDInfo);
}
else if (Steamworks.Int64ToUniqueNetId(SteamGroup.ObjectID, UIDInfo.UID))
{
if (UIDRankRelationsSteamGroups.Find('Uid', UIDInfo.UID) == INDEX_NONE)
UIDRankRelationsSteamGroups.AddItem(UIDInfo);
}
else `Log("[ScoreboardExt] WARN: Can't add steamgroup:"@SteamGroup.ObjectID);
else `warning("Can't add steamgroup:"@SteamGroup.ObjectID);
}
}
@ -164,31 +184,34 @@ private function AddPlayer(Controller C)
{
local KFPlayerController KFPC;
local UIDRankRelation Relation;
local SClient RepClient;
local SClient RepClient, RepClientNew;
`callstack();
KFPC = KFPlayerController(C);
if (KFPC == None)
return;
RepClient.KFPC = KFPC;
RepClient.RepInfo = Spawn(class'ScoreboardExtRepInfo', KFPC);
RepClient.RepInfo.Mut = Self;
RepClient.RepInfo.CustomRanks = class'CustomRanks'.default.Rank;
RepClient.RepInfo.SteamGroupRelations = UIDRankRelationsSteamGroups;
RepClient.RepInfo.Settings = Settings;
RepClient.RepInfo.RankRelation.UID = KFPC.PlayerReplicationInfo.UniqueId;
RepClient.RepInfo.RankRelation.RankID = UIDRankRelationsPlayers.Find('UID', RepClient.RepInfo.RankRelation.UID);
RepClientNew.KFPC = KFPC;
RepClientNew.RepInfo = Spawn(class'ScoreboardExtRepInfo', KFPC);
RepClientNew.RepInfo.Mut = Self;
RepClientNew.RepInfo.CustomRanks = class'CustomRanks'.default.Rank;
RepClientNew.RepInfo.SteamGroupRelations = UIDRankRelationsSteamGroups;
RepClientNew.RepInfo.Settings = Settings;
RepClientNew.RepInfo.RankRelation.UID = KFPC.PlayerReplicationInfo.UniqueId;
RepClientNew.RepInfo.RankRelation.RankID = UIDRankRelationsPlayers.Find('UID', RepClientNew.RepInfo.RankRelation.UID);
UIDRankRelationsActive.AddItem(RepClient.RepInfo.RankRelation);
UIDRankRelationsActive.AddItem(RepClientNew.RepInfo.RankRelation);
RepClients.AddItem(RepClient);
RepClients.AddItem(RepClientNew);
// хуйня
foreach UIDRankRelationsActive(Relation)
foreach RepClients(RepClient)
foreach UIDRankRelationsActive(Relation) // For this player
RepClientNew.RepInfo.AddRankRelation(Relation);
RepClientNew.RepInfo.StartFirstTimeReplication();
foreach RepClients(RepClient) // For other players
RepClient.RepInfo.AddRankRelation(Relation);
RepClient.RepInfo.StartFirstTimeReplication();
}
private function RemovePlayer(Controller C)
@ -196,6 +219,8 @@ private function RemovePlayer(Controller C)
local KFPlayerController KFPC;
local int Index;
`callstack();
KFPC = KFPlayerController(C);
if (KFPC == None)
return;
@ -232,6 +257,8 @@ public function UpdatePlayerRank(UIDRankRelation Rel)
local SClient RepClient;
local int Index;
`callstack();
Index = UIDRankRelationsActive.Find('UID', Rel.UID);
if (Index != INDEX_NONE)
@ -244,6 +271,9 @@ public function UpdatePlayerRank(UIDRankRelation Rel)
public function AddPlayerRank(UIDRankRelation Rel)
{
local SClient RepClient;
`callstack();
foreach RepClients(RepClient)
RepClient.RepInfo.AddRankRelation(Rel);
}

View File

@ -1,5 +1,8 @@
class ScoreboardExtRepInfo extends ReplicationInfo;
`include(Build.uci)
`include(Logger.uci)
// Server vars
var public ScoreboardExtMut Mut;
@ -17,6 +20,8 @@ var private int CustomRanksRepProgress, SteamGroupsRepProgress;
simulated event PostBeginPlay()
{
`callstack();
super.PostBeginPlay();
if (bDeleteMe) return;
@ -29,6 +34,8 @@ simulated event PostBeginPlay()
private reliable client function ClientInit()
{
`callstack();
if (SC == None)
SC = ScoreboardExtHUD(GetALocalPlayerController().myHUD).Scoreboard;
@ -43,17 +50,23 @@ private reliable client function ClientInit()
public function StartFirstTimeReplication()
{
`callstack();
SetTimer(0.01f, true, nameof(ReplicateCustomRanks));
SetTimer(0.01f, true, nameof(ReplicateSteamGroupRelations));
}
private reliable client function ClientSetSettings(SCESettings Set)
{
`callstack();
SC.Settings = Set;
}
private function ReplicateCustomRanks()
{
`callstack();
if (CustomRanksRepProgress < CustomRanks.Length)
{
ClientAddCustomRank(CustomRanks[CustomRanksRepProgress]);
@ -67,11 +80,15 @@ private function ReplicateCustomRanks()
private reliable client function ClientAddCustomRank(RankInfo Rank)
{
`callstack();
CustomRanks.AddItem(Rank);
}
private function ReplicateSteamGroupRelations()
{
`callstack();
if (SteamGroupsRepProgress < SteamGroupRelations.Length)
{
ClientAddSteamGroupRelation(SteamGroupRelations[SteamGroupsRepProgress]);
@ -87,6 +104,8 @@ private function ReplicateSteamGroupRelations()
private reliable client function ClientAddSteamGroupRelation(UIDRankRelation Rel)
{
`callstack();
SteamGroupRelations.AddItem(Rel);
}
@ -94,6 +113,8 @@ private reliable client function FindMyRankInSteamGroups()
{
local UIDRankRelation SteamGroupRel;
`callstack();
foreach SteamGroupRelations(SteamGroupRel)
if (SW.CheckPlayerGroup(SteamGroupRel.UID))
RankRelation.RankID = SteamGroupRel.RankID;
@ -104,32 +125,44 @@ private reliable client function FindMyRankInSteamGroups()
private reliable server function ServerApplyRank(int RankID)
{
`callstack();
RankRelation.RankID = RankID;
Mut.UpdatePlayerRank(RankRelation);
}
public function AddRankRelation(UIDRankRelation Rel)
{
`callstack();
ClientAddRankRelation(Rel);
}
private reliable client function ClientAddRankRelation(UIDRankRelation Rel)
{
`callstack();
SC.RankRelations.AddItem(Rel);
}
public function RemoveRankRelation(UIDRankRelation Rel)
{
`callstack();
ClientRemoveRankRelation(Rel);
}
private unreliable client function ClientRemoveRankRelation(UIDRankRelation Rel)
{
`callstack();
SC.RankRelations.RemoveItem(Rel);
}
public function UpdateRankRelation(UIDRankRelation Rel)
{
`callstack();
ClientUpdateRankRelation(Rel);
}
@ -137,6 +170,8 @@ private reliable client function ClientUpdateRankRelation(UIDRankRelation Rel)
{
local int Index;
`callstack();
Index = SC.RankRelations.Find('UID', Rel.UID);
if (Index != INDEX_NONE)

View File

@ -2,6 +2,9 @@ class ScoreboardStyle extends Object
dependson(Types)
config(ScoreboardExt);
`include(Build.uci)
`include(Logger.uci)
var config ColorRGBA ServerNameBoxColor;
var config ColorRGBA ServerNameTextColor;
var config ColorRGBA GameInfoBoxColor;
@ -42,9 +45,12 @@ var config ColorRGBA PingTextColorLow;
var config ColorRGBA PingTextColorMid;
var config ColorRGBA PingTextColorHigh;
public static function SCEStyle defaultSettings()
public static function SCEStyle DefaultSettings()
{
local SCEStyle Settings;
`callstack_static("DefaultSettings");
return Settings;
}
@ -52,6 +58,8 @@ public static function SCEStyle Settings()
{
local SCEStyle Settings;
`callstack_static("Settings");
Settings.ServerNameBoxColor = default.ServerNameBoxColor;
Settings.ServerNameTextColor = default.ServerNameTextColor;
Settings.GameInfoBoxColor = default.GameInfoBoxColor;
@ -97,6 +105,8 @@ public static function SCEStyle Settings()
public static function WriteSettings(SCEStyle Settings)
{
`callstack_static("WriteSettings");
default.ServerNameBoxColor = Settings.ServerNameBoxColor;
default.ServerNameTextColor = Settings.ServerNameTextColor;
default.GameInfoBoxColor = Settings.GameInfoBoxColor;

View File

@ -2,6 +2,9 @@ class SteamGroupRankRelations extends Object
dependson(Types)
config(ScoreboardExt);
`include(Build.uci)
`include(Logger.uci)
var config array<RankRelation> Relation;
DefaultProperties

View File

@ -2,6 +2,9 @@ class SystemAdminRank extends Object
dependson(Types)
config(ScoreboardExt);
`include(Build.uci)
`include(Logger.uci)
var config string Rank;
var config ColorRGBA TextColor;
var config Fields ApplyColorToFields;
@ -9,6 +12,9 @@ var config Fields ApplyColorToFields;
public static function SCESettingsAdmin DefaultSettings()
{
local SCESettingsAdmin Settings;
`callstack_static("DefaultSettings");
return Settings;
}
@ -16,6 +22,8 @@ public static function SCESettingsAdmin Settings()
{
local SCESettingsAdmin Settings;
`callstack_static("Settings");
Settings.Rank = default.Rank;
Settings.TextColor = default.TextColor;
Settings.ApplyColorToFields = default.ApplyColorToFields;
@ -25,6 +33,8 @@ public static function SCESettingsAdmin Settings()
public static function WriteSettings(SCESettingsAdmin Settings)
{
`callstack_static("WriteSettings");
default.Rank = Settings.Rank;
default.TextColor = Settings.TextColor;
default.ApplyColorToFields = Settings.ApplyColorToFields;

View File

@ -2,6 +2,9 @@ class SystemPlayerRank extends Object
dependson(Types)
config(ScoreboardExt);
`include(Build.uci)
`include(Logger.uci)
var config string Rank;
var config ColorRGBA TextColor;
var config Fields ApplyColorToFields;
@ -9,6 +12,9 @@ var config Fields ApplyColorToFields;
public static function SCESettingsPlayer DefaultSettings()
{
local SCESettingsPlayer Settings;
`callstack_static("abc");
return Settings;
}
@ -16,6 +22,8 @@ public static function SCESettingsPlayer Settings()
{
local SCESettingsPlayer Settings;
`callstack_static("abc");
Settings.Rank = default.Rank;
Settings.TextColor = default.TextColor;
Settings.ApplyColorToFields = default.ApplyColorToFields;
@ -25,6 +33,8 @@ public static function SCESettingsPlayer Settings()
public static function WriteSettings(SCESettingsPlayer Settings)
{
`callstack_static("abc");
default.Rank = Settings.Rank;
default.TextColor = Settings.TextColor;
default.ApplyColorToFields = Settings.ApplyColorToFields;

View File

@ -1,5 +1,8 @@
class Types extends Object;
`include(Build.uci)
`include(Logger.uci)
struct ColorRGBA
{
var byte R, G, B, A;

9
ScoreboardExt/Logger.uci Normal file
View File

@ -0,0 +1,9 @@
`define scelog(text, cond) `log(`text, `cond, 'ScoreboardExt')
`define info(text) `scelog("[INFO]"@`text, true)
`define warning(text) `scelog("[WARNING]"@`text, true)
`define error(text) `scelog("[ERROR]"@`text, true)
`define debug(text, cond) `scelog("[DEBUG]"@`text, true)
`define callstack() `scelog("[CALLSTACK]"@`Location@"ROLE="$ROLE, `bEnableCallstack)
`define callstack_static(text) `scelog("[CALLSTACK]"@`text, `bEnableCallstack)