From 71db52c5443a7bf82d9a23a770994a42b043be04 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Thu, 27 Jul 2023 22:11:31 +0100 Subject: Initial commit --- code/ui/PlayerInfo.razor | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 code/ui/PlayerInfo.razor (limited to 'code/ui/PlayerInfo.razor') diff --git a/code/ui/PlayerInfo.razor b/code/ui/PlayerInfo.razor new file mode 100644 index 0000000..53a71df --- /dev/null +++ b/code/ui/PlayerInfo.razor @@ -0,0 +1,41 @@ +@using Sandbox; +@using Sandbox.UI; + +@namespace MurderGame +@inherits Panel + + + + + + +@code +{ + public string GetTeamColour() + { + var ClientPawn = Game.LocalPawn; + if (ClientPawn is Player) + { + return TeamOperations.GetTeamColour(((Player)ClientPawn).CurrentTeam); + } + return ""; + } + + protected override int BuildHash() + { + return GetTeamColour().GetHashCode(); + } +} -- cgit v1.2.3-70-g09d2