Elin Modding Docs Doc
Loading...
Searching...
No Matches
Person.cs
1using System;
2using Newtonsoft.Json;
3using UnityEngine;
4using UnityEngine.UI;
5
6// Token: 0x020000C1 RID: 193
7public class Person : EClass
8{
9 // Token: 0x1700011D RID: 285
10 // (get) Token: 0x0600054E RID: 1358 RVA: 0x0002583D File Offset: 0x00023A3D
11 public SourcePerson.Row source
12 {
13 get
14 {
15 return EClass.sources.persons.map.TryGetValue(this.id.IsEmpty("narrator"), null);
16 }
17 }
18
19 // Token: 0x1700011E RID: 286
20 // (get) Token: 0x0600054F RID: 1359 RVA: 0x00025864 File Offset: 0x00023A64
21 public Chara chara
22 {
23 get
24 {
25 return this._tempChara ?? this.refChara.GetAndCache(this.uidChara);
26 }
27 }
28
29 // Token: 0x1700011F RID: 287
30 // (get) Token: 0x06000550 RID: 1360 RVA: 0x00025881 File Offset: 0x00023A81
31 public bool hasChara
32 {
33 get
34 {
35 return this.chara != null;
36 }
37 }
38
39 // Token: 0x17000120 RID: 288
40 // (get) Token: 0x06000551 RID: 1361 RVA: 0x0002588C File Offset: 0x00023A8C
41 public bool HumanSpeak
42 {
43 get
44 {
45 return this.chara == null || this.chara.IsPC || this.chara.IsHumanSpeak;
46 }
47 }
48
49 // Token: 0x17000121 RID: 289
50 // (get) Token: 0x06000552 RID: 1362 RVA: 0x000258B4 File Offset: 0x00023AB4
51 public string Name
52 {
53 get
54 {
55 string str = this.tempName;
56 string str2 = this.name;
57 Chara chara = this.chara;
58 string defaultStr;
59 if ((defaultStr = ((chara != null) ? chara.Name : null)) == null)
60 {
61 SourcePerson.Row source = this.source;
62 defaultStr = (((source != null) ? source.GetText("name", true) : null) ?? "null");
63 }
64 return str.IsEmpty(str2.IsEmpty(defaultStr)).ToTitleCase(false);
65 }
66 }
67
68 // Token: 0x17000122 RID: 290
69 // (get) Token: 0x06000553 RID: 1363 RVA: 0x00025914 File Offset: 0x00023B14
70 public string NameBraced
71 {
72 get
73 {
74 string str = this.tempName;
75 string str2 = this.name;
76 Chara chara = this.chara;
77 string defaultStr;
78 if ((defaultStr = ((chara != null) ? chara.NameBraced : null)) == null)
79 {
80 SourcePerson.Row source = this.source;
81 defaultStr = (((source != null) ? source.GetText("name", true) : null) ?? "null");
82 }
83 return str.IsEmpty(str2.IsEmpty(defaultStr)).ToTitleCase(false);
84 }
85 }
86
87 // Token: 0x17000123 RID: 291
88 // (get) Token: 0x06000554 RID: 1364 RVA: 0x00025974 File Offset: 0x00023B74
89 public string Aka
90 {
91 get
92 {
93 Chara chara = this.chara;
94 string result;
95 if ((result = ((chara != null) ? chara.Aka : null)) == null)
96 {
97 SourcePerson.Row source = this.source;
98 result = (((source != null) ? source.GetText("aka", true) : null) ?? "");
99 }
100 return result;
101 }
102 }
103
104 // Token: 0x06000555 RID: 1365 RVA: 0x000259AD File Offset: 0x00023BAD
105 public Person()
106 {
107 }
108
109 // Token: 0x06000556 RID: 1366 RVA: 0x000259C0 File Offset: 0x00023BC0
110 public Person(string _id, Chara c = null)
111 {
112 this.id = _id;
113 this.SetChara(c);
114 }
115
116 // Token: 0x06000557 RID: 1367 RVA: 0x000259E4 File Offset: 0x00023BE4
117 public Person(Religion r)
118 {
119 this.id = r.id;
120 this.name = r.Name;
121 this.idPortrait = "UN_" + r.id;
122 if (!Portrait.modPortraits.dict.ContainsKey(this.idPortrait))
123 {
124 this.idPortrait = "UN_eyth";
125 }
126 }
127
128 // Token: 0x06000558 RID: 1368 RVA: 0x00025A52 File Offset: 0x00023C52
129 public Person(Chara c)
130 {
131 this.SetChara(c);
132 }
133
134 // Token: 0x06000559 RID: 1369 RVA: 0x00025A6C File Offset: 0x00023C6C
135 public void SetChara(Chara c)
136 {
137 if (c == null)
138 {
139 return;
140 }
141 this._tempChara = c;
142 this.uidChara = c.uid;
143 this.name = this.chara.Name;
144 this.idPortrait = this.chara.GetIdPortrait();
145 this.gender = this.chara.bio.gender;
146 this.tones = this.chara.c_idTone;
147 }
148
149 // Token: 0x0600055A RID: 1370 RVA: 0x00025AD9 File Offset: 0x00023CD9
150 public string ApplyTone(string text)
151 {
152 Chara chara = this.chara;
153 return ((chara != null) ? chara.ApplyTone(text, false) : null) ?? text;
154 }
155
156 // Token: 0x0600055B RID: 1371 RVA: 0x00025AF4 File Offset: 0x00023CF4
157 public string GetDramaTitle()
158 {
159 if (!this.tempName.IsEmpty())
160 {
161 return this.tempName;
162 }
163 if (this.chara != null)
164 {
165 Biography bio = this.chara.bio;
166 string text = (!EClass.debug.showTone || !Lang.setting.useTone || this.chara.c_idTalk.IsEmpty() || this.chara.c_idTone.IsEmpty()) ? "" : string.Concat(new string[]
167 {
168 " (",
169 this.chara.c_idTone.Split('|', StringSplitOptions.None)[0].TrimEnd('-'),
170 "な",
171 MOD.listTalk.GetTalk(this.chara.c_idTalk, "name", false, true),
172 ")"
173 });
174 string dramaText = this.chara.trait.GetDramaText();
175 if (!dramaText.IsEmpty())
176 {
177 text = text + " " + dramaText;
178 }
179 return string.Concat(new string[]
180 {
181 this.chara.Name.ToTitleCase(false),
182 " - ",
183 this.chara.race.GetText("name", false).ToTitleCase(false),
184 " ",
185 Lang.Parse("age", bio.TextAge(this.chara), null, null, null, null),
186 " ",
187 Lang._gender(bio.gender),
188 text
189 });
190 }
191 if (this.Name.IsEmpty())
192 {
193 return this.Aka;
194 }
195 if (this.Aka.IsEmpty())
196 {
197 return "「" + this.Name + "」";
198 }
199 return this.Aka.ToTitleCase(false) + "「" + this.Name + "」";
200 }
201
202 // Token: 0x0600055C RID: 1372 RVA: 0x00025CDC File Offset: 0x00023EDC
203 public void SetImage(Image image)
204 {
205 Chara chara = this.chara;
206 Sprite sprite;
207 if ((sprite = ((chara != null) ? chara.GetSprite(0) : null)) == null)
208 {
209 sprite = (Resources.Load<Sprite>("Media/Drama/Actor/" + this.source.idActor) ?? SpriteSheet.Get(this.source.idActor));
210 }
211 Sprite sprite2 = sprite;
212 if (sprite2)
213 {
214 image.sprite = sprite2;
215 image.SetNativeSize();
216 }
217 }
218
219 // Token: 0x040006E1 RID: 1761
220 [JsonProperty]
221 public string name;
222
223 // Token: 0x040006E2 RID: 1762
224 [JsonProperty]
225 public string idPortrait;
226
227 // Token: 0x040006E3 RID: 1763
228 [JsonProperty]
229 public string id;
230
231 // Token: 0x040006E4 RID: 1764
232 [JsonProperty]
233 public string tones;
234
235 // Token: 0x040006E5 RID: 1765
236 [JsonProperty]
237 public int uidChara;
238
239 // Token: 0x040006E6 RID: 1766
240 [JsonProperty]
241 public int gender;
242
243 // Token: 0x040006E7 RID: 1767
244 [JsonProperty]
245 public SerializableColor colorHair;
246
247 // Token: 0x040006E8 RID: 1768
248 public RefChara refChara = new RefChara();
249
250 // Token: 0x040006E9 RID: 1769
251 public Chara _tempChara;
252
253 // Token: 0x040006EA RID: 1770
254 public string tempName;
255}
Definition Chara.cs:12