15 return EClass.sources.persons.map.TryGetValue(this.
id.IsEmpty(
"narrator"),
null);
25 return this._tempChara ?? this.refChara.GetAndCache(this.uidChara);
35 return this.chara !=
null;
41 public bool HumanSpeak
45 return this.chara ==
null || this.chara.IsPC || this.chara.IsHumanSpeak;
55 string str = this.tempName;
56 string str2 = this.name;
57 Chara chara = this.chara;
59 if ((defaultStr = ((chara !=
null) ? chara.Name :
null)) ==
null)
62 defaultStr = (((source !=
null) ? source.GetText(
"name",
true) :
null) ??
"null");
64 return str.IsEmpty(str2.IsEmpty(defaultStr)).ToTitleCase(
false);
70 public string NameBraced
74 string str = this.tempName;
75 string str2 = this.name;
76 Chara chara = this.chara;
78 if ((defaultStr = ((chara !=
null) ? chara.NameBraced :
null)) ==
null)
81 defaultStr = (((source !=
null) ? source.GetText(
"name",
true) :
null) ??
"null");
83 return str.IsEmpty(str2.IsEmpty(defaultStr)).ToTitleCase(
false);
93 Chara chara = this.chara;
95 if ((result = ((chara !=
null) ? chara.Aka :
null)) ==
null)
98 result = (((source !=
null) ? source.GetText(
"aka",
true) :
null) ??
"");
121 this.idPortrait =
"UN_" + r.id;
122 if (!
Portrait.modPortraits.dict.ContainsKey(
this.idPortrait))
124 this.idPortrait =
"UN_eyth";
135 public void SetChara(
Chara 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;
150 public string ApplyTone(
string text)
152 Chara chara = this.chara;
153 return ((chara !=
null) ? chara.ApplyTone(text,
false) :
null) ?? text;
157 public string GetDramaTitle()
159 if (!this.tempName.IsEmpty())
161 return this.tempName;
163 if (this.chara !=
null)
166 string text = (!EClass.debug.showTone || !Lang.setting.useTone || this.chara.c_idTalk.IsEmpty() || this.chara.c_idTone.IsEmpty()) ?
"" :
string.Concat(
new string[]
169 this.chara.c_idTone.Split(
'|', StringSplitOptions.None)[0].TrimEnd(
'-'),
171 MOD.listTalk.GetTalk(this.chara.c_idTalk,
"name",
false,
true),
174 string dramaText = this.chara.trait.GetDramaText();
175 if (!dramaText.IsEmpty())
177 text = text +
" " + dramaText;
179 return string.Concat(
new string[]
181 this.chara.Name.ToTitleCase(
false),
183 this.chara.race.GetText(
"name",
false).ToTitleCase(
false),
185 Lang.Parse(
"age", bio.TextAge(
this.chara),
null,
null,
null,
null),
187 Lang._gender(bio.gender),
191 if (this.Name.IsEmpty())
195 if (this.Aka.IsEmpty())
197 return "「" + this.Name +
"」";
199 return this.Aka.ToTitleCase(
false) +
"「" + this.Name +
"」";
203 public void SetImage(Image image)
205 Chara chara = this.chara;
207 if ((sprite = ((chara !=
null) ? chara.GetSprite(0) :
null)) ==
null)
209 sprite = (Resources.Load<Sprite>(
"Media/Drama/Actor/" + this.source.idActor) ?? SpriteSheet.Get(this.source.idActor));
211 Sprite sprite2 = sprite;
214 image.sprite = sprite2;
215 image.SetNativeSize();
225 public string idPortrait;
245 public SerializableColor colorHair;
251 public Chara _tempChara;
254 public string tempName;