Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- <<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>
- EUTCTFHud
- <<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>
- */
- class EUTCTFHud extends ChallengeCTFHUD;
- var CTFReplicationInfo GameRI;
- var EUTGameReplicationInfo MyCRI;
- var DeathMatchPlus DMP;
- var EUTHudSettings HudSettings;
- var CTFFlag Flag${1}< ${3} >
- var Pawn P;
- var PlayerReplicationInfo PRI;
- var private PlayerReplicationInfo StoredPRI[32];
- var private PlayerReplicationInfo MyPRI;
- var private GameReplicationInfo StoredGRI;
- var EUTStatInfo StatInfo;
- var EUTHudHelper HudHelper;
- var private PlayerPawn MyPlayer;
- var font MySmallFont;
- var class<EUTStatInfo> StatInfo${1}< ${3} >
- var class<EUTHudHelper> HudHelper${1}< ${3} >
- var class<EUTDemoEnhancer> EUTDemoEnhancer${1}< ${3} >
- var bool bWarmupSwitch, bStartMessage, bUdemo;
- var byte RedTeamSize,
- BlueTeamSize,
- RequestHitsounds;
- var color BlueColor,
- RedColor;
- var float PreBaseEye;
- var string RedFlagCarrierLocation,
- BlueFlagCarrierLocation,
- StartMessage,
- LastEventMessage;
- var texture TimeBack,
- PingBack,
- TeamBack,
- AccuracyBack,
- AccuracyBackRifle,
- AccuracyBackShock,
- EUTElements,
- Badge;
- //-------------------------------------
- // PostBeginPlay
- //-------------------------------------
- simulated function PostBeginPlay()
- {
- SetTimer(1.0, True);
- if (ServerInfo == none) ServerInfo = Spawn(ServerInfoClass, Owner);
- if (StatInfo == none) StatInfo = Spawn(StatInfoClass, Owner);
- if (HudHelper == none) HudHelper = Spawn(HudHelperClass,Owner);
- if (MyFonts == none) MyFonts = FontInfo(Spawn(Class<Actor>(DynamicLoadObject(FontInfoClass, class'Class'))));
- InitializeHudSettings();
- LoadTextures();
- SetDefaults(0);
- if (Level.NetMode != NM_Standalone) MOTDFadeOutTime = 350;
- FaceAreaOffset = -64;
- if ((PlayerPawn(Owner).GameReplicationInfo != None)
- && (PlayerPawn(Owner).GameReplicationInfo.RemainingTime > 0))
- TimeMessageClass = class<CriticalEventPlus>(DynamicLoadObject("BotPack.TimeMessage", class'Class'));
- MyCRI = EUTGameReplicationInfo(PlayerPawn(Owner).GameReplicationInfo);
- }
- //-------------------------------------
- // InitializeHudSettings
- //-------------------------------------
- simulated final function InitializeHudSettings()
- {
- if (HudSettings == none)
- {
- HudSettings = EUTHudSettings(Spawn(Class<Actor>(DynamicLoadObject("EUTSource.EUTHudSettings",class'class'))));
- if (HudSettings != none)
- {
- HudSettings.MyPlayer = PlayerPawn(Owner);
- HudSettings.HS = HudSettings;
- HudSettings.SaveConfig();
- }
- }
- }
- //-------------------------------------
- // LoadTextures
- //-------------------------------------
- simulated final function LoadTextures()
- {
- TimeBack = texture(DynamicLoadObject("EUT_Textures.Timeback", class'Texture'));
- PingBack = texture(DynamicLoadObject("EUT_Textures.PingDisplay", class'Texture'));
- TeamBack = texture(DynamicLoadObject("EUT_Textures.TeamBack", class'Texture'));
- AccuracyBack = Texture(DynamicLoadObject("EUT_Textures.EUTAccBack", class'Texture'));
- AccuracyBackRifle = Texture(DynamicLoadObject("EUT_Textures.EUTAccBackRifle", class'Texture'));
- AccuracyBackShock = Texture(DynamicLoadObject("EUT_Textures.EUTAccBackShock", class'Texture'));
- EUTElements = Texture(DynamicLoadObject("EUT_Textures.EUT_Elements", class'Texture'));
- Badge = Texture(DynamicLoadObject("EUT_Textures.EUT_Badge", class'Texture'));
- MySmallFont = Font(DynamicLoadObject("EUT_Textures.EUTSmallFont", class'Font'));
- }
- //-------------------------------------
- // SetDefaults
- //-------------------------------------
- simulated final function SetDefaults(byte c)
- {
- switch (c)
- {
- case 0: HudHelper.ResetWeaponData(); break;
- case 1: HudHelper.ResetWeaponData();
- HudHelper.StageCount = 1;
- HudHelper.WeaponDrawOffset = 0;
- if(MyCRI != none) MyCRI.MouseYSetting = 100;
- break;
- }
- }
- //-------------------------------------
- // Timer
- //-------------------------------------
- function Timer()
- {
- super(ChallengeHUD).Timer();
- if ((PlayerOwner == None) || (PawnOwner == None))
- return;
- if (PlayerPawn(Owner).PlayerReplicationInfo == none)
- return;
- if (MyCRI == none)
- {
- MyCRI = EUTGameReplicationInfo(PlayerPawn(Owner).GameReplicationInfo);
- MyCRI.MouseYSetting = 100;
- }
- else
- {
- MyCRI.ClientCrosshair = Crosshair;
- MyCRI.ClientCrosshairTexture = CrossHairTextures[Crosshair];
- if (!HudHelper.bCheckKeyBindings) HudHelper.CheckKeyBindings();
- MyCRI.MouseYRefCount = HudHelper.MouseYCount;
- MyCRI.RequestHitsounds = RequestHitsounds;
- MyCRI.WeaponAccuracy.Enforcer = HudHelper.Acc.Enforcer;
- MyCRI.WeaponAccuracy.BioGun = HudHelper.Acc.BioGun;
- MyCRI.WeaponAccuracy.ShockRifle = HudHelper.Acc.ShockRifle;
- MyCRI.WeaponAccuracy.PulseGun = HudHelper.Acc.PulseGun;
- MyCRI.WeaponAccuracy.Ripper = HudHelper.Acc.Ripper;
- MyCRI.WeaponAccuracy.MiniGun = HudHelper.Acc.MiniGun;
- MyCRI.WeaponAccuracy.FlakCannon = HudHelper.Acc.FlakGun;
- MyCRI.WeaponAccuracy.EightBall = HudHelper.Acc.EightBall;
- MyCRI.WeaponAccuracy.SniperRifle = HudHelper.Acc.SniperRifle;
- MyCRI.WeaponAccuracy.SuperShockRifle = HudHelper.Acc.SuperShockRifle;
- MyCRI.WeaponAccuracy.CustomWeapon = HudHelper.Acc.CustomWeapon;
- MyCRI.bJumpBoots = HudSettings.bJumpBoots;
- if (!HudHelper.bSetMessageDefaults) HudHelper.SetMessageDefaults(0);
- if (!bWarmupSwitch && MyCRI.bWarmupSwitch)
- {
- bWarmupSwitch = true;
- SetDefaults(1);
- if (!HudHelper.bCheckForAutoRecorder && MyCRI.bTournament && MyCRI.bMatchStarted)
- HudHelper.CheckForAutoRecorder(PlayerPawn(Owner), HudSettings.AutoRecorder);
- }
- if (!HudHelper.bCheckForAutoRecorder && !MyCRI.bTournament && MyCRI.bMatchStarted)
- HudHelper.CheckForAutoRecorder(PlayerPawn(Owner), HudSettings.AutoRecorder);
- MyCRI.TextureCounter++;
- if (MyCRI.TextureCounter == 2)
- {
- MyCRI.TextureCounter = 0;
- switch (MyCRI.TextureSwitch)
- {
- case 0: MyCRI.TextureSwitch = 1; break;
- case 1: MyCRI.TextureSwitch = 0; break;
- }
- }
- if (MyCRI.PlayWaitMessage[PlayerPawn(Owner).PlayerReplicationInfo.PlayerID] == 1)
- PlayerOwner.ReceiveLocalizedMessage(class'EUTHudMessages', 17);
- }
- GameRI = CTFReplicationInfo(PlayerPawn(Owner).GameReplicationInfo);
- if (GameRI == None) return;
- RedTeamSize = GameRI.Teams[0].Size;
- BlueTeamSize = GameRI.Teams[1].Size;
- RequestHitsounds = HudSettings.HitSounds;
- if (PawnOwner.PlayerReplicationInfo.HasFlag != None
- && (!PawnOwner.PlayerReplicationInfo.HasFlag.IsA('EUTReadyFlag')))
- PlayerOwner.ReceiveLocalizedMessage( class'CTFMessage2', 0);
- if ((FlagClass != None) && !FlagClass.bHome)
- PlayerOwner.ReceiveLocalizedMessage(class'CTFMessage2', 1);
- if (HudHelper.DelayDataClear < 20) HudHelper.DelayDataClear++;
- if (PlayerPawn(Owner).PlayerReplicationInfo.bIsSpectator) return;
- if (PlayerPawn(Owner).GameReplicationInfo != none)
- {
- MyCRI.bAutoShot = HudSettings.bAutoShot;
- if (PlayerPawn(Owner).GameReplicationInfo.GameEndedComments != "")
- {
- HudHelper.ScreenShotDelay++;
- if (HudHelper.ScreenShotDelay >= 6 && PlayerPawn(Owner).IsInState('GameEnded'))
- {
- HudHelper.StopDemo(PlayerPawn(Owner));
- if (!HudHelper.bScreenShotTaken && HudSettings.bAutoShot)
- {
- HudHelper.bScreenShotTaken = True;
- PlayerPawn(Owner).ConsoleCommand("sshot");
- PlayerPawn(Owner).ClientMessage("Auto ScreenShot Taken");
- }
- }
- }
- }
- }
- //-------------------------------------
- // PreRender
- //-------------------------------------
- simulated event PreRender(Canvas C)
- {
- local byte i;
- MyPlayer = PlayerPawn(Owner);
- if (HudHelper != none)
- bUdemo = HudHelper.IsUdemoSpectator(PlayerOwner);
- if(MyPlayer != none && HudHelper != none)
- HudHelper.FixPhysics(MyPlayer);
- if (MyCRI != none)
- {
- for (i=0; i<MyCRI.ScrollersCount; i++)
- {
- if (MyCRI.Scrollers[i] != none && MyPlayer != none)
- {
- MyCRI.Scrollers[i].Player = MyPlayer;
- MyCRI.Scrollers[i].Player.PlayerReplicationInfo = MyPlayer.PlayerReplicationInfo;
- MyCRI.Scrollers[i].Player.GameReplicationInfo = MyPlayer.GameReplicationInfo;
- }
- }
- }
- if (level.netmode != NM_ListenServer)
- {
- if (MyPlayer != None
- && (MyPlayer.GameReplicationInfo != none)
- && (MyPlayer.PlayerReplicationInfo != none))
- {
- if (!bUdemo)
- {
- PreBaseEye = MyPlayer.BaseEyeHeight;
- MyPlayer.BaseEyeHeight = -10000;
- }
- for (i = 0; i < 32; i++)
- {
- PRI = MyPlayer.GameReplicationInfo.PRIArray[i];
- if ((PRI != None ) && (PRI != MyPlayer.PlayerReplicationInfo))
- {
- P = Pawn(PRI.Owner);
- if (P != None && !bUdemo)
- {
- P.bIsPlayer = false;
- P.bISpawn = false;
- StoredPRI[i] = P.PlayerReplicationInfo;
- if (P.PlayerReplicationInfo != none && (P.PlayerReplicationInfo.HasFlag == none))
- P.PlayerReplicationInfo = none;
- }
- }
- }
- }
- }
- if (MyPlayer != none
- && (MyPlayer.PlayerReplicationInfo != none)
- && (!bUdemo))
- {
- MyPRI = MyPlayer.PlayerReplicationInfo;
- MyPlayer.PlayerReplicationInfo = none;
- }
- if (MyPlayer != none
- && (MyPlayer.GameReplicationInfo != none)
- && (!bUdemo))
- {
- StoredGRI = MyPlayer.GameReplicationInfo;
- MyPlayer.GameReplicationInfo = none;
- }
- super.PreRender(C);
- }
- //-------------------------------------
- // PostRender
- //-------------------------------------
- simulated event PostRender(Canvas C)
- {
- local float X, Y, XL, YL, _Scale;
- local CTFFlag _Flag;
- local byte i;
- MyPlayer = PlayerPawn(Owner);
- if (MyPlayer != none
- && (MyPlayer.GameReplicationInfo == none)
- && (StoredGRI != none)
- && (!bUdemo))
- MyPlayer.GameReplicationInfo = StoredGRI;
- if (MyPlayer != none
- && (MyPlayer.PlayerReplicationInfo == none)
- && (MyPRI != none)
- && (!bUdemo))
- MyPlayer.PlayerReplicationInfo = MyPRI;
- if (MyPlayer == none
- || (MyPlayer.PlayerReplicationInfo == none)
- || (PawnOwner == none)
- || (PlayerOwner == none)
- || (HudHelper == none)
- || (MyCRI == none))
- {
- MyPlayer.bIsPlayer = true;
- super(ChallengeHUD).PostRender(C);
- return;
- }
- if (level.netmode != NM_ListenServer)
- {
- if (MyPlayer != None
- && (MyPlayer.GameReplicationInfo != none)
- && (MyPlayer.PlayerReplicationInfo != None))
- {
- if (!bUdemo)
- {
- MyPlayer.BaseEyeHeight = PreBaseEye;
- MyPlayer.PlayerReplicationInfo.Ping = 9999;
- }
- for (i = 0; i < 32; i++)
- {
- PRI = MyPlayer.GameReplicationInfo.PRIArray[i];
- if (PRI != None
- && (PRI != MyPlayer.PlayerReplicationInfo))
- {
- P = Pawn(PRI.Owner);
- if (P != None)
- {
- P.bIsPlayer = true;
- P.bISpawn = true;
- if (P.PlayerReplicationInfo == none && !bUdemo)
- P.PlayerReplicationInfo = StoredPRI[i];
- if (P.PlayerReplicationInfo != none
- && (P.PlayerReplicationInfo.Team != MyPlayer.PlayerReplicationInfo.Team)
- && (HudHelper.DelayDataClear > 10))
- {
- if (MyPlayer.LineOfSightTo(P))
- {
- P.NetPriority = 2.0;
- P.NetUpdateFrequency = 100.0;
- }
- else
- {
- P.NetPriority = HudHelper.NetAdjustment(2.0, HudSettings.nLevel);
- P.NetUpdateFrequency = HudHelper.NetAdjustment(100.0, HudSettings.nLevel);
- }
- }
- if (P.PlayerReplicationInfo != none
- && (P.PlayerReplicationInfo.Team == MyPlayer.PlayerReplicationInfo.Team))
- {
- if (MyPlayer.LineOfSightTo(P)
- && (HudHelper.StageCount > 25))
- {
- P.NetPriority = 2.0;
- P.NetUpdateFrequency = 100.0;
- if (P.Health > 0
- && (HudSettings.bTeamBeacon)
- && (MyCRI.bTeamBeacon))
- HudHelper.DrawBeacon(C,P,0);
- }
- else
- {
- P.NetPriority = HudHelper.NetAdjustment(2.0, HudSettings.nLevel);
- P.NetUpdateFrequency = HudHelper.NetAdjustment(100.0, HudSettings.nLevel);
- }
- }
- if (P.LightType == LT_Steady)
- {
- P.AmbientGlow = 254;
- P.LightRadius = 0;
- P.LightEffect = LE_NonIncidence;
- P.LightRadius = 6;
- }
- else
- {
- P.LightRadius = 0;
- P.AmbientGlow = 17;
- P.LightEffect = LE_None;
- P.LightRadius = 0;
- }
- P.bUnlit = false;
- P.ScaleGlow = 1.0;
- P.SoundRadius = 9;
- if (P.Texture != Texture'S_Pawn' && P.Texture != Texture'unrealshare.Belt_fx.Invis')
- P.Texture = Texture'S_Pawn';
- }
- }
- }
- }
- }
- if (HudHelper.StageCount > 25)
- {
- if (!PlayerOwner.bShowScores
- && (!bForceScores)
- && (!bHideHUD)
- && (HudSettings.bShowFC)
- && (!bShowInfo)
- && (!bHideTeamInfo)
- && (!HudHelper.bShowStats))
- {
- for (i = 0; i < 32; i++)
- {
- if (MyPlayer.GameReplicationInfo.PRIArray[i] != None)
- {
- PRI = MyPlayer.GameReplicationInfo.PRIArray[i];
- if (PRI != None)
- {
- if (PRI.HasFlag != none
- && (!PRI.HasFlag.IsA('EUTReadyFlag')))
- {
- C.DrawColor = WhiteColor;
- if (C.ClipX > 900)
- C.Font = MyFonts.GetSmallestFont(C.ClipX);
- else
- C.Font = MySmallFont;
- switch (PRI.Team)
- {
- case 0:
- Y = (C.ClipY - 350 * Scale) - (150 * Scale);
- C.DrawColor = TeamColor[0];
- if (PRI.PlayerLocation != none)
- RedFlagCarrierLocation = PRI.PlayerLocation.LocationName;
- else if (PRI.PlayerZone != none)
- RedFlagCarrierLocation = PRI.PlayerZone.ZoneName;
- else
- RedFlagCarrierLocation = "";
- break;
- case 1:
- Y = (C.ClipY - 350 * Scale);
- C.DrawColor = TeamColor[1];
- if (PRI.PlayerLocation != none)
- BlueFlagCarrierLocation = PRI.PlayerLocation.LocationName;
- else if (PRI.PlayerZone != none)
- BlueFlagCarrierLocation = PRI.PlayerZone.ZoneName;
- else
- BlueFlagCarrierLocation = "";
- break;
- }
- C.StrLen(PRI.PlayerName, XL, YL);
- C.SetPos(C.ClipX - XL - 5, Y + (32 * scale * 2));
- C.DrawText(PRI.PlayerName, False);
- if (PRI.Team == MyPlayer.PlayerReplicationInfo.Team)
- {
- switch (PRI.Team)
- {
- case 0:
- C.DrawColor = TeamColor[0];
- C.StrLen(RedFlagCarrierLocation, XL, YL);
- C.SetPos(C.ClipX - XL - 5, Y + (32 * scale * 2) + YL);
- C.DrawText(RedFlagCarrierLocation, False);
- break;
- case 1:
- C.DrawColor = TeamColor[1];
- C.StrLen(BlueFlagCarrierLocation, XL, YL);
- C.SetPos(C.ClipX - XL - 5, Y + (32 * scale * 2) + YL);
- C.DrawText(BlueFlagCarrierLocation, False);
- break;
- }
- }
- }
- }
- }
- }
- }
- C.Style = Style;
- if (!PlayerOwner.bShowScores
- && (!bForceScores)
- && (!bHideHUD)
- && (!bShowInfo)
- && (!bHideTeamInfo)
- && (!HudHelper.bShowStats))
- {
- X = C.ClipX - 70 * Scale;
- Y = C.ClipY - 350 * Scale;
- for (i = 0; i < 4; i++)
- {
- _Flag = CTFReplicationInfo(PlayerOwner.GameReplicationInfo).FlagList[i];
- if (_Flag != None)
- {
- C.DrawColor = TeamColor[_Flag.Team];
- C.SetPos(X, Y);
- if (_Flag.Team == PawnOwner.PlayerReplicationInfo.Team) FlagClass = _Flag;
- if (_Flag.bHome) C.DrawIcon(texture'I_Home', scale * 2);
- else if (_Flag.bHeld) C.DrawIcon(texture'I_Capt', scale * 2);
- else C.DrawIcon(texture'I_Down', scale * 2);
- }
- Y -= 150 * Scale;
- }
- }
- if (PawnOwner.Weapon != None
- && (!PlayerOwner.bShowScores)
- && (Level.LevelAction == LEVACT_None)
- && (!bForceScores)
- && (!bShowInfo)
- && (!HudHelper.bShowStats))
- HudHelper.DrawReticle(C, MyPlayer, HudSettings.NewScopeTexture, HudSettings.ScopeMode, CrosshairColor, HudSettings.DotColor);
- HudHelper.ResetScope(MyPlayer);
- }
- if (HudHelper.StageCount < 30) HudHelper.StageCount++;
- if (MyPlayer.Health <= 0) HudHelper.ResetAmmoCount();
- if (bHideFrags)
- {
- HudHelper.WeaponDrawOffset = 0;
- if (!bHideAllWeapons && (HudScale * WeaponScale * C.ClipX >= C.ClipX - 256 * Scale))
- HudHelper.WeaponDrawOffset = 63.5;
- }
- else
- {
- HudHelper.WeaponDrawOffset = 63.5;
- if (bHideAllWeapons)
- HudHelper.WeaponDrawOffset = 0;
- else if (HudScale * WeaponScale * C.ClipX >= C.ClipX - 256 * Scale)
- HudHelper.WeaponDrawOffset = 127.0;
- }
- if (PlayerOwner.Weapon != none)
- {
- HudHelper.StatInfo.Accuracy = HudHelper.GetAccuracy(PlayerOwner.PlayerReplicationInfo.PlayerID, PlayerOwner.Weapon);
- HudHelper.StatInfo.Effeciency = Clamp(int((float(MyCRI.TotalKills[PlayerOwner.PlayerReplicationInfo.PlayerID]) /
- float(MyCRI.TotalKills[PlayerOwner.PlayerReplicationInfo.PlayerID] + MyCRI.TotalDeaths[PlayerOwner.PlayerReplicationInfo.PlayerID])) * 100), 0, 100);
- }
- if (!PlayerOwner.bShowScores
- && (!bForceScores)
- && (!bHideHUD)
- && (HudHelper.bShowTeamInfo)
- && (!bShowInfo)
- && (!HudHelper.bShowStats))
- HudHelper.RenderInfo(C);
- if (HudHelper.bShowStats)
- {
- StatInfo.RenderInfo(C);
- return;
- }
- if (HudHelper.bDebugLoad) HudHelper.ParseLoad(C);
- super(ChallengeHUD).PostRender(C);
- }
- //-------------------------------------
- // DrawStatus
- //-------------------------------------
- simulated function DrawStatus(Canvas C)
- {
- local float StatScale, ChestAmount, ThighAmount, H1, H2, X, Y, DamageTime, TempX, TexX, TexY;
- Local int ArmorAmount,CurAbs,i, Ping;
- Local inventory Inv,BestArmor;
- local bool bChestArmor, bShieldbelt, bThighArmor, bJumpBoots, bHasDoll;
- local Bot BotOwner;
- local TournamentPlayer TPOwner;
- local texture Doll, DollBelt;
- local byte BootCharges, TimeX;
- local string Time, s;
- local byte CanvasStyle;
- local byte acc;
- local int eff;
- if (MyCRI == None || HudSettings == none || HudHelper == None)
- return;
- ArmorAmount = 0;
- CurAbs = 0;
- i = 0;
- BestArmor = None;
- TimeX = 1;
- for (Inv = PawnOwner.Inventory; Inv != None; Inv = Inv.Inventory)
- {
- if (Inv.bIsAnArmor)
- {
- if (Inv.IsA('UT_Shieldbelt')) bShieldbelt = true;
- else if (Inv.IsA('Thighpads'))
- {
- ThighAmount += Inv.Charge;
- bThighArmor = true;
- }
- else
- {
- bChestArmor = true;
- ChestAmount += Inv.Charge;
- }
- ArmorAmount += Inv.Charge;
- }
- else if (Inv.IsA('UT_JumpBoots'))
- {
- bJumpBoots = true;
- BootCharges = Inv.Charge;
- }
- else
- {
- i++;
- if (i > 100) break;
- }
- }
- if (!bHideStatus)
- {
- TPOwner = TournamentPlayer(PawnOwner);
- if (C.ClipX < 400) bHasDoll = false;
- else if (TPOwner != None)
- {
- Doll = TPOwner.StatusDoll;
- DollBelt = TPOwner.StatusBelt;
- bHasDoll = true;
- }
- else
- {
- BotOwner = Bot(PawnOwner);
- if (BotOwner != None)
- {
- Doll = BotOwner.StatusDoll;
- DollBelt = BotOwner.StatusBelt;
- bHasDoll = true;
- }
- }
- if (bHasDoll)
- {
- C.Style = ERenderStyle.STY_Translucent;
- StatScale = Scale * StatusScale;
- X = C.ClipX - 128 * StatScale;
- C.SetPos(X, 0);
- if (PawnOwner.DamageScaling > 2.0) C.DrawColor = PurpleColor;
- else C.DrawColor = HUDColor;
- C.DrawTile(Doll, 128*StatScale, 256*StatScale, 0, 0, 128.0, 256.0);
- C.DrawColor = HUDColor;
- if (bShieldBelt)
- {
- C.DrawColor = BaseColor;
- C.DrawColor.B = 0;
- C.SetPos(X, 0);
- C.DrawIcon(DollBelt, StatScale);
- }
- if (bChestArmor)
- {
- ChestAmount = FMin(0.01 * ChestAmount,1);
- C.DrawColor = HUDColor * ChestAmount;
- C.SetPos(X, 0);
- C.DrawTile(Doll, 128*StatScale, 64*StatScale, 128, 0, 128, 64);
- }
- if (bThighArmor)
- {
- ThighAmount = FMin(0.02 * ThighAmount,1);
- C.DrawColor = HUDColor * ThighAmount;
- C.SetPos(X, 64*StatScale);
- C.DrawTile(Doll, 128*StatScale, 64*StatScale, 128, 64, 128, 64);
- }
- if (bJumpBoots)
- {
- C.DrawColor = HUDColor;
- C.SetPos(X, 128*StatScale);
- C.DrawTile(Doll, 128*StatScale, 64*StatScale, 128, 128, 128, 64);
- }
- C.Style = Style;
- if ((PawnOwner == PlayerOwner) && Level.bHighDetailMode && !Level.bDropDetail)
- {
- for (i=0; i<4; i++)
- {
- DamageTime = Level.TimeSeconds - HitTime[i];
- if (DamageTime < 1)
- {
- C.SetPos(X + HitPos[i].X * StatScale, HitPos[i].Y * StatScale);
- if ((HUDColor.G > 100) || (HUDColor.B > 100)) C.DrawColor = RedColor;
- else C.DrawColor = (WhiteColor - HudColor) * FMin(1, 2 * DamageTime);
- C.DrawColor.R = 255 * FMin(1, 2 * DamageTime);
- C.DrawTile(Texture'BotPack.HudElements1', StatScale * HitDamage[i] * 25, StatScale * HitDamage[i] * 64, 0, 64, 25.0, 64.0);
- }
- }
- }
- }
- }
- C.DrawColor = HUDColor;
- if (bHideStatus && bHideAllWeapons)
- {
- X = 0.5 * C.ClipX;
- Y = C.ClipY - 64 * Scale;
- }
- else
- {
- X = C.ClipX - 128 * StatScale - 140 * Scale;
- Y = 63.5 * Scale;
- }
- C.SetPos(X,Y);
- if (PawnOwner.Health < 50)
- {
- H1 = 1.5 * TutIconBlink;
- H2 = 1 - H1;
- C.DrawColor = WhiteColor * H2 + (HUDColor - WhiteColor) * H1;
- }
- else C.DrawColor = HUDColor;
- C.DrawTile(Texture'BotPack.HudElements1', 128*Scale, 64*Scale, 128, 128, 128.0, 64.0);
- if (PawnOwner.Health < 50)
- {
- H1 = 1.5 * TutIconBlink;
- H2 = 1 - H1;
- C.DrawColor = C.DrawColor * H2 + (WhiteColor - C.DrawColor) * H1;
- }
- else C.DrawColor = WhiteColor;
- DrawBigNum(C, Max(0, PawnOwner.Health), X + 4 * Scale, Y + 16 * Scale, 1);
- C.DrawColor = HUDColor;
- if (bHideStatus && bHideAllWeapons)
- {
- X = 0.5 * C.ClipX - 128 * Scale;
- Y = C.ClipY - 64 * Scale;
- }
- else
- {
- X = C.ClipX - 128 * StatScale - 140 * Scale;
- Y = 0;
- }
- C.SetPos(X, Y);
- C.DrawTile(Texture'BotPack.HudElements1', 128*Scale, 64*Scale, 0, 192, 128.0, 64.0);
- if (bHideStatus && bShieldBelt) C.DrawColor = GoldColor;
- else C.DrawColor = WhiteColor;
- if (MyCRI == none) MyCRI = EUTGameReplicationInfo(PlayerPawn(Owner).GameReplicationInfo);
- if (!PlayerPawn(Owner).PlayerReplicationInfo.bIsSpectator)
- DrawBigNum(C, Min(150, ArmorAmount), X + 4 * Scale, Y + 16 * Scale, 1);
- else
- DrawBigNum(C, Min(150, MyCRI.ArmorAmmount[PawnOwner.PlayerReplicationInfo.PlayerID]), X + 4 * Scale, Y + 16 * Scale, 1);
- C.DrawColor = HudColor;
- if (HudSettings.bShowPing)
- {
- if (bHideStatus && bHideAllWeapons)
- {
- X = 0.50 * C.ClipX + 256 * Scale;
- Y = C.ClipY - 63.5 * Scale;
- }
- else
- {
- X = C.ClipX - 128 * StatScale - 140 * Scale;
- Y = 127 * Scale;
- }
- if (MyCRI != none && PlayerOwner != none && (PlayerOwner.PlayerReplicationInfo != none))
- Ping = MyCRI.ClientPing[PlayerOwner.PlayerReplicationInfo.PlayerID];
- if (Ping > 999) Ping = 999;
- C.SetPos(X, Y);
- C.DrawTile(PingBack, 128.00 * Scale, 64.00 * Scale, 0.00, 0.00, 128.00, 64.00);
- if (PlayerOwner == none || (PlayerOwner.PlayerReplicationInfo == none))
- C.DrawColor = WhiteColor;
- else if (PlayerOwner.PlayerReplicationInfo.PacketLoss < 20 && PlayerOwner.PlayerReplicationInfo.PacketLoss != 0)
- C.DrawColor = GoldColor;
- else if (PlayerOwner.PlayerReplicationInfo.PacketLoss > 20)
- C.DrawColor = RedColor;
- else
- C.DrawColor = WhiteColor;
- DrawBigNum(C, Ping, X + 4 * Scale, Y + 16 * Scale, 1);
- }
- C.DrawColor = HUDColor;
- if (HudSettings.bShowTime && HudHelper != none)
- {
- if (bHideStatus && bHideAllWeapons)
- {
- X = 0.50 * C.ClipX - 384 * Scale;
- Y = C.ClipY - 63.5 * Scale;
- }
- else
- {
- X = C.ClipX - 128 * StatScale - 140 * Scale;
- if (HudSettings.bShowPing) Y = 190.5 * Scale;
- else Y = 127 * Scale;
- }
- C.SetPos(X, Y);
- C.DrawTile(EUTElements,128.0 * Scale, 64.0 * Scale, 0.00, 0.00, 128.00, 64.00);
- Time = HudHelper.GetTime(PlayerOwner.GameReplicationInfo);
- C.DrawColor = WhiteColor;
- CanvasStyle = C.Style;
- C.Style = ERenderStyle.STY_Translucent;
- while (TimeX < 5)
- {
- switch (TimeX)
- {
- case 1: TempX = X + (3*Scale); break;
- case 2: TempX = TempX + (32*Scale) - (5*Scale); break;
- case 3: TempX = TempX + (32*Scale) + (5*Scale); break;
- case 4: TempX = TempX + (32*Scale) - (5*Scale); break;
- }
- C.SetPos(TempX, Y + 13 * Scale);
- s = Mid(Time, TimeX - 1, 1);
- HudHelper.GetTimeDigit(s,TexX,TexY);
- C.DrawTile(EUTElements,32.0 * Scale, 64.0 * Scale, TexX, TexY, 32.00, 64.00);
- TimeX++;
- }
- C.Style = CanvasStyle;
- }
- C.DrawColor = HUDColor;
- if (HudSettings.bJumpBoots && bJumpBoots)
- {
- if (bHideStatus && bHideAllWeapons)
- {
- X = 0.5 * C.ClipX + 384 * Scale;
- Y = C.ClipY - 63.5 * Scale;
- }
- else
- {
- X = C.ClipX - 128 * StatScale - 140 * Scale;
- if (HudSettings.bShowTime && HudSettings.bShowPing) Y = 254 * Scale;
- else if (HudSettings.bShowTime || HudSettings.bShowPing) Y = 190.5 * Scale;
- else Y = 127 * Scale;
- }
- C.SetPos(X,Y);
- C.DrawTile(EUTElements,128.0 * Scale, 64.0 * Scale,128.0,64.0,128.0,64.0);
- C.DrawColor = WhiteColor;
- DrawBigNum(C, BootCharges, X + 4 * Scale, Y + 16 * Scale, 1);
- C.DrawColor = HUDColor;
- }
- if (!PlayerOwner.bShowScores
- && (!bForceScores)
- && (!bHideHUD)
- && (HudSettings.bShowTeams)
- && (!bShowInfo)
- && (!HudHelper.bShowStats))
- HudHelper.DrawTeamCount(C, TeamBack, RedTeamSize, BlueTeamSize, Scale, HudSettings.bShowWeaponAccuracy);
- if (!PlayerOwner.bShowScores
- && (!bForceScores)
- && (!bHideHUD)
- && (!bShowInfo)
- && (HudHelper != none)
- && (!HudHelper.bShowStats))
- {
- if (HudSettings != none)
- {
- if (HudSettings.bShowWeaponAccuracy == 1)
- HudHelper.DrawAccuracy(C, HudHelper.StatInfo.Accuracy, AccuracyBack, Scale, HudColor);
- else if (HudSettings.bShowWeaponAccuracy == 2)
- HudHelper.DrawEffeciency(C, EUTElements, HudHelper.StatInfo.Effeciency, Scale, HudColor);
- }
- }
- C.DrawColor = HudColor;
- //C.SetPos(0,0);
- //C.DrawPortal(0, 0, C.ClipX / 4, C.ClipY / 4, PlayerPawn(Owner), PlayerPawn(Owner).Location + 100*vector(PlayerPawn(Owner).Rotation), rotator(-vector(PlayerPawn(Owner).Rotation)), 90, true);
- }
- //-------------------------------------
- // Message
- //-------------------------------------
- simulated function Message(PlayerReplicationInfo _PRI, coerce string msg, name MsgType)
- {
- local int i;
- local Class<LocalMessage> Message${1}< ${3} >
- switch (MsgType)
- {
- case 'Say':
- MessageClass = class'EUTSayMessagePlus';
- break;
- case 'TeamSay':
- if (HudSettings.bColoredText)
- MessageClass = class'EUTTeamSayMessagePlus';
- else
- MessageClass = class'TeamSayMessagePlus';
- break;
- case 'CriticalEvent':
- MessageClass = class'CriticalStringPlus';
- LocalizedMessage(MessageClass, 0, None, None, None, msg);
- return;
- case 'Event':
- case 'Scroll':
- if (bUdemo)
- {
- if (msg == LastEventMessage) return;
- LastEventMessage = msg;
- }
- MessageClass = class'EUTStringMessagePlus';
- break;
- case 'EUTEvent':
- if (bUdemo)
- {
- if (msg == LastEventMessage) return;
- LastEventMessage = msg;
- }
- MessageClass = class'EUTStringMessagePlus';
- break;
- default:
- MessageClass = class'EUTStringMessagePlus';
- break;
- }
- if (HudSettings.bColoredText)
- {
- if (ClassIsChildOf(MessageClass, class'EUTSayMessagePlus')
- || ClassIsChildOf(MessageClass, class'EUTTeamSayMessagePlus'))
- {
- FaceTexture = _PRI.TalkTexture;
- FaceTeam = TeamColor[_PRI.Team];
- if (FaceTexture != None) FaceTime = Level.TimeSeconds + 3;
- if (msg == "") return;
- }
- }
- else
- {
- if (ClassIsChildOf(MessageClass, class'EUTSayMessagePlus')
- || ClassIsChildOf(MessageClass, class'TeamSayMessagePlus'))
- {
- FaceTexture = _PRI.TalkTexture;
- FaceTeam = TeamColor[_PRI.Team];
- if (FaceTexture != None) FaceTime = Level.TimeSeconds + 3;
- if (msg == "") return;
- }
- }
- for (i = 0; i < 4; i++)
- {
- if (ShortMessageQueue[i].Message == None)
- {
- ShortMessageQueue[i].Message = Message${1}< ${3} >
- ShortMessageQueue[i].Switch = 0;
- ShortMessageQueue[i].RelatedPRI = _PRI;
- ShortMessageQueue[i].OptionalObject = None;
- ShortMessageQueue[i].EndOfLife = MessageClass.Default.Lifetime + Level.TimeSeconds;
- if (MessageClass.Default.bComplexString) ShortMessageQueue[i].StringMessage = msg;
- else ShortMessageQueue[i].StringMessage = MessageClass.Static.AssembleString(self, 0, _PRI, msg);
- return;
- }
- }
- for (i = 0; i < 3; i++)
- CopyMessage(ShortMessageQueue[i],ShortMessageQueue[i + 1]);
- ShortMessageQueue[3].Message = Message${1}< ${3} >
- ShortMessageQueue[3].Switch = 0;
- ShortMessageQueue[3].RelatedPRI = _PRI;
- ShortMessageQueue[3].OptionalObject = None;
- ShortMessageQueue[3].EndOfLife = MessageClass.Default.Lifetime + Level.TimeSeconds;
- if (MessageClass.Default.bComplexString)
- ShortMessageQueue[3].StringMessage = msg;
- else
- ShortMessageQueue[3].StringMessage = MessageClass.Static.AssembleString(self, 0, _PRI, msg);
- }
- //-------------------------------------
- // DisplayMessages
- //-------------------------------------
- simulated function bool DisplayMessages( canvas C )
- {
- return true;
- }
- //-------------------------------------
- // DrawNextMessagePart
- //-------------------------------------
- simulated function float DrawNextMessagePart(Canvas C, string MString, float X, int YPos)
- {
- local float XL, YL;
- C.SetPos(4 + X, YPos);
- C.StrLen(MString, XL, YL);
- C.DrawText(MString, false);
- return (X + XL);
- }
- //-------------------------------------
- // DrawTeam
- //-------------------------------------
- simulated function DrawTeam(Canvas C, TeamInfo TI)
- {
- if ((TI != None) && (TI.Size > 0))
- {
- C.DrawColor = TeamColor[TI.TeamIndex];
- DrawBigNum(C, int(TI.Score), C.ClipX - 144 * Scale, C.ClipY - 336 * scale - (150 * scale * TI.TeamIndex), 1);
- }
- }
- //-------------------------------------
- // DrawWeapons
- //-------------------------------------
- simulated function DrawWeapons(Canvas C)
- {
- local Weapon W, WeaponSlot[11];
- local inventory inv;
- local int i, BaseY, BaseX, Pending, WeapX, WeapY;
- local float AmmoScale, WeaponOffset, WeapScale, WeaponX, TexX, TexY;
- BaseX = 0.5 * (C.ClipX - HudScale * WeaponScale * C.ClipX);
- WeapScale = WeaponScale * Scale;
- C.Style = Style;
- BaseY = C.ClipY - 63.5 * WeapScale;
- WeaponOffset = 0.1 * HUDScale * WeaponScale * C.ClipX;
- if (PawnOwner.Weapon != none)
- {
- W = PawnOwner.Weapon;
- if ((Opacity > 8)
- || !Level.bHighDetailMode)
- C.Style = ERenderStyle.STY_Normal;
- WeaponX = BaseX + ( W.InventoryGroup - 1 ) * WeaponOffset;
- C.CurX = WeaponX;
- C.CurY = BaseY;
- C.DrawColor = SolidHUDColor;
- C.DrawIcon(W.StatusIcon, WeapScale);
- C.DrawColor = GoldColor;
- C.CurX = WeaponX + 4 * WeapScale;
- C.CurY = BaseY + 4 * WeapScale;
- C.Style = Style;
- if (W.InventoryGroup == 10)
- C.DrawTile(Texture'BotPack.HudElements1', 0.75 * WeapScale * 25, 0.75 * WeapScale * 64, 0, 0, 25.0, 64.0);
- else
- C.DrawTile(Texture'BotPack.HudElements1', 0.75 * WeapScale * 25, 0.75 * WeapScale * 64, 25 * W.InventoryGroup, 0, 25.0, 64.0);
- WeaponSlot[W.InventoryGroup] = W;
- C.CurX = WeaponX;
- C.CurY = BaseY;
- C.DrawTile(Texture'BotPack.HUDWeapons', 128 * WeapScale, 64 * WeapScale, 128, 64, 128, 64);
- }
- if (Level.bHighDetailMode
- && (PawnOwner.PendingWeapon != None))
- {
- Pending = PawnOwner.PendingWeapon.InventoryGroup;
- C.CurX = BaseX + (Pending - 1) * WeaponOffset - 64 * WeapScale;
- C.CurY = C.ClipY - 96 * WeapScale;
- C.Style = ERenderStyle.STY_Translucent;
- C.DrawColor = GoldColor;
- C.DrawTile(Texture'BotPack.HUDWeapons', 256 * WeapScale, 128 * WeapScale, 0, 128, 256.0, 128.0);
- }
- else
- Pending = 100;
- C.Style = Style;
- i = 0;
- for (inv = PawnOwner.Inventory; inv != None; inv = inv.Inventory)
- {
- if (inv.IsA('Weapon')
- && (inv != PawnOwner.Weapon))
- {
- W = Weapon(inv);
- if ( WeaponSlot[W.InventoryGroup] == none )
- WeaponSlot[W.InventoryGroup] = W;
- else if (( WeaponSlot[W.InventoryGroup] != PawnOwner.Weapon)
- && ((W == PawnOwner.PendingWeapon)
- || (WeaponSlot[W.InventoryGroup].AutoSwitchPriority < W.AutoSwitchPriority)))
- WeaponSlot[ W.InventoryGroup] = W;
- }
- i++;
- if (i > 100)
- break;
- }
- W = PawnOwner.Weapon;
- TexX = 128 * WeapScale;
- TexY = 64 * WeapScale;
- for (i = 1; i < 11; i++)
- {
- if (WeaponSlot[i] == none)
- {
- C.Style = Style;
- C.DrawColor = 0.5 * HUDColor;
- C.CurX = BaseX + (i - 1) * WeaponOffset;
- C.CurY = BaseY;
- WeapX = ((i - 1 ) % 4) * 64;
- WeapY = ((i - 1 ) / 4) * 32;
- C.DrawTile(Texture'BotPack.HUDWeapons', TexX, TexY, WeapX, WeapY, 64.0, 32.0);
- }
- else if (WeaponSlot[i] != W)
- {
- if (Pending == i)
- {
- if ((Opacity > 8) || !Level.bHighDetailMode)
- C.Style = ERenderStyle.STY_Normal;
- C.DrawColor = SolidHUDColor;
- }
- else
- {
- C.Style = Style;
- C.DrawColor = 0.5 * HUDColor;
- }
- C.CurX = BaseX + (i - 1) * WeaponOffset;
- C.CurY = BaseY;
- if (WeaponSlot[i].bSpecialIcon)
- C.DrawIcon(WeaponSlot[i].StatusIcon, WeapScale);
- else
- {
- WeapX = ((i - 1) % 4) * 64;
- WeapY = ((i - 1) / 4) * 32;
- C.DrawTile(Texture'BotPack.HUDWeapons', TexX, TexY, WeapX, WeapY, 64.0, 32.0);
- }
- }
- }
- TexX = 0.75 * WeapScale * 25;
- TexY = 0.75 * WeapScale * 64;
- for (i = 1; i < 11; i++)
- {
- if (WeaponSlot[i] != none)
- {
- WeaponX = BaseX + (i - 1) * WeaponOffset + 4 * WeapScale;
- if (WeaponSlot[i] != W)
- {
- C.CurX = WeaponX;
- C.CurY = BaseY + 4 * WeapScale;
- C.DrawColor = GoldColor;
- if ((Opacity > 8) || !Level.bHighDetailMode)
- C.Style = ERenderStyle.STY_Normal;
- else
- C.Style = Style;
- if (i == 10)
- C.DrawTile(Texture'BotPack.HudElements1', TexX, TexY, 0, 0, 25.0, 64.0);
- else
- C.DrawTile(Texture'BotPack.HudElements1', TexX, TexY, 25 * i, 0, 25.0, 64.0);
- }
- if (WeaponSlot[i].AmmoType != none)
- {
- C.CurX = WeaponX;
- C.CurY = BaseY + 52 * WeapScale;
- C.DrawColor = BaseColor;
- AmmoScale = FClamp(88.0 * WeapScale * WeaponSlot[i].AmmoType.AmmoAmount / WeaponSlot[i].AmmoType.MaxAmmo, 0, 88);
- C.DrawTile(Texture'BotPack.HudElements1', AmmoScale, 8 * WeapScale, 64, 64, 128.0, 8.0);
- }
- }
- }
- }
- //-------------------------------------
- // DrawCrossHair
- //-------------------------------------
- simulated function DrawCrossHair(Canvas C, int X, int Y)
- {
- local float XScale, PickDiff;
- local float XLength;
- local texture T, M;
- if (Crosshair >= CrosshairCount) Return;
- if (C.ClipX < 512) XScale = 0.5;
- else XScale = FMax(1, int(0.1 + C.ClipX / 640.0));
- PickDiff = Level.TimeSeconds - PickupTime;
- if (PickDiff < 0.4)
- {
- if (PickDiff < 0.2) XScale *= (1 + 5 * PickDiff);
- else XScale *= (3 - 5 * PickDiff);
- }
- XLength = XScale * 64.0;
- C.SetPos(0.5 * (C.ClipX - XLength), 0.5 * (C.ClipY - XLength));
- C.Style = ERenderStyle.STY_Translucent;
- C.DrawColor = 15 * CrosshairColor;
- M = CrossHairTextures[7];
- T = CrossHairTextures[Crosshair];
- if (T == None) T = LoadCrosshair(Crosshair);
- if (M == None) M = LoadCrosshair(7);
- C.DrawTile(T, XLength, XLength, 0, 0, 64, 64);
- C.DrawColor = HudSettings.DotColor;
- C.SetPos(0.5 * (C.ClipX - XLength) - 10 + HudSettings.DotX, 0.5 * (C.ClipY - XLength) - 10 + HudSettings.DotY);
- if (HudSettings.bDot) C.DrawTile(M, XLength, XLength, 0, 0, 64, 64);
- C.bNoSmooth = True;
- C.Style = Style;
- }
- //-------------------------------------
- // TraceIdentify
- //-------------------------------------
- simulated function bool TraceIdentify(canvas C)
- {
- local actor A;
- local vector HitLocation, HitNormal, StartTrace, EndTrace;
- if (PawnOwner == none || MyCRI == none) return false;
- StartTrace = PawnOwner.Location;
- StartTrace.Z += PawnOwner.BaseEyeHeight;
- EndTrace = StartTrace + vector(PawnOwner.ViewRotation) * MyCRI.TraceDistance;
- A = Trace(HitLocation, HitNormal, EndTrace, StartTrace, true);
- if (Pawn(A) != None)
- {
- if (Pawn(A).bIsPlayer)
- {
- IdentifyTarget = Pawn(A).PlayerReplicationInfo;
- IdentifyFadeTime = 3.0;
- }
- }
- else if ((A != None) && SpecialIdentify(C, A))
- return false;
- if ((IdentifyFadeTime == 0.0 ) || (IdentifyTarget == None) || IdentifyTarget.bFeigningDeath)
- return false;
- return true;
- }
- //-------------------------------------
- // SpecialIdentify
- //-------------------------------------
- simulated function bool SpecialIdentify(Canvas C, Actor A )
- {
- return false;
- }
- //-------------------------------------
- // SetIDColor
- //-------------------------------------
- simulated function SetIDColor( Canvas C, int type)
- {
- if (type == 0) C.DrawColor = AltTeamColor[IdentifyTarget.Team] * 0.333 * IdentifyFadeTime;
- else C.DrawColor = TeamColor[IdentifyTarget.Team] * 0.333 * IdentifyFadeTime;
- }
- //-------------------------------------
- // DrawTwoColorID
- //-------------------------------------
- simulated function DrawTwoColorID( canvas C, string TitleString, string ValueString, int YStart)
- {
- local float XL, YL, X, X1;
- C.Style = Style;
- C.StrLen(TitleString$": ", XL, YL);
- X1 = XL;
- C.StrLen(ValueString, XL, YL);
- X = C.ClipX/2 - (X1 + XL) / 2;
- C.SetPos(X, YStart);
- SetIDColor(C, 0);
- X += X1;
- C.DrawText(TitleString);
- C.SetPos(X, YStart);
- SetIDColor(C, 1);
- C.DrawText(ValueString);
- C.DrawColor = WhiteColor;
- C.Font = MyFonts.GetSmallFont(C.ClipX);
- }
- //-------------------------------------
- // DrawIdentifyInfo
- //-------------------------------------
- simulated function bool DrawIdentifyInfo(canvas C)
- {
- local float XL, YL, X, X1;
- local Pawn P;
- if (!Super.DrawIdentifyInfo(C))
- return false;
- C.StrLen("TEST", XL, YL);
- if (PawnOwner.PlayerReplicationInfo.Team == IdentifyTarget.Team)
- {
- P = Pawn(IdentifyTarget.Owner);
- C.Font = MyFonts.GetSmallFont(C.ClipX);
- if (P != None)
- DrawTwoColorID(C,IdentifyHealth,string(P.Health), (C.ClipY - 256 * Scale) + 1.5 * YL);
- }
- return true;
- }
- //-------------------------------------
- // Tick
- //-------------------------------------
- simulated function Tick(float DeltaTime)
- {
- local int i;
- Super.Tick(DeltaTime);
- IdentifyFadeTime = FMax(0.0, IdentifyFadeTime - DeltaTime);
- MOTDFadeOutTime = FMax(0.0, MOTDFadeOutTime - DeltaTime * 55);
- TutIconBlink += DeltaTime;
- if (TutIconBlink >= 0.5) TutIconBlink = 0.0;
- if (bDrawFaceArea)
- {
- if (FaceAreaOffset < 0)
- FaceAreaOffset += DeltaTime * 600;
- if (FaceAreaOffset > 0)
- FaceAreaOffset = 0.0;
- }
- else if (FaceAreaOffset > MinFaceAreaOffset)
- FaceAreaOffset = FMax(FaceAreaOffset - DeltaTime * 600, MinFaceAreaOffset );
- if (bDrawMessageArea)
- {
- if (MessageFadeTime < 1.0)
- {
- MessageFadeTime += DeltaTime * 8;
- if (MessageFadeTime > 1.0) MessageFadeTime = 1.0;
- }
- }
- else if ((MessageFadeTime > 0.0) && (MessageFadeCount == 0))
- {
- MessageFadeTime -= DeltaTime * 2;
- if (MessageFadeTime < 0.0) MessageFadeTime = 0.0;
- }
- WeaponNameFade -= DeltaTime;
- }
- //-------------------------------------
- // DisplayProgressMessage
- //-------------------------------------
- simulated function DisplayProgressMessage( canvas C )
- {
- local int i;
- local float XL, YL, YOffset, LogoSize;
- local GameReplicationInfo GRI;
- local string s;
- local byte style;
- local bool bReturn;
- PlayerOwner.ProgressTimeOut = FMin(PlayerOwner.ProgressTimeOut, Level.TimeSeconds + 8);
- if ((MyCRI == None) || (MyCRI.bTournament && MyCRI.bMatchStarted))
- return;
- C.Style = ERenderStyle.STY_Normal;
- C.bCenter = True;
- C.Font = MyFonts.GetBigFont( C.ClipX );
- C.StrLen("TEST", XL, YL);
- if ( UTIntro(Level.Game) != None )
- YOffset = 64 * scale + 2 * YL;
- else if ( (MOTDFadeOutTime <= 0) || (C.ClipY < 300) )
- YOffset = 64 * scale + 6 * YL;
- else
- {
- YOffset = 64 * scale + 6 * YL;
- GRI = PlayerOwner.GameReplicationInfo;
- if ( GRI != None )
- {
- if ( GRI.MOTDLine1 != "" )
- YOffset += YL;
- if ( GRI.MOTDLine2 != "" )
- YOffset += YL;
- if ( GRI.MOTDLine3 != "" )
- YOffset += YL;
- if ( GRI.MOTDLine4 != "" )
- YOffset += YL;
- }
- }
- for (i=0; i<8; i++)
- {
- if ( i == 0)
- {
- if (!bStartMessage)
- {
- bStartMessage = true;
- StartMessage = PlayerPawn(Owner).ProgressMessage[i];
- }
- else
- {
- if (PlayerPawn(Owner).ProgressMessage[i] != StartMessage) bReturn = true;
- }
- }
- C.SetPos(0, YOffset);
- C.DrawColor = PlayerPawn(Owner).ProgressColor[i];
- C.DrawText(PlayerPawn(Owner).ProgressMessage[i], False);
- if(PlayerPawn(Owner).ProgressMessage[i] == "") break;
- YOffset += YL + 1;
- }
- if ((MyCRI.bTournament && !MyCRI.bWarmupSwitch && PlayerPawn(Owner).Health > 0) || (bReturn))
- {
- C.bCenter = False;
- C.Style = Style;
- HUDSetup(C);
- return;
- }
- if (MyCRI.MessageOfTheDay != "")
- {
- s = MyCRI.MessageOfTheDay;
- if(Len(s) > 50) s = Left(s,50);
- C.SetPos(0, YOffset);
- C.DrawColor = WhiteColor;
- C.DrawText(s, False);
- YOffset += YL + 1;
- }
- C.SetPos(0, YOffset);
- C.DrawColor = GoldColor;
- C.DrawText("EUT SOURCE", False);
- YOffset += YL + 1;
- C.SetPos(0, YOffset);
- C.DrawColor = GreenColor;
- C.DrawText("Type ShowHelp In Console For Extended Commands", False);
- YOffset += YL + 1;
- C.DrawColor = WhiteColor;
- LogoSize = Badge.USize * Scale;
- C.SetPos(C.ClipX/2 - LogoSize/2, YOffset);
- Style = C.Style;
- C.Style = ERenderStyle.STY_Translucent;
- C.DrawIcon(Badge,Scale);
- C.bCenter = False;
- C.Style = Style;
- HUDSetup(C);
- }
- //-------------------------------------
- // EXECS
- //-------------------------------------
- exec function ShowStats()
- {
- if (HudHelper.bShowStats) HudHelper.bShowStats = False;
- else
- {
- HudHelper.bShowStats = True;
- PlayerPawn(Owner).bShowScores = False;
- bShowInfo = false;
- }
- }
- //-------------------------------------
- exec function ShowServerInfo()
- {
- if (bShowInfo) bShowInfo = False;
- else
- {
- bShowInfo = True;
- PlayerPawn(Owner).bShowScores = False;
- HudHelper.bShowStats = false;
- }
- }
- //-------------------------------------
- exec function ShowScores()
- {
- if (PlayerPawn(Owner).bShowScores) PlayerPawn(Owner).bShowScores = False;
- else
- {
- PlayerPawn(Owner).bShowScores = True;
- bShowInfo = False;
- HudHelper.bShowStats = false;
- }
- }
- //-------------------------------------
- exec function ShowPing(string s)
- {
- HudSettings.ShowPing(s);
- }
- //-------------------------------------
- exec function ShowTime(string s)
- {
- HudSettings.ShowTime(s);
- }
- //-------------------------------------
- exec function EText(string s)
- {
- HudSettings.EText(s);
- }
- //-------------------------------------
- exec function ShowTeams(string s)
- {
- HudSettings.ShowTeams(s);
- }
- //-------------------------------------
- exec function Scope(string s)
- {
- HudSettings.Scope(s);
- }
- //-------------------------------------
- exec function ShowFC(string s)
- {
- HudSettings.ShowFC(s);
- }
- //-------------------------------------
- exec function ShowWeaponAccuracy(string s)
- {
- HudSettings.ShowWeaponAccuracy(s);
- }
- //-------------------------------------
- exec function HitSounds(string s)
- {
- HudSettings._HitSounds(s);
- }
- //-------------------------------------
- exec function AutoSS(string s)
- {
- HudSettings.AutoSS(s);
- }
- //-------------------------------------
- exec function ShowHelp(string s)
- {
- HudSettings.ShowHelp(s);
- }
- //-------------------------------------
- exec function ShowBeacon(string s)
- {
- HudSettings.ShowBeacon(s);
- }
- //-------------------------------------
- exec function UseDot(string s)
- {
- HudSettings.UseDot(s);
- }
- //-------------------------------------
- exec function ShowBoots(string s)
- {
- HudSettings.ShowBoots(s);
- }
- //-------------------------------------
- exec function ShowTeamInfo()
- {
- if (HudHelper.bShowTeamInfo)
- HudHelper.bShowTeamInfo = False;
- else
- HudHelper.bShowTeamInfo = True;
- }
- //-------------------------------------
- exec function Spectate(string s)
- {
- if (s ~= "")
- {
- if (PlayerPawn(Owner).IsA('Spectator'))
- {
- PlayerPawn(Owner).ClientMessage("You are already a Spectator!");
- return;
- }
- if (MyCRI.bCanSpectate)
- {
- PlayerPawn(Owner).ClientMessage("Changing to Spectator Mode");
- PlayerPawn(Owner).ConsoleCommand("Disconnect");
- PlayerPawn(Owner).UpdateURL("OverrideClass", "Botpack.CHSpectator", True);
- PlayerPawn(Owner).ConsoleCommand("Reconnect");
- }
- else
- PlayerPawn(Owner).ClientMessage("Spectator Spots Full.");
- }
- }
- //-------------------------------------
- exec function QuickJoin(string s)
- {
- if (PlayerPawn(Owner).IsA('Spectator'))
- {
- if (s ~= "")
- {
- PlayerPawn(Owner).ClientMessage("Joining Server");
- PlayerPawn(Owner).UpdateURL("OverrideClass", "", True);
- PlayerPawn(Owner).ConsoleCommand("Reconnect");
- }
- }
- }
- //-------------------------------------
- exec function DebugLoad(string s)
- {
- if (!MyPlayer.PlayerReplicationInfo.bAdmin)
- {
- MyPlayer.ClientMessage("You Must Be Logged In As An Admin To Access This Debugger!");
- return;
- }
- switch (s)
- {
- case "1":
- MyPlayer.ConsoleCommand("Inject UserFlag 1");
- MyPlayer.ClientMessage("Load Debugger Activated!");
- HudHelper.bDebugLoad = true;
- break;
- case "0":
- MyPlayer.ConsoleCommand("Inject UserFlag 0");
- MyPlayer.ClientMessage("Load Debugger DeActivated!");
- HudHelper.bDebugLoad = false;
- break;
- }
- }
- //-------------------------------------
- exec function NetCode(string s)
- {
- HudSettings.ChangenLevel(s);
- }
- //-------------------------------------
- exec function ShowLeader(string s)
- {
- HudSettings.ShowLeader(s);
- }
- //-------------------------------------
- // defaultproperties
- //-------------------------------------
- defaultproperties
- {
- StatInfoClass=Class'EUTSource.EUTStatInfo'
- HudHelperClass=Class'EUTSource.EUTHudHelper'
- BlueColor=(B=255)
- RedColor=(R=255)
- ServerInfoClass=Class'EUTSource.EUTServerInfo'
- }
Add Comment
Please, Sign In to add comment