aboutsummaryrefslogtreecommitdiffstats
path: root/code/ui/character
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
parent87d74b50bf443bf199be05bd03afdca6ece082ff (diff)
ReformatHEADmaster
Diffstat (limited to 'code/ui/character')
-rw-r--r--code/ui/character/LookingAtInfo.razor45
-rw-r--r--code/ui/character/NameInfo.razor10
2 files changed, 25 insertions, 30 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
diff --git a/code/ui/character/NameInfo.razor b/code/ui/character/NameInfo.razor
index f0a7488..69b7bca 100644
--- a/code/ui/character/NameInfo.razor
+++ b/code/ui/character/NameInfo.razor
@@ -1,8 +1,6 @@
-@using Sandbox;
-@using Sandbox.UI;
-
@namespace MurderGame
-@inherits Panel
+@using Sandbox
+@inherits Sandbox.UI.Panel
<style>
.team-info {
@@ -14,7 +12,7 @@
</style>
<div class="team-info" style="color: @(Colour)">
-@GetName()
+ @GetName()
</div>
@code
@@ -35,4 +33,4 @@
{
return GetName().GetHashCode();
}
-}
+} \ No newline at end of file