From f608412edbaee60157ab0587c9b59f95764a5845 Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Sun, 16 May 2021 07:40:47 +0300 Subject: [PATCH] clean --- ScoreboardExt/Classes/KF2GUIController.uc | 1 - ScoreboardExt/Classes/ScoreboardExtHUD.uc | 1850 +------------------- ScoreboardExt/Classes/UIP_ColorSettings.uc | 155 -- ScoreboardExt/Classes/UIP_Settings.uc | 255 --- ScoreboardExt/Classes/UI_MidGameMenu.uc | 140 -- 5 files changed, 2 insertions(+), 2399 deletions(-) delete mode 100644 ScoreboardExt/Classes/UIP_ColorSettings.uc delete mode 100644 ScoreboardExt/Classes/UIP_Settings.uc delete mode 100644 ScoreboardExt/Classes/UI_MidGameMenu.uc diff --git a/ScoreboardExt/Classes/KF2GUIController.uc b/ScoreboardExt/Classes/KF2GUIController.uc index 5f73c5a..94d38fb 100644 --- a/ScoreboardExt/Classes/KF2GUIController.uc +++ b/ScoreboardExt/Classes/KF2GUIController.uc @@ -267,7 +267,6 @@ simulated function RenderMenu( Canvas C ) if( !KFPlayerController(PlayerOwner).MyGFxManager.bMenusActive ) { HUDOwner.Canvas = C; - HUDOwner.RenderKFHUD(KFPawn_Human(PlayerOwner.Pawn)); for( i=(HUDOwner.HUDWidgets.Length-1); i>=0; --i ) { diff --git a/ScoreboardExt/Classes/ScoreboardExtHUD.uc b/ScoreboardExt/Classes/ScoreboardExtHUD.uc index f6d34d8..36eb049 100644 --- a/ScoreboardExt/Classes/ScoreboardExtHUD.uc +++ b/ScoreboardExt/Classes/ScoreboardExtHUD.uc @@ -273,12 +273,10 @@ var transient OnlineSubsystem OnlineSub; var transient bool bLoadedInitItems; var array DamageMsgColors; -var UIP_ColorSettings ColorSettingMenu; var transient GFxClikWidget HUDChatInputField, PartyChatInputField; var transient bool bReplicatedColorTextures; var config Color HudMainColor, HudOutlineColor, FontColor, CustomArmorColor, CustomHealthColor; -var config bool bEnableDamagePopups, bLightHUD, bHideWeaponInfo, bHidePlayerInfo, bHideDosh, bDisableHiddenPlayers, bShowSpeed, bDisableLastZEDIcons, bDisablePickupInfo, bDisableLockOnUI, bDisableRechargeUI, bShowXPEarned, bShowDoshEarned, bNewScoreboard, bDisableHUD; var config int HealthBarFullVisDist, HealthBarCutoffDist; var config int iConfigVersion; @@ -301,21 +299,6 @@ simulated function PostBeginPlay() HudOutlineColor = DefaultHudOutlineColor; FontColor = DefaultFontColor; - bLightHUD = false; - bHideWeaponInfo = false; - bHidePlayerInfo = false; - bHideDosh = false; - bDisableHiddenPlayers = false; - bEnableDamagePopups = true; - bShowSpeed = false; - bDisableLastZEDIcons = false; - bDisablePickupInfo = false; - bDisableLockOnUI = false; - bDisableRechargeUI = false; - bShowXPEarned = true; - bShowDoshEarned = true; - bNewScoreboard = true; - bDisableHUD = false; PlayerInfoType = ClassicPlayerInfo ? INFO_LEGACY : INFO_MODERN; HealthBarFullVisDist = 350.f; HealthBarCutoffDist = 3500.f; @@ -368,103 +351,11 @@ simulated function PostBeginPlay() SetTimer(300 + FRand()*120.f, false, 'CheckForItems'); - if( bDisableHUD ) + if( true ) // ??? { RemoveMovies(); - HUDClass = class'KFGFxHudWrapper'.default.HUDClass; CreateHUDMovie(); } - - SetTimer(0.25f, false, nameof(InitializeHUD)); - - InitializePartyChatHook(); - InitializeHUDChatHook(); -} - -function InitializeHUD() -{ - WriteToChat(" Initialized!", "FFFF00"); - WriteToChat(" Type !settings or use OpenSettingsMenu in console to configure!", "00FF00"); -} - -delegate OnPartyChatInputKeyDown(GFxClikWidget.EventData Data) -{ - OnChatKeyDown(PartyChatInputField, Data); -} - -delegate OnHUDChatInputKeyDown(GFxClikWidget.EventData Data) -{ - if (OnChatKeyDown(HUDChatInputField, Data)) - HUDMovie.HudChatBox.ClearAndCloseChat(); -} - -function bool OnChatKeyDown(GFxClikWidget InputField, GFxClikWidget.EventData Data) -{ - local GFXObject InputDetails; - local int KeyCode; - local string EventType; - local string KeyEvent; - local string Text; - - InputDetails = Data._this.GetObject("details"); - KeyCode = InputDetails.GetInt("code"); - EventType = InputDetails.GetString("type"); - KeyEvent = InputDetails.GetString("value"); - - if (EventType != "key") return false; - - if (KeyCode == 13 && (KeyEvent == "keyHold" || KeyEvent == "keyDown")) - { - Text = InputField.GetText(); - switch (Locs(Text)) - { - case "!settings": - OpenSettingsMenu(); - break; - default: - return false; - } - - InputField.SetText(""); - - return true; - } - - return false; -} - -function InitializePartyChatHook() -{ - if (KFPlayerOwner.MyGFxManager == None || KFPlayerOwner.MyGFxManager.PartyWidget == None || KFPlayerOwner.MYGFxManager.PartyWidget.PartyChatWidget == None) - { - SetTimer(1.f, false, nameof(InitializePartyChatHook)); - return; - } - - KFPlayerOwner.MyGFxManager.PartyWidget.PartyChatWidget.SetVisible(true); - PartyChatInputField = GFxClikWidget(KFPlayerOwner.MyGFxManager.PartyWidget.PartyChatWidget.GetObject("ChatInputField", class'GFxClikWidget')); - PartyChatInputField.AddEventListener('CLIK_input', OnPartyChatInputKeyDown, false, GFxListenerPriority, false); -} - -function InitializeHUDChatHook() -{ - if( HUDMovie == None || HUDMovie.HudChatBox == None ) - { - SetTimer(1.f, false, nameof(InitializeHUDChatHook)); - return; - } - - HUDChatInputField = GFxClikWidget(HUDMovie.HudChatBox.GetObject("ChatInputField", class'GFxClikWidget')); - HUDChatInputField.AddEventListener('CLIK_input', OnHUDChatInputKeyDown, false, GFxListenerPriority, false);; -} - -function WriteToChat(string Message, string HexColor) -{ - if (KFPlayerOwner.MyGFxManager.PartyWidget != None && KFPlayerOwner.MyGFxManager.PartyWidget.PartyChatWidget != None) - KFPlayerOwner.MyGFxManager.PartyWidget.PartyChatWidget.AddChatMessage(Message, HexColor); - - if (HUDMovie != None && HUDMovie.HudChatBox != None) - HUDMovie.HudChatBox.AddChatMessage(Message, HexColor); } function ResetHUDColors() @@ -700,31 +591,7 @@ function DrawHUD() Super(HUD).DrawHUD(); - Canvas.EnableStencilTest(true); - - if( !bDisablePickupInfo && WeaponPickup != None ) - { - DrawWeaponPickupInfo(); - } - - if( bEnableDamagePopups ) - DrawDamage(); - - if( KFPlayerOwner != None && KFPlayerOwner.Pawn != None ) - { - if( !bDisableLockOnUI && KFWeap_MedicBase(KFPlayerOwner.Pawn.Weapon) != None ) - { - DrawMedicWeaponLockOn(KFWeap_MedicBase(KFPlayerOwner.Pawn.Weapon)); - } - - if( !bDisableRechargeUI && !KFPlayerOwner.bCinematicMode ) - DrawMedicWeaponRecharge(); - } - Canvas.EnableStencilTest(false); - - if( !bDisableHUD ) - DrawTraderIndicator(); if( KFGRI == None ) { @@ -802,46 +669,6 @@ function DrawHUD() Canvas.EnableStencilTest(false); } } - - if( bDisableHUD ) - return; - - if( KillMessages.Length > 0 ) - { - RenderKillMsg(); - } - - if( NonCriticalMessages.Length > 0 ) - { - for( i=0; i 0 ) - { - DrawItemsList(); - } } simulated function SearchInventoryForNewItem() @@ -886,63 +713,6 @@ simulated final function string RarityStr( byte R ) } } -simulated final function DrawItemsList() -{ - local int i; - local float T,FontScale,XS,YS,YSize,XPos,YPos,BT,OT; - local Color BackgroundColor,OutlineColor,TextColor; - - FontScale = Canvas.ClipY / 660.f; - Canvas.Font = GUIStyle.PickFont(FontScale); - Canvas.TextSize("ABC",XS,YSize,FontScale,FontScale); - YSize*=2.f; - YPos = Canvas.ClipY*0.7 - YSize; - XPos = Canvas.ClipX - YSize*0.15; - - for( i=0; i=10.f ) - { - NewItems.Remove(i--,1); - continue; - } - if( T>9.f ) - { - T = 255.f * (10.f-T); - TextColor = MakeColor(255,255,255,T); - - BT = HudMainColor.A * (10.f-BT); - BackgroundColor = MakeColor(HudMainColor.R, HudMainColor.G, HudMainColor.B, BT); - - OT = HudOutlineColor.A * (10.f-OT); - OutlineColor = MakeColor(HudOutlineColor.R, HudOutlineColor.G, HudOutlineColor.B, OT); - } - else - { - TextColor = MakeColor(255,255,255,255); - BackgroundColor = HudMainColor; - OutlineColor = HudOutlineColor; - } - - Canvas.TextSize(NewItems[i].Item,XS,YS,FontScale,FontScale); - GUIStyle.DrawOutlinedBox(XPos-(XS+(ScaledBorderSize*2)), YPos-(ScaledBorderSize*0.5), XS+(ScaledBorderSize*4), YSize+(ScaledBorderSize*2), 1, BackgroundColor, OutlineColor); - - XS = XPos-XS; - - Canvas.DrawColor = TextColor; - Canvas.SetPos(XS, YPos); - Canvas.DrawText("New Item:",, FontScale, FontScale); - Canvas.SetPos(XS, YPos+(YSize*0.5)); - Canvas.DrawText(NewItems[i].Item,, FontScale, FontScale); - - YPos-=YSize; - } -} - simulated function CheckForItems() { if( KFGRI!=none ) @@ -961,117 +731,6 @@ function AddPopupMessage(const out PopupMessage NewMessage) } } -function DrawPopupInfo() -{ - local float IconSize, TempX, TempY, DrawHeight, TimeElapsed, TempWidth, TempHeight, FontScalar, NotificationHeight, NotificationWidth; - - Canvas.Font = GUIStyle.PickFont(FontScalar); - NotificationHeight = GUIStyle.DefaultHeight * 1.5f; - - Canvas.TextSize(MessageQueue[0].Body, TempWidth, TempHeight, FontScalar, FontScalar); - NotificationWidth = TempWidth + (NotificationHeight*2) + (ScaledBorderSize*4); - - TimeElapsed = `TimeSince(NotificationPhaseStartTime); - switch( NotificationPhase ) - { - case PHASE_SHOWING: - if (TimeElapsed < NotificationShowTime) - { - DrawHeight = (TimeElapsed / NotificationShowTime) * NotificationHeight; - } - else - { - NotificationPhase = PHASE_DELAYING; - NotificationPhaseStartTime = `TimeSince(TimeElapsed - NotificationShowTime); - DrawHeight = NotificationHeight; - } - break; - case PHASE_DELAYING: - if (TimeElapsed < NotificationHideDelay ) - { - DrawHeight = NotificationHeight; - } - else - { - NotificationPhase = PHASE_HIDING; // Hiding Phase - TimeElapsed -= NotificationHideDelay; - NotificationPhaseStartTime = `TimeSince(TimeElapsed); - DrawHeight = (1.0 - (TimeElapsed / NotificationHideTime)) * NotificationHeight; - } - break; - case PHASE_HIDING: - if (TimeElapsed < NotificationHideTime) - { - DrawHeight = (1.0 - (TimeElapsed / NotificationHideTime)) * NotificationHeight; - } - else - { - // We're done - MessageQueue.Remove(0, 1); - if( MessageQueue.Length != 0 ) - { - NotificationPhaseStartTime = WorldInfo.TimeSeconds; - NotificationPhase = PHASE_SHOWING; - } - else - { - NotificationPhase = PHASE_DONE; - } - return; - } - break; - } - - switch( MessageQueue[0].MsgPosition ) - { - case PP_TOP_LEFT: - case PP_BOTTOM_LEFT: - TempX = 0; - break; - case PP_TOP_CENTER: - case PP_BOTTOM_CENTER: - TempX = (Canvas.ClipX * 0.5f) - (NotificationWidth * 0.5f); - break; - case PP_TOP_RIGHT: - case PP_BOTTOM_RIGHT: - TempX = Canvas.ClipX - NotificationWidth; - break; - default: - `Warn("Unrecognized position:" @ MessageQueue[0].MsgPosition); - break; - } - - switch( MessageQueue[0].MsgPosition ) - { - case PP_BOTTOM_CENTER: - case PP_BOTTOM_LEFT: - case PP_BOTTOM_RIGHT: - TempY = Canvas.ClipY - DrawHeight - (ScaledBorderSize*2); - break; - case PP_TOP_CENTER: - case PP_TOP_LEFT: - case PP_TOP_RIGHT: - TempY = DrawHeight - NotificationHeight + (ScaledBorderSize*2); - break; - default: - `Warn("Unrecognized position:" @ MessageQueue[0].MsgPosition); - break; - } - - // Draw the Background - GUIStyle.DrawRoundedBox(ScaledBorderSize*2, TempX, TempY, NotificationWidth, NotificationHeight, HudMainColor); - GUIStyle.DrawRoundedBoxEx(ScaledBorderSize*2, TempX, TempY, NotificationHeight, NotificationHeight, HudOutlineColor, true, false, true, false); - - IconSize = NotificationHeight - (NotificationBorderSize * 2.0); - - Canvas.SetDrawColor(255, 255, 255, 255); - Canvas.SetPos(TempX + ((NotificationHeight-IconSize)*0.5f), TempY + ((NotificationHeight-IconSize)*0.5f)); - Canvas.DrawTile(MessageQueue[0].Image, IconSize, IconSize, 1, 0, 256, 256); - - Canvas.SetPos(TempX + (NotificationHeight*0.5f) + ((NotificationWidth-TempWidth)*0.5f), TempY + ((NotificationHeight-TempHeight)*0.5f)); - Canvas.DrawText(MessageQueue[0].Body,, FontScalar, FontScalar); -} - function string GetGameInfoText() { if( KFGRI != None ) @@ -1133,34 +792,6 @@ function DrawHUDBox TextColor.A = byte(HBRI.Alpha); } - if( !bLightHUD ) - { - if( HBRI.bUseRounded ) - { - if( HBRI.bHighlighted ) - { - if( HBRI.bRoundedOutline ) - GUIStyle.DrawOutlinedBox(X+(ScaledBorderSize*2), Y, Width-(ScaledBorderSize*4), Height, ScaledBorderSize, BoxColor, OutlineColor); - else - { - Canvas.DrawColor = BoxColor; - Canvas.SetPos(X+(ScaledBorderSize*2), Y); - GUIStyle.DrawWhiteBox(Width-(ScaledBorderSize*4), Height); - } - - GUIStyle.DrawRoundedBoxEx(ScaledBorderSize*2, X, Y, ScaledBorderSize*2, Height, OutlineColor, true, false, true, false); - GUIStyle.DrawRoundedBoxEx(ScaledBorderSize*2, X+Width-(ScaledBorderSize*2), Y, ScaledBorderSize*2, Height, OutlineColor, false, true, false, true); - } - else - { - if( HBRI.bRoundedOutline ) - GUIStyle.DrawRoundedBoxOutlined(ScaledBorderSize, X, Y, Width, Height, BoxColor, OutlineColor); - else GUIStyle.DrawRoundedBox(ScaledBorderSize*2, X, Y, Width, Height, BoxColor); - } - } - else GUIStyle.DrawOutlinedBox(X, Y, Width, Height, ScaledBorderSize, BoxColor, OutlineColor); - } - if( HBRI.IconTex != None ) { if( HBRI.IconScale == 1.f ) @@ -1251,557 +882,6 @@ function DrawHUDBox } } -function RenderKFHUD(KFPawn_Human KFPH) -{ - local float scale_w, scale_w2, FontScalar, OriginalFontScalar, XL, YL, ObjYL, BoxXL, BoxYL, BoxSW, BoxSH, DoshXL, DoshYL, PerkXL, PerkYL, StarXL, StarYL, ObjectiveH, SecondaryXL, SecondaryYL, PerkLevelXL, PerkLevelYL, PerkIconY; - local float PerkProgressSize, PerkProgressX, PerkProgressY; - local byte PerkLevel; - local int i, XPos, YPos, DrawCircleSize, FlashlightCharge, AmmoCount, MagCount, CurrentScore, Index, ObjectiveSize, ObjectivePadding, ObjX, ObjY, bStatusWarning, bStatusNotification, PrestigeLevel; - local string CircleText, SubCircleText, WeaponName, TraderDistanceText, ObjectiveTitle, ObjectiveDesc, ObjectiveProgress, ObjectiveReward, ObjectiveStatusMessage; - local bool bSingleFire, bHasSecondaryAmmo; - local Texture2D PerkIcon; - local KFInventoryManager Inv; - local KFPlayerReplicationInfo MyKFPRI; - local KFWeapon CurrentWeapon; - local KFTraderTrigger T; - local KFGFxObject_TraderItems TraderItems; - local FontRenderInfo FRI; - local Color HealthFontColor, PerkStarColor; - local HUDBoxRenderInfo HBRI; - local KFInterface_MapObjective MapObjective; - - if( bDisableHUD || KFPlayerOwner.bCinematicMode ) - return; - - FRI.bClipText = true; - FRI.bEnableShadow = true; - - Canvas.Font = GUIStyle.PickFont(OriginalFontScalar); - - scale_w = GUIStyle.ScreenScale(64); - scale_w2 = GUIStyle.ScreenScale(32); - - BoxXL = SizeX * 0.015; - BoxYL = SizeY * 0.935; - - BoxSW = SizeX * 0.0625; - BoxSH = SizeY * 0.0425; - - // Trader/Wave info - if( KFGRI != None ) - { - CircleText = GetGameInfoText(); - SubCircleText = GetGameInfoSubText(); - - if( CircleText != "" ) - { - Canvas.Font = GUIStyle.PickFont(OriginalFontScalar, false, KFGRI.IsEndlessWave()); - - FontScalar = OriginalFontScalar + GUIStyle.ScreenScale(KFGRI.IsEndlessWave() ? 0.75 : 0.3); - DrawCircleSize = GUIStyle.ScreenScale(128); - - if( !bLightHUD ) - { - if( HudOutlineColor != DefaultHudOutlineColor ) - Canvas.SetDrawColor(HudOutlineColor.R, HudOutlineColor.G, HudOutlineColor.B, 255); - else Canvas.SetDrawColor(255, 255, 255, 255); - - Canvas.SetPos(Canvas.ClipX - DrawCircleSize, 2); - Canvas.DrawRect(DrawCircleSize, DrawCircleSize, (KFGRI != None && KFGRI.bWaveIsActive) ? BioCircle : WaveCircle); - } - - Canvas.TextSize(CircleText, XL, YL, FontScalar, FontScalar); - - XPos = Canvas.ClipX - DrawCircleSize*0.5f - (XL * 0.5f); - YPos = SubCircleText != "" ? DrawCircleSize*0.5f - (YL / 1.5) : DrawCircleSize*0.5f - YL * 0.5f; - - Canvas.DrawColor = FontColor; - if( bLightHUD ) - GUIStyle.DrawTextShadow(CircleText, XPos, YPos, 1, FontScalar); - else - { - Canvas.SetPos(XPos, YPos); - Canvas.DrawText(CircleText, , FontScalar, FontScalar, FRI); - } - - if( SubCircleText != "" ) - { - Canvas.Font = GUIStyle.PickFont(OriginalFontScalar); - FontScalar = OriginalFontScalar; - - Canvas.TextSize(SubCircleText, XL, YL, FontScalar, FontScalar); - - XPos = Canvas.ClipX - DrawCircleSize*0.5f - (XL * 0.5f); - YPos = DrawCircleSize*0.5f + (YL / 2.5f); - - if( bLightHUD ) - GUIStyle.DrawTextShadow(SubCircleText, XPos, YPos, 1, FontScalar); - else - { - Canvas.SetPos(XPos, YPos); - Canvas.DrawText(SubCircleText, , FontScalar, FontScalar, FRI); - } - } - } - } - - if( !bShowHUD || KFPH == None ) - return; - - Inv = KFInventoryManager(KFPH.InvManager); - - Canvas.Font = GUIStyle.PickFont(OriginalFontScalar, true); - FontScalar = OriginalFontScalar + GUIStyle.ScreenScale(0.3); - - HBRI.IconScale = scale_w2; - HBRI.Justification = HUDA_Right; - HBRI.TextColor = FontColor; - HBRI.bUseOutline = bLightHUD; - - if( !bHidePlayerInfo ) - { - // Health - HealthFontColor = FontColor; - if ( KFPH.Health < 50 ) - { - HealthFontColor.R = 255; - HealthFontColor.G = Clamp(Sin(WorldInfo.TimeSeconds * 12) * 200 + 200, 0, 200); - HealthFontColor.B = 0; - } - - HBRI.TextColor = HealthFontColor; - HBRI.IconTex = HealthIcon; - DrawHUDBox(BoxXL, BoxYL, BoxSW, BoxSH, string(KFPH.Health), FontScalar, HBRI); - - HBRI.TextColor = FontColor; - - // Armor - HBRI.IconTex = ArmorIcon; - DrawHUDBox(BoxXL, BoxYL, BoxSW, BoxSH, string(KFPH.Armor), FontScalar, HBRI); - - if( Inv != None ) - { - HBRI.IconTex = WeightIcon; - - // Weight - BoxSW = SizeX * 0.082; - DrawHUDBox(BoxXL, BoxYL, BoxSW, BoxSH, Inv.CurrentCarryBlocks$"/"$Inv.MaxCarryBlocks, FontScalar, HBRI); - } - - BoxSW = SizeX * 0.0625; - } - - MyKFPRI = KFPlayerReplicationInfo(KFPlayerOwner.PlayerReplicationInfo); - if( MyKFPRI != None ) - { - if( !bHideDosh ) - { - FontScalar = OriginalFontScalar + GUIStyle.ScreenScale(0.625); - - // Dosh - DoshXL = SizeX * 0.85; - DoshYL = SizeY * 0.835; - - Canvas.DrawColor = PlayerBarShadowColor; - Canvas.SetPos(DoshXL+1, DoshYL+1); - Canvas.DrawRect(scale_w, scale_w, DoshIcon); - - if( HudOutlineColor != DefaultHudOutlineColor ) - Canvas.SetDrawColor(HudOutlineColor.R, HudOutlineColor.G, HudOutlineColor.B, 255); - else Canvas.SetDrawColor(255, 255, 255, 255); - - Canvas.SetPos(DoshXL, DoshYL); - Canvas.DrawRect(scale_w, scale_w, DoshIcon); - - CurrentScore = int(MyKFPRI.Score); - if( OldPlayerScore != CurrentScore ) - { - NotifyDoshEarned(CurrentScore - OldPlayerScore); - OldPlayerScore = CurrentScore; - } - - if( ScoreDelta != CurrentScore ) - { - if( !bInterpolating ) - { - bInterpolating = true; - TimeX = WorldInfo.RealTimeSeconds; - TimeXEnd = TimeX + 1.f; - } - - PlayerScore = Clamp(FInterpEaseInOut(PlayerScore, CurrentScore, GUIStyle.TimeFraction(TimeX, TimeXEnd, WorldInfo.RealTimeSeconds), 1.5f), 0, CurrentScore); - if( PlayerScore == CurrentScore ) - { - bInterpolating = false; - ScoreDelta = CurrentScore; - } - } - - Canvas.TextSize(PlayerScore, XL, YL, FontScalar, FontScalar); - Canvas.DrawColor = FontColor; - GUIStyle.DrawTextShadow(PlayerScore, DoshXL + (DoshXL * 0.035), DoshYL + (scale_w * 0.5f) - (YL * 0.5f), 1, FontScalar); - - if( bShowDoshEarned && DoshPopups.Length > 0 ) - DrawDoshEarned((DoshXL + (DoshXL * 0.035)) + ((scale_w-XL) * 0.5f), DoshYL); - } - - // Draw Perk Info - if( MyKFPRI.CurrentPerkClass != None ) - { - FontScalar = OriginalFontScalar; - - PrestigeLevel = MyKFPRI.GetActivePerkPrestigeLevel(); - PerkLevel = MyKFPRI.GetActivePerkLevel(); - PerkIcon = MyKFPRI.CurrentPerkClass.default.PerkIcon; - - //Perk Icon - PerkXL = SizeX - (SizeX - 12); - PerkYL = SizeY * 0.8625; - - Canvas.Font = GUIStyle.PickFont(OriginalFontScalar); - Canvas.TextSize(PerkLevel@MyKFPRI.CurrentPerkClass.default.PerkName, XL, YL, FontScalar, FontScalar); - - PerkLevelXL = PerkXL + scale_w + (ScaledBorderSize*2); - PerkLevelYL = PerkYL + (scale_w - YL) + (ScaledBorderSize*2); - PerkIconY = PerkYL; - - Canvas.DrawColor = FontColor; - GUIStyle.DrawTextShadow(PerkLevel@MyKFPRI.CurrentPerkClass.default.PerkName, PerkLevelXL, PerkLevelYL, 1, FontScalar); - - Canvas.Font = GUIStyle.PickFont(OriginalFontScalar, true); - - if( PrestigeLevel > 0 ) - { - Canvas.DrawColor = PlayerBarShadowColor; - Canvas.SetPos(PerkXL+1, PerkIconY+1); - Canvas.DrawTile(MyKFPRI.CurrentPerkClass.default.PrestigeIcons[PrestigeLevel - 1], scale_w, scale_w, 0, 3, 256, 256); - - Canvas.DrawColor = WhiteColor; - Canvas.SetPos(PerkXL, PerkIconY); - Canvas.DrawTile(MyKFPRI.CurrentPerkClass.default.PrestigeIcons[PrestigeLevel - 1], scale_w, scale_w, 0, 3, 256, 256); - } - - if (PrestigeLevel > 0) - { - Canvas.DrawColor = WhiteColor; - Canvas.SetPos(PerkXL + ((scale_w*0.5f) - ((scale_w*PrestigeIconScale)*0.5f)), PerkIconY + ((scale_w*0.5f) - ((scale_w*PrestigeIconScale)*0.5f)) - 4); - Canvas.DrawRect(scale_w*PrestigeIconScale, scale_w*PrestigeIconScale, PerkIcon); - } - else - { - Canvas.DrawColor = PlayerBarShadowColor; - Canvas.SetPos(PerkXL+1, PerkIconY+1); - Canvas.DrawRect(scale_w, scale_w, PerkIcon); - - Canvas.DrawColor = WhiteColor; - Canvas.SetPos(PerkXL, PerkIconY); - Canvas.DrawRect(scale_w, scale_w, PerkIcon); - } - - //Perk Stars - if( PrestigeLevel > 0 ) - { - PerkIconSize = GUIStyle.ScreenScale(default.PerkIconSize); - StarXL = PerkLevelXL + PerkIconSize; - StarYL = PerkLevelYL - PerkIconSize; - - PerkStarColor = MakeColor(255, 200 * (PrestigeLevel/`MAX_PRESTIGE_LEVEL), 15, 255); - for ( i = 0; i < PrestigeLevel; i++ ) - { - Canvas.DrawColor = PlayerBarShadowColor; - Canvas.SetPos(StarXL+1, StarYL+1); - Canvas.DrawRect(PerkIconSize, PerkIconSize, PerkStarIcon); - - Canvas.DrawColor = PerkStarColor; - Canvas.SetPos(StarXL, StarYL); - Canvas.DrawRect(PerkIconSize, PerkIconSize, PerkStarIcon); - - StarXL += PerkIconSize; - } - } - - // Progress Bar - PerkProgressSize = GUIStyle.ScreenScale(76); - PerkProgressX = Canvas.ClipX * 0.007; - PerkProgressY = PerkIconY - (PerkProgressSize*0.125f) - ScaledBorderSize; - Canvas.DrawColor = WhiteColor; - - bDisplayingProgress = true; - LevelProgressBar = KFPlayerOwner.GetPerkLevelProgressPercentage(KFPlayerOwner.CurrentPerk.Class) / 100.f; - DrawProgressBar(PerkProgressX,PerkProgressY-PerkProgressSize*0.12f,PerkProgressSize*2.f,PerkProgressSize*0.125f,VisualProgressBar); - if( bShowXPEarned && XPPopups.Length > 0 ) - DrawXPEarned(PerkProgressX + (PerkProgressSize*0.5f), PerkProgressY-(PerkProgressSize*0.125f)-(ScaledBorderSize*2)); - } - } - - // Trader Distance/Objective Container - if( KFGRI != None ) - { - if( KFGRI.OpenedTrader != None || KFGRI.NextTrader != None ) - { - T = KFGRI.OpenedTrader != None ? KFGRI.OpenedTrader : KFGRI.NextTrader; - if( T != None ) - { - Canvas.Font = GUIStyle.PickFont(OriginalFontScalar); - - FontScalar = OriginalFontScalar + GUIStyle.ScreenScale(0.3); - - TraderDistanceText = "Trader"$": "$int(VSize(T.Location - KFPH.Location) / 100.f)$"m"; - Canvas.TextSize(TraderDistanceText, XL, YL, FontScalar, FontScalar); - - Canvas.DrawColor = FontColor; - GUIStyle.DrawTextShadow(TraderDistanceText, Canvas.ClipX*0.015, YL, 1, FontScalar); - - Canvas.Font = GUIStyle.PickFont(OriginalFontScalar, true); - } - } - - //Map Objectives - MapObjective = KFInterface_MapObjective(KFGRI.CurrentObjective); - if( MapObjective == None ) - MapObjective = KFInterface_MapObjective(KFGRI.PreviousObjective); - - if( MapObjective != None && (MapObjective.IsActive() || ((MapObjective.IsComplete() || MapObjective.HasFailedObjective()) && KFGRI.bWaveIsActive)) ) - { - Canvas.Font = GUIStyle.PickFont(OriginalFontScalar); - FontScalar = OriginalFontScalar + GUIStyle.ScreenScale(0.155); - - ObjectivePadding = GUIStyle.ScreenScale(8); - ObjectiveH = GUIStyle.ScreenScale(142); - ObjectiveSize = ObjectiveH * 2.25; - - ObjX = Canvas.ClipX*0.015; - ObjY = T != None ? (YL * 2) + ObjectivePadding : ObjectiveH; - - ObjectiveTitle = Localize("Objectives", "ObjectiveTitle", "KFGame"); - Canvas.TextSize(ObjectiveTitle, XL, ObjYL, FontScalar, FontScalar); - - if( !bLightHUD ) - GUIStyle.DrawRoundedBoxOutlined(ScaledBorderSize, ObjX, ObjY, ObjectiveSize, ObjectiveH, HudMainColor, HudOutlineColor); - - // Objective Title - XPos = ObjX + ObjectivePadding; - YPos = ObjY + ((ObjectivePadding-ScaledBorderSize) * 0.5f); - - if( MapObjective.GetIcon() != None ) - { - Canvas.DrawColor = FontColor; - Canvas.SetPos(XPos + ScaledBorderSize, YPos + (ScaledBorderSize*2.5) + 0.5); - Canvas.DrawTile(MapObjective.GetIcon(), ObjYL - (ScaledBorderSize*4), ObjYL - (ScaledBorderSize*4), 0, 0, 256, 256); - - XPos += (ObjYL - (ScaledBorderSize*2)) + ObjectivePadding; - } - - Canvas.DrawColor = FontColor; - if( bLightHUD ) - GUIStyle.DrawTextShadow(ObjectiveTitle, XPos, YPos, 1, FontScalar); - else - { - Canvas.SetPos(XPos, YPos); - Canvas.DrawText(ObjectiveTitle,, FontScalar, FontScalar, FRI); - } - - // Objective Progress - if( MapObjective.IsComplete() ) - { - ObjectiveProgress = Localize("Objectives", "SuccessString", "KFGame"); - Canvas.SetDrawColor(0, 255, 0, 255); - } - else if( MapObjective.HasFailedObjective() ) - { - ObjectiveProgress = Localize("Objectives", "FailedString", "KFGame"); - Canvas.SetDrawColor(255, 0, 0, 255); - } - else - { - ObjectiveProgress = MapObjective.GetProgressText(); - Canvas.DrawColor = FontColor; - } - Canvas.TextSize(ObjectiveProgress, XL, YL, FontScalar, FontScalar); - - XPos = ObjX + (ObjectiveSize - XL - ObjectivePadding); - - if( bLightHUD ) - GUIStyle.DrawTextShadow(ObjectiveProgress, XPos, YPos, 1, FontScalar); - else - { - Canvas.SetPos(XPos, YPos); - Canvas.DrawText(ObjectiveProgress,, FontScalar, FontScalar, FRI); - } - - // Objective Reward - Canvas.SetDrawColor(0, 255, 0, 255); - FontScalar = OriginalFontScalar + GUIStyle.ScreenScale(0.1); - - ObjectiveReward = "£" $ (MapObjective.HasFailedObjective() ? 0 : MapObjective.GetDoshReward()); - Canvas.TextSize(ObjectiveReward, XL, YL, FontScalar, FontScalar); - - XPos = ObjX + (ObjectiveSize - XL - ObjectivePadding); - YPos = ObjY + ((ObjectiveH-ObjYL)*0.5f) + (YL*0.5f); - - if( bLightHUD ) - GUIStyle.DrawTextShadow(ObjectiveReward, XPos, YPos, 1, FontScalar); - else - { - Canvas.SetPos(XPos, YPos); - Canvas.DrawText(ObjectiveReward,, FontScalar, FontScalar, FRI); - } - - // Objective Description - ObjectiveDesc = MapObjective.GetLocalizedShortDescription(); - if( MapObjective.IsComplete() || MapObjective.HasFailedObjective() ) - Canvas.DrawColor = FontColor * 0.5f; - else Canvas.DrawColor = FontColor; - - YPos = ObjY + ((ObjectiveH-ObjYL)/1.5f) - (YL/1.5f) - (ScaledBorderSize*2); - XPos = ObjX + ObjectivePadding; - - if( bLightHUD ) - GUIStyle.DrawTextShadow(ObjectiveDesc, XPos, YPos, 1, FontScalar); - else - { - Canvas.SetPos(XPos, YPos); - Canvas.DrawText(ObjectiveDesc,, FontScalar, FontScalar, FRI); - } - - // Status Message for the Objective - MapObjective.GetLocalizedStatus(ObjectiveStatusMessage, bStatusWarning, bStatusNotification); - if( ObjectiveStatusMessage != "" ) - { - if( bool(bStatusWarning) ) - Canvas.SetDrawColor(255, Clamp(Sin(WorldInfo.TimeSeconds * 12) * 200 + 200, 0, 200), 0, 255); - else Canvas.DrawColor = FontColor; - - Canvas.TextSize(ObjectiveStatusMessage, XL, YL, FontScalar, FontScalar); - - XPos = ObjX + ObjectivePadding; - YPos += YL; - - if( bLightHUD ) - GUIStyle.DrawTextShadow(ObjectiveStatusMessage, XPos, YPos, 1, FontScalar); - else - { - Canvas.SetPos(XPos, YPos); - Canvas.DrawText(ObjectiveStatusMessage,, FontScalar, FontScalar, FRI); - } - } - Canvas.Font = GUIStyle.PickFont(OriginalFontScalar, true); - } - } - - CurrentWeapon = KFWeapon(KFPH.Weapon); - if( CurrentWeapon != None ) - { - if( !bHideWeaponInfo ) - { - FontScalar = OriginalFontScalar + GUIStyle.ScreenScale(0.1); - - // Weapon Name - if( CachedWeaponInfo.Weapon != CurrentWeapon ) - { - if( KFGRI != None ) - { - TraderItems = KFGRI.TraderItems; - if( TraderItems != None ) - { - Index = TraderItems.SaleItems.Find('ClassName', CurrentWeapon.Class.Name); - if( Index != INDEX_NONE ) - { - WeaponName = TraderItems.SaleItems[Index].WeaponDef.static.GetItemName(); - } - } - } - - if( WeaponName == "" ) - WeaponName = CurrentWeapon.ItemName; - - CachedWeaponInfo.Weapon = CurrentWeapon; - CachedWeaponInfo.WeaponName = WeaponName; - } - else WeaponName = CachedWeaponInfo.WeaponName; - - Canvas.TextSize(WeaponName, XL, YL, FontScalar, FontScalar); - Canvas.DrawColor = FontColor; - GUIStyle.DrawTextShadow(WeaponName, (SizeX * 0.95f) - XL, SizeY * 0.892f, 1, FontScalar); - - BoxXL = SizeX * 0.915; - FontScalar = OriginalFontScalar + GUIStyle.ScreenScale(0.3); - - HBRI.Justification = HUDA_Left; - - if( Inv != None ) - { - // Grenades - HBRI.IconTex = GrenadesIcon; - DrawHUDBox(BoxXL, BoxYL, BoxSW, BoxSH, string(Inv.GrenadeCount), FontScalar, HBRI); - } - - // ToDo - Find better way to check for weapons like the Welder and Med Syringe - if( CurrentWeapon.UsesAmmo() || CurrentWeapon.GetSpecialAmmoForHUD() != "" || CurrentWeapon.IsA('KFWeap_Welder') || CurrentWeapon.IsA('KFWeap_Healer_Syringe') ) - { - bSingleFire = CurrentWeapon.MagazineCapacity[0] <= 1; - bHasSecondaryAmmo = CurrentWeapon.UsesSecondaryAmmo(); - - AmmoCount = CurrentWeapon.AmmoCount[0]; - MagCount = bSingleFire ? CurrentWeapon.GetSpareAmmoForHUD() : FCeil(float(CurrentWeapon.GetSpareAmmoForHUD()) / float(CurrentWeapon.MagazineCapacity[0])); - - if( CurrentWeapon.IsA('KFWeap_Welder') || CurrentWeapon.IsA('KFWeap_Healer_Syringe') || CurrentWeapon.GetSpecialAmmoForHUD() != "" ) - { - bSingleFire = true; - MagCount = AmmoCount; - } - - // Clips - HBRI.IconTex = GetClipIcon(CurrentWeapon, bSingleFire); - DrawHUDBox(BoxXL, BoxYL, BoxSW, BoxSH, CurrentWeapon.GetSpecialAmmoForHUD() != "" ? CurrentWeapon.GetSpecialAmmoForHUD() : string(MagCount), FontScalar, HBRI); - - // Bullets - if( !bSingleFire ) - { - HBRI.IconTex = GetBulletIcon(CurrentWeapon); - DrawHUDBox(BoxXL, BoxYL, BoxSW, BoxSH, AmmoCount, FontScalar, HBRI); - } - - // Secondary Ammo - if( bHasSecondaryAmmo ) - { - if( CurrentWeapon.AmmoCount[class'KFWeapon'.const.ALTFIRE_FIREMODE] <= 0 ) - { - SecondaryXL = BoxXL; - SecondaryYL = BoxYL - BoxSH; - - HBRI.IconTex = None; - HBRI.TextColor = MakeColor(255, Clamp(Sin(WorldInfo.TimeSeconds * 12) * 200 + 200, 0, 200), 0, 255); - - DrawHUDBox(SecondaryXL, SecondaryYL, BoxSW, BoxSH, "RELOAD", FontScalar * 0.75, HBRI); - - HBRI.TextColor = FontColor; - } - - HBRI.IconTex = GetSecondaryAmmoIcon(CurrentWeapon); - DrawHUDBox(BoxXL, BoxYL, BoxSW, BoxSH, CurrentWeapon.GetSecondaryAmmoForHUD(), FontScalar, HBRI); - } - } - - // Flashlight - FlashlightCharge = KFPH.BatteryCharge; - if( FlashlightCharge != KFPH.default.BatteryCharge || KFPH.bFlashlightOn ) - { - HBRI.IconTex = KFPH.bFlashlightOn ? FlashlightIcon : FlashlightOffIcon; - DrawHUDBox(BoxXL, BoxYL, BoxSW, BoxSH, string(int(KFPH.BatteryCharge)), FontScalar, HBRI); - } - } - } - - // Speed - if( bShowSpeed ) - DrawSpeedMeter(); - - // Inventory - if ( bDisplayInventory ) - DrawInventory(); -} - function RefreshInventory() { if ( `TimeSince(InventoryFadeStartTime) > InventoryFadeInTime ) @@ -1812,231 +892,6 @@ function RefreshInventory() } } -function DrawInventory() -{ - local InventoryCategory Categorized[MAX_WEAPON_GROUPS]; - local int i, j; - local byte FadeAlpha, OrgFadeAlpha, ItemIndex; - local float TempSize, TempX, TempY, TempWidth, TempHeight, TempBorder, OriginalFontScalar, FontScalar, AmmoFontScalar, CatagoryFontScalar, UpgradeX, UpgradeY, UpgradeW, UpgradeH, EmptyW, EmptyH, EmptyX, EmptyY; - local float XL, YL, XS, YS; - local string WeaponName, S; - local bool bHasAmmo; - local KFWeapon KFW; - local Color MainColor, OutlineColor; - local HUDBoxRenderInfo HBRI; - - if( PlayerOwner.Pawn == None || PlayerOwner.Pawn.InvManager == None ) - { - return; - } - - TempSize = `TimeSince(InventoryFadeStartTime); - if ( TempSize > InventoryFadeTime ) - { - bDisplayInventory = false; - return; - } - - if ( TempSize < InventoryFadeInTime ) - { - FadeAlpha = int((TempSize / InventoryFadeInTime) * 255.0); - } - else if ( TempSize > InventoryFadeTime - InventoryFadeOutTime ) - { - FadeAlpha = int((1.0 - ((TempSize - (InventoryFadeTime - InventoryFadeOutTime)) / InventoryFadeOutTime)) * 255.0); - } - else - { - FadeAlpha = 255; - } - - foreach PlayerOwner.Pawn.InvManager.InventoryActors( class'KFWeapon', KFW ) - { - if ( KFW.InventoryGroup < MAX_WEAPON_GROUPS ) - { - Categorized[KFW.InventoryGroup].Items[Categorized[KFW.InventoryGroup].ItemCount++] = KFW; - } - } - - Canvas.Font = GUIStyle.PickFont(OriginalFontScalar); - FontScalar = OriginalFontScalar; - AmmoFontScalar = OriginalFontScalar; - CatagoryFontScalar = OriginalFontScalar; - - TempWidth = InventoryBoxWidth * Canvas.ClipX; - TempHeight = InventoryBoxHeight * Canvas.ClipX; - TempBorder = BorderSize * Canvas.ClipX; - - TempX = (Canvas.ClipX*0.5f) - (((TempWidth + TempBorder) * MAX_WEAPON_GROUPS)*0.5f); - - OrgFadeAlpha = FadeAlpha; - - for ( i = 0; i < MAX_WEAPON_GROUPS; i++ ) - { - if( SelectedInventoryCategory == i && MaxWeaponIndex[i] != 0 ) - { - if( SelectedInventoryIndex == 0 && MinWeaponIndex[i] != 0 ) - { - MinWeaponIndex[i] = 0; - } - - if( SelectedInventoryIndex > MaxWeaponIndex[i] ) - MinWeaponIndex[i] = SelectedInventoryIndex - MaxWeaponsPerCatagory; - else if( SelectedInventoryIndex < MinWeaponIndex[i] ) - MinWeaponIndex[i]--; - } - else if( MinWeaponIndex[i] != 0 ) - { - MinWeaponIndex[i] = 0; - } - - TempY = InventoryY * Canvas.ClipY; - - HBRI.Justification = HUDA_Top; - HBRI.JustificationPadding = 24; - HBRI.TextColor = FontColor; - HBRI.Alpha = OrgFadeAlpha; - HBRI.bUseOutline = bLightHUD; - - DrawHUDBox(TempX, TempY, TempWidth, TempHeight * 0.25, GetWeaponCatagoryName(i), CatagoryFontScalar, HBRI); - - if ( Categorized[i].ItemCount != 0 ) - { - for ( j = 0; j < Categorized[i].ItemCount; j++ ) - { - if( j < MinWeaponIndex[i] ) - continue; - - KFW = Categorized[i].Items[j]; - bHasAmmo = KFW.HasAnyAmmo(); - if( !bHasAmmo ) - FadeAlpha *= 0.5; - else if( FadeAlpha != OrgFadeAlpha ) - FadeAlpha = OrgFadeAlpha; - - OutlineColor = KFW.CurrentWeaponUpgradeIndex > 0 ? MakeColor(255, 255, 0) : HudOutlineColor; - OutlineColor.A = Min(OrgFadeAlpha, default.DefaultHudOutlineColor.A); - - if ( i == SelectedInventoryCategory && j == SelectedInventoryIndex ) - { - MainColor = HudOutlineColor * 0.5; - MainColor.A = Min(FadeAlpha, DefaultHudOutlineColor.A); - - if( KFW.CurrentWeaponUpgradeIndex > 0 ) - GUIStyle.DrawRoundedBoxOutlined(ScaledBorderSize, TempX, TempY, TempWidth, TempHeight, MainColor, OutlineColor); - else GUIStyle.DrawRoundedBox(ScaledBorderSize*2, TempX, TempY, TempWidth, TempHeight, MainColor); - - if( KFGRI != None && GetItemIndicesFromArche(ItemIndex, KFW.Class.Name) ) - WeaponName = KFGRI.TraderItems.SaleItems[ItemIndex].WeaponDef.static.GetItemName(); - else WeaponName = KFW.ItemName; - - Canvas.DrawColor = WhiteColor; - Canvas.DrawColor.A = FadeAlpha; - Canvas.TextSize(WeaponName, XS, YS, FontScalar, FontScalar); - - while( XS > TempWidth ) - { - FontScalar -= 0.1; - Canvas.TextSize(WeaponName, XS, YS, FontScalar, FontScalar); - } - - Canvas.SetPos(TempX + ((TempWidth*0.5f) - (XS*0.5f)), TempY + (YS/4)); - Canvas.DrawText(WeaponName,, FontScalar, FontScalar); - } - else - { - MainColor = HudMainColor; - MainColor.A = Min(FadeAlpha, default.DefaultHudMainColor.A); - - GUIStyle.DrawRoundedBox(ScaledBorderSize*2, TempX, TempY, TempWidth, TempHeight, MainColor); - } - - if( KFW.CurrentWeaponUpgradeIndex > 0 ) - { - S = "*"$KFW.CurrentWeaponUpgradeIndex; - Canvas.TextSize(S, XS, YS, OriginalFontScalar, OriginalFontScalar); - - UpgradeW = XS + (ScaledBorderSize*4); - UpgradeH = YS + (ScaledBorderSize*4); - UpgradeX = TempX + ScaledBorderSize; - UpgradeY = TempY + (TempHeight*0.5f) - (UpgradeH*0.5f); - - GUIStyle.DrawRoundedBoxEx(ScaledBorderSize*2, UpgradeX, UpgradeY, UpgradeW, UpgradeH, OutlineColor, false, true, false, true); - - Canvas.DrawColor = WhiteColor; - Canvas.DrawColor.A = FadeAlpha; - - GUIStyle.DrawTextShadow(S, UpgradeX + ((UpgradeW*0.5f) - (XS*0.5f)), UpgradeY + (UpgradeH*0.5f) - (YS*0.5f), 2, OriginalFontScalar); - } - - Canvas.DrawColor = WhiteColor; - Canvas.DrawColor.A = FadeAlpha; - - XL = TempWidth * 0.75; - YL = TempHeight * 0.5; - - Canvas.SetPos(TempX + ((TempWidth*0.5f) - (XL*0.5f)), TempY + ((TempHeight*0.5f) - (YL*0.5f))); - Canvas.DrawRect(XL, YL, KFW.WeaponSelectTexture); - - if( KFW.static.UsesAmmo() ) - { - S = KFW.AmmoCount[class'KFWeapon'.const.DEFAULT_FIREMODE]$"/"$KFW.SpareAmmoCount[class'KFWeapon'.const.DEFAULT_FIREMODE]; - Canvas.TextSize(S, XS, YS, AmmoFontScalar, AmmoFontScalar); - Canvas.SetPos(TempX + (TempWidth - XS) - (ScaledBorderSize*2), TempY + (TempHeight - YS) - (ScaledBorderSize*2)); - Canvas.DrawText(S,, AmmoFontScalar, AmmoFontScalar); - } - - if( KFW.UsesSecondaryAmmo() && KFW.bCanRefillSecondaryAmmo ) - { - if( KFW.SpareAmmoCount[class'KFWeapon'.const.ALTFIRE_FIREMODE] <= 0 ) - S = "[" @ string(KFW.AmmoCount[class'KFWeapon'.const.ALTFIRE_FIREMODE]) @ "]"; - else S = "[" @ KFW.AmmoCount[class'KFWeapon'.const.ALTFIRE_FIREMODE]$"/"$KFW.SpareAmmoCount[class'KFWeapon'.const.ALTFIRE_FIREMODE] @ "]"; - - Canvas.TextSize(S, XS, YS, AmmoFontScalar, AmmoFontScalar); - Canvas.SetPos(TempX + (ScaledBorderSize*2), TempY + (TempHeight - YS) - (ScaledBorderSize*2)); - Canvas.DrawText(S,, AmmoFontScalar, AmmoFontScalar); - } - - if( !bHasAmmo ) - { - S = "EMPTY"; - Canvas.TextSize(S, XS, YS, OriginalFontScalar, OriginalFontScalar); - - EmptyW = XS * 1.25f; - EmptyH = YS * 1.25f; - EmptyX = TempX + ((TempWidth*0.5f) - (EmptyW*0.5f)); - EmptyY = TempY + ((TempHeight*0.5f) - (EmptyH*0.5f)); - - MainColor = DefaultHudMainColor; - MainColor.A = Min(FadeAlpha, default.DefaultHudMainColor.A); - - GUIStyle.DrawRoundedBox(ScaledBorderSize*2, EmptyX, EmptyY, EmptyW, EmptyH, MainColor); - - Canvas.DrawColor = WhiteColor; - Canvas.DrawColor.A = FadeAlpha; - Canvas.SetPos(EmptyX + (EmptyW*0.5f) - (XS*0.5f), EmptyY + (EmptyH*0.5f) - (YS*0.5f)); - Canvas.DrawText(S,, OriginalFontScalar, OriginalFontScalar); - } - - if( (TempY + TempHeight) > (Canvas.ClipY * 0.75) ) - { - if( MaxWeaponsPerCatagory == 0 ) - { - MaxWeaponsPerCatagory = j; - } - - MaxWeaponIndex[i] = j; - break; - } - - TempY += TempHeight; - } - } - - TempX += TempWidth + TempBorder; - } -} - final function bool GetItemIndicesFromArche( out byte ItemIndex, name WeaponClassName ) { local int Index; @@ -2068,184 +923,6 @@ final function string GetWeaponCatagoryName(int Index) } } -function DrawPriorityMessage() -{ - local float XS, YS, TextX, TextY, IconX, IconY, BoxW, OrgBoxW, BoxH, OrgBoxH, BoxX, BoxY, OrignalFontScalar, FontScalar, Box2W, OrgBox2W, Box2H, OrgBox2H, Box2X, Box2Y, Box3W, Box3X, SecondaryXS, SecondaryYS, SecondaryScaler; - local float TempSize, BoxAlpha, SecondaryBoxAlpha; - local bool bHasIcon, bHasSecondaryIcon, bHasSecondary, bAlignTop, bAlignBottom, bAnimFinished; - - TempSize = `TimeSince(PriorityMessage.StartTime); - - Canvas.Font = GUIStyle.PickFont(OrignalFontScalar); - - bHasIcon = PriorityMessage.Icon != None; - bHasSecondaryIcon = PriorityMessage.SecondaryIcon != None; - bHasSecondary = PriorityMessage.SecondaryText != ""; - - FontScalar = OrignalFontScalar + GUIStyle.ScreenScale(0.85f); - Canvas.TextSize(PriorityMessage.PrimaryText, XS, YS, FontScalar, FontScalar); - - if( bHasSecondary ) - { - SecondaryScaler = OrignalFontScalar + GUIStyle.ScreenScale(0.3f); - Canvas.TextSize(PriorityMessage.SecondaryText, SecondaryXS, SecondaryYS, SecondaryScaler, SecondaryScaler); - BoxW = FMax(XS,SecondaryXS + (SecondaryXS*0.5f))+(YS*2)*2; - } - else BoxW = XS+(YS*2)*2; - BoxH = YS; - - OrgBoxW = BoxW; - OrgBoxH = BoxH; - - if( PriorityMessage.FadeInTime - TempSize > 0 ) - { - BoxAlpha = (PriorityMessage.FadeInTime - TempSize) / PriorityMessage.FadeInTime; - BoxAlpha = 1.f - BoxAlpha; - } - else if( (PriorityMessage.LifeTime - TempSize) < PriorityMessage.FadeOutTime ) - { - BoxAlpha = (PriorityMessage.LifeTime - TempSize) / PriorityMessage.FadeOutTime; - } - else - { - BoxAlpha = 1.f; - } - - if( PriorityMessage.PrimaryAnim == ANIM_SLIDE ) - BoxW = Lerp(BoxH, BoxW, BoxAlpha); - else BoxH = Lerp(0, BoxH, BoxAlpha); - - if( TempSize > PriorityMessage.LifeTime ) - { - PriorityMessage = default.PriorityMessage; - CurrentPriorityMessageA = 0; - CurrentSecondaryMessageA = 0; - return; - } - - BoxX = CenterX - (BoxW*0.5f); - BoxY = (CenterY*0.5) - (BoxH*0.5f); - - TextX = BoxX + (BoxW*0.5f) - (XS*0.5f); - TextY = BoxY + (BoxH*0.5f) - (YS*0.5f); - - if( bHasIcon ) - GUIStyle.DrawOutlinedBox(BoxX+BoxH, BoxY, BoxW-(BoxH*2), BoxH, ScaledBorderSize, HudMainColor, HudOutlineColor); - else GUIStyle.DrawRoundedBoxOutlined(ScaledBorderSize, BoxX, BoxY, BoxW, BoxH, HudMainColor, HudOutlineColor); - - bAnimFinished = (PriorityMessage.PrimaryAnim == ANIM_SLIDE ? BoxW >= OrgBoxW : BoxH >= OrgBoxH) && (TempSize+PriorityMessage.FadeInTime+0.5f) > 1.f; - if( bAnimFinished ) - { - if( CurrentPriorityMessageA != 255 ) - { - CurrentPriorityMessageA += RandRange(3,10); - if( CurrentPriorityMessageA > 255 ) - CurrentPriorityMessageA = 255; - } - - Canvas.DrawColor = FontColor; - Canvas.DrawColor.A = CurrentPriorityMessageA; - GUIStyle.DrawTextBlurry(PriorityMessage.PrimaryText, TextX, TextY, FontScalar); - } - - if( bHasIcon ) - { - IconX = BoxX; - - GUIStyle.DrawRoundedBoxEx(ScaledBorderSize*2, IconX, BoxY, BoxH, BoxH, HudOutlineColor, true, false, true, false); - - Canvas.DrawColor = PriorityMessage.IconColor; - Canvas.SetPos(IconX, TextY); - Canvas.DrawRect(BoxH, BoxH, PriorityMessage.Icon); - - IconX = BoxX+(BoxW-BoxH); - - GUIStyle.DrawRoundedBoxEx(ScaledBorderSize*2, IconX, BoxY, BoxH, BoxH, HudOutlineColor, false, true, false, true); - - Canvas.DrawColor = PriorityMessage.IconColor; - Canvas.SetPos(IconX, TextY); - Canvas.DrawRect(BoxH, BoxH, PriorityMessage.Icon); - } - - if( bHasSecondary && bAnimFinished && CurrentPriorityMessageA >= 255 ) - { - Box2H = SecondaryYS; - - if( PriorityMessage.SecondaryStartTime <= 0.f ) - PriorityMessage.SecondaryStartTime = WorldInfo.TimeSeconds; - - if( PriorityMessage.bSecondaryUsesFullLength ) - Box2W = BoxW - (BoxH * 2) + (ScaledBorderSize*2); - else - { - Box2W = FMin(SecondaryXS + (SecondaryXS*0.5f), BoxW - (BoxH * 2)); - if( bHasSecondaryIcon ) - Box2W += Box2H*2; - } - - OrgBox2W = Box2W; - OrgBox2H = Box2H; - - SecondaryBoxAlpha = GUIStyle.TimeFraction(PriorityMessage.SecondaryStartTime, PriorityMessage.SecondaryStartTime+PriorityMessage.FadeInTime, WorldInfo.TimeSeconds); - if( PriorityMessage.SecondaryAnim == ANIM_SLIDE ) - Box2W = Lerp(0, Box2W, SecondaryBoxAlpha); - else Box2H = Lerp(0, Box2H, SecondaryBoxAlpha); - - Box2X = BoxX + (BoxW*0.5f) - (Box2W*0.5f); - - bAlignTop = PriorityMessage.SecondaryAlign == PR_TOP; - bAlignBottom = PriorityMessage.SecondaryAlign == PR_BOTTOM; - - if( bAlignTop ) - Box2Y = BoxY - Box2H; - else Box2Y = BoxY + BoxH; - - Box3X = Box2X+ScaledBorderSize; - Box3W = Box2W-(ScaledBorderSize*2); - - Canvas.DrawColor = HudMainColor; - Canvas.SetPos(Box3X, Box2Y); - GUIStyle.DrawWhiteBox(Box3W, Box2H); - - GUIStyle.DrawRoundedBoxEx(ScaledBorderSize*4, Box2X, Box2Y, ScaledBorderSize*2, Box2H, HudOutlineColor, bAlignTop, false, bAlignBottom, false); - GUIStyle.DrawRoundedBoxEx(ScaledBorderSize*4, Box2X+(Box2W-(ScaledBorderSize*2)), Box2Y, ScaledBorderSize*2, Box2H, HudOutlineColor, false, bAlignTop, false, bAlignBottom); - - TextX = Box3X + ((Box3W-SecondaryXS)*0.5f); - TextY = Box2Y + ((Box2H-SecondaryYS)*0.5f); - - if( PriorityMessage.SecondaryAnim == ANIM_SLIDE ? Box2W >= OrgBox2W : Box2H >= OrgBox2H ) - { - if( CurrentSecondaryMessageA != 255 ) - { - CurrentSecondaryMessageA += RandRange(3,10); - if( CurrentSecondaryMessageA > 255 ) - CurrentSecondaryMessageA = 255; - } - - Canvas.DrawColor = FontColor; - Canvas.DrawColor.A = CurrentSecondaryMessageA; - Canvas.SetPos(TextX, TextY); - Canvas.DrawText(PriorityMessage.SecondaryText,,SecondaryScaler,SecondaryScaler); - } - - if( bHasSecondaryIcon ) - { - IconX = Box3X+(ScaledBorderSize*4); - IconY = TextY+(ScaledBorderSize*2); - - Canvas.DrawColor = PriorityMessage.SecondaryIconColor; - Canvas.SetPos(IconX, IconY); - Canvas.DrawRect(Box2H-(ScaledBorderSize*4), Box2H-(ScaledBorderSize*4), PriorityMessage.SecondaryIcon); - - IconX = Box3X+Box3W-Box2H; - - Canvas.DrawColor = PriorityMessage.SecondaryIconColor; - Canvas.SetPos(IconX, IconY); - Canvas.DrawRect(Box2H-(ScaledBorderSize*4), Box2H-(ScaledBorderSize*4), PriorityMessage.SecondaryIcon); - } - } -} - function ShowPriorityMessage(FPriorityMessage Msg) { if( Msg.LifeTime <= 0.f ) @@ -2256,134 +933,6 @@ function ShowPriorityMessage(FPriorityMessage Msg) PriorityMessage = Msg; } -function DrawNonCritialMessage( int Index, FCritialMessage Message, float X, float Y ) -{ - local float XS, YS, XL, YL, TX, BoxXS, BoxYS, FontScalar, TempSize, TY, OrgXL, BoxAlpha, AnimFadeIn, AnimFadeOut, DisplayTime; - local int i, FadeAlpha; - local array SArray; - local HUDBoxRenderInfo HBRI; - local bool bAnimFinished, bTextAnimFinished; - local string S; - local Color TextColor; - - Canvas.Font = GUIStyle.PickFont(FontScalar); - FontScalar += GUIStyle.ScreenScale(0.1); - TextColor = FontColor; - DisplayTime = Message.bUseAnimation ? 1.775f : NonCriticalMessageDisplayTime; - - TempSize = `TimeSince(Message.StartTime); - if ( TempSize > DisplayTime ) - { - NonCriticalMessages.RemoveItem(Message); - return; - } - - if( Message.Delimiter != "" ) - { - SArray = SplitString(Message.Text, Message.Delimiter); - if( SArray.Length > 0 ) - { - for( i=0; i 0 ) - { - BoxAlpha = (AnimFadeIn - TempSize) / AnimFadeIn; - BoxAlpha = 1.f - BoxAlpha; - } - else if( (DisplayTime - TempSize) < AnimFadeOut ) - { - BoxAlpha = (DisplayTime - TempSize) / AnimFadeOut; - } - else - { - BoxAlpha = 1.f; - } - - BoxAlpha = FClamp(BoxAlpha, 0.f, 1.f); - XL = Lerp(ScaledBorderSize*2, XL, BoxAlpha); - - bAnimFinished = XL >= OrgXL && (TempSize+AnimFadeIn+0.5f) > 1.f; - if( bAnimFinished ) - { - HBRI.StringArray = SArray; - S = Message.Text; - - bTextAnimFinished = NonCriticalMessages[Index].TextAnimAlpha >= 255; - if( !bTextAnimFinished ) - { - NonCriticalMessages[Index].TextAnimAlpha += RandRange(3,10); - if( NonCriticalMessages[Index].TextAnimAlpha > 255 ) - NonCriticalMessages[Index].TextAnimAlpha = 255; - } - - TextColor.A = NonCriticalMessages[Index].TextAnimAlpha; - } - } - else - { - if ( TempSize < NonCriticalMessageFadeInTime ) - { - FadeAlpha = int((TempSize / NonCriticalMessageFadeInTime) * 255.0); - } - else if ( TempSize > DisplayTime - NonCriticalMessageFadeOutTime ) - { - FadeAlpha = int((1.0 - ((TempSize - (DisplayTime - NonCriticalMessageFadeOutTime)) / NonCriticalMessageFadeOutTime)) * 255.0); - } - else - { - FadeAlpha = 255; - } - - HBRI.StringArray = SArray; - S = Message.Text; - } - - BoxXS = X - (XL * 0.5f); - BoxYS = Y - ((YL + (ScaledBorderSize * 2)) * Index); - - if( (BoxYS + YL) > Canvas.ClipY ) - BoxYS = Canvas.ClipY - YL - (ScaledBorderSize * 2); - - HBRI.TextColor = TextColor; - HBRI.Alpha = FadeAlpha; - HBRI.bUseOutline = bLightHUD; - HBRI.bUseRounded = true; - HBRI.bHighlighted = Message.bHighlight; - - DrawHUDBox(BoxXS, BoxYS, XL, YL, S, FontScalar, HBRI); -} - function ShowNonCriticalMessage( string Message, optional string Delimiter, optional bool bHighlight, optional bool bUseAnimation ) { local FCritialMessage Messages; @@ -2514,64 +1063,6 @@ function Texture GetSecondaryAmmoIcon(KFWeapon Wep) return SingleBulletIcon; } -function RenderKillMsg() -{ - local float Sc,PDSc,CurrentSc,XL,YL,TextXL,TextYL,PDYL,T,Y; - local string S; - local int i; - local KFInterface_MapObjective MapObjective; - - Canvas.Font = GUIStyle.PickFont(Sc); - Canvas.TextSize("A",XL,YL,Sc,Sc); - - PDSc = Sc*1.375f; - Canvas.TextSize("A",XL,PDYL,PDSc,PDSc); - - MapObjective = KFInterface_MapObjective(KFGRI.CurrentObjective); - if( MapObjective == None ) - MapObjective = KFInterface_MapObjective(KFGRI.PreviousObjective); - - if( MapObjective != None && (MapObjective.IsActive() || ((MapObjective.IsComplete() || MapObjective.HasFailedObjective()) && KFGRI.bWaveIsActive)) ) - Y = Canvas.ClipY*0.235; - else Y = Canvas.ClipY*0.15; - - for( i=0; i1 ? " kills" : " kill"); - else if( KillMessages[i].bPlayerDeath ) - S = (KillMessages[i].bSuicide ? "" : KillMessages[i].Name)$" UI_PerkIcons_TEX.UI_PerkIcon_ZED "$(KillMessages[i].OwnerPRI!=None ? KillMessages[i].OwnerPRI.GetHumanReadableName() : KillMessages[i].KillerName); - else S = (KillMessages[i].OwnerPRI!=None ? KillMessages[i].OwnerPRI.GetHumanReadableName() : KillMessages[i].KillerName)$" +"$KillMessages[i].Counter@KillMessages[i].Name$(KillMessages[i].Counter>1 ? " kills" : " kill"); - - CurrentSc = KillMessages[i].bPlayerDeath ? PDSc : Sc; - - if( T>6.f ) - { - KillMessages[i].CurrentXPosition -= RenderDelta*400.f; - - Canvas.TextSize(GUIStyle.StripTextureFromString(S),TextXL,TextYL,CurrentSc,CurrentSc); - if( (KillMessages[i].CurrentXPosition+TextXL) <= 0.f ) - { - KillMessages.Remove(i--,1); - continue; - } - } - else - { - KillMessages[i].CurrentXPosition += RenderDelta*200.f; - KillMessages[i].CurrentXPosition = FMin(KillMessages[i].CurrentXPosition, KillMessages[i].XPosition); - } - - Canvas.DrawColor = KillMessages[i].MsgColor; - GUIStyle.DrawTexturedString(S, KillMessages[i].CurrentXPosition, Y, CurrentSc,, true); - Y+=KillMessages[i].bPlayerDeath ? PDYL : YL; - } -} - function color GetMsgColor( bool bDamage, int Count ) { local float T; @@ -2741,48 +1232,6 @@ function AddNumberMsg( int Amount, vector Pos, class Type ) NextDamagePopupIndex=0; } -function DrawDamage() -{ - local int i, Vel; - local float TimeSinceHit, TextWidth, TextHeight, Sc, TextX, TextY; - local vector HBScreenPos; - local string S; - - Canvas.Font = GUIStyle.PickFont(Sc); - - for( i=0; i < DAMAGEPOPUP_COUNT ; i++ ) - { - TimeSinceHit = `TimeSince(DamagePopups[i].HitTime); - if( TimeSinceHit > DamagePopupFadeOutTime || ( Normal(DamagePopups[i].HitLocation - PLCameraLoc) dot Normal(PLCameraDir) < 0.1 ) ) //don't draw if player faced back to the hit location - continue; - - S = string(DamagePopups[i].Damage); - - Canvas.TextSize(S,TextWidth,TextHeight,Sc,Sc); - Vel = RenderDelta*900.f; - - if ( i % 2 == 0 ) - DamagePopups[i].RandVect.X *= -1.f; - - DamagePopups[i].HitLocation += DamagePopups[i].RandVect*RenderDelta; - if( (TimeSinceHit/DamagePopupFadeOutTime) < 0.035f ) - DamagePopups[i].RandVect.Z += Vel*2; - else DamagePopups[i].RandVect.Z -= Vel; - - HBScreenPos = Canvas.Project(DamagePopups[i].HitLocation); - - TextX = HBScreenPos.X-(TextWidth*0.5f); - TextY = HBScreenPos.Y-(TextHeight*0.5f); - if( TextX < 0 || TextX > Canvas.ClipX || TextY < 0 || TextY > Canvas.ClipY ) - continue; - - Canvas.DrawColor = DamagePopups[i].FontColor; - Canvas.DrawColor.A = 255 * Cos(0.5f * Pi * TimeSinceHit/DamagePopupFadeOutTime); - - GUIStyle.DrawTextShadow(S, TextX, TextY, 1, Sc); - } -} - function string GetSpeedStr() { local int Speed; @@ -2806,19 +1255,6 @@ function string GetSpeedStr() return S; } -function DrawSpeedMeter() -{ - local float FontScalar, XL, YL; - local string S; - - S = GetSpeedStr() $ " ups"; - - Canvas.Font = GUIStyle.PickFont(FontScalar); - Canvas.TextSize(S,XL,YL,FontScalar,FontScalar); - - GUIStyle.DrawTextShadow(S, Canvas.ClipX - XL + (ScaledBorderSize*2), Canvas.ClipY * 0.80, 1, FontScalar); -} - function DrawImportantHealthBar(float X, float Y, float W, float H, string S, float HealthFrac, Color MainColor, Color BarColor, Texture2D Icon, optional float BorderScale, optional bool bDisabled, optional bool bTrackDamageHistory, optional int Health, optional int HealthMax, optional bool bEaseInOut) { local float FontScalar,MainBoxH,XPos,YPos,IconBoxX,IconBoxY,IconXL,IconYL,XL,YL,HistoryX; @@ -2926,176 +1362,6 @@ function DrawImportantHealthBar(float X, float Y, float W, float H, string S, fl } } -function DrawBossHealthBars() -{ - local int i; - local float BarH, BarW, MainBarX, MainBarY, MainBoxW, ArmorW, ArmorH; - local float ArmorPct; - local ArmorZoneInfo ArmorZone; - local KFPawn_Monster Pawn; - - if( bDisplayInventory || Scoreboard.bVisible || !bDisplayImportantHealthBar ) - return; - - Pawn = BossRef.GetMonsterPawn(); - - BarH = GUIStyle.DefaultHeight; - BarW = Canvas.ClipX * 0.45; - - MainBoxW = BarW * 0.125; - - MainBarX = (Canvas.ClipX*0.5f) - (BarW*0.5f) + (MainBoxW*0.5f); - MainBarY = BarH; - - DrawImportantHealthBar(MainBarX, MainBarY, BarW, BarH, Pawn.static.GetLocalizedName(), FClamp(BossRef.GetHealthPercent(), 0.f, 1.f), HudMainColor, BossBattlePhaseColor, BossInfoIcon,,,true,Pawn.Health,Pawn.HealthMax,true); - - if( Pawn.ArmorInfo != None ) - { - ArmorW = BarW * 0.2; - ArmorH = BarH * 0.45; - - MainBarX = MainBarX + (BarW - ArmorW - ScaledBorderSize); - MainBarY += (BarH*0.5f) + ArmorH + (ScaledBorderSize*2); - - for(i=0; i Canvas.ClipX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.ClipY) - return; - - IconSize = WorldInfo.static.GetResolutionBasedHUDScale() * MedicLockOnIconSize; - RealIconSize = FInterpEaseInOut(IconSize*2, IconSize, GUIStyle.TimeFraction(LockOnStartTime, LockOnEndTime, WorldInfo.RealTimeSeconds), 2.5); - - Canvas.DrawColor = IconColor; - Canvas.SetPos(ScreenPos.X - (RealIconSize * 0.5f), ScreenPos.Y - (RealIconSize * 0.5f)); - Canvas.DrawRect(RealIconSize, RealIconSize, MedicLockOnIcon); -} - -function DrawTraderIndicator() -{ - local KFTraderTrigger T; - - if( KFGRI == None || (KFGRI.OpenedTrader == None && KFGRI.NextTrader == None) ) - return; - - T = KFGRI.OpenedTrader != None ? KFGRI.OpenedTrader : KFGRI.NextTrader; - if( T != None ) - DrawDirectionalIndicator(T.Location, bLightHUD ? TraderArrowLight : TraderArrow, Canvas.ClipY/33.f,, HudOutlineColor, class'KFGFxHUD_TraderCompass'.default.TraderString, !bLightHUD); -} - final function Vector DrawDirectionalIndicator(Vector Loc, Texture Mat, float IconSize, optional float FontMult=1.f, optional Color DrawColor=WhiteColor, optional string Text, optional bool bDrawBackground) { local rotator R; @@ -3395,100 +1661,6 @@ function NotifyDoshEarned( int Dosh ) DoshPopups.AddItem(DoshEarned); } -function DrawWeaponPickupInfo() -{ - local vector ScreenPos; - local bool bHasSingleForDual, bCanCarry; - local Inventory Inv; - local KFInventoryManager KFIM; - local string WeightText, S; - local class KFWC; - local int Weight; - local color CanCarryColor; - local FontRenderInfo FRI; - local float FontScale, ResModifier, IconSize; - local float TextWidth, TextHeight, TextYOffset, SecondaryBGWidth, SecondaryBGHeight; - local float InfoBaseX, InfoBaseY; - local float BGX, BGY, BGWidth, BGHeight; - - ScreenPos = Canvas.Project(WeaponPickup.Location + vect(0,0,25)); - if (ScreenPos.X < 0 || ScreenPos.X > Canvas.ClipX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.ClipY) - return; - - KFWC = class(WeaponPickup.InventoryClass); - if (KFWC.default.DualClass != None && PlayerOwner.Pawn != None && PlayerOwner.Pawn.InvManager != None) - { - Inv = PlayerOwner.Pawn.InvManager.FindInventoryType(KFWC); - if (KFWeapon(Inv) != None) - bHasSingleForDual = true; - } - - if (bHasSingleForDual) - { - Weight = KFWC.default.DualClass.default.InventorySize - KFWeapon(Inv).GetModifiedWeightValue(); - } - else Weight = KFWC.default.InventorySize; - - WeightText = string(Weight); - if (PlayerOwner.Pawn != None && KFInventoryManager(PlayerOwner.Pawn.InvManager) != None) - { - KFIM = KFInventoryManager(PlayerOwner.Pawn.InvManager); - if (KFIM.CanCarryWeapon(KFWC)) - { - if (KFWC.default.DualClass != None) - bCanCarry = !KFIM.ClassIsInInventory(KFWC.default.DualClass, Inv); - else bCanCarry = !KFIM.ClassIsInInventory(KFWC, Inv); - } - } - else bCanCarry = true; - - CanCarryColor = (bCanCarry ? WeaponIconColor : WeaponOverweightIconColor); - - FRI = Canvas.CreateFontRenderInfo(true); - - ResModifier = WorldInfo.static.GetResolutionBasedHUDScale(); - Canvas.Font = GUIStyle.PickFont(FontScale); - Canvas.TextSize(WeightText, TextWidth, TextHeight, FontScale, FontScale); - - IconSize = WeaponIconSize * ResModifier; - InfoBaseX = ScreenPos.X - ((IconSize * 1.5 + TextWidth) * 0.5); - InfoBaseY = ScreenPos.Y; - TextYOffset = (IconSize - TextHeight) * 0.5; - - BGWidth = IconSize * 2.0 + TextWidth; - BGX = InfoBaseX - (IconSize * 0.25); - BGHeight = IconSize * 1.5; - BGY = InfoBaseY + IconSize * 1.5 - (BGHeight * 0.125); - - GUIStyle.DrawRoundedBox(ScaledBorderSize*2, BGX, BGY, BGWidth, BGHeight, HudMainColor); - - Canvas.DrawColor = CanCarryColor; - Canvas.SetPos(InfoBaseX, InfoBaseY + IconSize * 1.5); - Canvas.DrawTile(WeaponWeightIcon, IconSize, IconSize, 0, 0, 256, 256); - - Canvas.DrawColor = WhiteColor; - Canvas.SetPos(InfoBaseX + IconSize * 1.5, InfoBaseY + IconSize * 1.5 + TextYOffset); - Canvas.DrawText(WeightText, , FontScale, FontScale, FRI); - - if( WeaponPickup.GetDisplayName() != "" ) - { - S = WeaponPickup.GetDisplayName(); - Canvas.TextSize(S, TextWidth, TextHeight, FontScale, FontScale); - - SecondaryBGWidth = TextWidth * 1.125; - SecondaryBGHeight = TextHeight * 1.125; - - BGY += BGHeight + (TextHeight*0.5f); - BGX += (BGWidth*0.5f) - (SecondaryBGWidth*0.5f); - - GUIStyle.DrawRoundedBox(ScaledBorderSize*2, BGX, BGY, SecondaryBGWidth, SecondaryBGHeight, HudMainColor); - - Canvas.DrawColor = WhiteColor; - Canvas.SetPos(BGX + (SecondaryBGWidth*0.5f) - (TextWidth*0.5f), BGY + (SecondaryBGHeight*0.5f) - (TextHeight*0.5f)); - Canvas.DrawText(S, , FontScale, FontScale, FRI); - } -} - function byte DrawToDistance(Actor A, optional float StartAlpha=255.f, optional float MinAlpha=90.f) { local float Dist, fZoom; @@ -3711,26 +1883,9 @@ function DrawZedIcon( Pawn ZedPawn, vector PawnLocation, float NormalizedAngle ) DrawDirectionalIndicator(PawnLocation + (ZedPawn.CylinderComponent.CollisionHeight * vect(0, 0, 1)), GenericZedIconTexture, PlayerStatusIconSize * (WorldInfo.static.GetResolutionBasedHUDScale() * FriendlyHudScale) * 0.5f,,, GetNameOf(ZedPawn.Class)); } -function CheckAndDrawRemainingZedIcons() -{ - if( !bDisableLastZEDIcons ) - Super.CheckAndDrawRemainingZedIcons(); -} - -simulated function CheckAndDrawHiddenPlayerIcons( array VisibleHumanPlayers, array HiddenHumanPlayers ) -{ - if( !bDisableHiddenPlayers ) - Super.CheckAndDrawHiddenPlayerIcons(VisibleHumanPlayers, HiddenHumanPlayers); -} - -exec function OpenSettingsMenu() -{ - GUIController.OpenMenu(class'ScoreboardExt.UI_MidGameMenu'); -} - exec function SetShowScores(bool bNewValue) { - if( bNewScoreboard && Scoreboard != None ) + if (Scoreboard != None) Scoreboard.SetVisibility(bNewValue); else Super.SetShowScores(bNewValue); } @@ -3793,7 +1948,6 @@ defaultproperties NonCriticalMessageFadeOutTime=0.5 RepObject=ObjectReferencer'KFClassicMode_Assets.ObjectRef.MainObj_List' - HUDClass=class'KF1_HUDWrapper' PerkStarIcon=Texture2D'KFClassicMode_Assets.HUD.Hud_Perk_Star' ScoreboardClass=class'KFScoreBoard' diff --git a/ScoreboardExt/Classes/UIP_ColorSettings.uc b/ScoreboardExt/Classes/UIP_ColorSettings.uc deleted file mode 100644 index 36b0c31..0000000 --- a/ScoreboardExt/Classes/UIP_ColorSettings.uc +++ /dev/null @@ -1,155 +0,0 @@ -Class UIP_ColorSettings extends KFGUI_MultiComponent; - -var KFGUI_ComponentList SettingsBox; -var KFGUI_ColorSlider MainHudSlider,OutlineSlider,FontSlider,ArmorSlider,HealthSlider; -var ScoreboardExtHUD HUD; - -function InitMenu() -{ - HUD = ScoreboardExtHUD(GetPlayer().myHUD); - - Super.InitMenu(); - - // Client settings - SettingsBox = KFGUI_ComponentList(FindComponentID('SettingsBox')); - - MainHudSlider = AddColorSlider('HUDColorSlider', "Main HUD Color", HUD.HudMainColor); - OutlineSlider = AddColorSlider('OutlineColorSlider', "HUD Outline Color", HUD.HudOutlineColor); - FontSlider = AddColorSlider('FontCSlider', "Font Color", HUD.FontColor); - ArmorSlider = AddColorSlider('ArmorCSlider', "Player Info Armor Color", HUD.CustomArmorColor); - HealthSlider = AddColorSlider('HealthCSlider', "Player Info Health Color", HUD.CustomHealthColor); -} - -function ShowMenu() -{ - Super.ShowMenu(); - HUD.ColorSettingMenu = self; - ArmorSlider.SetDefaultColor(HUD.CustomArmorColor); - HealthSlider.SetDefaultColor(HUD.CustomHealthColor); -} - -final function KFGUI_ColorSlider AddColorSlider( name IDN, string Caption, Color DefaultColor ) -{ - local KFGUI_MultiComponent MC; - local KFGUI_ColorSlider SL; - - MC = KFGUI_MultiComponent(SettingsBox.AddListComponent(class'KFGUI_MultiComponent')); - MC.XSize = 0.65; - MC.XPosition = 0.15; - MC.InitMenu(); - SL = new(MC) class'KFGUI_ColorSlider'; - SL.CaptionText = Caption; - SL.DefaultColor = DefaultColor; - SL.ID = IDN; - SL.OnColorSliderValueChanged = CheckColorSliderChange; - MC.AddComponent(SL); - - return SL; -} - -function CheckColorSliderChange(KFGUI_ColorSlider Sender, KFGUI_Slider Slider, int Value) -{ - switch(Sender.ID) - { - case 'HUDColorSlider': - switch( Slider.ID ) - { - case 'ColorSliderR': - HUD.HudMainColor.R = Value; - break; - case 'ColorSliderG': - HUD.HudMainColor.G = Value; - break; - case 'ColorSliderB': - HUD.HudMainColor.B = Value; - break; - case 'ColorSliderA': - HUD.HudMainColor.A = Value; - break; - } - HUD.SaveConfig(); - break; - case 'OutlineColorSlider': - switch( Slider.ID ) - { - case 'ColorSliderR': - HUD.HudOutlineColor.R = Value; - break; - case 'ColorSliderG': - HUD.HudOutlineColor.G = Value; - break; - case 'ColorSliderB': - HUD.HudOutlineColor.B = Value; - break; - case 'ColorSliderA': - HUD.HudOutlineColor.A = Value; - break; - } - HUD.SaveConfig(); - break; - case 'FontCSlider': - switch( Slider.ID ) - { - case 'ColorSliderR': - HUD.FontColor.R = Value; - break; - case 'ColorSliderG': - HUD.FontColor.G = Value; - break; - case 'ColorSliderB': - HUD.FontColor.B = Value; - break; - case 'ColorSliderA': - HUD.FontColor.A = Value; - break; - } - HUD.SaveConfig(); - break; - case 'ArmorCSlider': - switch( Slider.ID ) - { - case 'ColorSliderR': - HUD.CustomArmorColor.R = Value; - break; - case 'ColorSliderG': - HUD.CustomArmorColor.G = Value; - break; - case 'ColorSliderB': - HUD.CustomArmorColor.B = Value; - break; - case 'ColorSliderA': - HUD.CustomArmorColor.A = Value; - break; - } - HUD.SaveConfig(); - break; - case 'HealthCSlider': - switch( Slider.ID ) - { - case 'ColorSliderR': - HUD.CustomHealthColor.R = Value; - break; - case 'ColorSliderG': - HUD.CustomHealthColor.G = Value; - break; - case 'ColorSliderB': - HUD.CustomHealthColor.B = Value; - break; - case 'ColorSliderA': - HUD.CustomHealthColor.A = Value; - break; - } - HUD.SaveConfig(); - break; - } -} - -defaultproperties -{ - Begin Object Class=KFGUI_ComponentList Name=ClientSettingsBox - ID="SettingsBox" - ListItemsPerPage=3 - End Object - - Components.Add(ClientSettingsBox) -} \ No newline at end of file diff --git a/ScoreboardExt/Classes/UIP_Settings.uc b/ScoreboardExt/Classes/UIP_Settings.uc deleted file mode 100644 index 22b9ff7..0000000 --- a/ScoreboardExt/Classes/UIP_Settings.uc +++ /dev/null @@ -1,255 +0,0 @@ -Class UIP_Settings extends KFGUI_MultiComponent; - -var KFGUI_ComponentList SettingsBox; -var KFGUI_TextLable ResetColorLabel,PerkStarsLabel,PerkStarsRowLabel,ControllerTypeLabel,PlayerInfoTypeLabel; -var KFGUI_EditBox PerkStarsBox, PerkRowsBox; -var KFGUI_ComboBox ControllerBox; - -var ScoreboardExtHUD HUD; -var KFPlayerController PC; - -function InitMenu() -{ - local string S; - - PC = KFPlayerController(GetPlayer()); - HUD = ScoreboardExtHUD(PC.myHUD); - - Super.InitMenu(); - - // Client settings - SettingsBox = KFGUI_ComponentList(FindComponentID('SettingsBox')); - - AddCheckBox("Disable HUD","Disables the HUD entirely.",'bDisableHUD',HUD.bDisableHUD); - AddCheckBox("Light HUD","Show a light version of the HUD.",'bLight',HUD.bLightHUD); - AddCheckBox("Show weapon info","Show current weapon ammunition status.",'bWeapons',!HUD.bHideWeaponInfo); - AddCheckBox("Show personal info","Display health and armor on the HUD.",'bPersonal',!HUD.bHidePlayerInfo); - AddCheckBox("Show score","Check to show scores on the HUD.",'bScore',!HUD.bHideDosh); - AddCheckBox("Show hidden player icons","Shows the hidden player icons.",'bDisableHiddenPlayers',!HUD.bDisableHiddenPlayers); - AddCheckBox("Show damage messages","Shows the damage popups when damaging ZEDs.",'bEnableDamagePopups',HUD.bEnableDamagePopups); - AddCheckBox("Show player speed","Shows how fast you are moving.",'bShowSpeed',HUD.bShowSpeed); - AddCheckBox("Show pickup information","Shows a UI with infromation on pickups.",'bDisablePickupInfo',!HUD.bDisablePickupInfo); - AddCheckBox("Show lockon target","Shows who you have targeted with a medic gun.",'bDisableLockOnUI',!HUD.bDisableLockOnUI); - AddCheckBox("Show medicgun recharge info","Shows what the recharge info is on various medic weapons.",'bDisableRechargeUI',!HUD.bDisableRechargeUI); - AddCheckBox("Show last remaining ZED icons","Shows the last remaining ZEDs as icons.",'bDisableLastZEDIcons',!HUD.bDisableLastZEDIcons); - AddCheckBox("Show XP earned","Shows when you earn XP.",'bShowXPEarned',HUD.bShowXPEarned); - AddCheckBox("Show Dosh earned","Shows when you earn Dosh.",'bShowDoshEarned',HUD.bShowDoshEarned); - AddCheckBox("Enable Modern Scoreboard","Makes the scoreboard look more modern.",'bNewScoreboard',HUD.bNewScoreboard); - - switch(HUD.PlayerInfoType) - { - case INFO_CLASSIC: - S = "Classic"; - break; - case INFO_LEGACY: - S = "Legacy"; - break; - case INFO_MODERN: - S = "Modern"; - break; - } - - ControllerBox = AddComboBox("Player Info Type","What style to draw the player info system in.",'PlayerInfo',PlayerInfoTypeLabel); - ControllerBox.Values.AddItem("Classic"); - ControllerBox.Values.AddItem("Legacy"); - ControllerBox.Values.AddItem("Modern"); - ControllerBox.SetValue(S); - - AddButton("Reset","Reset HUD Colors","Resets the color settings for the HUD.",'ResetColors',ResetColorLabel); -} -final function KFGUI_CheckBox AddCheckBox( string Cap, string TT, name IDN, bool bDefault ) -{ - local KFGUI_CheckBox CB; - - CB = KFGUI_CheckBox(SettingsBox.AddListComponent(class'KFGUI_CheckBox')); - CB.LableString = Cap; - CB.ToolTip = TT; - CB.bChecked = bDefault; - CB.InitMenu(); - CB.ID = IDN; - CB.OnCheckChange = CheckChange; - return CB; -} -final function KFGUI_Button AddButton( string ButtonText, string Cap, string TT, name IDN, out KFGUI_TextLable Label ) -{ - local KFGUI_Button CB; - local KFGUI_MultiComponent MC; - - MC = KFGUI_MultiComponent(SettingsBox.AddListComponent(class'KFGUI_MultiComponent')); - MC.InitMenu(); - Label = new(MC) class'KFGUI_TextLable'; - Label.SetText(Cap); - Label.XSize = 0.60; - Label.FontScale = 1; - Label.AlignY = 1; - MC.AddComponent(Label); - CB = new(MC) class'KFGUI_Button'; - CB.XPosition = 0.77; - CB.XSize = 0.15; - CB.ButtonText = ButtonText; - CB.ToolTip = TT; - CB.ID = IDN; - CB.OnClickLeft = ButtonClicked; - CB.OnClickRight = ButtonClicked; - MC.AddComponent(CB); - - return CB; -} -final function KFGUI_ComboBox AddComboBox( string Cap, string TT, name IDN, out KFGUI_TextLable Label ) -{ - local KFGUI_ComboBox CB; - local KFGUI_MultiComponent MC; - - MC = KFGUI_MultiComponent(SettingsBox.AddListComponent(class'KFGUI_MultiComponent')); - MC.InitMenu(); - Label = new(MC) class'KFGUI_TextLable'; - Label.SetText(Cap); - Label.XSize = 0.60; - Label.FontScale = 1; - Label.AlignY = 1; - MC.AddComponent(Label); - CB = new(MC) class'KFGUI_ComboBox'; - CB.XPosition = 0.77; - CB.XSize = 0.15; - CB.ToolTip = TT; - CB.ID = IDN; - CB.OnComboChanged = OnComboChanged; - MC.AddComponent(CB); - - return CB; -} - -function OnComboChanged(KFGUI_ComboBox Sender) -{ - switch( Sender.ID ) - { - case 'PlayerInfo': - switch(Sender.GetCurrent()) - { - case "Classic": - HUD.PlayerInfoType = INFO_CLASSIC; - break; - case "Legacy": - HUD.PlayerInfoType = INFO_LEGACY; - break; - case "Modern": - HUD.PlayerInfoType = INFO_MODERN; - break; - } - - break; - } - - switch(HUD.PlayerInfoType) - { - case INFO_CLASSIC: - HUD.CustomArmorColor = HUD.BlueColor; - HUD.CustomHealthColor = HUD.RedColor; - break; - case INFO_LEGACY: - HUD.CustomArmorColor = HUD.ClassicArmorColor; - HUD.CustomHealthColor = HUD.ClassicHealthColor; - break; - case INFO_MODERN: - HUD.CustomArmorColor = HUD.ArmorColor; - HUD.CustomHealthColor = HUD.HealthColor; - break; - } - - HUD.SaveConfig(); -} - -function CheckChange( KFGUI_CheckBox Sender ) -{ - switch( Sender.ID ) - { - case 'bDisableHUD': - HUD.bDisableHUD = Sender.bChecked; - - HUD.RemoveMovies(); - if( HUD.bDisableHUD ) - { - HUD.HUDClass = class'KFGFxHudWrapper'.default.HUDClass; - HUD.CreateHUDMovie(); - } - else - { - HUD.HUDClass = HUD.default.HUDClass; - HUD.CreateHUDMovie(); - } - break; - case 'bLight': - HUD.bLightHUD = Sender.bChecked; - break; - case 'bWeapons': - HUD.bHideWeaponInfo = !Sender.bChecked; - break; - case 'bPersonal': - HUD.bHidePlayerInfo = !Sender.bChecked; - break; - case 'bScore': - HUD.bHideDosh = !Sender.bChecked; - break; - case 'bDisableHiddenPlayers': - HUD.bDisableHiddenPlayers = !Sender.bChecked; - break; - case 'bEnableDamagePopups': - HUD.bEnableDamagePopups = Sender.bChecked; - break; - case 'bShowSpeed': - HUD.bShowSpeed = Sender.bChecked; - break; - case 'bDisableLastZEDIcons': - HUD.bDisableLastZEDIcons = !Sender.bChecked; - break; - case 'bDisablePickupInfo': - HUD.bDisablePickupInfo = !Sender.bChecked; - break; - case 'bDisableLockOnUI': - HUD.bDisableLockOnUI = !Sender.bChecked; - break; - case 'bDisableRechargeUI': - HUD.bDisableRechargeUI = !Sender.bChecked; - break; - case 'bNewScoreboard': - HUD.bNewScoreboard = Sender.bChecked; - - HUD.Scoreboard.SetVisibility(false); - if( HUD.HUDMovie.GfxScoreBoardPlayer != None ) - HUD.HUDMovie.GfxScoreBoardPlayer.ShowScoreboard(false); - break; - case 'bShowXPEarned': - HUD.bShowXPEarned = Sender.bChecked; - break; - case 'bShowDoshEarned': - HUD.bShowDoshEarned = Sender.bChecked; - break; - } - - HUD.SaveConfig(); -} -function ButtonClicked( KFGUI_Button Sender ) -{ - switch( Sender.ID ) - { - case 'ResetColors': - HUD.ResetHUDColors(); - if( HUD.ColorSettingMenu != None ) - { - HUD.ColorSettingMenu.MainHudSlider.SetDefaultColor(HUD.HudMainColor); - HUD.ColorSettingMenu.OutlineSlider.SetDefaultColor(HUD.HudOutlineColor); - HUD.ColorSettingMenu.FontSlider.SetDefaultColor(HUD.FontColor); - } - break; - } -} - -defaultproperties -{ - Begin Object Class=KFGUI_ComponentList Name=ClientSettingsBox - ID="SettingsBox" - ListItemsPerPage=16 - End Object - - Components.Add(ClientSettingsBox) -} \ No newline at end of file diff --git a/ScoreboardExt/Classes/UI_MidGameMenu.uc b/ScoreboardExt/Classes/UI_MidGameMenu.uc deleted file mode 100644 index 72a2974..0000000 --- a/ScoreboardExt/Classes/UI_MidGameMenu.uc +++ /dev/null @@ -1,140 +0,0 @@ -Class UI_MidGameMenu extends KFGUI_FloatingWindow; - -struct FPageInfo -{ - var class PageClass; - var string Caption,Hint; -}; -var KFGUI_SwitchMenuBar PageSwitcher; -var() array Pages; - -var transient KFGUI_Button PrevButton; -var transient int NumButtons,NumButtonRows; - -var KFPlayerReplicationInfo KFPRI; - -function InitMenu() -{ - local int i; - local KFGUI_Button B; - - PageSwitcher = KFGUI_SwitchMenuBar(FindComponentID('Pager')); - Super(KFGUI_Page).InitMenu(); - - AddMenuButton('Close',"Close","Close this menu"); - - for( i=0; i8 ) - { - ++NumButtonRows; - NumButtons = 0; - } - - AddComponent(B); - return B; -} - -defaultproperties -{ - WindowTitle="Classic HUD - Menu" - XPosition=0.2 - YPosition=0.1 - XSize=0.6 - YSize=0.8 - - bAlwaysTop=true - bOnlyThisFocus=true - - Pages.Add((PageClass=Class'UIP_Settings',Caption="Settings",Hint="Show additional Classic Mode settings")) - Pages.Add((PageClass=Class'UIP_ColorSettings',Caption="Colors",Hint="Settings to adjust the hud colors")) - - Begin Object Class=KFGUI_SwitchMenuBar Name=MultiPager - ID="Pager" - XPosition=0.015 - YPosition=0.04 - XSize=0.975 - YSize=0.8 - BorderWidth=0.05 - ButtonAxisSize=0.1 - End Object - - Components.Add(MultiPager) -} \ No newline at end of file