aboutsummaryrefslogtreecommitdiffstats
path: root/code/ui/team/TeamInfo.razor
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.com>2023-07-27 22:11:31 +0100
committerLeonardo Bishop <me@leonardobishop.com>2023-07-27 22:11:31 +0100
commit71db52c5443a7bf82d9a23a770994a42b043be04 (patch)
treef75f2605bb1bdc53842cd85c90d105dcc77e1c10 /code/ui/team/TeamInfo.razor
Initial commit
Diffstat (limited to 'code/ui/team/TeamInfo.razor')
-rw-r--r--code/ui/team/TeamInfo.razor37
1 files changed, 37 insertions, 0 deletions
diff --git a/code/ui/team/TeamInfo.razor b/code/ui/team/TeamInfo.razor
new file mode 100644
index 0000000..18e1f7f
--- /dev/null
+++ b/code/ui/team/TeamInfo.razor
@@ -0,0 +1,37 @@
+@using Sandbox;
+@using Sandbox.UI;
+
+@namespace MurderGame
+@inherits Panel
+
+<style>
+.team-info {
+ font-size: 35px;
+ font-weight: 700;
+ font-family: "Roboto";
+}
+</style>
+
+<div class="team-info" style="color: @(Colour)">
+@GetTeamName()
+</div>
+
+@code
+{
+ public string Colour { get; set; }
+
+ public string GetTeamName()
+ {
+ var ClientPawn = Game.LocalPawn;
+ if (ClientPawn is Player)
+ {
+ return TeamOperations.GetTeamName(((Player)ClientPawn).CurrentTeam);
+ }
+ return "";
+ }
+
+ protected override int BuildHash()
+ {
+ return GetTeamName().GetHashCode();
+ }
+}