add status icons

This commit is contained in:
GenZmeY 2022-09-12 05:34:44 +03:00
parent c85532cf78
commit 4d8a6ef97e
2 changed files with 54 additions and 40 deletions

View File

@ -1404,12 +1404,11 @@ final function DrawArrowBox(int Direction, float X, float Y, float Width, float
DrawTileStretched(DirectionMat, X,Y, Width, Height); DrawTileStretched(DirectionMat, X,Y, Width, Height);
} }
function DrawTexture(Texture2D Tex, float X, float Y, float W, float H, Color TexColor) function DrawTexture(Texture2D Tex, float X, float Y, float W, float H, optional float UL, optional float VL)
{ {
Canvas.SetPos(X, Y); Canvas.SetPos(X, Y);
Canvas.SetDrawColorStruct(TexColor); Canvas.DrawTile(Tex, W, H, 0, 0, UL == 0.f ? float(Tex.SizeX) : UL, VL == 0.f ? float(Tex.SizeY) : VL);
Canvas.DrawTile(Tex, W, H, 0, 0, Tex.SizeX, Tex.SizeY);
} }
final function DrawTileStretched(Texture Tex, float X, float Y, float XS, float YS) final function DrawTileStretched(Texture Tex, float X, float Y, float XS, float YS)

View File

