update formatting to match .editorconfig

This commit is contained in:
GenZmeY 2023-05-01 23:06:46 +03:00
parent da1914f612
commit e29d18ea1c
56 changed files with 858 additions and 844 deletions

View File

@ -2,7 +2,7 @@
[h1]Description[/h1]
Yet another scoreboard...
Based on the scoreboard from [url=https://steamcommunity.com/sharedfiles/filedetails/?id=1963099942]ClassicHUD[/url] and heavily modified.
Based on the scoreboard from [url=https://steamcommunity.com/sharedfiles/filedetails/?id=1963099942]ClassicHUD[/url] and heavily modified.
[h1]Whitelisted?[/h1]
[b]No.[/b] But I really hope that it will be whitelisted.
@ -13,7 +13,7 @@ https://forums.tripwireinteractive.com/index.php?threads/whitelisting-mods-and-m
[h1]Usage (single player)[/h1]
[olist]
[*]Subscribe to this mutator;
[*]Start KF2;
[*]Start KF2;
[*]Open console (`) and input:
[b]open KF-BioticsLab?Mutator=YAS.YASMut?[/b]
(replace the map and add the parameters you need)

View File

@ -7,18 +7,18 @@
[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/GenZmeY/KF2-YetAnotherScoreboard)](https://github.com/GenZmeY/KF2-YetAnotherScoreboard/tags)
[![GitHub](https://img.shields.io/github/license/GenZmeY/KF2-YetAnotherScoreboard)](LICENSE)
# Description
## Description
Yet another scoreboard...
Based on the scoreboard from [ClassicHUD](https://steamcommunity.com/sharedfiles/filedetails/?id=1963099942) and heavily modified.
# Usage
## Usage
[See steam workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=2521826524)
***
**Note:** If you want to build/test/brew/publish a mutator without git-bash and/or scripts, follow [these instructions](https://tripwireinteractive.atlassian.net/wiki/spaces/KF2SW/pages/26247172/KF2+Code+Modding+How-to) instead of what is described here.
# Build
## Build
1. Install [Killing Floor 2](https://store.steampowered.com/app/232090/Killing_Floor_2/), Killing Floor 2 - SDK and [git for windows](https://git-scm.com/download/win);
2. open git-bash and go to any folder where you want to store sources:
`cd <ANY_FOLDER_YOU_WANT>`
@ -31,14 +31,14 @@ Based on the scoreboard from [ClassicHUD](https://steamcommunity.com/sharedfiles
5. The compiled files will be here:
`C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Unpublished\BrewedPC\Script\`
# Testing
## Testing
Open git-bash in the source folder and run command:
`./tools/builder -t`
(or `./tools/builder -ct` if you haven't compiled the mutator yet)
A local single-user test will be launched with parameters from `test.cfg` (edit this file if you want to test mutator with different parameters).
# Bug reports
## Bug reports
If you find a bug, go to the [issue page](https://github.com/GenZmeY/KF2-YetAnotherScoreboard/issues) and check if there is a description of your bug. If not, create a new issue.
Describe what the bug looks like and how reproduce it.
Attach screenshots if you think it might help.
@ -47,6 +47,6 @@ If it's a crash issue, be sure to include the `Launch.log` files. You can find t
`C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Logs\`
Please note that these files are overwritten every time you start the game/server. Therefore, you must take these files immediately after the game crashes in order not to lose information.
# License
## License
* [GNU GPLv3](LICENSE) - **YetAnotherScoreboard**
* [GNU LGPLv3](https://github.com/GenZmeY/KF2-BoxPainterLib/blob/master/LICENSE) - **BoxPainterLib**

View File

@ -18,7 +18,7 @@ function RenderFramedWindow(KFGUI_FloatingWindow P)
Canvas.DrawTileStretched(TabTextures[`TAB_TOP], XS, TitleHeight, 0,0, 128, 16);
// Frame itself.
if (`BOX_SMALL_SLIGHTTRANSPARENT >= 0 && `BOX_SMALL_SLIGHTTRANSPARENT < BorderTextures.Length)
{
Canvas.SetPos(0, TitleHeight);
@ -165,7 +165,7 @@ function RenderScrollBar(KFGUI_ScrollBarBase S)
Canvas.SetPos(0.f, S.ButtonOffset);
Canvas.DrawTileStretched(ScrollTexture, S.CompPos[2], S.SliderScale, 0,0, 32, 32);
}
else
else
{
Canvas.SetPos(S.ButtonOffset, 0.f);
Canvas.DrawTileStretched(ScrollTexture, S.SliderScale, S.CompPos[3], 0,0, 32, 32);
@ -229,7 +229,7 @@ function RenderComboList(KFGUI_ComboSelector C)
// Draw background.
Edge = C.Combo.BorderSize;
if (`BOX_SMALL_SLIGHTTRANSPARENT >= 0 && `BOX_SMALL_SLIGHTTRANSPARENT < BorderTextures.Length)
{
Canvas.SetPos(0.f, 0.f);
@ -422,4 +422,5 @@ function RenderButton(KFGUI_Button B)
defaultproperties
{
}
}

View File

@ -3,7 +3,7 @@ class GUIStyleBase extends Object
var Texture2D ItemTex;
var array<Texture2D> BorderTextures, ArrowTextures, ButtonTextures, TabTextures, ItemBoxTextures, PerkBox, CheckBoxTextures, ProgressBarTextures, SliderTextures;
var Texture2D ScrollTexture, FavoriteIcon, BankNoteIcon;
var Texture2D ScrollTexture, FavoriteIcon, BankNoteIcon;
var SoundCue MenuDown, MenuDrag, MenuEdit, MenuFade, MenuClick, MenuHover, MenuUp;
@ -55,7 +55,7 @@ function InitStyle()
ItemTex=Texture2D(DynamicLoadObject("UI_LevelChevrons_TEX.UI_LevelChevron_Icon_02", class'Texture2D'));
if (ItemTex == None)
ItemTex=Texture2D'EngineMaterials.DefaultWhiteGrid';
BoxPainter = new class'BoxPainterLib.BoxPainter';
NumberFont = Font(DynamicLoadObject("UI_Canvas_Fonts.Font_General", class'Font'));
@ -185,35 +185,35 @@ function PickDefaultFontSize(float YRes)
final function float ScreenScale(float Size, optional float MaxRes=1080.f)
{
local float FillSizeX, FillSizeY;
GetFillScreenSize(FillSizeX, FillSizeY);
return Size * (FillSizeY / MaxRes);
}
final function float GetFontScaler()
{
local float FillSizeX, FillSizeY, Scaler;
GetFillScreenSize(FillSizeX, FillSizeY);
if (FillSizeY <= 1080.0f) { scaler = 0.750f; }
else if (FillSizeY <= 1440.0f) { scaler = 0.562f; }
else if (FillSizeY <= 2160.0f) { scaler = 0.377f; }
else { scaler = 0.190f; }
return FClamp(FillSizeY * scaler / 1080.f, 0.175f, 1.0f);
}
final function GetFillScreenSize(out float SizeX, out float SizeY)
{
local float Base, BaseX, BaseY;
BaseX = HUDOwner.SizeX / 16;
BaseY = HUDOwner.SizeY / 9;
Base = Min(BaseX, BaseY);
SizeX = Base * 16;
SizeY = Base * 9;
}
@ -221,9 +221,9 @@ final function GetFillScreenSize(out float SizeX, out float SizeY)
final function float PickEdgeSize(float DefaultSize = 8.0f)
{
local float FillSizeX, FillSizeY;
GetFillScreenSize(FillSizeX, FillSizeY);
return (FillSizeY / 1080.f) * DefaultSize;
}
@ -275,7 +275,7 @@ final function DrawColoredText(coerce string S, float X, float Y, optional float
{
if (bUseOutline)
DrawTextShadow(S, X, Y, 1, Scale);
else
else
{
Canvas.SetPos(X, Y);
Canvas.DrawText(S, ,Scale, Scale);
@ -292,7 +292,7 @@ final function DrawColoredText(coerce string S, float X, float Y, optional float
if (bUseOutline)
DrawTextShadow(PrevT, X, Y, 1, Scale);
else
else
{
Canvas.SetPos(X, Y);
Canvas.DrawText(PrevT, ,Scale, Scale);
@ -319,7 +319,7 @@ final function DrawColoredText(coerce string S, float X, float Y, optional float
if (bUseOutline)
DrawTextShadow(T, X, Y, 1, Scale);
else
else
{
Canvas.SetPos(X, Y);
Canvas.DrawText(T, ,Scale, Scale);
@ -361,7 +361,7 @@ final function DrawTextOutline(coerce string S, float X, float Y, int Size, Colo
Size += 1;
Steps = (Size * 2) / 3;
if (Steps < 1 )
if (Steps < 1 )
{
Steps = 1;
}
@ -672,7 +672,7 @@ final function DrawRoundedBoxHollowEx(float BorderSize, float X, float Y, float
DrawWhiteBox(W - BorderSize * 2, BorderSize);
Canvas.SetPos(X, Y + BorderSize);
DrawWhiteBox(BorderSize, H - BorderSize * 2);
DrawWhiteBox(BorderSize, H - BorderSize * 2);
Canvas.SetPos(X + W - BorderSize, Y + BorderSize);
DrawWhiteBox(BorderSize, H - BorderSize * 2);
@ -728,7 +728,7 @@ final function DrawArrowBox(int Direction, float X, float Y, float Width, float
function DrawTexture(Texture2D Tex, float X, float Y, float W, float H, optional float UL, optional float VL)
{
Canvas.SetPos(X, Y);
Canvas.DrawTile(Tex, W, H, 0, 0, UL == 0.f ? float(Tex.SizeX) : UL, VL == 0.f ? float(Tex.SizeY) : VL);
}
@ -736,17 +736,17 @@ final function DrawTileStretched(Texture Tex, float X, float Y, float XS, float
{
local float mW, mH, MidX, MidY, SmallTileW, SmallTileH, fX, fY;
local int OptimizeTiles;
if (Tex == None ) Tex = Texture2D'EngineMaterials.DefaultDiffuse';
// Get the size of the image
mW = Tex.GetSurfaceWidth();
mH = Tex.GetSurfaceHeight();
// Get the midpoints of the image
MidX = int(mW/2);
MidY = int(mH/2);
// Grab info about the scaled image
SmallTileW = XS - mW;
SmallTileH = YS - mH;
@ -762,18 +762,18 @@ final function DrawTileStretched(Texture Tex, float X, float Y, float XS, float
OptimizeTiles += 1;
Canvas.PreOptimizeDrawTiles(OptimizeTiles, Tex);
// Draw the spans first
// Top and Bottom
if (mW < XS)
{
fX = MidX;
if (mH > YS)
fY = YS/2;
else
fY = MidY;
Canvas.SetPos(X+fX, Y);
Canvas.DrawTile(Tex, SmallTileW, fY, MidX, 0,1, fY);
Canvas.SetPos(X+fX, Y+YS-fY);
@ -781,12 +781,12 @@ final function DrawTileStretched(Texture Tex, float X, float Y, float XS, float
}
else
fX = XS / 2;
// Left and Right
if (mH < YS)
{
fY = MidY;
Canvas.SetPos(X, Y+fY);
Canvas.DrawTile(Tex, fX, SmallTileH, 0,fY, fX, 1);
Canvas.SetPos(X+XS-fX, Y+fY);
@ -794,14 +794,14 @@ final function DrawTileStretched(Texture Tex, float X, float Y, float XS, float
}
else
fY = YS / 2;
// Center
if ((mH < YS) && (mW < XS))
{
Canvas.SetPos(X+fX, Y+fY);
Canvas.DrawTile(Tex, SmallTileW, SmallTileH, fX, fY, 1,1);
}
// Draw the 4 corners.
Canvas.SetPos(X, Y);
Canvas.DrawTile(Tex, fX, fY, 0,0, fX, fY);
@ -870,8 +870,8 @@ defaultproperties
// Font'UI_Canvas_Fonts.Font_Main'
//MainFont=Font'KFYAS_Assets.Font.KFMainFont'
//InfiniteFont=Font'KFYAS_Assets.Font.KFInfiniteFont'
MainFont=Font'UI_Canvas_Fonts.Font_Main'
NumberFont=Font'UI_Canvas_Fonts.Font_General'
InfiniteFont=Font'UI_Canvas_Fonts.Font_Main'
}
}

View File

@ -366,8 +366,8 @@ simulated function MenuInput(float DeltaTime)
V = ClientViewport.GetMousePosition();
MousePosition.X = Clamp(V.X, 0, ScreenSize.X);
MousePosition.Y = Clamp(V.Y, 0, ScreenSize.Y);
MousePosition.X = Clamp(V.X, 0, ScreenSize.X);
MousePosition.Y = Clamp(V.Y, 0, ScreenSize.Y);
MouseMove();
}
@ -756,8 +756,8 @@ simulated function bool ReceivedInputKey(int ControllerId, name Key, EInputEvent
if (KeyboardFocus == None)
{
if (KFInput != None)
{
KFInput.GetKeyBindFromCommand(BoundKey, "GBA_VoiceChat", false);
{
KFInput.GetKeyBindFromCommand(BoundKey, "GBA_VoiceChat", false);
if (string(Key) ~= KFInput.GetBindDisplayName(BoundKey))
{
if (Event == IE_Pressed)
@ -894,4 +894,4 @@ defaultproperties
bAbsorbInput=true
bAlwaysTick=true
bHideCursor=true
}
}

View File

@ -59,4 +59,5 @@ function PreClientTravel(string PendingURL, ETravelType TravelType, bool bIsSeam
defaultproperties
{
}
}

View File

@ -449,4 +449,4 @@ function RenderButton(KFGUI_Button B)
defaultproperties
{
MaxFontScale=5
}
}

View File

@ -117,4 +117,4 @@ static final function Color LinearColorToColor(const LinearColor RGB)
TrueRGB.A = RGB.A * 255;
return TrueRGB;
}
}

View File

@ -341,4 +341,4 @@ defaultproperties
YSize=1
bCanFocus=true
bVisible=true
}
}

View File

@ -38,4 +38,4 @@ defaultproperties
TextColor=(R=0, G=0, B=0, A=255)
TextFontInfo=(bClipText=true, bEnableShadow=true)
FontScale=1
}
}

View File

@ -77,4 +77,5 @@ function DrawMenu()
defaultproperties
{
}
}

View File

@ -86,4 +86,5 @@ function EmptyList()
defaultproperties
{
}
}

View File

@ -27,4 +27,4 @@ defaultproperties
{
bForceUniform=true
LableWidth=0.85
}
}

View File

@ -92,4 +92,4 @@ function HandleMouseClick(bool bRight);
defaultproperties
{
bHoverSound=true
}
}

View File

@ -50,7 +50,7 @@ final function KFGUI_Slider AddSlider(string Cap, name IDN, int MinValue, int Ma
Label.SetText(Cap);
Label.XSize = 0.45;
Label.FontScale = 1;
MC.AddComponent(Label);
MC.AddComponent(Label);
ColorValueLabel = new(MC) class'KFGUI_TextLable';
ColorValueLabel.XPosition = 0.95;
ColorValueLabel.XSize = 0.1;
@ -119,4 +119,4 @@ defaultproperties
ID="CaptionText"
End Object
Components.Add(CaptionLabel)
}
}

View File

@ -442,4 +442,4 @@ defaultproperties
Components.Add(ColumnComps)
LineFontInfo=(bClipText=true, bEnableShadow=false)
}
}

View File

@ -203,4 +203,4 @@ defaultproperties
{
bClickable=true
ColumnMinSize=8
}
}

View File

@ -61,4 +61,4 @@ defaultproperties
SelectedTextColor=(R=255, G=128, B=128, A=255)
TextColor=(R=255, G=255, B=255, A=255)
BorderSize=4
}
}

