aboutsummaryrefslogtreecommitdiffstats
path: root/code/ui/PlayerInfo.razor
blob: 53a71df797e57c382a27a2f2b4de49a8af39c9d4 (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
39
40
41
@using Sandbox;
@using Sandbox.UI;

@namespace MurderGame
@inherits Panel

<style>
    playerinfo {
        position: absolute;
        left: 30px;
        bottom: 30px;
        background-color: rgba(0, 0, 0, 0.20);
		backdrop-filter-blur: 8px;
        display: flex;
        align-items: center;
        flex-direction: row;
        gap: 10px;
        padding: 10px;
    }
</style>

<Health Colour="@GetTeamColour()"></Health>
<TeamInfo Colour="@GetTeamColour()"></TeamInfo>

@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();
	}
}