diff options
Diffstat (limited to 'code/ui/character')
| -rw-r--r-- | code/ui/character/LookingAtInfo.razor | 45 | ||||
| -rw-r--r-- | code/ui/character/NameInfo.razor | 10 |
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 |
