Add visual counter for health regen from healing

This commit is contained in:
Anton Tarasenko 2024-03-19 14:34:24 +07:00
parent 2bf5f3dbe1
commit 87f60c9c60
2 changed files with 34 additions and 4 deletions

View File

@ -107,6 +107,10 @@ function PostRender(Canvas C)
local int x, y, center, barWidth, offset; local int x, y, center, barWidth, offset;
local int missesWidth, missesHeight, missesSpace; local int missesWidth, missesHeight, missesSpace;
local int missesX, missesY; local int missesX, missesY;
local TeamInfo team;
local int healthToGive, totalExpectedHealth;
local float textWidth, textHeight;
local string textToDraw;
// local Vector CamPos, ViewDir; // local Vector CamPos, ViewDir;
// local Rotator CamRot; // local Rotator CamRot;
// local float OffsetX, BarLength, BarHeight, XL, YL, posY; // local float OffsetX, BarLength, BarHeight, XL, YL, posY;
@ -256,6 +260,32 @@ function PostRender(Canvas C)
} }
} }
team = C.ViewPort.Actor.Pawn.PlayerReplicationInfo.Team;
//// Draw health still in regen timer
healthToGive = ScrnHumanPawn(C.ViewPort.Actor.Pawn).clientHealthToGive;
if (healthToGive > 0) {
totalExpectedHealth = healthToGive + C.ViewPort.Actor.Pawn.health;;
C.Font = class'ROHUD'.Static.LoadSmallFontStatic(3);
if (totalExpectedHealth >= C.ViewPort.Actor.Pawn.healthMax) {
if(team.teamIndex == 0) {
C.SetDrawColor(255, 64, 64);
}
else {
C.SetDrawColor(
team.teamColor.R,
team.teamColor.G,
team.teamColor.B);
}
}
else {
C.SetDrawColor(128, 128, 128);
}
textToDraw = "+" $ healthToGive;
C.TextSize(textToDraw, textWidth, textHeight);
C.SetPos(C.ClipX * 0.05, C.ClipY * 0.9);
C.DrawText(textToDraw);
}
//// Draw cooldowns //// Draw cooldowns
if (nicePlayer.abilityManager == none) if (nicePlayer.abilityManager == none)
return; return;
@ -273,7 +303,7 @@ function PostRender(Canvas C)
{ {
if (niceMutator.niceCounterSet[i].value != 0 || niceMutator.niceCounterSet[i].bShowZeroValue) if (niceMutator.niceCounterSet[i].value != 0 || niceMutator.niceCounterSet[i].bShowZeroValue)
{ {
DrawCounter(C, niceMutator.niceCounterSet[i], x, y, C.ViewPort.Actor.Pawn.PlayerReplicationInfo.Team); DrawCounter(C, niceMutator.niceCounterSet[i], x, y, team);
x += 128 + 4; x += 128 + 4;
} }
} }