diff options
Diffstat (limited to 'code/ui/PlayerInfo.razor')
| -rw-r--r-- | code/ui/PlayerInfo.razor | 41 |
1 files changed, 41 insertions, 0 deletions
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
+
+<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();
+ }
+}
|
