diff options
Diffstat (limited to 'code/ui/team')
| -rw-r--r-- | code/ui/team/TeamInfo.razor | 37 |
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();
+ }
+}
|
