Elin Modding Docs Doc
Loading...
Searching...
No Matches
CardInspector.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Reflection;
5using UnityEngine;
6
7// Token: 0x0200028E RID: 654
8public class CardInspector : EMono
9{
10 // Token: 0x17000597 RID: 1431
11 // (get) Token: 0x060013BF RID: 5055 RVA: 0x00082145 File Offset: 0x00080345
12 public string Info
13 {
14 get
15 {
16 if (this.card != null)
17 {
18 return this.card.id + "(" + this.card.NameSimple + ")";
19 }
20 return "";
21 }
22 }
23
24 // Token: 0x17000598 RID: 1432
25 // (get) Token: 0x060013C0 RID: 5056 RVA: 0x0008217A File Offset: 0x0008037A
26 // (set) Token: 0x060013C1 RID: 5057 RVA: 0x0008218D File Offset: 0x0008038D
27 public string idEditor
28 {
29 get
30 {
31 Card card = this.card;
32 if (card == null)
33 {
34 return null;
35 }
36 return card.c_idEditor;
37 }
38 set
39 {
40 if (this.card != null)
41 {
42 this.card.c_idEditor = value;
43 }
44 }
45 }
46
47 // Token: 0x17000599 RID: 1433
48 // (get) Token: 0x060013C2 RID: 5058 RVA: 0x000821A3 File Offset: 0x000803A3
49 // (set) Token: 0x060013C3 RID: 5059 RVA: 0x000821B6 File Offset: 0x000803B6
50 public string trait
51 {
52 get
53 {
54 Card card = this.card;
55 if (card == null)
56 {
57 return null;
58 }
59 return card.c_idTrait;
60 }
61 set
62 {
63 if (this.card != null)
64 {
65 this.card.c_idTrait = value;
66 }
67 }
68 }
69
70 // Token: 0x1700059A RID: 1434
71 // (get) Token: 0x060013C4 RID: 5060 RVA: 0x000821CC File Offset: 0x000803CC
72 // (set) Token: 0x060013C5 RID: 5061 RVA: 0x0008222A File Offset: 0x0008042A
73 public string BGM
74 {
75 get
76 {
77 if (this.card == null || this.card.refVal == 0)
78 {
79 return "0";
80 }
81 BGMData bgmdata = EMono.core.refs.bgms.FirstOrDefault((BGMData a) => a.id == this.card.refVal);
82 if (!(bgmdata == null))
83 {
84 return bgmdata.name;
85 }
86 return "0";
87 }
88 set
89 {
90 if (this.card != null)
91 {
92 this.card.refVal = value.Split(' ', StringSplitOptions.None)[0].ToInt();
93 }
94 }
95 }
96
97 // Token: 0x060013C6 RID: 5062 RVA: 0x00082250 File Offset: 0x00080450
98 private IEnumerable<string> _TapeList()
99 {
100 List<string> list = new List<string>();
101 foreach (BGMData bgmdata in EMono.core.refs.bgms)
102 {
103 list.Add(bgmdata.name);
104 }
105 return list;
106 }
107
108 // Token: 0x1700059B RID: 1435
109 // (get) Token: 0x060013C7 RID: 5063 RVA: 0x000822B8 File Offset: 0x000804B8
110 public bool IsTape
111 {
112 get
113 {
114 Card card = this.card;
115 return ((card != null) ? card.trait : null) is TraitTape;
116 }
117 }
118
119 // Token: 0x060013C8 RID: 5064 RVA: 0x000822D4 File Offset: 0x000804D4
120 private IEnumerable<string> Traits()
121 {
122 IEnumerable<Type> enumerable = (this.card == null || !this.card.isChara) ? this.GetInheritedClasses(typeof(Trait), typeof(TraitChara)) : this.GetInheritedClasses(typeof(TraitChara), null);
123 List<string> list = new List<string>();
124 list.Add("");
125 foreach (Type type in enumerable)
126 {
127 list.Add(type.Name);
128 }
129 return list;
130 }
131
132 // Token: 0x060013C9 RID: 5065 RVA: 0x00082374 File Offset: 0x00080574
133 private IEnumerable<Type> GetInheritedClasses(Type MyType, Type exclude = null)
134 {
135 return from TheType in Assembly.GetAssembly(MyType).GetTypes()
136 where TheType.IsClass && TheType.IsSubclassOf(MyType) && (exclude == null || !TheType.IsSubclassOf(exclude))
137 select TheType;
138 }
139
140 // Token: 0x1700059C RID: 1436
141 // (get) Token: 0x060013CA RID: 5066 RVA: 0x000823B8 File Offset: 0x000805B8
142 // (set) Token: 0x060013CB RID: 5067 RVA: 0x00082436 File Offset: 0x00080636
143 public string spawnList
144 {
145 get
146 {
147 if (this.card == null || this.card.c_idRefCard.IsEmpty() || !EMono.editorSources.spawnLists.map.ContainsKey(this.card.c_idRefCard))
148 {
149 return "-";
150 }
151 SourceSpawnList.Row row = EMono.editorSources.spawnLists.rows.First((SourceSpawnList.Row a) => a.id == this.card.c_idRefCard);
152 if (row != null)
153 {
154 return row.id;
155 }
156 return "-";
157 }
158 set
159 {
160 if (this.card != null)
161 {
162 this.card.c_idRefCard = value;
163 }
164 }
165 }
166
167 // Token: 0x060013CC RID: 5068 RVA: 0x0008244C File Offset: 0x0008064C
168 protected IEnumerable<string> _SpawnList()
169 {
170 return EMono.editorSources.spawnLists.GetListString();
171 }
172
173 // Token: 0x060013CD RID: 5069 RVA: 0x0008245D File Offset: 0x0008065D
174 private void Awake()
175 {
176 CardInspector.Instance = this;
177 }
178
179 // Token: 0x060013CE RID: 5070 RVA: 0x00082468 File Offset: 0x00080668
180 public void SetCard(Card c, bool select = true)
181 {
182 this.card = c;
183 this.tags.Clear();
184 if (c != null && !c.c_editorTags.IsEmpty())
185 {
186 foreach (string text in c.c_editorTags.Split(',', StringSplitOptions.None))
187 {
188 try
189 {
190 this.tags.Add(text.ToEnum(true));
191 }
192 catch
193 {
194 Debug.Log("No Editor Tag Found:" + text);
195 }
196 }
197 }
198 this.traitVals = c.c_editorTraitVal;
199 }
200
201 // Token: 0x060013CF RID: 5071 RVA: 0x00082500 File Offset: 0x00080700
202 private void OnValidate()
203 {
204 if (!Application.isPlaying || !EMono.core.IsGameStarted || this.card == null)
205 {
206 return;
207 }
208 string text = null;
209 bool flag = true;
210 if (this.tags != null)
211 {
212 foreach (EditorTag editorTag in this.tags)
213 {
214 text = text + (flag ? "" : ",") + editorTag.ToString();
215 flag = false;
216 }
217 }
218 this.card.c_editorTags = text;
219 this.card.c_editorTraitVal = (this.traitVals.IsEmpty() ? null : this.traitVals);
220 }
221
222 // Token: 0x04000F8D RID: 3981
223 public static CardInspector Instance;
224
225 // Token: 0x04000F8E RID: 3982
226 public Card card;
227
228 // Token: 0x04000F8F RID: 3983
229 public List<EditorTag> tags = new List<EditorTag>();
230
231 // Token: 0x04000F90 RID: 3984
232 public string traitVals;
233}
Definition Card.cs:13
Definition EMono.cs:6
Definition Trait.cs:9