Add visual counter for health regen from healing
This commit is contained in:
parent
2bf5f3dbe1
commit
87f60c9c60
@ -107,6 +107,10 @@ function PostRender(Canvas C)
|
||||
local int x, y, center, barWidth, offset;
|
||||
local int missesWidth, missesHeight, missesSpace;
|
||||
local int missesX, missesY;
|
||||
local TeamInfo team;
|
||||
local int healthToGive, totalExpectedHealth;
|
||||
local float textWidth, textHeight;
|
||||
local string textToDraw;
|
||||
// local Vector CamPos, ViewDir;
|
||||
// local Rotator CamRot;
|
||||
// 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
|
||||
if (nicePlayer.abilityManager == none)
|
||||
return;
|
||||
@ -273,7 +303,7 @@ function PostRender(Canvas C)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -283,7 +313,7 @@ function PostRender(Canvas C)
|
||||
function DrawCounter(Canvas C, NicePack.CounterDisplay counter, int x, int y, TeamInfo team){
|
||||
local float borderSpace;
|
||||
local Texture textureToDraw;
|
||||
local float textWidth, textHeight;
|
||||
local float textWidth, textHeight;
|
||||
local string textToDraw;
|
||||
// Some per-defined values for drawing
|
||||
local int iconSize, backgroundWidth, backgroundHeight;
|
||||
@ -320,7 +350,7 @@ function DrawAbilityCooldown(Canvas C, int abilityIndex){
|
||||
local class<NiceVeterancyTypes> niceVet;
|
||||
local int x, y;
|
||||
local string textToDraw;
|
||||
local float textWidth, textHeight;
|
||||
local float textWidth, textHeight;
|
||||
local NiceAbilityManager.EAbilityState abilityState;
|
||||
if(C == none) return;
|
||||
if(C.ViewPort == none) return;
|
||||
|
@ -846,7 +846,7 @@ function VeterancyChanged(){
|
||||
nicePlayer.TriggerSelectEventOnPerkChange(nicePrevPerkClass,
|
||||
class<NiceVeterancyTypes>(KFPRI.ClientVeteranSkill));
|
||||
}
|
||||
|
||||
|
||||
super.VeterancyChanged();
|
||||
}
|
||||
simulated function AltFire(optional float F){
|
||||
|
Loading…
Reference in New Issue
Block a user