View File

@ -24,4 +24,4 @@ defaultproperties
CurrentRow=-1
OldRow=-1
bFocusedPostDrawItem=true
}
}

View File

@ -219,4 +219,4 @@ defaultproperties
NumColumns=1
bClickable=true
bDrawBackground=false
}
}

View File

@ -425,4 +425,4 @@ defaultproperties
LastLength=-1
YSize=0.06
}
}

View File

@ -99,4 +99,4 @@ defaultproperties
TextFontInfo=(bClipText=true, bEnableShadow=true)
End Object
TextLable=MyBoxLableText
}
}

View File

@ -104,4 +104,4 @@ defaultproperties
bUseAnimation=true
OpenAnimSpeed=0.05f
WindowFadeInTime=0.2f
}
}

View File

@ -20,4 +20,4 @@ function MouseRelease(bool bRight)
defaultproperties
{
bClickable=true
}
}

View File

@ -5,7 +5,7 @@ var() float HeaderSize[2]; // Pixels wide for edges (left, top).
var() Texture FrameTex;
var() bool bDrawHeader, bHeaderCenter, bUseLegacyDrawTile, bDrawBackground;
var() float FontScale;
function InitMenu()
{
Super(KFGUI_Page).InitMenu();
@ -43,12 +43,12 @@ delegate OnDrawFrame(Canvas C, float W, Float H)
{
Owner.CurrentStyle.DrawTileStretched(FrameTex, 0,0, W,H);
}
else
else
{
Canvas.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(FrameTex, W,H, 0,0, FrameTex.GetSurfaceWidth(), FrameTex.GetSurfaceHeight());
}
if (bDrawHeader && WindowTitle != "")
{
FRI.bClipText = true;
@ -68,7 +68,7 @@ delegate OnDrawFrame(Canvas C, float W, Float H)
C.DrawText(WindowTitle, ,T, T,FRI);
}
}
function PreDraw()
{
local int i;
@ -90,7 +90,7 @@ function PreDraw()
XPosition = Lerp(CenterX, default.XPosition, Frac);
YPosition = Lerp(CenterY, default.YPosition, Frac);
}
ComputeCoords();
Canvas.SetDrawColor(255, 255, 255);
Canvas.SetOrigin(CompPos[0], CompPos[1]);
@ -120,9 +120,9 @@ defaultproperties
HeaderSize(0)=26.f
HeaderSize(1)=8.f
EdgeSize(0)=20
EdgeSize(1)=35
EdgeSize(2)=-40
EdgeSize(3)=-50
}
}

View File

@ -77,7 +77,7 @@ function DrawMenu()
break;
case ISTY_Stretched:
if (X1 < 0 && X2 < 0 && Y1 < 0 && Y2 < 0 )
if (X1 < 0 && X2 < 0 && Y1 < 0 && Y2 < 0 )
Owner.CurrentStyle.DrawTileStretched(Image, 0.f, 0.f, CompPos[2], CompPos[3]);
else
{
@ -140,4 +140,4 @@ defaultproperties
X2=-1
Y1=-1
Y2=-1
}
}

View File

@ -226,4 +226,4 @@ defaultproperties
ID="Scrollbar"
End Object
Components.Add(ListScroller)
}
}

View File

@ -222,4 +222,4 @@ defaultproperties
ID="Scrollbar"
End Object
Components.Add(ListScroller)
}
}

View File

@ -13,6 +13,7 @@ function InitMenu()
Components[i].InitMenu();
}
}
function ShowMenu()
{
local int i;
@ -20,6 +21,7 @@ function ShowMenu()
for (i=0; i < Components.Length; ++i)
Components[i].ShowMenu();
}
function PreDraw()
{
local int i;
@ -41,6 +43,7 @@ function PreDraw()
Components[i].PreDraw();
}
}
function InventoryChanged(optional KFWeapon Wep, optional bool bRemove)
{
local int i;
@ -48,6 +51,7 @@ function InventoryChanged(optional KFWeapon Wep, optional bool bRemove)
for (i=0; i < Components.Length; ++i)
Components[i].InventoryChanged(Wep, bRemove);
}
function MenuTick(float DeltaTime)
{
local int i;
@ -72,6 +76,7 @@ function CloseMenu()
for (i=0; i < Components.Length; ++i)
Components[i].CloseMenu();
}
function bool CaptureMouse()
{
local int i;
@ -87,6 +92,7 @@ function bool CaptureMouse()
MouseArea = None;
return Super.CaptureMouse(); // check with frame itself.
}
function bool ReceievedControllerInput(int ControllerId, name Key, EInputEvent Event)
{
local int i;
@ -101,6 +107,7 @@ function bool ReceievedControllerInput(int ControllerId, name Key, EInputEvent E
return Super.ReceievedControllerInput(ControllerId, Key, Event);
}
function KFGUI_Base FindComponentID(name InID)
{
local int i;
@ -115,6 +122,7 @@ function KFGUI_Base FindComponentID(name InID)
}
return Result;
}
function FindAllComponentID(name InID, out array < KFGUI_Base> Res)
{
local int i;
@ -124,6 +132,7 @@ function FindAllComponentID(name InID, out array < KFGUI_Base> Res)
for (i=0; i < Components.Length; ++i)
Components[i].FindAllComponentID(InID, Res);
}
function RemoveComponent(KFGUI_Base B)
{
local int i;
@ -138,6 +147,7 @@ function RemoveComponent(KFGUI_Base B)
for (i=0; i < Components.Length; ++i)
Components[i].RemoveComponent(B);
}
function NotifyLevelChange()
{
local int i;

View File

@ -23,4 +23,4 @@ defaultproperties
bUnique=true
bPersistant=true
FrameOpacity=175
}
}

View File

@ -35,7 +35,7 @@ function DrawMenu()
Height = CompPos[3];
// Select the right font in the Canvas
Canvas.Font = Owner.CurrentStyle.PickFont(Sc);
Canvas.Font = Owner.CurrentStyle.PickFont(Sc);
if (CaptionWidth > 0.0 && Width > 0 && Len(Caption) > 0)
{
@ -79,7 +79,7 @@ function DrawMenu()
{
S = string(int(Value));
}
else
else
{
S = string(int(High));
}

View File

@ -28,7 +28,7 @@ final function ComputeSize()
if (OldSizeX == Owner.ScreenSize.X)
return;
if (ItemRows.Length == 0)
{
YS = 0;
@ -86,7 +86,7 @@ function PreDraw()
Super.PreDraw();
}
function DrawMenu()
{
{
Owner.CurrentStyle.RenderRightClickMenu(Self);
if (bDrawToolTip)
@ -160,4 +160,4 @@ defaultproperties
EdgeSize=2
BoxColor=(R=5, G=5, B=5, A=200)
OutlineColor=(R=115, G=115, B=115, A=255)
}
}

View File

@ -120,4 +120,4 @@ defaultproperties
ScrollStride=1
PageStep=10
ButtonScale=1
}
}

View File

@ -3,4 +3,4 @@ class KFGUI_ScrollBarH extends KFGUI_ScrollBarBase;
defaultproperties
{
bVertical=false
}
}

