poison / bleed icons fix

This commit is contained in:
Shtoyan 2022-01-23 16:49:36 +04:00
parent 137b90ec25
commit 9b03198d32

View File

@ -18,14 +18,37 @@ event NotifyLevelChange(){
function RegisterMutator(NicePack activePack){ function RegisterMutator(NicePack activePack){
NicePackMutator = activePack; NicePackMutator = activePack;
} }
function bool isPoisoned(ScrnHumanPawn pwn){
local Inventory I; final private function bool bIsPoisoned(ScrnHumanPawn pwn)
if(pwn.Inventory != none) {
for(I = pwn.Inventory; I != none; I = I.Inventory) local Inventory I;
if(I != none && MeanPoisonInventory(I) != none)
return true; if (pwn.Inventory != none)
return false; {
for (I = pwn.Inventory; I != none; I = I.Inventory)
{
if (MeanPoisonInventory(I) != none)
return true;
}
}
return false;
} }
final private function bool bIsBleeding(ScrnHumanPawn pwn)
{
local Inventory I;
if (pwn.Inventory != none)
{
for (I = pwn.Inventory; I != none; I = I.Inventory)
{
if (MeanBleedInventory(I) != none)
return true;
}
}
return false;
}
function PostRender(Canvas C){ function PostRender(Canvas C){
local int i; local int i;
local NicePack niceMutator; local NicePack niceMutator;
@ -48,24 +71,28 @@ function PostRender(Canvas C){
if(nicePlayer == none) if(nicePlayer == none)
return; return;
scrnHUDInstance = ScrnHUD(nicePlayer.myHUD); scrnHUDInstance = ScrnHUD(nicePlayer.myHUD);
//// Draw bleed and poison icons //// Draw bleed and poison icons
szRI = class'MeanReplicationInfo'.static.findSZri(ViewportOwner.Actor.PlayerReplicationInfo);
offset = 4; offset = 4;
if(szRI != none){ // BLEED!!!
if(szRI.isBleeding){ if (bIsBleeding(ScrnHumanPawn(C.ViewPort.Actor.Pawn)))
x = C.ClipX * 0.007; {
y = C.ClipY * 0.93 - size * offset; x = C.ClipX * 0.007;
C.SetPos(x, y); y = C.ClipY * 0.93 - size * offset;
C.DrawTile(bleedIcon, size, size, 0, 0, bleedIcon.MaterialUSize(), bleedIcon.MaterialVSize()); C.SetPos(x, y);
} C.DrawTile(bleedIcon, size, size, 0, 0, bleedIcon.MaterialUSize(), bleedIcon.MaterialVSize());
offset++; }
if(isPoisoned(ScrnHumanPawn(C.ViewPort.Actor.Pawn))){ offset++;
x = C.ClipX * 0.007; // POISON!!!
y = C.ClipY * 0.93 - size * offset; if (bIsPoisoned(ScrnHumanPawn(C.ViewPort.Actor.Pawn)))
C.SetPos(x, y); {
C.DrawTile(poisonIcon, size, size, 0, 0, poisonIcon.MaterialUSize(), poisonIcon.MaterialVSize()); x = C.ClipX * 0.007;
} y = C.ClipY * 0.93 - size * offset;
} C.SetPos(x, y);
C.DrawTile(poisonIcon, size, size, 0, 0, poisonIcon.MaterialUSize(), poisonIcon.MaterialVSize());
}
if(niceWeap != none && niceWeap.bShowSecondaryCharge && scrnHUDInstance != none){ if(niceWeap != none && niceWeap.bShowSecondaryCharge && scrnHUDInstance != none){
C.ColorModulate.X = 1; C.ColorModulate.X = 1;
C.ColorModulate.Y = 1; C.ColorModulate.Y = 1;