aboutsummaryrefslogtreecommitdiffstats
path: root/code/ui/character/LookingAtInfo.razor
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.com>2023-08-06 17:21:45 +0100
committerLeonardo Bishop <me@leonardobishop.com>2023-08-06 17:21:45 +0100
commit0bba89a7858ce091f485e04284f853e1f7f304af (patch)
tree89ba42616e0f245cc84c96cc5b353eea117057d0 /code/ui/character/LookingAtInfo.razor
parent87d74b50bf443bf199be05bd03afdca6ece082ff (diff)
ReformatHEADmaster
Diffstat (limited to 'code/ui/character/LookingAtInfo.razor')
-rw-r--r--code/ui/character/LookingAtInfo.razor45
1 files changed, 21 insertions, 24 deletions
diff --git a/code/ui/character/LookingAtInfo.razor b/code/ui/character/LookingAtInfo.razor
index ab43527..3c9bbab 100644
--- a/code/ui/character/LookingAtInfo.razor
+++ b/code/ui/character/LookingAtInfo.razor
@@ -1,9 +1,6 @@
-@using Sandbox;
-@using Sandbox.UI;
-@using System;
-
@namespace MurderGame
-@inherits Panel
+@using Sandbox
+@inherits Sandbox.UI.Panel
<style>
lookingatinfo {
@@ -31,27 +28,27 @@ lookingatinfo {
@if (GetLookingAtName() != "")
{
-<smallbox class="box" style="color: @GetLookingAtColour()">
- <span class="text">@GetLookingAtName()</span>
-</smallbox>
+ <smallbox class="box" style="color: @GetLookingAtColour()">
+ <span class="text">@GetLookingAtName()</span>
+ </smallbox>
}
@code
{
- public string GetLookingAtName()
- {
- if (Game.LocalPawn is not Player player) return "";
- return player.LookingAt is not { } lookingAt ? "" : (lookingAt.CharacterName ?? lookingAt.Client.Name);
- }
-
- public string GetLookingAtColour()
- {
- if (Game.LocalPawn is not Player player) return "white";
- return player.LookingAt is not { } lookingAt ? "white" : (string.IsNullOrWhiteSpace(lookingAt.HexColor) ? "white" : lookingAt.HexColor);
- }
+ public string GetLookingAtName()
+ {
+ if (Game.LocalPawn is not Player player) return "";
+ return player.LookingAt is not { } lookingAt ? "" : lookingAt.CharacterName ?? lookingAt.Client.Name;
+ }
- protected override int BuildHash()
- {
- return GetLookingAtName().GetHashCode();
- }
-}
+ public string GetLookingAtColour()
+ {
+ if (Game.LocalPawn is not Player player) return "white";
+ return player.LookingAt is not { } lookingAt ? "white" : string.IsNullOrWhiteSpace(lookingAt.HexColor) ? "white" : lookingAt.HexColor;
+ }
+
+ protected override int BuildHash()
+ {
+ return GetLookingAtName().GetHashCode();
+ }
+} \ No newline at end of file