From 0bba89a7858ce091f485e04284f853e1f7f304af Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Sun, 6 Aug 2023 17:21:45 +0100 Subject: Reformat --- code/ui/spectator/Spectator.razor | 55 +++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 28 deletions(-) (limited to 'code/ui/spectator') diff --git a/code/ui/spectator/Spectator.razor b/code/ui/spectator/Spectator.razor index fe0d662..3853233 100644 --- a/code/ui/spectator/Spectator.razor +++ b/code/ui/spectator/Spectator.razor @@ -1,9 +1,7 @@ -@using Sandbox; -@using Sandbox.UI; -@using System; - @namespace MurderGame -@inherits Panel +@using System +@using Sandbox +@inherits Sandbox.UI.Panel -@if (Spectating) { -
-
Spectating @TargetName
-
+@if (Spectating) +{ +
+
Spectating @TargetName
+
} @code { - public bool Spectating { get; set; } - public string TargetName { get; set; } + public bool Spectating { get; set; } + public string TargetName { get; set; } - protected override int BuildHash() - { - var localPawn = Game.LocalPawn; - if (localPawn is Player player && player.Camera is SpectatorCameraComponent spectator) - { - 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) - { - Spectating = false; - } - return Spectating.GetHashCode(); - } -} + protected override int BuildHash() + { + var localPawn = Game.LocalPawn; + if (localPawn is Player player && player.Camera is SpectatorCameraComponent spectator) + { + 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) + { + Spectating = false; + } + return Spectating.GetHashCode(); + } +} \ No newline at end of file -- cgit v1.2.3-70-g09d2