Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ColorKey.cs
Go to the documentation of this file.
1
using
Microsoft.Xna.Framework
;
2
using
Newtonsoft.Json.Linq;
3
4
namespace
ReLogic.Peripherals.RGB.SteelSeries
;
5
6
internal
class
ColorKey
7
{
8
private
const
int
TimesToDenyIdenticalColors
= 30;
9
10
public
string
EventName
;
11
12
public
string
TriggerName
;
13
14
private
Color
_colorToShow
;
15
16
private
bool
_needsToSendMessage
;
17
18
public
bool
IsVisible
;
19
20
private
int
_timesDeniedColorRepeats
;
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
{
31
_timesDeniedColorRepeats
++;
32
return
;
33
}
34
_timesDeniedColorRepeats
= 0;
35
_colorToShow
= color;
36
_needsToSendMessage
=
true
;
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
51
if
(!
_needsToSendMessage
)
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
}
ReLogic.Peripherals.RGB.SteelSeries.ColorKey._colorToShow
Color _colorToShow
Definition
ColorKey.cs:14
ReLogic.Peripherals.RGB.SteelSeries.ColorKey.EventName
string EventName
Definition
ColorKey.cs:10
ReLogic.Peripherals.RGB.SteelSeries.ColorKey._timesDeniedColorRepeats
int _timesDeniedColorRepeats
Definition
ColorKey.cs:20
ReLogic.Peripherals.RGB.SteelSeries.ColorKey.TryGettingRequest
JObject TryGettingRequest()
Definition
ColorKey.cs:39
ReLogic.Peripherals.RGB.SteelSeries.ColorKey.TriggerName
string TriggerName
Definition
ColorKey.cs:12
ReLogic.Peripherals.RGB.SteelSeries.ColorKey.TimesToDenyIdenticalColors
const int TimesToDenyIdenticalColors
Definition
ColorKey.cs:8
ReLogic.Peripherals.RGB.SteelSeries.ColorKey.UpdateColor
void UpdateColor(Color color, bool isVisible)
Definition
ColorKey.cs:22
ReLogic.Peripherals.RGB.SteelSeries.ColorKey._needsToSendMessage
bool _needsToSendMessage
Definition
ColorKey.cs:16
ReLogic.Peripherals.RGB.SteelSeries.ColorKey.IsVisible
bool IsVisible
Definition
ColorKey.cs:18
ReLogic.Peripherals.RGB.SteelSeries.ColorKey
Definition
ColorKey.cs:7
Microsoft.Xna.Framework
Definition
AlphaTestEffect.cs:1
ReLogic.Peripherals.RGB.SteelSeries
Definition
ColorKey.cs:4
Microsoft.Xna.Framework.Color
Definition
Color.cs:12
source
ReLogic
ReLogic.Peripherals.RGB.SteelSeries
ColorKey.cs
Generated by
1.10.0