@ -5,7 +5,7 @@ const HeaderWidthRatio = 0.30f;
const PlayerListWidthRatio = 0.6f; const PlayerListWidthRatio = 0.6f;
const PlayerEntryHeightMod = 1.05f; const PlayerEntryHeightMod = 1.05f;
const CompactModePlayers = 12; const CompactModePlayers = 5;
const ListItemsCompact = 16; const ListItemsCompact = 16;
const ListItemsDefault = 12; const ListItemsDefault = 12;
@ -13,8 +13,7 @@ const ListItemsDefault = 12;
const FontScalarModCompact = 1.0f; const FontScalarModCompact = 1.0f;
const FontScalarModDefault = 1.25f; const FontScalarModDefault = 1.25f;
/* //const IconRanked = Texture2D'YAS.IconRanked';
const IconRanked = Texture2D'YAS.IconRanked';
const IconCustom = Texture2D'UI_Menus.ServerBrowserMenu_SWF_I26'; const IconCustom = Texture2D'UI_Menus.ServerBrowserMenu_SWF_I26';
const IconUnranked = Texture2D'UI_Menus.ServerBrowserMenu_SWF_I28'; const IconUnranked = Texture2D'UI_Menus.ServerBrowserMenu_SWF_I28';
const IconPassword = Texture2D'UI_Menus.ServerBrowserMenu_SWF_I20'; const IconPassword = Texture2D'UI_Menus.ServerBrowserMenu_SWF_I20';
@ -22,8 +21,11 @@ const IconDosh = Texture2D'UI_HUD.InGameHUD_SWF_I13A';
const IconPlayer = Texture2D'UI_HUD.InGameHUD_ZED_SWF_I1F5'; const IconPlayer = Texture2D'UI_HUD.InGameHUD_ZED_SWF_I1F5';
const IconClock = Texture2D'UI_HUD.InGameHUD_SWF_I17D'; const IconClock = Texture2D'UI_HUD.InGameHUD_SWF_I17D';
const IconSkull = Texture2D'UI_Shared.AssetLib_I32'; const IconSkull = Texture2D'UI_Shared.AssetLib_I32';
const IconSkullAndBones = Texture2D'UI_ZEDRadar_TEX.MapIcon_FailedSpawn';
const IconHealth = Texture2D'UI_VoiceComms_TEX.UI_VoiceCommand_Icon_Heal'; const IconHealth = Texture2D'UI_VoiceComms_TEX.UI_VoiceCommand_Icon_Heal';
*/ const IconHealthAlt = Texture2D'UI_Objective_Tex.UI_Obj_Healing_Loc';
const IconHorzine = Texture2D'UI_PerkIcons_TEX.UI_Horzine_H_Logo';
const IconGlobe = Texture2D'DailyObjective_UI.KF2_Dailies_Icon_Map';
var public E_LogLevel LogLevel; var public E_LogLevel LogLevel;
@ -401,7 +403,7 @@ function DrawMenu()
DrawTextShadowHLeftVCenter(S, BoxX + EdgeSize, YPos, BoxH, FontScalar); DrawTextShadowHLeftVCenter(S, BoxX + EdgeSize, YPos, BoxH, FontScalar);
S = Owner.CurrentStyle.GetTimeString(KFGRI.ElapsedTime); S = Owner.CurrentStyle.GetTimeString(KFGRI.ElapsedTime);
DrawTextShadowHVCenter(S, XPos + Width * 0.7, YPos, Width * 0.3, BoxH, FontScalar); // TODO: ? DrawTextShadowHVCenter(S, XPos + Width * 0.7, YPos, Width * 0.3, BoxH, FontScalar);
YPos += BoxH; YPos += BoxH;
@ -474,9 +476,15 @@ function DrawMenu()
ColorTMP = Settings.Style.ListHeaderTextColor; ColorTMP = Settings.Style.ListHeaderTextColor;
ColorTMP.A = 150; ColorTMP.A = 150;
Canvas.SetDrawColorStruct(ColorTmp); Canvas.SetDrawColorStruct(ColorTMP);
Owner.CurrentStyle.DrawTexture(
DrawHealthIcon(XPos + HealthXPos, YPos, HealthWBox, BoxH); IconHealthAlt,
XPos + HealthXPos + BoxH * 0.5f,
YPos + BorderSize,
BoxH - BorderSize * 2,
BoxH - BorderSize * 2,
256,
256);
PlayersList.XPosition = ((Canvas.ClipX - Width) * 0.5) / InputPos[2]; PlayersList.XPosition = ((Canvas.ClipX - Width) * 0.5) / InputPos[2];
PlayersList.YPosition = (YPos + YL + BorderSize * 4) / InputPos[3]; PlayersList.YPosition = (YPos + YL + BorderSize * 4) / InputPos[3];
@ -532,26 +540,6 @@ function DrawMenu()
} }
} }
function DrawHealthIcon(float X, float Y, float W, float H)
{
local float XPos, YPos, Size, Part;
Size = H * 0.65;
Part = Size / 3;
XPos = X + (W * 0.5 - Part * 0.5);
YPos = Y + (H * 0.5 - Size * 0.5);
Owner.CurrentStyle.DrawRectBox(XPos, YPos, Part, Part, 4, 100);
XPos = X + (W * 0.5 - Size * 0.5);
YPos = Y + (H * 0.5 - Part * 0.5);
Owner.CurrentStyle.DrawRectBox(XPos, YPos, Size, Part, 4, 100);
XPos = X + (W * 0.5 - Part * 0.5);
YPos = Y + (H * 0.5 + Part * 0.5);
Owner.CurrentStyle.DrawRectBox(XPos, YPos, Part, Part, 4, 100);
}
function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float Width, bool bFocus) function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float Width, bool bFocus)
{ {
local string S, StrValue; local string S, StrValue;
@ -559,6 +547,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
local float XPos, BoxWidth, RealPlayerWBox; local float XPos, BoxWidth, RealPlayerWBox;
local KFPlayerReplicationInfo KFPRI; local KFPlayerReplicationInfo KFPRI;
local byte Level, PrestigeLevel; local byte Level, PrestigeLevel;
local Color ColorTMP;
local bool bIsZED; local bool bIsZED;
local int Ping; local int Ping;
local Rank Rank; local Rank Rank;
@ -607,13 +596,39 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
// Health box // Health box
C.SetDrawColorStruct(HealthBoxColor); C.SetDrawColorStruct(HealthBoxColor);
Owner.CurrentStyle.DrawRectBox(XPos, Owner.CurrentStyle.DrawRectBox(
XPos,
YOffset, YOffset,
HealthWBox, HealthWBox,
Height, Height,
EdgeSize, EdgeSize,
ShapeHealth); ShapeHealth);
if (!KFGRI.bMatchHasBegun)
{
ColorTMP = Settings.Style.ListHeaderTextColor;
ColorTMP.A = 200;
Canvas.SetDrawColorStruct(ColorTMP);
Owner.CurrentStyle.DrawTexture(
IconHorzine,
XPos + (HealthWBox - Height) * 0.5f + BorderSize * 2,
YOffset + BorderSize * 2,
Height - BorderSize * 4,
Height - BorderSize * 4);
}
else if (KFPRI.PlayerHealth <= 0 || KFPRI.PlayerHealthPercent <= 0)
{
ColorTMP = Settings.Style.ListHeaderTextColor;
ColorTMP.A = 200;
Canvas.SetDrawColorStruct(ColorTMP);
Owner.CurrentStyle.DrawTexture(
IconSkullAndBones,
XPos + BorderSize * 2,
YOffset + BorderSize * 2,
HealthWBox - BorderSize * 4,
Height - BorderSize * 4);
}
C.SetDrawColorStruct(Settings.Style.StateTextColorHealthHigh); C.SetDrawColorStruct(Settings.Style.StateTextColorHealthHigh);
if (KFPRI.PlayerHealth > 0) if (KFPRI.PlayerHealth > 0)