diff --git a/PublicationContent/description.txt b/PublicationContent/description.txt new file mode 100644 index 0000000..631d5a7 --- /dev/null +++ b/PublicationContent/description.txt @@ -0,0 +1,6 @@ +[h1]there should be a description, but there isn't one :( [/h1] + +I will definitely write in more detail (but a little later) + +[h1]Sources:[/h1] +[u]https://github.com/GenZmeY/KF2-ScoreboardExt[/u] [b](GNU GPLv3)[/b] \ No newline at end of file diff --git a/PublicationContent/preview.png b/PublicationContent/preview.png new file mode 100644 index 0000000..c73bff6 Binary files /dev/null and b/PublicationContent/preview.png differ diff --git a/PublicationContent/tags.txt b/PublicationContent/tags.txt new file mode 100644 index 0000000..80d4cf5 --- /dev/null +++ b/PublicationContent/tags.txt @@ -0,0 +1 @@ +Mutators \ No newline at end of file diff --git a/PublicationContent/title.txt b/PublicationContent/title.txt new file mode 100644 index 0000000..87aed8f --- /dev/null +++ b/PublicationContent/title.txt @@ -0,0 +1 @@ +ScoreboardExt \ No newline at end of file diff --git a/ScoreboardExt/Classes/KFScoreBoard.uc b/ScoreboardExt/Classes/KFScoreBoard.uc index 0c34e1a..52ee338 100644 --- a/ScoreboardExt/Classes/KFScoreBoard.uc +++ b/ScoreboardExt/Classes/KFScoreBoard.uc @@ -20,6 +20,9 @@ var KFPlayerController OwnerPC; var Color PingColor; var float PingBars; +// Cache +var array PerkNames; + // Ranks var array CustomRanks; var array RankRelations; @@ -39,9 +42,26 @@ var localized string Dead; function InitMenu() { + `callstack(); + Super.InitMenu(); PlayersList = KFGUI_List(FindComponentID('PlayerList')); OwnerPC = KFPlayerController(GetPlayer()); + + if (PerkNames.Length == 0) + { + PerkNames.AddItem(class'KFGFxMenu_Inventory'.default.PerkFilterString); + PerkNames.AddItem(class'KFPerk_Berserker'.default.PerkName); + PerkNames.AddItem(class'KFPerk_Commando'.default.PerkName); + PerkNames.AddItem(class'KFPerk_Support'.default.PerkName); + PerkNames.AddItem(class'KFPerk_FieldMedic'.default.PerkName); + PerkNames.AddItem(class'KFPerk_Demolitionist'.default.PerkName); + PerkNames.AddItem(class'KFPerk_Firebug'.default.PerkName); + PerkNames.AddItem(class'KFPerk_Gunslinger'.default.PerkName); + PerkNames.AddItem(class'KFPerk_Sharpshooter'.default.PerkName); + PerkNames.AddItem(class'KFPerk_SWAT'.default.PerkName); + PerkNames.AddItem(class'KFPerk_Survivalist'.default.PerkName); + } } static function CheckAvatar(KFPlayerReplicationInfo KFPRI, KFPlayerController PC) @@ -109,7 +129,7 @@ function DrawMenu() local PlayerController PC; local KFPlayerReplicationInfo KFPRI; local PlayerReplicationInfo PRI; - local float XPos, YPos, YL, XL, FontScalar, XPosCenter, BoxW, BoxX, BoxH, MinBoxW; + local float XPos, YPos, YL, XL, FontScalar, XPosCenter, BoxW, BoxX, BoxH, MinBoxW, DoshSize; local int i, j, NumSpec, NumPlayer, NumAlivePlayer, Width; local float BorderSize; @@ -263,7 +283,6 @@ function DrawMenu() RankXPos = Owner.HUDOwner.ScaledBorderSize * 8 + Settings.Style.EdgeSize; PlayerXPos = Width * 0.20; - PerkXPos = Width * 0.40; Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.PingString$" ", XL, YL, FontScalar, FontScalar); PingXPos = Width - (XL < MinBoxW ? MinBoxW : XL); @@ -278,7 +297,17 @@ function DrawMenu() KillsXPos = AssistXPos - (XL < MinBoxW ? MinBoxW : XL); Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.DoshString$" ", XL, YL, FontScalar, FontScalar); - CashXPos = KillsXPos - (XL < MinBoxW ? MinBoxW : XL); + Canvas.TextSize("99999", DoshSize, YL, FontScalar, FontScalar); + CashXPos = KillsXPos - (XL < DoshSize ? DoshSize : XL); + + BoxW = 0; + foreach PerkNames(S) + { + // PerkName + 2 Space + 2 Symbols for level + Canvas.TextSize(S$" 99", XL, YL, FontScalar, FontScalar); + if (XL > BoxW) BoxW = XL; + } + PerkXPos = CashXPos - (BoxW < MinBoxW ? MinBoxW : BoxW); StatusWBox = PlayerXPos - RankXPos; PlayerWBox = PerkXPos - PlayerXPos; @@ -587,6 +616,12 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float else SetDrawColor(C, Settings.Style.PlayerNameTextColor); S = KFPRI.PlayerName; + Canvas.TextSize(S, XL, YL, FontScalar, FontScalar); + while (XL > PlayerWBox) + { + S = Left(S, Len(S)-1); + Canvas.TextSize(S, XL, YL, FontScalar, FontScalar); + } DrawTextShadowHLeftVCenter(S, PlayerXPos, TextYOffset, FontScalar); // Kill @@ -615,7 +650,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float SetDrawColor(C, CurrentRank.TextColor); else SetDrawColor(C, Settings.Style.DoshTextColor); - StrValue = GetNiceSize(int(KFPRI.Score)); + StrValue = String(int(KFPRI.Score)); //StrValue = GetNiceSize(int(KFPRI.Score)); } DrawTextShadowHVCenter(StrValue, CashXPos, TextYOffset, CashWBox, FontScalar); diff --git a/ScoreboardExt/Logger.uci b/ScoreboardExt/Logger.uci index 60bc77b..7522f00 100644 --- a/ScoreboardExt/Logger.uci +++ b/ScoreboardExt/Logger.uci @@ -5,5 +5,5 @@ `define error(text) `scelog("[ERROR]"@`text, true) `define debug(text) if (`bEnableDebug) { `scelog("[DEBUG]"@`text, `bEnableDebug); } -`define callstack() if (`bEnableCallstack) { `scelog("[CALLSTACK]"@`Location@"ROLE="$ROLE, `bEnableCallstack); } +`define callstack() if (`bEnableCallstack) { `scelog("[CALLSTACK]"@`Location, `bEnableCallstack); } `define callstack_static(text) if (`bEnableCallstack) { `scelog("[CALLSTACK]"@`text, `bEnableCallstack); } \ No newline at end of file