Elin Modding Docs Doc
Loading...
Searching...
No Matches
HotAction.cs
1using System;
2using Newtonsoft.Json;
3using UnityEngine;
4
5// Token: 0x0200060F RID: 1551
6public class HotAction : HotItem
7{
8 // Token: 0x17000C60 RID: 3168
9 // (get) Token: 0x06002B27 RID: 11047 RVA: 0x000F320F File Offset: 0x000F140F
10 // (set) Token: 0x06002B28 RID: 11048 RVA: 0x000F3221 File Offset: 0x000F1421
11 public Color bgColor
12 {
13 get
14 {
15 return IntColor.FromInt(this._bgColor);
16 }
17 set
18 {
19 this._bgColor = IntColor.ToInt(ref value);
20 }
21 }
22
23 // Token: 0x17000C61 RID: 3169
24 // (get) Token: 0x06002B29 RID: 11049 RVA: 0x000F3230 File Offset: 0x000F1430
25 public override Color SpriteColor
26 {
27 get
28 {
29 if (!this.CanChangeIconColor || this._bgColor == 0)
30 {
31 return base.SpriteColor;
32 }
33 return this.bgColor;
34 }
35 }
36
37 // Token: 0x17000C62 RID: 3170
38 // (get) Token: 0x06002B2A RID: 11050 RVA: 0x000F324F File Offset: 0x000F144F
39 public virtual string Id
40 {
41 get
42 {
43 return "";
44 }
45 }
46
47 // Token: 0x17000C63 RID: 3171
48 // (get) Token: 0x06002B2B RID: 11051 RVA: 0x000F3256 File Offset: 0x000F1456
49 public virtual bool CanChangeIconColor
50 {
51 get
52 {
53 return false;
54 }
55 }
56
57 // Token: 0x17000C64 RID: 3172
58 // (get) Token: 0x06002B2C RID: 11052 RVA: 0x000F3259 File Offset: 0x000F1459
59 public virtual bool CanName
60 {
61 get
62 {
63 return true;
64 }
65 }
66
67 // Token: 0x17000C65 RID: 3173
68 // (get) Token: 0x06002B2D RID: 11053 RVA: 0x000F325C File Offset: 0x000F145C
69 public override string Name
70 {
71 get
72 {
73 return this.text.IsEmpty(("hotAction" + this.Id).lang());
74 }
75 }
76
77 // Token: 0x17000C66 RID: 3174
78 // (get) Token: 0x06002B2E RID: 11054 RVA: 0x000F327E File Offset: 0x000F147E
79 public override string pathSprite
80 {
81 get
82 {
83 return "icon_hot" + this.Id;
84 }
85 }
86
87 // Token: 0x06002B2F RID: 11055 RVA: 0x000F3290 File Offset: 0x000F1490
88 public override void OnClick(ButtonHotItem b, Hotbar h)
89 {
90 if (!EClass.player.CanAcceptInput())
91 {
92 SE.Beep();
93 return;
94 }
95 this.Perform();
96 }
97
98 // Token: 0x06002B30 RID: 11056 RVA: 0x000F32AA File Offset: 0x000F14AA
99 public virtual void Perform()
100 {
101 }
102
103 // Token: 0x06002B31 RID: 11057 RVA: 0x000F32AC File Offset: 0x000F14AC
104 public override void OnShowContextMenu(UIContextMenu m)
105 {
106 base.OnShowContextMenu(m);
107 if (this.CanName)
108 {
109 m.AddButton("changeName", delegate()
110 {
111 Dialog.InputName("dialogChangeName", this.text.IsEmpty(""), delegate(bool cancel, string t)
112 {
113 if (!cancel)
114 {
115 this.text = t;
116 }
117 }, Dialog.InputType.Default);
118 }, true);
119 }
120 if (this.CanChangeIconColor)
121 {
122 m.AddButton("actChangeColor", delegate()
123 {
124 if (this._bgColor == 0)
125 {
126 this.bgColor = Color.white;
127 }
128 EClass.ui.AddLayer<LayerColorPicker>().SetColor(this.bgColor, Color.white, delegate(PickerState state, Color _c)
129 {
130 this.bgColor = _c;
131 this.button.icon.color = _c;
132 });
133 }, true);
134 }
135 }
136
137 // Token: 0x0400182E RID: 6190
138 [JsonProperty]
139 public int _bgColor;
140
141 // Token: 0x0400182F RID: 6191
142 [JsonProperty]
143 public string text;
144}