blob: 4a54b81b068e921f617c094340efb8348de5acb6 (
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
@using Sandbox;
@using Sandbox.UI;
@using System;
@namespace MurderGame
@inherits Panel
<style>
lookingatinfo {
top: 0;
left: 0;
width: 100vw;
height: 100vh;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.box {
/* backdrop-filter-blur: 8px;
background-color: rgba(0, 0, 0, 0.20);
padding: 10px;
color: white; */
font-weight: 700;
font-size: 25px;
font-family: "Roboto";
margin-top: 60px;
}
.text {
text-shadow: 1px 1px 0px 0px rgba(0,0,0,0.75);
}
</style>
<div class="box" style="color: @GetLookingAtColour()">
<span class="text">@GetLookingAtName()</span>
</div>
@code
{
public string GetLookingAtName()
{
if (Game.LocalPawn is not Player player) return "";
return player.LookingAt is not { } lookingAt ? "" : lookingAt.CharacterName;
}
public string GetLookingAtColour()
{
if (Game.LocalPawn is not Player player) return "white";
return player.LookingAt is not { } lookingAt ? "white" : lookingAt.HexColor;
}
protected override int BuildHash()
{
return GetLookingAtName().GetHashCode();
}
}
|