From 914512435d37d9f1e1ea4c045afd4ec5612b7534 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Sun, 30 Jul 2023 02:45:36 +0100 Subject: Replace movement controllers --- code/ui/health/Health.razor | 2 +- code/ui/overlay/DeathOverlay.razor | 33 +++++++++++++++++++++++---------- code/ui/spectator/Spectator.razor | 14 +++++--------- 3 files changed, 29 insertions(+), 20 deletions(-) (limited to 'code/ui') diff --git a/code/ui/health/Health.razor b/code/ui/health/Health.razor index c3c6660..8961f63 100644 --- a/code/ui/health/Health.razor +++ b/code/ui/health/Health.razor @@ -21,7 +21,7 @@ Health { left: 0; } -
+
@code diff --git a/code/ui/overlay/DeathOverlay.razor b/code/ui/overlay/DeathOverlay.razor index 15848f6..23c3a17 100644 --- a/code/ui/overlay/DeathOverlay.razor +++ b/code/ui/overlay/DeathOverlay.razor @@ -10,6 +10,11 @@ 0% { opacity: 0; } 100% { opacity: 1; } } +@@keyframes blurIn +{ + 0% { opacity: 0; } + 100% { opacity: 1; } +} deathoverlay { } .overlay { @@ -18,11 +23,22 @@ deathoverlay { top: 0; width: 100vw; height: 100vh; - - background-color: rgba(80, 1, 1, 0.90); - backdrop-filter-blur: 64px; +} +.fade { + opacity: 0; + background-color: rgb(0, 0, 0); animation-name: fadeIn; - animation-duration: 2.5s; + animation-duration: 0.5s; + animation-delay: 1.5s; + animation-iteration-count: 1; + animation-timing-function: ease-in; + animation-fill-mode: forwards; +} +.blur { + opacity: 0; + backdrop-filter-blur: 32px; + animation-name: fadeIn; + animation-duration: 1.5s; animation-iteration-count: 1; animation-timing-function: ease-in; animation-fill-mode: forwards; @@ -56,7 +72,9 @@ deathoverlay { @if (ShowOverlay) { -
+
+
+
@@ -78,11 +96,6 @@ deathoverlay { protected override int BuildHash() { - var clientPawn = Game.LocalPawn; - if (clientPawn is Player player) - { - ShowOverlay = player.LifeState == LifeState.Dead && player.Spectator == null; - } return ShowOverlay.GetHashCode(); } diff --git a/code/ui/spectator/Spectator.razor b/code/ui/spectator/Spectator.razor index f6fe8af..fe0d662 100644 --- a/code/ui/spectator/Spectator.razor +++ b/code/ui/spectator/Spectator.razor @@ -43,16 +43,12 @@ spectator { protected override int BuildHash() { var localPawn = Game.LocalPawn; - if (localPawn is Player player) + if (localPawn is Player player && player.Camera is SpectatorCameraComponent spectator) { - var spectator = player.Spectator; - if (spectator != null) - { - var target = spectator.Target; - Spectating = true; - TargetName = (target != null && target.IsValid() && target.LifeState == LifeState.Alive) ? target.Client.Name : ""; - return HashCode.Combine(Spectating.GetHashCode(), TargetName.GetHashCode()); - } + var target = spectator.Target; + Spectating = true; + TargetName = (target != null && target.IsValid() && target.LifeState == LifeState.Alive) ? target.Client.Name : ""; + return HashCode.Combine(Spectating.GetHashCode(), TargetName.GetHashCode()); } if (Spectating) { -- cgit v1.2.3-70-g09d2