From 9b03198d32ea4ae897a5e4ff8b9878729a132dad Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Sun, 23 Jan 2022 16:49:36 +0400 Subject: [PATCH] poison / bleed icons fix --- sources/GUI/NiceInteraction.uc | 73 +++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 23 deletions(-) diff --git a/sources/GUI/NiceInteraction.uc b/sources/GUI/NiceInteraction.uc index f6f7e11..ceb5312 100644 --- a/sources/GUI/NiceInteraction.uc +++ b/sources/GUI/NiceInteraction.uc @@ -18,14 +18,37 @@ event NotifyLevelChange(){ function RegisterMutator(NicePack activePack){ NicePackMutator = activePack; } -function bool isPoisoned(ScrnHumanPawn pwn){ - local Inventory I; - if(pwn.Inventory != none) - for(I = pwn.Inventory; I != none; I = I.Inventory) - if(I != none && MeanPoisonInventory(I) != none) - return true; - return false; + +final private function bool bIsPoisoned(ScrnHumanPawn pwn) +{ + local Inventory I; + + if (pwn.Inventory != none) + { + 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){ local int i; local NicePack niceMutator; @@ -48,24 +71,28 @@ function PostRender(Canvas C){ if(nicePlayer == none) return; scrnHUDInstance = ScrnHUD(nicePlayer.myHUD); + //// Draw bleed and poison icons - szRI = class'MeanReplicationInfo'.static.findSZri(ViewportOwner.Actor.PlayerReplicationInfo); offset = 4; - if(szRI != none){ - if(szRI.isBleeding){ - x = C.ClipX * 0.007; - y = C.ClipY * 0.93 - size * offset; - C.SetPos(x, y); - C.DrawTile(bleedIcon, size, size, 0, 0, bleedIcon.MaterialUSize(), bleedIcon.MaterialVSize()); - } - offset++; - if(isPoisoned(ScrnHumanPawn(C.ViewPort.Actor.Pawn))){ - 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()); - } - } + // BLEED!!! + if (bIsBleeding(ScrnHumanPawn(C.ViewPort.Actor.Pawn))) + { + x = C.ClipX * 0.007; + y = C.ClipY * 0.93 - size * offset; + C.SetPos(x, y); + C.DrawTile(bleedIcon, size, size, 0, 0, bleedIcon.MaterialUSize(), bleedIcon.MaterialVSize()); + } + offset++; + // POISON!!! + if (bIsPoisoned(ScrnHumanPawn(C.ViewPort.Actor.Pawn))) + { + 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){ C.ColorModulate.X = 1; C.ColorModulate.Y = 1;