Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ColorKey.cs
Go to the documentation of this file.
2using Newtonsoft.Json.Linq;
3
5
6internal class ColorKey
7{
8 private const int TimesToDenyIdenticalColors = 30;
9
10 public string EventName;
11
12 public string TriggerName;
13
15
16 private bool _needsToSendMessage;
17
18 public bool IsVisible;
19
21
22 public void UpdateColor(Color color, bool isVisible)
23 {
24 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
25 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
26 //IL_0036: Unknown result type (might be due to invalid IL or missing references)
27 //IL_0037: Unknown result type (might be due to invalid IL or missing references)
28 IsVisible = isVisible;
29 if (_colorToShow == color && _timesDeniedColorRepeats < 30)
30 {
32 return;
33 }
35 _colorToShow = color;
37 }
38
39 public JObject TryGettingRequest()
40 {
41 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
42 //IL_0017: Expected O, but got Unknown
43 //IL_0068: Unknown result type (might be due to invalid IL or missing references)
44 //IL_006e: Expected O, but got Unknown
45 //IL_007b: Unknown result type (might be due to invalid IL or missing references)
46 //IL_0081: Expected O, but got Unknown
47 //IL_008d: Unknown result type (might be due to invalid IL or missing references)
48 //IL_0092: Unknown result type (might be due to invalid IL or missing references)
49 //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
50 //IL_00b5: Expected O, but got Unknown
52 {
53 return null;
54 }
55 _needsToSendMessage = false;
56 JObject jObject = new JObject();
57 jObject.Add("red", JToken.op_Implicit(((Color)(ref _colorToShow)).R));
58 jObject.Add("green", JToken.op_Implicit(((Color)(ref _colorToShow)).G));
59 jObject.Add("blue", JToken.op_Implicit(((Color)(ref _colorToShow)).B));
60 JObject jObject2 = new JObject();
61 jObject2.Add(TriggerName, (JToken)(object)jObject);
62 JObject jObject3 = new JObject();
63 jObject3.Add("frame", (JToken)(object)jObject2);
64 JObject val = new JObject();
65 val.Add("event", JToken.op_Implicit(EventName));
66 val.Add("data", (JToken)(object)jObject3);
67 return val;
68 }
69}
void UpdateColor(Color color, bool isVisible)
Definition ColorKey.cs:22