blob: 71a2d66f6ec34cf7ba37e869156105bf03824e13 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
@using Sandbox;
@using Sandbox.UI;
@namespace MurderGame
@inherits Panel
<style>
.team-info {
font-size: 30px;
font-weight: 700;
font-family: "Roboto";
text-shadow: 1px 1px 0 0 rgba(0,0,0,0.75);
}
</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 {Camera: not null } player)
{
return TeamOperations.GetTeamName(player.Camera.GetObservedTeam());
}
return "";
}
protected override int BuildHash()
{
return GetTeamName().GetHashCode();
}
}
|