View File

@ -3,4 +3,4 @@ class KFGUI_ScrollBarV extends KFGUI_ScrollBarBase;
defaultproperties
{
bVertical=true
}
}

View File

@ -162,4 +162,4 @@ defaultproperties
ButtonAxisSize=0.08
CurrentPageNum=-1
PageComponentIndex=-1
}
}

View File

@ -487,4 +487,4 @@ defaultproperties
bCanFocus=false
bClickable=false
bUseOutlineText=false
}
}

View File

@ -117,4 +117,4 @@ defaultproperties
FontScale=1.f
OutlineSize=1
bCanFocus=false
}
}

View File

@ -182,4 +182,4 @@ function MouseClick(bool bRight)
defaultproperties
{
ScrollSpeed=0.01
}
}

View File

@ -39,4 +39,4 @@ defaultproperties
TextFontInfo=(bClipText=true, bEnableShadow=true)
bCanFocus=false
bFocusedPostDrawItem=true
}
}

View File

@ -11,10 +11,10 @@ public static function InitConfig(int Version, int LatestVersion)
{
case `NO_CONFIG:
ApplyDefault();
default: break;
}
if (LatestVersion != Version)
{
StaticSaveConfig();
@ -25,7 +25,7 @@ private static function ApplyDefault()
{
default.DisplayTime = 30;
default.bRandomize = true;
default.Message.Length = 0;
default.Message.AddItem("UwU");
default.Message.AddItem("OwO");

View File

@ -10,10 +10,10 @@ public static function InitConfig(int Version, int LatestVersion)
{
case `NO_CONFIG:
ApplyDefault();
default: break;
}
if (LatestVersion != Version)
{
StaticSaveConfig();
@ -23,13 +23,13 @@ public static function InitConfig(int Version, int LatestVersion)
private static function ApplyDefault()
{
local RankRelation NewRankRelation;
default.Relation.Length = 0;
// Example relation:
NewRankRelation.RankID = 1; // "Man of culture" ID
NewRankRelation.ObjectID = "103582791429670253"; // HENTAI Group SteamID64
default.Relation.AddItem(NewRankRelation);
}

View File

@ -12,10 +12,10 @@ public static function InitConfig(int Version, int LatestVersion)
{
case `NO_CONFIG:
ApplyDefault();
default: break;
}
if (LatestVersion != Version)
{
StaticSaveConfig();
@ -25,24 +25,24 @@ public static function InitConfig(int Version, int LatestVersion)
private static function ApplyDefault()
{
local Rank NewRank;
// System ranks:
default.Player.RankName = "";
default.Player.RankColor = MakeColor(250, 250, 250, 250);
default.Player.PlayerColor = MakeColor(250, 250, 250, 250);
default.Admin.RankName = "Admin";
default.Admin.RankColor = MakeColor(250, 0, 0, 250);
default.Admin.PlayerColor = MakeColor(250, 0, 0, 250);
default.Rank.Length = 0;
// Example custom rank:
NewRank.RankID = 1;
NewRank.RankName = "Man of culture";
NewRank.RankColor = MakeColor(0, 250, 0, 250);
NewRank.PlayerColor = MakeColor(250, 250, 250, 250);
default.Rank.AddItem(NewRank);
}

View File

@ -1,450 +1,450 @@
class YAS extends Info
config(YAS);
const LatestVersion = 1;
const CfgRanks = class'Ranks';
const CfgRankRelations = class'RankRelations';
const CfgMessageOfTheDay = class'MessageOfTheDay';
const UpdateInterval = 1.0f;
const MatchUID = "0x";
const MatchPlayerSteamID64 = "76561";
const MatchGroupSteamID64 = "10358279";
var private config int Version;
var private config E_LogLevel LogLevel;
var private KFGameInfo KFGI;
var private KFGameInfo_Survival KFGIS;
var private KFGameInfo_Endless KFGIE;
var private KFGameReplicationInfo KFGRI;
var private KFOnlineGameSettings KFOGS;
var private OnlineSubsystemSteamworks OSS;
var private Array<YAS_RepInfoOwner> RepInfos;
var private Array<CachedRankRelation> PlayerRelations;
var private Array<CachedRankRelation> GroupRelations;
var private int LastMessageID;
public simulated function bool SafeDestroy()
{
`Log_Trace();
return (bPendingDelete || bDeleteMe || Destroy());
}
public event PreBeginPlay()
{
`Log_Trace();
if (WorldInfo.NetMode == NM_Client)
{
`Log_Fatal("NetMode == NM_Client");
SafeDestroy();
return;
}
Super.PreBeginPlay();
PreInit();
}
public event PostBeginPlay()
{
`Log_Trace();
if (bPendingDelete || bDeleteMe) return;
Super.PostBeginPlay();
PostInit();
}
private function PreInit()
{
`Log_Trace();
if (Version == `NO_CONFIG)
{
LogLevel = LL_Info;
SaveConfig();
}
CfgRanks.static.InitConfig(Version, LatestVersion);
CfgRankRelations.static.InitConfig(Version, LatestVersion);
CfgMessageOfTheDay.static.InitConfig(Version, LatestVersion);
switch (Version)
{
case `NO_CONFIG:
`Log_Info("Config created");
case MaxInt:
`Log_Info("Config updated to version" @ LatestVersion);
break;
case LatestVersion:
`Log_Info("Config is up-to-date");
break;
default:
`Log_Warn("The config version is higher than the current version (are you using an old mutator?)");
`Log_Warn("Config version is" @ Version @ "but current version is" @ LatestVersion);
`Log_Warn("The config version will be changed to" @ LatestVersion);
break;
}
if (LatestVersion != Version)
{
Version = LatestVersion;
SaveConfig();
}
if (LogLevel == LL_WrongLevel)
{
LogLevel = LL_Info;
`Log_Warn("Wrong 'LogLevel', return to default value");
SaveConfig();
}
`Log_Base("LogLevel:" @ LogLevel);
OSS = OnlineSubsystemSteamworks(class'GameEngine'.static.GetOnlineSubsystem());
if (OSS != None)
{
InitRanks();
}
else
{
`Log_Error("Can't get online subsystem!");
}
}
private function InitRanks()
{
local Array<RankRelation> Relations;
local RankRelation Relation;
Relations = CfgRankRelations.default.Relation;
foreach Relations(Relation)
{
if (IsUID(Relation.ObjectID) || IsPlayerSteamID64(Relation.ObjectID))
{
AddRelation(Relation, PlayerRelations);
}
else if (IsGroupSteamID64(Relation.ObjectID))
{
AddRelation(Relation, GroupRelations);
}
else
{
`Log_Warn("Can't parse ID:" @ Relation.ObjectID);
}
}
}
private function AddRelation(RankRelation Relation, out Array<CachedRankRelation> OutArray)
{
local CachedRankRelation CachedRankRelation;
local Array<Rank> Ranks;
local Rank Rank;
if (AnyToUID(Relation.ObjectID, CachedRankRelation.UID))
{
CachedRankRelation.RawID = Relation.ObjectID;
Ranks = CfgRanks.default.Rank;
foreach Ranks(Rank)
{
if (Rank.RankID == Relation.RankID)
{
CachedRankRelation.Rank = Rank;
break;
}
}
if (CachedRankRelation.Rank.RankID > 0)
{
OutArray.AddItem(CachedRankRelation);
}
else
{
`Log_Warn("Rank with ID" @ Relation.RankID @ "not found");
}
}
else
{
`Log_Warn("Can't convert to UniqueNetID:" @ Relation.ObjectID);
}
}
private static function bool IsUID(String ID)
{
return (Left(ID, Len(MatchUID)) ~= MatchUID);
}
private static function bool IsPlayerSteamID64(String ID)
{
return (Left(ID, Len(MatchPlayerSteamID64)) ~= MatchPlayerSteamID64);
}
private static function bool IsGroupSteamID64(String ID)
{
return (Left(ID, Len(MatchGroupSteamID64)) ~= MatchGroupSteamID64);
}
private function bool AnyToUID(String ID, out UniqueNetId UID)
{
return IsUID(ID) ? OSS.StringToUniqueNetId(ID, UID) : OSS.Int64ToUniqueNetId(ID, UID);
}
private function PostInit()
{
`Log_Trace();
if (WorldInfo == None || WorldInfo.Game == None)
{
SetTimer(1.0f, false, nameof(PostInit));
return;
}
KFGI = KFGameInfo(WorldInfo.Game);
if (KFGI == None || KFGameInfo_VersusSurvival(KFGI) != None) // VersusSurvival is not supported (yet)
{
`Log_Fatal("Incompatible gamemode:" @ WorldInfo.Game);
SafeDestroy();
return;
}
KFGI.HUDType = class'YAS_HUD';
if (KFGI.GameReplicationInfo == None)
{
SetTimer(1.0f, false, nameof(PostInit));
return;
}
KFGRI = KFGameReplicationInfo(KFGI.GameReplicationInfo);
if (KFGRI == None)
{
`Log_Fatal("Incompatible Replication info:" @ KFGI.GameReplicationInfo);
SafeDestroy();
return;
}
if (KFGI.PlayfabInter != None && KFGI.PlayfabInter.GetGameSettings() != None)
{
KFOGS = KFOnlineGameSettings(KFGI.PlayfabInter.GetGameSettings());
}
else if (KFGI.GameInterface != None)
{
KFOGS = KFOnlineGameSettings(
KFGI.GameInterface.GetGameSettings(
KFGI.PlayerReplicationInfoClass.default.SessionName));
}
if (KFOGS == None)
{
SetTimer(1.0f, false, nameof(PostInit));
return;
}
KFGIS = KFGameInfo_Survival(KFGI);
KFGIE = KFGameInfo_Endless(KFGI);
SetTimer(UpdateInterval, true, nameof(UpdateTimer));
if (CfgMessageOfTheDay.default.Message.Length > 0)
{
MessageOfTheDayTimer();
SetTimer(CfgMessageOfTheDay.default.DisplayTime, true, nameof(MessageOfTheDayTimer));
}
}
private function UpdateTimer()
{
local YAS_RepInfoOwner RepInfo;
foreach RepInfos(RepInfo)
{
RepInfo.DynamicServerName = KFOGS.OwningPlayerName;
RepInfo.UsesStats = KFOGS.bUsesStats;
RepInfo.Custom = KFOGS.bCustom;
RepInfo.PasswordRequired = KFOGS.bRequiresPassword;
}
}
private function MessageOfTheDayTimer()
{
local YAS_RepInfoOwner RepInfo;
local int MessageIndex;
if (CfgMessageOfTheDay.default.bRandomize)
{
MessageIndex = Rand(CfgMessageOfTheDay.default.Message.Length);
}
else
{
MessageIndex = LastMessageID + 1;
}
if (MessageIndex == LastMessageID)
{
++MessageIndex;
}
if (MessageIndex >= CfgMessageOfTheDay.default.Message.Length)
{
MessageIndex = 0;
}
foreach RepInfos(RepInfo)
{
RepInfo.MessageOfTheDay = CfgMessageOfTheDay.default.Message[MessageIndex];
}
LastMessageID = MessageIndex;
}
public function NotifyLogin(Controller C)
{
local YAS_RepInfoOwner RepInfo;
`Log_Trace();
RepInfo = CreateRepInfo(C);
if (RepInfo == None)
{
`Log_Error("Can't create RepInfo for:" @ C);
return;
}
InitRank(RepInfo);
}
public function NotifyLogout(Controller C)
{
local YAS_RepInfoOwner RepInfo;
`Log_Trace();
RepInfo = FindRepInfo(C);
if (!DestroyRepInfo(RepInfo))
{
`Log_Error("Can't destroy RepInfo of:" @ C);
}
}
public function YAS_RepInfoOwner CreateRepInfo(Controller C)
{
local YAS_RepInfoOwner OwnerRepInfo;
local YAS_RepInfoPlayer PlayerRepInfo;
`Log_Trace();
OwnerRepInfo = Spawn(class'YAS_RepInfoOwner', C);
PlayerRepInfo = Spawn(class'YAS_RepInfoPlayer', C);
if (OwnerRepInfo != None && PlayerRepInfo != None)
{
RepInfos.AddItem(OwnerRepInfo);
OwnerRepInfo.PlayerRepInfo = PlayerRepInfo;
OwnerRepInfo.YAS = Self;
OwnerRepInfo.LogLevel = LogLevel;
OwnerRepInfo.RankPlayer = CfgRanks.default.Player;
OwnerRepInfo.RankAdmin = CfgRanks.default.Admin;
OwnerRepInfo.MessageOfTheDay = CfgMessageOfTheDay.default.Message[LastMessageID];
return OwnerRepInfo;
}
return None;
}
private function YAS_RepInfoOwner FindRepInfo(Controller C)
{
local YAS_RepInfoOwner RepInfo;
if (C == None) return None;
foreach RepInfos(RepInfo)
{
if (RepInfo.Owner == C)
{
return RepInfo;
}
}
return None;
}
public function bool DestroyRepInfo(YAS_RepInfoOwner RepInfo)
{
`Log_Trace();
if (RepInfo == None) return false;
RepInfos.RemoveItem(RepInfo);
RepInfo.PlayerRepInfo.SafeDestroy();
RepInfo.SafeDestroy();
return true;
}
private function InitRank(YAS_RepInfoOwner RepInfo)
{
local CachedRankRelation Rel;
local String JoinedGroupIDs;
local PlayerReplicationInfo PRI;
local KFPlayerController KFPC;
local Array<String> StringGroupIDs;
`Log_Trace();
KFPC = RepInfo.GetKFPC();
if (KFPC == None) return;
PRI = KFPC.PlayerReplicationInfo;
if (PRI == None) return;
foreach PlayerRelations(Rel)
{
if (Rel.UID.Uid == PRI.UniqueID.Uid)
{
RepInfo.PlayerRepInfo.Rank = Rel.Rank;
break;
}
}
if (RepInfo.PlayerRepInfo.Rank.RankID <= 0 && !KFPC.bIsEosPlayer)
{
foreach GroupRelations(Rel)
{
StringGroupIDs.AddItem(Rel.RawID);
}
JoinArray(StringGroupIDs, JoinedGroupIDs);
RepInfo.CheckGroupRanks(JoinedGroupIDs);
}
}
public function Rank RankByGroupID(UniqueNetId GroupUID)
{
local CachedRankRelation Rel;
foreach GroupRelations(Rel) if (Rel.UID == GroupUID) break;
return Rel.Rank;
}
DefaultProperties
{
}
class YAS extends Info
config(YAS);
const LatestVersion = 1;
const CfgRanks = class'Ranks';
const CfgRankRelations = class'RankRelations';
const CfgMessageOfTheDay = class'MessageOfTheDay';
const UpdateInterval = 1.0f;
const MatchUID = "0x";
const MatchPlayerSteamID64 = "76561";
const MatchGroupSteamID64 = "10358279";
var private config int Version;
var private config E_LogLevel LogLevel;
var private KFGameInfo KFGI;
var private KFGameInfo_Survival KFGIS;
var private KFGameInfo_Endless KFGIE;
var private KFGameReplicationInfo KFGRI;
var private KFOnlineGameSettings KFOGS;
var private OnlineSubsystemSteamworks OSS;
var private Array<YAS_RepInfoOwner> RepInfos;
var private Array<CachedRankRelation> PlayerRelations;
var private Array<CachedRankRelation> GroupRelations;
var private int LastMessageID;
public simulated function bool SafeDestroy()
{
`Log_Trace();
return (bPendingDelete || bDeleteMe || Destroy());
}
public event PreBeginPlay()
{
`Log_Trace();
if (WorldInfo.NetMode == NM_Client)
{
`Log_Fatal("NetMode == NM_Client");
SafeDestroy();
return;
}
Super.PreBeginPlay();
PreInit();
}
public event PostBeginPlay()
{
`Log_Trace();
if (bPendingDelete || bDeleteMe) return;
Super.PostBeginPlay();
PostInit();
}
private function PreInit()
{
`Log_Trace();
if (Version == `NO_CONFIG)
{
LogLevel = LL_Info;
SaveConfig();
}
CfgRanks.static.InitConfig(Version, LatestVersion);
CfgRankRelations.static.InitConfig(Version, LatestVersion);
CfgMessageOfTheDay.static.InitConfig(Version, LatestVersion);
switch (Version)
{
case `NO_CONFIG:
`Log_Info("Config created");
case MaxInt:
`Log_Info("Config updated to version" @ LatestVersion);
break;
case LatestVersion:
`Log_Info("Config is up-to-date");
break;
default:
`Log_Warn("The config version is higher than the current version (are you using an old mutator?)");
`Log_Warn("Config version is" @ Version @ "but current version is" @ LatestVersion);
`Log_Warn("The config version will be changed to" @ LatestVersion);
break;
}
if (LatestVersion != Version)
{
Version = LatestVersion;
SaveConfig();
}
if (LogLevel == LL_WrongLevel)
{
LogLevel = LL_Info;
`Log_Warn("Wrong 'LogLevel', return to default value");
SaveConfig();
}
`Log_Base("LogLevel:" @ LogLevel);
OSS = OnlineSubsystemSteamworks(class'GameEngine'.static.GetOnlineSubsystem());
if (OSS != None)
{
InitRanks();
}
else
{
`Log_Error("Can't get online subsystem!");
}
}
private function InitRanks()
{
local Array<RankRelation> Relations;
local RankRelation Relation;
Relations = CfgRankRelations.default.Relation;
foreach Relations(Relation)
{
if (IsUID(Relation.ObjectID) || IsPlayerSteamID64(Relation.ObjectID))
{
AddRelation(Relation, PlayerRelations);
}
else if (IsGroupSteamID64(Relation.ObjectID))
{
AddRelation(Relation, GroupRelations);
}
else
{
`Log_Warn("Can't parse ID:" @ Relation.ObjectID);
}
}
}
private function AddRelation(RankRelation Relation, out Array<CachedRankRelation> OutArray)
{
local CachedRankRelation CachedRankRelation;
local Array<Rank> Ranks;
local Rank Rank;
if (AnyToUID(Relation.ObjectID, CachedRankRelation.UID))
{
CachedRankRelation.RawID = Relation.ObjectID;
Ranks = CfgRanks.default.Rank;
foreach Ranks(Rank)
{
if (Rank.RankID == Relation.RankID)
{
CachedRankRelation.Rank = Rank;
break;
}
}
if (CachedRankRelation.Rank.RankID > 0)
{
OutArray.AddItem(CachedRankRelation);
}
else
{
`Log_Warn("Rank with ID" @ Relation.RankID @ "not found");
}
}
else
{
`Log_Warn("Can't convert to UniqueNetID:" @ Relation.ObjectID);
}
}
private static function bool IsUID(String ID)
{
return (Left(ID, Len(MatchUID)) ~= MatchUID);
}
private static function bool IsPlayerSteamID64(String ID)
{
return (Left(ID, Len(MatchPlayerSteamID64)) ~= MatchPlayerSteamID64);
}
private static function bool IsGroupSteamID64(String ID)
{
return (Left(ID, Len(MatchGroupSteamID64)) ~= MatchGroupSteamID64);
}
private function bool AnyToUID(String ID, out UniqueNetId UID)
{
return IsUID(ID) ? OSS.StringToUniqueNetId(ID, UID) : OSS.Int64ToUniqueNetId(ID, UID);
}
private function PostInit()
{
`Log_Trace();
if (WorldInfo == None || WorldInfo.Game == None)
{
SetTimer(1.0f, false, nameof(PostInit));
return;
}
KFGI = KFGameInfo(WorldInfo.Game);
if (KFGI == None || KFGameInfo_VersusSurvival(KFGI) != None) // VersusSurvival is not supported (yet)
{
`Log_Fatal("Incompatible gamemode:" @ WorldInfo.Game);
SafeDestroy();
return;
}
KFGI.HUDType = class'YAS_HUD';
if (KFGI.GameReplicationInfo == None)
{
SetTimer(1.0f, false, nameof(PostInit));
return;
}
KFGRI = KFGameReplicationInfo(KFGI.GameReplicationInfo);
if (KFGRI == None)
{
`Log_Fatal("Incompatible Replication info:" @ KFGI.GameReplicationInfo);
SafeDestroy();
return;
}
if (KFGI.PlayfabInter != None && KFGI.PlayfabInter.GetGameSettings() != None)
{
KFOGS = KFOnlineGameSettings(KFGI.PlayfabInter.GetGameSettings());
}
else if (KFGI.GameInterface != None)
{
KFOGS = KFOnlineGameSettings(
KFGI.GameInterface.GetGameSettings(
KFGI.PlayerReplicationInfoClass.default.SessionName));
}
if (KFOGS == None)
{
SetTimer(1.0f, false, nameof(PostInit));
return;
}
KFGIS = KFGameInfo_Survival(KFGI);
KFGIE = KFGameInfo_Endless(KFGI);
SetTimer(UpdateInterval, true, nameof(UpdateTimer));
if (CfgMessageOfTheDay.default.Message.Length > 0)
{
MessageOfTheDayTimer();
SetTimer(CfgMessageOfTheDay.default.DisplayTime, true, nameof(MessageOfTheDayTimer));
}
}
private function UpdateTimer()
{
local YAS_RepInfoOwner RepInfo;
foreach RepInfos(RepInfo)
{
RepInfo.DynamicServerName = KFOGS.OwningPlayerName;
RepInfo.UsesStats = KFOGS.bUsesStats;
RepInfo.Custom = KFOGS.bCustom;
RepInfo.PasswordRequired = KFOGS.bRequiresPassword;
}
}
private function MessageOfTheDayTimer()
{
local YAS_RepInfoOwner RepInfo;
local int MessageIndex;
if (CfgMessageOfTheDay.default.bRandomize)
{
MessageIndex = Rand(CfgMessageOfTheDay.default.Message.Length);
}
else
{
MessageIndex = LastMessageID + 1;
}
if (MessageIndex == LastMessageID)
{
++MessageIndex;
}
if (MessageIndex >= CfgMessageOfTheDay.default.Message.Length)
{
MessageIndex = 0;
}
foreach RepInfos(RepInfo)
{
RepInfo.MessageOfTheDay = CfgMessageOfTheDay.default.Message[MessageIndex];
}
LastMessageID = MessageIndex;
}
public function NotifyLogin(Controller C)
{
local YAS_RepInfoOwner RepInfo;
`Log_Trace();
RepInfo = CreateRepInfo(C);
if (RepInfo == None)
{
`Log_Error("Can't create RepInfo for:" @ C);
return;
}
InitRank(RepInfo);
}
public function NotifyLogout(Controller C)
{
local YAS_RepInfoOwner RepInfo;
`Log_Trace();
RepInfo = FindRepInfo(C);
if (!DestroyRepInfo(RepInfo))
{
`Log_Error("Can't destroy RepInfo of:" @ C);
}
}
public function YAS_RepInfoOwner CreateRepInfo(Controller C)
{
local YAS_RepInfoOwner OwnerRepInfo;
local YAS_RepInfoPlayer PlayerRepInfo;
`Log_Trace();
OwnerRepInfo = Spawn(class'YAS_RepInfoOwner', C);
PlayerRepInfo = Spawn(class'YAS_RepInfoPlayer', C);
if (OwnerRepInfo != None && PlayerRepInfo != None)
{
RepInfos.AddItem(OwnerRepInfo);
OwnerRepInfo.PlayerRepInfo = PlayerRepInfo;
OwnerRepInfo.YAS = Self;
OwnerRepInfo.LogLevel = LogLevel;
OwnerRepInfo.RankPlayer = CfgRanks.default.Player;
OwnerRepInfo.RankAdmin = CfgRanks.default.Admin;
OwnerRepInfo.MessageOfTheDay = CfgMessageOfTheDay.default.Message[LastMessageID];
return OwnerRepInfo;
}
return None;
}
private function YAS_RepInfoOwner FindRepInfo(Controller C)
{
local YAS_RepInfoOwner RepInfo;
if (C == None) return None;
foreach RepInfos(RepInfo)
{
if (RepInfo.Owner == C)
{
return RepInfo;
}
}
return None;
}
public function bool DestroyRepInfo(YAS_RepInfoOwner RepInfo)
{
`Log_Trace();
if (RepInfo == None) return false;
RepInfos.RemoveItem(RepInfo);
RepInfo.PlayerRepInfo.SafeDestroy();
RepInfo.SafeDestroy();
return true;
}
private function InitRank(YAS_RepInfoOwner RepInfo)
{
local CachedRankRelation Rel;
local String JoinedGroupIDs;
local PlayerReplicationInfo PRI;
local KFPlayerController KFPC;
local Array<String> StringGroupIDs;
`Log_Trace();
KFPC = RepInfo.GetKFPC();
if (KFPC == None) return;
PRI = KFPC.PlayerReplicationInfo;
if (PRI == None) return;
foreach PlayerRelations(Rel)
{
if (Rel.UID.Uid == PRI.UniqueID.Uid)
{
RepInfo.PlayerRepInfo.Rank = Rel.Rank;
break;
}
}
if (RepInfo.PlayerRepInfo.Rank.RankID <= 0 && !KFPC.bIsEosPlayer)
{
foreach GroupRelations(Rel)
{
StringGroupIDs.AddItem(Rel.RawID);
}
JoinArray(StringGroupIDs, JoinedGroupIDs);
RepInfo.CheckGroupRanks(JoinedGroupIDs);
}
}
public function Rank RankByGroupID(UniqueNetId GroupUID)
{
local CachedRankRelation Rel;
foreach GroupRelations(Rel) if (Rel.UID == GroupUID) break;
return Rel.Rank;
}
DefaultProperties
{
}

View File

@ -1,4 +1,4 @@
[Flags]
AllowDownload=True
ClientOptional=False
ServerSideOnly=False
[Flags]
AllowDownload=True
ClientOptional=False
ServerSideOnly=False

View File

@ -1,5 +1,5 @@
class YASMut extends KFMutator;
var private YAS YAS;
public simulated function bool SafeDestroy()
@ -10,19 +10,19 @@ public simulated function bool SafeDestroy()
public event PreBeginPlay()
{
Super.PreBeginPlay();
if (WorldInfo.NetMode == NM_Client) return;
foreach WorldInfo.DynamicActors(class'YAS', YAS)
{
break;
}
if (YAS == None)
{
YAS = WorldInfo.Spawn(class'YAS');
}
if (YAS == None)
{
`Log_Base("FATAL: Can't Spawn 'YAS'");
@ -33,7 +33,7 @@ public event PreBeginPlay()
public function AddMutator(Mutator Mut)
{
if (Mut == Self) return;
if (Mut.Class == Class)
Mut.Destroy();
else
@ -43,18 +43,18 @@ public function AddMutator(Mutator Mut)
public function NotifyLogin(Controller C)
{
YAS.NotifyLogin(C);
Super.NotifyLogin(C);
}
public function NotifyLogout(Controller C)
{
YAS.NotifyLogout(C);
Super.NotifyLogout(C);
}
DefaultProperties
{
}
}

View File

@ -107,4 +107,4 @@ exec function SetShowScores(bool bNewValue)
defaultproperties
{
ScoreboardClass=class'YAS_ScoreBoard'
}
}

View File

@ -24,7 +24,7 @@ replication
{
if (bNetInitial)
LogLevel, RankPlayer, RankAdmin;
if (bNetDirty)
DynamicServerName, UsesStats, Custom, PasswordRequired, MessageOfTheDay;
}
@ -32,48 +32,48 @@ replication
public simulated function bool SafeDestroy()
{
`Log_Trace();
return (bPendingDelete || bDeleteMe || Destroy());
}
public simulated event ReplicatedEvent(name VarName)
{
`Log_Trace();
switch (VarName)
{
case 'LogLevel':
if (SC != None) SC.LogLevel = LogLevel;
break;
case 'RankPlayer':
if (SC != None) SC.RankPlayer = RankPlayer;
break;
case 'RankAdmin':
if (SC != None) SC.RankAdmin = RankAdmin;
break;
case 'DynamicServerName':
if (SC != None) SC.DynamicServerName = DynamicServerName;
break;
case 'MessageOfTheDay':
if (SC != None) SC.MessageOfTheDay = MessageOfTheDay;
break;
case 'UsesStats':
if (SC != None) SC.UsesStats = UsesStats;
break;
case 'Custom':
if (SC != None) SC.Custom = Custom;
break;
case 'PasswordRequired':
if (SC != None) SC.PasswordRequired = PasswordRequired;
break;
default:
super.ReplicatedEvent(VarName);
break;
@ -83,37 +83,37 @@ public simulated event ReplicatedEvent(name VarName)
public simulated event PreBeginPlay()
{
`Log_Trace();
if (bPendingDelete || bDeleteMe) return;
Super.PreBeginPlay();
if (Role < ROLE_Authority || WorldInfo.NetMode == NM_StandAlone)
{
GetScoreboard();
}
if (Role == ROLE_Authority || WorldInfo.NetMode == NM_StandAlone)
{
SetTimer(UpdatePlayerStatsTimer, true, nameof(UpdatePlayerStats));
}
GetOnlineSubsystem();
}
public simulated event PostBeginPlay()
{
if (bPendingDelete || bDeleteMe) return;
Super.PostBeginPlay();
}
public function UpdatePlayerStats()
{
if (GetKFPC() == None || KFPC.MatchStats == None) return;
if (WorldInfo.GRI == None || KFGameReplicationInfo(WorldInfo.GRI) == None) return;
// At the end of the wave, TotalDamageDealt is incremented by GetDamageDealtInWave(),
// but GetDamageDealtInWave() is not reset immediately.
// In order not to receive a short-term doubling of damage in statistics,
@ -129,17 +129,17 @@ public reliable client function CheckGroupRanks(String JoinedGroupIDs)
local Array<String> StringGroupIDs;
local String StringGroupID;
local UniqueNetId GroupUID;
`Log_Trace();
StringGroupIDs = SplitString(JoinedGroupIDs);
if (GetOnlineSubsystem() == None)
{
`Log_Error("Can't get online subsystem");
return;
}
foreach StringGroupIDs(StringGroupID)
{
if (OSS.Int64ToUniqueNetId(StringGroupID, GroupUID))
@ -147,7 +147,7 @@ public reliable client function CheckGroupRanks(String JoinedGroupIDs)
PendingGroupIDs.AddItem(GroupUID);
}
}
Retries = 0;
CheckGroupsCycle();
}
@ -155,15 +155,15 @@ public reliable client function CheckGroupRanks(String JoinedGroupIDs)
private simulated function CheckGroupsCycle()
{
local UniqueNetId GroupUID;
`Log_Trace();
if (Retries++ >= MaxRetries) return;
// CheckPlayerGroup doesn't return real values right away,
// so we do a dry run and a few checks just in case
foreach PendingGroupIDs(GroupUID) OSS.CheckPlayerGroup(GroupUID);
foreach PendingGroupIDs(GroupUID)
{
if (OSS.CheckPlayerGroup(GroupUID))
@ -173,16 +173,16 @@ private simulated function CheckGroupsCycle()
return;
}
}
SetTimer(0.2f, false, nameof(CheckGroupsCycle));
}
private reliable server function ServerApplyMembership(UniqueNetId GroupUID)
{
local Rank Rank;
`Log_Trace();
Rank = YAS.RankByGroupID(GroupUID);
if (Rank.RankID > 0)
{
@ -198,35 +198,35 @@ private reliable server function ServerApplyMembership(UniqueNetId GroupUID)
public simulated function KFPlayerController GetKFPC()
{
`Log_Trace();
if (KFPC != None) return KFPC;
KFPC = KFPlayerController(Owner);
if (KFPC == None && ROLE < ROLE_Authority)
{
KFPC = KFPlayerController(GetALocalPlayerController());
}
return KFPC;
}
private simulated function OnlineSubsystemSteamworks GetOnlineSubsystem()
{
`Log_Trace();
if (OSS == None)
{
OSS = OnlineSubsystemSteamworks(class'GameEngine'.static.GetOnlineSubsystem());
}
return OSS;
}
private reliable client function GetScoreboard()
{
`Log_Trace();
if (SC == None)
{
if (GetKFPC() != None && KFPC.myHUD != None)
@ -234,22 +234,22 @@ private reliable client function GetScoreboard()
SC = YAS_HUD(KFPC.myHUD).Scoreboard;
}
}
if (SC == None)
{
SetTimer(0.2f, false, nameof(GetScoreboard));
return;
}
InitScoreboard();
}
private simulated function InitScoreboard()
{
`Log_Trace();
if (SC == None) return;
SC.LogLevel = LogLevel;
SC.RankPlayer = RankPlayer;
SC.RankAdmin = RankAdmin;
@ -264,10 +264,10 @@ defaultproperties
{
Role = ROLE_Authority
RemoteRole = ROLE_SimulatedProxy
bAlwaysRelevant = false
bOnlyRelevantToOwner = true
bSkipActorPropertyReplication = false
Retries = 0
}
}

View File

@ -8,7 +8,7 @@ replication
{
if (bNetInitial)
UID;
if (bNetDirty)
Rank, DamageDealt;
}
@ -21,9 +21,9 @@ public simulated function bool SafeDestroy()
public simulated event PreBeginPlay()
{
if (bPendingDelete || bDeleteMe) return;
Super.PreBeginPlay();
if (Role == ROLE_Authority || WorldInfo.NetMode == NM_StandAlone)
{
if (Controller(Owner) != None && Controller(Owner).PlayerReplicationInfo != None)
@ -37,7 +37,7 @@ defaultproperties
{
Role = ROLE_Authority
RemoteRole = ROLE_SimulatedProxy
bAlwaysRelevant = true
bSkipActorPropertyReplication = false
}

View File

@ -13,7 +13,7 @@ const ListItemsDefault = 12;
const FontScalarModCompact = 1.0f;
const FontScalarModDefault = 1.25f;
const ShowDamage = true;
const ShowDamage = true;
const IconRanked = Texture2D'DailyObjective_UI.KF2_Dailies_Icon_PerkLvl'; // where the hell is the right icon?
//const IconCustom = Texture2D'UI_Menus.ServerBrowserMenu_SWF_I26';
@ -68,7 +68,7 @@ var private float FontScalarMod;
function YAS_RepInfoPlayer FindRepInfo(KFPlayerReplicationInfo KFPRI)
{
local YAS_RepInfoPlayer RepInfo;
foreach RepInfos(RepInfo)
{
if (RepInfo.UID.Uid == KFPRI.UniqueId.Uid)
@ -81,39 +81,39 @@ function YAS_RepInfoPlayer FindRepInfo(KFPlayerReplicationInfo KFPRI)
else return RepInfo;
}
}
foreach KFPRI.DynamicActors(class'YAS_RepInfoPlayer', RepInfo)
{
if (RepInfo.UID.Uid == KFPRI.UniqueId.Uid)
{
if (RepInfo.bPendingDelete || RepInfo.bDeleteMe) continue;
RepInfos.AddItem(RepInfo);
return RepInfo;
}
}
return None;
}
function Rank PlayerRank(YAS_RepInfoPlayer RepInfo, bool bAdmin)
{
local Rank Rank;
`Log_Trace();
Rank = class'YAS_Types'.static.FromSystemRank(RankPlayer);
if (RepInfo != None)
{
Rank = RepInfo.Rank;
}
if (bAdmin && !Rank.OverrideAdmin)
{
Rank = class'YAS_Types'.static.FromSystemRank(RankAdmin);
}
return Rank;
}
@ -140,7 +140,7 @@ function float MinPerkBoxWidth(float FontScalar)
Canvas.TextSize(PerkName $ "A", XL, YL, FontScalar * FontScalarMod, FontScalar * FontScalarMod);
if (XL > MaxWidth) MaxWidth = XL;
}
return MaxWidth;
}
@ -201,27 +201,27 @@ delegate bool InOrder(KFPlayerReplicationInfo P1, KFPlayerReplicationInfo P2)
function string WaveText()
{
local int CurrentWaveNum;
CurrentWaveNum = KFGRI.WaveNum;
if (KFGRI.IsBossWave())
{
if (KFGRI.IsBossWave())
{
return class'KFGFxHUD_WaveInfo'.default.BossWaveString;
}
}
else if (KFGRI.IsFinalWave())
{
return class'KFGFxHUD_ScoreboardMapInfoContainer'.default.FinalString;
}
else
{
else
{
if (KFGRI.default.bEndlessMode)
{
return "" $ CurrentWaveNum;
return "" $ CurrentWaveNum;
}
else
{
return CurrentWaveNum $ " / " $ KFGRI.GetFinalWaveNum();
}
}
}
}
function KFGameReplicationInfo GetKFGRI()
@ -230,7 +230,7 @@ function KFGameReplicationInfo GetKFGRI()
{
KFGRI = KFGameReplicationInfo(GetPlayer().WorldInfo.GRI);
}
return KFGRI;
}
@ -245,7 +245,7 @@ function DrawMenu()
local float BorderSize, EdgeSize, PlayerListSizeY;
local Color ColorTMP;
local Array<String> MessageOfTheDayLines;
PC = GetPlayer();
if (GetKFGRI() == None)
{
@ -320,30 +320,30 @@ function DrawMenu()
Canvas.TextSize("ABC", XL, YL, FontScalar, FontScalar);
BorderSize = Owner.HUDOwner.ScaledBorderSize;
EdgeSize = Owner.CurrentStyle.PickEdgeSize();
// Server Info
XPosCenter = Canvas.ClipX * 0.5;
Width = Canvas.ClipX * HeaderWidthRatio; // Full Box Width
XPos = XPosCenter - Width * 0.5;
YPos = YL;
BoxW = Width;
BoxX = XPos;
BoxH = YL + BorderSize;
// Top Rect (Server name)
Canvas.SetDrawColorStruct(Settings.Style.ServerNameBoxColor);
Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, EdgeSize, Settings.Style.ShapeServerNameBox);
Canvas.SetDrawColorStruct(Settings.Style.ServerNameTextColor);
S = (DynamicServerName == "" ? KFGRI.ServerName : DynamicServerName);
DrawTextShadowHVCenter(S, BoxX, YPos, BoxW, BoxH, FontScalar);
// icons
ColorTMP = Settings.Style.ServerNameTextColor;
ColorTMP.A = 200;
Canvas.SetDrawColorStruct(ColorTMP);
if (PasswordRequired)
{
Owner.CurrentStyle.DrawTexture(
@ -353,7 +353,7 @@ function DrawMenu()
BoxH - BorderSize*4,
BoxH - BorderSize*4);
}
if (UsesStats)
{
//if (Custom)
@ -384,42 +384,42 @@ function DrawMenu()
// BoxH - BorderSize*4,
// 256, 256);
//}
YPos += BoxH;
// Mid Left Rect (Info)
BoxW = Width * 0.7;
BoxH = YL * 2 + BorderSize * 2;
Canvas.SetDrawColorStruct(Settings.Style.GameInfoBoxColor);
Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, EdgeSize, Settings.Style.ShapeGameInfoBox);
Canvas.SetDrawColorStruct(Settings.Style.GameInfoTextColor);
S = class'KFCommon_LocalizedStrings'.static.GetFriendlyMapName(PC.WorldInfo.GetMapName(true));
DrawTextShadowHLeftVCenter(S, BoxX + EdgeSize, YPos, BoxH/2, FontScalar);
S = KFGRI.GameClass.default.GameName $ " - " $ class'KFCommon_LocalizedStrings'.Static.GetDifficultyString(KFGRI.GameDifficulty);
DrawTextShadowHLeftVCenter(S, BoxX + EdgeSize, YPos + BoxH/2, BoxH/2, FontScalar);
// Mid Right Rect (Wave)
BoxX = BoxX + BoxW;
BoxW = Width - BoxW;
Canvas.SetDrawColorStruct(Settings.Style.WaveBoxColor);
Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, EdgeSize, Settings.Style.ShapeWaveInfoBox);
Canvas.SetDrawColorStruct(Settings.Style.WaveTextColor);
S = class'KFGFxHUD_ScoreboardMapInfoContainer'.default.WaveString;
S = class'KFGFxHUD_ScoreboardMapInfoContainer'.default.WaveString;
DrawTextShadowHVCenter(S, BoxX, YPos, BoxW, BoxH / 2, FontScalar);
DrawTextShadowHVCenter(WaveText(), BoxX, YPos + BoxH / 2, BoxW, BoxH / 2, FontScalar);
YPos += BoxH;
// Bottom Rect (Players count)
BoxX = XPos;
BoxW = Width;
BoxH = YL + BorderSize;
Canvas.SetDrawColorStruct(Settings.Style.PlayerCountBoxColor);
Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, EdgeSize, Settings.Style.ShapePlayersCountBox);
/*
Owner.CurrentStyle.DrawTexture(IconPlayer,
BoxX + EdgeSize + IconIndent,
@ -428,15 +428,15 @@ function DrawMenu()
BoxH - IconIndent*2,
MakeColor(250,250,250,250));
*/
Canvas.SetDrawColorStruct(Settings.Style.PlayerCountTextColor);
S = Players $ ":" @ NumPlayer @ "/" @ KFGRI.MaxHumanCount $ " " $ Spectators $ ": " $ NumSpec; ;
S = Players $ ":" @ NumPlayer @ "/" @ KFGRI.MaxHumanCount $ " " $ Spectators $ ": " $ NumSpec; ;
Canvas.TextSize(S, XL, YL, FontScalar, FontScalar);
DrawTextShadowHLeftVCenter(S, BoxX + EdgeSize, YPos, BoxH, FontScalar);
S = Owner.CurrentStyle.GetTimeString(KFGRI.ElapsedTime);
DrawTextShadowHVCenter(S, XPos + Width * 0.7, YPos, Width * 0.3, BoxH, FontScalar);
YPos += BoxH;
// Header
@ -454,8 +454,8 @@ function DrawMenu()
Settings.Style.ShapeHeaderBox);
// Calc X offsets
MinBoxW = Width * 0.07; // minimum width for column
MinBoxW = Width * 0.07; // minimum width for column
// Health
HealthXPos = 0;
BoxW = 0;
@ -465,9 +465,9 @@ function DrawMenu()
{
HealthWBox = PlayersList.GetItemHeight();
}
PlayerXPos = HealthXPos + HealthWBox + PlayersList.GetItemHeight() + EdgeSize;
Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.PingString$" ", XL, YL, FontScalar, FontScalar);
PingWBox = XL < MinBoxW ? MinBoxW : XL;
if (NumPlayer <= PlayersList.ListItemsPerPage)
@ -475,28 +475,28 @@ function DrawMenu()
else
ScrollBarWidth = BorderSize * 8;
PingXPos = Width - PingWBox - ScrollBarWidth;
Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.AssistsString$" ", XL, YL, FontScalar, FontScalar);
AssistWBox = XL < MinBoxW ? MinBoxW : XL;
AssistXPos = PingXPos - AssistWBox;
Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.KillsString$" ", XL, YL, FontScalar, FontScalar);
KillsWBox = XL < MinBoxW ? MinBoxW : XL;
KillsXPos = AssistXPos - KillsWBox;
Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.DoshString$" ", XL, YL, FontScalar, FontScalar);
Canvas.TextSize("999999", DoshSize, YL, FontScalar, FontScalar);
DoshWBox = XL < DoshSize ? DoshSize : XL;
DoshXPos = KillsXPos - DoshWBox;
BoxW = MinPerkBoxWidth(FontScalar);
PerkWBox = BoxW < MinBoxW ? MinBoxW : BoxW;
PerkXPos = DoshXPos - PerkWBox;
Canvas.TextSize("000", XL, YL, FontScalar, FontScalar);
LevelWBox = XL;
LevelXPos = PerkXPos - LevelWBox;
// Header texts
Canvas.SetDrawColorStruct(Settings.Style.ListHeaderTextColor);
DrawTextShadowHLeftVCenter(class'KFGFxHUD_ScoreboardWidget'.default.PlayerString, XPos + PlayerXPos, YPos, BoxH, FontScalar);
@ -512,7 +512,7 @@ function DrawMenu()
}
DrawTextShadowHVCenter(class'KFGFxHUD_ScoreboardWidget'.default.DoshString, XPos + DoshXPos, YPos, DoshWBox, BoxH, FontScalar);
DrawTextShadowHVCenter(class'KFGFxHUD_ScoreboardWidget'.default.PingString, XPos + PingXPos, YPos, PingWBox, BoxH, FontScalar);
ColorTMP = Settings.Style.ListHeaderTextColor;
ColorTMP.A = 150;
Canvas.SetDrawColorStruct(ColorTMP);
@ -524,17 +524,17 @@ function DrawMenu()
BoxH - BorderSize * 2,
256,
256);
PlayersList.XPosition = ((Canvas.ClipX - Width) * 0.5) / InputPos[2];
PlayersList.YPosition = (YPos + YL + BorderSize * 4) / InputPos[3];
PlayersList.YSize = (1.f - PlayersList.YPosition) - 0.15;
PlayersList.ChangeListSize(KFPRIArray.Length);
PlayerListSizeY = PlayersList.GetItemHeight() * PlayerEntryHeightMod * (NumPlayer <= PlayersList.ListItemsPerPage ? NumPlayer : PlayersList.ListItemsPerPage);
PlayerListSizeY -= PlayersList.GetItemHeight() * PlayerEntryHeightMod - PlayersList.GetItemHeight();
// Scroll bar (fake)
// This is an imitation of a scroll bar
// just to let people know that they can scroll the mouse wheel.
@ -552,10 +552,10 @@ function DrawMenu()
EdgeSize,
0);
}
// MessageOfTheDay
MessageOfTheDayLines = SplitString(MessageOfTheDay, "\n");
YPos += BoxH + BorderSize * 6 + PlayerListSizeY;
Width = Canvas.ClipX * PlayerListWidthRatio;
BoxH = YL + BorderSize;
@ -567,7 +567,7 @@ function DrawMenu()
BoxH * (MessageOfTheDayLines.Length > 0 ? MessageOfTheDayLines.Length : 1),
EdgeSize,
152);
if (MessageOfTheDay != "")
{
Canvas.SetDrawColorStruct(Settings.Style.ListHeaderTextColor);
@ -591,23 +591,23 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
local bool bIsZED;
local int Ping;
local Rank Rank;
local float BorderSize, EdgeSize;
local int Shape, ShapeHealth;
local Color HealthBoxColor;
BorderSize = Owner.HUDOwner.ScaledBorderSize;
EdgeSize = Owner.CurrentStyle.PickEdgeSize();
YOffset *= PlayerEntryHeightMod;
KFPRI = KFPRIArray[Index];
RepInfo = FindRepInfo(KFPRI);
Rank = PlayerRank(RepInfo, KFPRI.bAdmin);
if (KFGRI.bVersusGame)
{
bIsZED = KFTeamInfo_Zeds(KFPRI.Team) != None;
@ -619,9 +619,9 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
FontScalar *= FontScalarMod;
Canvas.TextSize("ABC", XL, YL, FontScalar, FontScalar);
ShapeHealth = Settings.Style.ShapeStateHealthBoxMidPlayer;
if (!(KFGRI.bMatchHasBegun || KFGRI.bTraderIsOpen || KFGRI.bWaveIsActive))
{
HealthBoxColor = Settings.Style.StateBoxColorLobby;
@ -634,7 +634,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
{
HealthBoxColor = HealthColorByPercent(ByteToFloat(KFPRI.PlayerHealthPercent));
}
// Health box
C.SetDrawColorStruct(HealthBoxColor);
Owner.CurrentStyle.DrawRectBox(
@ -644,7 +644,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
Height,
EdgeSize,
ShapeHealth);
if (!(KFGRI.bMatchHasBegun || KFGRI.bTraderIsOpen || KFGRI.bWaveIsActive))
{
ColorTMP = Settings.Style.ListHeaderTextColor;
@ -674,9 +674,9 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
C.SetDrawColorStruct(Settings.Style.StateTextColorHealthHigh);
DrawTextShadowHVCenter(String(KFPRI.PlayerHealth), HealthXPos, YOffset, HealthWBox, Height, FontScalar);
}
XPos += HealthWBox;
// PlayerBox
if (PlayerIndex == Index)
C.SetDrawColorStruct(Settings.Style.PlayerOwnerBoxColor);
@ -687,12 +687,12 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
BoxWidth = DoshXPos - HealthWBox - BorderSize * 2;
Owner.CurrentStyle.DrawRectBox(XPos, YOffset, BoxWidth, Height, EdgeSize, Shape);
XPos += BoxWidth;
// Right stats box
Shape = Settings.Style.ShapeStatsBoxMidPlayer;
BoxWidth = Width - XPos;
C.SetDrawColorStruct(Settings.Style.StatsBoxColor);
Owner.CurrentStyle.DrawRectBox(
@ -743,15 +743,15 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
C.SetPos(PerkIconPosX, PerkIconPosY);
C.DrawTile(KFPRI.CurrentPerkClass.default.PerkIcon, PerkIconSize, PerkIconSize, 0, 0, 256, 256);
}
if (Level < Settings.Level.Low[KFGRI.GameDifficulty])
C.SetDrawColorStruct(Settings.Style.LevelTextColorLow);
else if (Level < Settings.Level.High[KFGRI.GameDifficulty])
C.SetDrawColorStruct(Settings.Style.LevelTextColorMid);
else
C.SetDrawColorStruct(Settings.Style.LevelTextColorHigh);
S = String(Level);
DrawTextShadowHLeftVCenter(S, LevelXPos, YOffset, Height, FontScalar);
@ -767,7 +767,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
RealPlayerWBox = PerkXPos - PlayerXPos;
}
}
// Rank
if (Rank.RankName != "")
{
@ -780,7 +780,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
{
CheckAvatar(KFPRI, OwnerPC);
}
if (KFPRI.Avatar != None)
{
C.SetDrawColor(255, 255, 255, 255);
@ -814,7 +814,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
{
DrawTextShadowHVCenter(GetNiceSize(KFPRI.Assists), AssistXPos, YOffset, AssistWBox, Height, FontScalar);
}
// Dosh
if (bIsZED)
{
@ -827,7 +827,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
StrValue = GetNiceSize(int(KFPRI.Score));
}
DrawTextShadowHVCenter(StrValue, DoshXPos, YOffset, DoshWBox, Height, FontScalar);
// Ping
if (KFPRI.bBot)
{
@ -840,7 +840,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
C.SetDrawColorStruct(PingColorByPing(Ping));
S = String(Ping);
}
C.TextSize(S, XL, YL, FontScalar, FontScalar);
DrawTextShadowHVCenter(S, PingXPos, YOffset, PingWBox/2, Height, FontScalar);
C.SetDrawColor(250, 250, 250, 255);
@ -905,7 +905,7 @@ function ScrollMouseWheel(bool bUp)
function Color HealthColorByPercent(float FloatPercent)
{
local Color CRED, CYLW, CGRN, RV;
CRED = MakeColor(200, 0, 0, 150);
CYLW = MakeColor(200, 200, 0, 150);
CGRN = MakeColor(0, 200, 0, 150);
@ -926,14 +926,14 @@ function Color HealthColorByPercent(float FloatPercent)
{
RV = CRED;
}
return RV;
}
function Color PingColorByPing(int Ping)
{
local Color CRED, CYLW, CGRN, RV;
CRED = MakeColor(200, 0, 0, 250);
CYLW = MakeColor(200, 200, 0, 250);
CGRN = MakeColor(0, 200, 0, 250);
@ -954,7 +954,7 @@ function Color PingColorByPing(int Ping)
{
RV = CRED;
}
return RV;
}
@ -964,19 +964,19 @@ function Color PickDynamicColor(Color LowerColor, Color UpperColor, float FloatP
// Percent: 0.0f <------- FloatPercent -------> 1.0f
return MakeColor((
LowerColor.R < UpperColor.R ?
LowerColor.R + ((UpperColor.R - LowerColor.R) * FloatPercent) :
LowerColor.R + ((UpperColor.R - LowerColor.R) * FloatPercent) :
LowerColor.R - ((LowerColor.R - UpperColor.R) * FloatPercent)),
(
LowerColor.G < UpperColor.G ?
LowerColor.G + ((UpperColor.G - LowerColor.G) * FloatPercent) :
LowerColor.G + ((UpperColor.G - LowerColor.G) * FloatPercent) :
LowerColor.G - ((LowerColor.G - UpperColor.G) * FloatPercent)),
(
LowerColor.B < UpperColor.B ?
LowerColor.B + ((UpperColor.B - LowerColor.B) * FloatPercent) :
LowerColor.B + ((UpperColor.B - LowerColor.B) * FloatPercent) :
LowerColor.B - ((LowerColor.B - UpperColor.B) * FloatPercent)),
(
LowerColor.A < UpperColor.A ?
LowerColor.A + ((UpperColor.A - LowerColor.A) * FloatPercent) :
LowerColor.A + ((UpperColor.A - LowerColor.A) * FloatPercent) :
LowerColor.A - ((LowerColor.A - UpperColor.A) * FloatPercent)));
}
@ -996,7 +996,7 @@ function DrawTextShadowHLeftVCenter(string Str, float XPos, float YPos, float Bo
local float TextHeight;
Canvas.TextSize(Str, TextWidth, TextHeight, FontScalar, FontScalar);
Owner.CurrentStyle.DrawTextShadow(Str, XPos, YPos + (BoxHeight - TextHeight)/2, 1, FontScalar);
}
@ -1006,7 +1006,7 @@ function DrawTextShadowHRightVCenter(string Str, float XPos, float YPos, float B
local float TextHeight;
Canvas.TextSize(Str, TextWidth, TextHeight, FontScalar, FontScalar);
Owner.CurrentStyle.DrawTextShadow(Str, XPos + BoxWidth - TextWidth, YPos + (BoxHeight - TextHeight)/2, 1, FontScalar);
}
@ -1014,7 +1014,7 @@ function DrawRankedIcon(float X, float Y, float W, float H)
{
local int Position;
local float XPos, YPos, Size, Block;
Size = Min(W, H);
Block = Size * 0.25f;
@ -1022,27 +1022,27 @@ function DrawRankedIcon(float X, float Y, float W, float H)
{
XPos = X + (W > Size ? (W - Size) * 0.5f : 0.f);
YPos = Y + Position * Size * 0.5f;
// 1
Canvas.SetPos(XPos, YPos + Block);
Owner.CurrentStyle.DrawCornerTex(Block, 0);
// 2
Canvas.SetPos(XPos + Block, YPos + Block);
Owner.CurrentStyle.DrawCornerTex(Block, 3);
// 3
Canvas.SetPos(XPos + Block, YPos);
Owner.CurrentStyle.DrawCornerTex(Block, 0);
// 4
Canvas.SetPos(XPos + Block * 2, YPos);
Owner.CurrentStyle.DrawCornerTex(Block, 1);
// 5
Canvas.SetPos(XPos + Block * 2, YPos + Block);
Owner.CurrentStyle.DrawCornerTex(Block, 2);
// 6
Canvas.SetPos(XPos + Block * 3, YPos + Block);
Owner.CurrentStyle.DrawCornerTex(Block, 1);
@ -1066,4 +1066,4 @@ defaultproperties
Components.Add(PlayerList)
DefaultAvatar=Texture2D'UI_HUD.ScoreBoard_Standard_SWF_I26'
}
}

View File

@ -1,10 +1,10 @@
class YAS_Types extends Object;
struct YAS_SettingsHealth
{
{
var int Low;
var int High;
Structdefaultproperties
{
Low = 40
@ -16,7 +16,7 @@ struct YAS_SettingsPing
{
var int Low;
var int High;
Structdefaultproperties
{
Low = 60
@ -28,7 +28,7 @@ struct YAS_SettingsLevel
{
var int Low [4];
var int High[4];
Structdefaultproperties
{
Low [0] = 0
@ -165,7 +165,7 @@ struct YAS_Style
var bool KillsTextSmoothColorChange;
var bool AssistsTextSmoothColorChange;
var bool PingTextSmoothColorChange;
Structdefaultproperties
{
// Box shapes
@ -183,27 +183,27 @@ struct YAS_Style
ShapeStatsBoxTopPlayer = 0
ShapeStatsBoxMidPlayer = 0
ShapeStatsBoxBottomPlayer = 0
// Server box
ServerNameBoxColor = (R=75, G=0, B=0, A=200)
ServerNameTextColor = (R=250, G=250, B=250, A=255)
// Game info box
GameInfoBoxColor = (R=30, G=30, B=30, A=200)
GameInfoTextColor = (R=250, G=250, B=250, A=255)
// Wave info box
WaveBoxColor = (R=10, G=10, B=10, A=200)
WaveTextColor = (R=250, G=250, B=250, A=255)
// Player count box
PlayerCountBoxColor = (R=75, G=0, B=0, A=200)
PlayerCountTextColor = (R=250, G=250, B=250, A=255)
// Header box
ListHeaderBoxColor = (R=10, G=10, B=10, A=200)
ListHeaderTextColor = (R=250, G=250, B=250, A=255)
// State box
StateBoxColorLobby = (R=150, G=150, B=150, A=150)
StateBoxColorReady = (R=150, G=150, B=150, A=150)
@ -214,15 +214,15 @@ struct YAS_Style
StateBoxColorHealthLow = (R=200, G=50, B=50, A=150)
StateBoxColorHealthMid = (R=200, G=200, B=0, A=150)
StateBoxColorHealthHigh = (R=0, G=200, B=0, A=150)
// Player box
PlayerOwnerBoxColor = (R=100, G=10, B=10, A=150)
PlayerBoxColor = (R=30, G=30, B=30, A=150)
// Stats box
StatsOwnerBoxColor = (R=10, G=10, B=10, A=150)
StatsBoxColor = (R=10, G=10, B=10, A=150)
// State text
StateTextColorLobby = (R=150, G=150, B=150, A=150)
StateTextColorReady = (R=150, G=150, B=150, A=150)
@ -233,18 +233,18 @@ struct YAS_Style
StateTextColorHealthLow = (R=250, G=250, B=250, A=255)
StateTextColorHealthMid = (R=250, G=250, B=250, A=255)
StateTextColorHealthHigh = (R=250, G=250, B=250, A=255)
// Rank text
RankTextColor = (R=250, G=250, B=250, A=255)
// Player text
PlayerNameTextColor = (R=250, G=250, B=250, A=255)
// Level text
LevelTextColorLow = (R=250, G=100, B=100, A=255)
LevelTextColorMid = (R=250, G=250, B=0, A=255)
LevelTextColorHigh = (R=0, G=250, B=0, A=255)
// Perk text
ZedTextColor = (R=255, G=0, B=0, A=255)
PerkNoneTextColor = (R=250, G=250, B=250, A=255)
@ -258,28 +258,28 @@ struct YAS_Style
PerkSharpshooterTextColor = (R=250, G=250, B=250, A=255)
PerkSwatTextColor = (R=250, G=250, B=250, A=255)
PerkSurvivalistTextColor = (R=250, G=250, B=250, A=255)
// Dosh text
DoshTextColorLow = (R=250, G=250, B=100, A=255)
DoshTextColorMid = (R=250, G=250, B=100, A=255)
DoshTextColorHigh = (R=250, G=250, B=100, A=255)
// Kills text
KillsTextColorLow = (R=250, G=250, B=250, A=255)
KillsTextColorMid = (R=250, G=250, B=250, A=255)
KillsTextColorHigh = (R=250, G=250, B=250, A=255)
// Assists text
AssistsTextColorLow = (R=250, G=250, B=250, A=255)
AssistsTextColorMid = (R=250, G=250, B=250, A=255)
AssistsTextColorHigh = (R=250, G=250, B=250, A=255)
// Ping text
PingTextColorNone = (R=250, G=250, B=250, A=255)
PingTextColorLow = (R=0, G=250, B=0, A=255)
PingTextColorMid = (R=250, G=250, B=0, A=255)
PingTextColorHigh = (R=250, G=0, B=0, A=255)
// Other settings
ShowPingBars = true
}
@ -290,7 +290,7 @@ struct SystemRank
var String RankName;
var Color RankColor;
var Color PlayerColor;
structdefaultproperties
{
RankName = ""
@ -306,7 +306,7 @@ struct Rank
var Color RankColor;
var Color PlayerColor;
var bool OverrideAdmin;
structdefaultproperties
{
RankID = 0
@ -341,17 +341,17 @@ struct YAS_Settings
public static function Rank FromSystemRank(SystemRank SysRank)
{
local Rank RV;
RV.RankID = 0;
RV.RankName = SysRank.RankName;
RV.RankColor = SysRank.RankColor;
RV.PlayerColor = SysRank.PlayerColor;
RV.OverrideAdmin = false;
return RV;
}
defaultproperties
{
}
}

View File

@ -1,20 +1,20 @@
class _Logger extends Object
abstract;
enum E_LogLevel
{
LL_WrongLevel,
LL_None,
LL_Fatal,
LL_Error,
LL_Warning,
LL_Info,
LL_Debug,
LL_Trace,
LL_All
};
defaultproperties
{
}
class _Logger extends Object
abstract;
enum E_LogLevel
{
LL_WrongLevel,
LL_None,
LL_Fatal,
LL_Error,
LL_Warning,
LL_Info,
LL_Debug,
LL_Trace,
LL_All
};
defaultproperties
{
}

View File

@ -1,50 +1,50 @@
// Constants
`define NO_CONFIG 0
// Scoreboard
`define BOX_INNERBORDER 0
`define BOX_INNERBORDER_TRANSPARENT 1
`define BOX_MEDIUM 2
`define BOX_MEDIUM_SLIGHTTRANSPARENT 3
`define BOX_MEDIUM_TRANSPARENT 4
`define BOX_LARGE 5
`define BOX_LARGE_SLIGHTTRANSPARENT 6
`define BOX_LARGE_TRANSPARENT 7
`define BOX_SMALL 8
`define BOX_SMALL_SLIGHTTRANSPARENT 9
`define BOX_SMALL_TRANSPARENT 10
`define BOX_CORNER_8 11
`define BOX_CORNER_16 12
`define BOX_CORNER_32 13
`define BOX_CORNER_64 14
`define BOX_CORNER_512 15
`define ITEMBOX_NORMAL 0
`define ITEMBOX_DISABLED 1
`define ITEMBOX_HIGHLIGHTED 2
`define CHECKMARK_NORMAL 0
`define CHECKMARK_DISABLED 1
`define CHECKMARK_HIGHLIGHTED 2
`define ARROW_DOWN 0
`define ARROW_LEFT 1
`define ARROW_RIGHT 2
`define ARROW_UP 3
`define BUTTON_NORMAL 0
`define BUTTON_DISABLED 1
`define BUTTON_HIGHLIGHTED 2
`define BUTTON_PRESSED 3
`define TAB_TOP 0
`define TAB_BOTTOM 1
`define PEN_WHITE 0
`define PEN_BLACK 1
`define PEN_GRAY 2
`define CURSOR_DEFAULT 0
`define CURSOR_SELECTION 1
`define CURSOR_RESIZEVERT 2
`define CURSOR_RESIZEHORZ 3
// Constants
`define NO_CONFIG 0
// Scoreboard
`define BOX_INNERBORDER 0
`define BOX_INNERBORDER_TRANSPARENT 1
`define BOX_MEDIUM 2
`define BOX_MEDIUM_SLIGHTTRANSPARENT 3
`define BOX_MEDIUM_TRANSPARENT 4
`define BOX_LARGE 5
`define BOX_LARGE_SLIGHTTRANSPARENT 6
`define BOX_LARGE_TRANSPARENT 7
`define BOX_SMALL 8
`define BOX_SMALL_SLIGHTTRANSPARENT 9
`define BOX_SMALL_TRANSPARENT 10
`define BOX_CORNER_8 11
`define BOX_CORNER_16 12
`define BOX_CORNER_32 13
`define BOX_CORNER_64 14
`define BOX_CORNER_512 15
`define ITEMBOX_NORMAL 0
`define ITEMBOX_DISABLED 1
`define ITEMBOX_HIGHLIGHTED 2
`define CHECKMARK_NORMAL 0
`define CHECKMARK_DISABLED 1
`define CHECKMARK_HIGHLIGHTED 2
`define ARROW_DOWN 0
`define ARROW_LEFT 1
`define ARROW_RIGHT 2
`define ARROW_UP 3
`define BUTTON_NORMAL 0
`define BUTTON_DISABLED 1
`define BUTTON_HIGHLIGHTED 2
`define BUTTON_PRESSED 3
`define TAB_TOP 0
`define TAB_BOTTOM 1
`define PEN_WHITE 0
`define PEN_BLACK 1
`define PEN_GRAY 2
`define CURSOR_DEFAULT 0
`define CURSOR_SELECTION 1
`define CURSOR_RESIZEVERT 2
`define CURSOR_RESIZEHORZ 3

View File

@ -1,3 +1,3 @@
// Imports
`include(Logger.uci)
`include(Constants.uci)
// Imports
`include(Logger.uci)
`include(Constants.uci)

View File

@ -1,15 +1,15 @@
// Logger
`define Log_Tag 'YAS'
`define LocationStatic "`{ClassName}::" $ GetFuncName()
`define Log_Base(msg, cond) `log(`msg `if(`cond), `cond`{endif}, `Log_Tag)
`define Log_Fatal(msg) `log("FATAL:" @ `msg, (LogLevel >= LL_Fatal), `Log_Tag)
`define Log_Error(msg) `log("ERROR:" @ `msg, (LogLevel >= LL_Error), `Log_Tag)
`define Log_Warn(msg) `log("WARN:" @ `msg, (LogLevel >= LL_Warning), `Log_Tag)
`define Log_Info(msg) `log("INFO:" @ `msg, (LogLevel >= LL_Info), `Log_Tag)
`define Log_Debug(msg) `log("DEBUG:" @ `msg, (LogLevel >= LL_Debug), `Log_Tag)
`define Log_Trace(msg) `log("TRACE:" @ `Location `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)
`define Log_TraceStatic(msg) `log("TRACE:" @ `LocationStatic `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)
// Logger
`define Log_Tag 'YAS'
`define LocationStatic "`{ClassName}::" $ GetFuncName()
`define Log_Base(msg, cond) `log(`msg `if(`cond), `cond`{endif}, `Log_Tag)
`define Log_Fatal(msg) `log("FATAL:" @ `msg, (LogLevel >= LL_Fatal), `Log_Tag)
`define Log_Error(msg) `log("ERROR:" @ `msg, (LogLevel >= LL_Error), `Log_Tag)
`define Log_Warn(msg) `log("WARN:" @ `msg, (LogLevel >= LL_Warning), `Log_Tag)
`define Log_Info(msg) `log("INFO:" @ `msg, (LogLevel >= LL_Info), `Log_Tag)
`define Log_Debug(msg) `log("DEBUG:" @ `msg, (LogLevel >= LL_Debug), `Log_Tag)
`define Log_Trace(msg) `log("TRACE:" @ `Location `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)
`define Log_TraceStatic(msg) `log("TRACE:" @ `LocationStatic `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)

View File

@ -7,7 +7,7 @@ StripSource="True"
# Mutators to be compiled
# Specify them with a space as a separator,
# Mutators will be compiled in the specified order
# Mutators will be compiled in the specified order
PackageBuildOrder="BoxPainterLib YAS"
@ -16,7 +16,7 @@ PackageBuildOrder="BoxPainterLib YAS"
# Packages you want to brew using @peelz's patched KFEditor.
# Useful for cases where regular brew doesn't put *.upk inside the package.
# Specify them with a space as a separator,
# The order doesn't matter
# The order doesn't matter
PackagePeelzBrew=""
@ -24,7 +24,7 @@ PackagePeelzBrew=""
# Mutators that will be uploaded to the workshop
# Specify them with a space as a separator,
# The order doesn't matter
# The order doesn't matter
PackageUpload="BoxPainterLib YAS"