Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
UIText Class Reference
Inheritance diagram for UIText:
IUISkin

Public Member Functions

void ApplySkin ()
 
void SetText (string s)
 
void SetText (string s, Color c)
 
void SetText (string s, FontColor c)
 
UIText SetSize (int a)
 
void SetColor (FontColor c)
 
void SetLang (string idLang)
 
void OnChangeLanguage ()
 
void ApplySkin ()
 

Public Attributes

string lang
 
BaseSkinRoot skinRoot
 
FontType fontType
 
FontColor fontColor
 
SkinType skinType
 
int size
 
HyphenationJpn hyphenation
 
UIButton button
 
Typewriter typewriter
 
float orgSpacing
 
Color orgColor = Color.white
 

Static Public Attributes

static int globalSizeMod
 

Protected Member Functions

override void Awake ()
 
override void OnEnable ()
 

Private Member Functions

void OnSetText ()
 

Detailed Description

Definition at line 5 of file UIText.cs.

Member Function Documentation

◆ ApplySkin()

void UIText.ApplySkin ( )
inline

Implements IUISkin.

Definition at line 38 of file UIText.cs.

39 {
40 if (!Application.isPlaying)
41 {
42 return;
43 }
45 int num = size + 19 + globalSizeMod;
46 SkinManager.FontSet fontSet = instance.fontSet;
47 FontSource fontSource = instance.FontList[0];
48 if (fontType != FontType.DontChange)
49 {
50 int num2 = 0;
51 switch (fontType)
52 {
53 case FontType.UI:
54 fontSource = fontSet.ui.source;
55 num2 = Mathf.Min(fontSet.ui.sizeMod, SkinManager.LimitFontSizeMod_UI);
56 break;
57 case FontType.Widget:
58 fontSource = fontSet.widget.source;
59 num2 = fontSet.widget.sizeMod;
60 break;
61 case FontType.Chatbox:
62 fontSource = fontSet.chatbox.source;
63 num2 = fontSet.chatbox.sizeMod;
64 break;
65 case FontType.Balloon:
66 fontSource = fontSet.balloon.source;
67 num2 = fontSet.balloon.sizeMod;
68 break;
69 case FontType.Dialog:
70 fontSource = fontSet.dialog.source;
71 num2 = fontSet.dialog.sizeMod;
72 break;
73 case FontType.News:
74 fontSource = fontSet.news.source;
75 num2 = fontSet.news.sizeMod;
76 break;
77 }
78 if (fontSource == null)
79 {
80 fontSource = instance.FontList[0];
81 }
82 base.font = fontSource.font;
83 num += fontSource.sizeFix + num2;
84 }
85 if (base.fontSize != num)
86 {
87 base.fontSize = num;
88 }
89 if (base.resizeTextForBestFit)
90 {
91 base.resizeTextMaxSize = base.fontSize;
92 }
93 if ((bool)button && (bool)button.skinRoot)
94 {
95 SkinAsset_Button skinAsset_Button = button.skinRoot.GetButton();
96 if (fontColor != 0)
97 {
98 this.color = skinAsset_Button.textColor;
99 }
100 Shadow component = GetComponent<Shadow>();
101 if (skinAsset_Button.textShadow)
102 {
103 if ((bool)component)
104 {
105 component.enabled = true;
106 component.effectColor = skinAsset_Button.textShadowColor;
107 }
108 }
109 else if ((bool)component)
110 {
111 component.enabled = false;
112 }
113 return;
114 }
115 if (orgSpacing == 0f)
116 {
117 orgSpacing = base.lineSpacing;
118 }
119 if (fontColor == FontColor.DontChange && orgColor == Color.white)
120 {
121 orgColor = this.color;
122 }
124 SkinColorProfile colors = obj.GetColors(skinType);
125 float num3 = 0.5f;
126 bool flag = fontColor == FontColor.DontChange;
127 float num4 = 1f + (flag ? 0f : colors.contrast) + fontSource.contrast;
128 obj.ApplySkin(this, fontSource);
129 Color color = (flag ? orgColor : colors.GetTextColor(fontColor));
130 if (base.fontStyle == FontStyle.Bold)
131 {
132 if (fontSource.alwaysBold)
133 {
134 base.fontStyle = FontStyle.Normal;
135 }
136 else
137 {
138 color.a *= fontSource.boldAlpha;
139 }
140 }
141 num3 = ((!(color.r + color.g + color.b > 1.5f)) ? (0.5f - (flag ? 0f : colors.strength) - (Lang.isJP ? (fontSource.strength + fontSource.strengthFixJP) : fontSource.strength)) : (0.5f + (flag ? 0f : colors.strength) + (Lang.isJP ? (fontSource.strength + fontSource.strengthFixJP) : fontSource.strength)));
142 color.r = (color.r - 0.5f) * num4 + num3;
143 color.g = (color.g - 0.5f) * num4 + num3;
144 color.b = (color.b - 0.5f) * num4 + num3;
145 this.color = color;
146 base.lineSpacing = orgSpacing * fontSource.lineSpacing;
147 _ = (bool)hyphenation;
148 }
FontColor
Definition: FontColor.cs:2
FontType
Definition: FontType.cs:2
virtual void ApplySkin(UIImage t)
Definition: BaseSkinRoot.cs:16
virtual SkinColorProfile GetColors(SkinType type)
Definition: BaseSkinRoot.cs:11
virtual SkinAsset_Button GetButton()
Definition: BaseSkinRoot.cs:28
float strength
Definition: FontSource.cs:21
bool alwaysBold
Definition: FontSource.cs:15
float contrast
Definition: FontSource.cs:19
float strengthFixJP
Definition: FontSource.cs:23
float lineSpacing
Definition: FontSource.cs:25
float boldAlpha
Definition: FontSource.cs:17
Font font
Definition: FontSource.cs:9
Definition: Lang.cs:6
static bool isJP
Definition: Lang.cs:38
Color GetTextColor(FontColor fontColor)
FontSet fontSet
Definition: SkinManager.cs:74
static SkinRootStatic CurrentSkin
Definition: SkinManager.cs:82
static SkinManager Instance
Definition: SkinManager.cs:78
List< FontSource > FontList
Definition: SkinManager.cs:80
static int LimitFontSizeMod_UI
Definition: SkinManager.cs:43
BaseSkinRoot skinRoot
Definition: UIButton.cs:142
int size
Definition: UIText.cs:19
Color orgColor
Definition: UIText.cs:30
UIButton button
Definition: UIText.cs:23
FontType fontType
Definition: UIText.cs:13
SkinType skinType
Definition: UIText.cs:17
HyphenationJpn hyphenation
Definition: UIText.cs:21
static int globalSizeMod
Definition: UIText.cs:7
float orgSpacing
Definition: UIText.cs:27
BaseSkinRoot skinRoot
Definition: UIText.cs:11
FontColor fontColor
Definition: UIText.cs:15

References FontSource.alwaysBold, BaseSkinRoot.ApplySkin(), SkinManager.FontSet.balloon, FontSource.boldAlpha, button, SkinManager.FontSet.chatbox, Color, FontSource.contrast, SkinColorProfile.contrast, SkinManager.CurrentSkin, SkinManager.FontSet.dialog, FontSource.font, fontColor, SkinManager.FontList, SkinManager.fontSet, fontType, BaseSkinRoot.GetButton(), BaseSkinRoot.GetColors(), SkinColorProfile.GetTextColor(), globalSizeMod, hyphenation, SkinManager.Instance, Lang.isJP, SkinManager.LimitFontSizeMod_UI, FontSource.lineSpacing, SkinManager.FontSet.news, orgColor, orgSpacing, size, SkinManager.FontData.sizeMod, UIButton.skinRoot, skinRoot, skinType, SkinManager.FontData.source, FontSource.strength, SkinColorProfile.strength, FontSource.strengthFixJP, SkinAsset_Button.textColor, SkinAsset_Button.textShadow, SkinAsset_Button.textShadowColor, SkinManager.FontSet.ui, and SkinManager.FontSet.widget.

Referenced by Awake(), SetColor(), SkinManager.SetFonts(), SetSize(), DialogDrama.SetText(), and SetText().

◆ Awake()

override void UIText.Awake ( )
inlineprotected

Definition at line 32 of file UIText.cs.

33 {
34 ApplySkin();
35 base.Awake();
36 }
void ApplySkin()
Definition: UIText.cs:38

References ApplySkin().

◆ OnChangeLanguage()

void UIText.OnChangeLanguage ( )
inline

Definition at line 246 of file UIText.cs.

247 {
248 if (!string.IsNullOrEmpty(lang))
249 {
250 text = Lang.Get(lang);
251 }
252 }
static string Get(string id)
Definition: Lang.cs:91
string lang
Definition: UIText.cs:9

References Lang.Get(), and lang.

◆ OnEnable()

override void UIText.OnEnable ( )
inlineprotected

Definition at line 150 of file UIText.cs.

151 {
152 base.OnEnable();
153 if (!string.IsNullOrEmpty(lang))
154 {
155 m_Text = Lang.Get(lang);
156 }
157 }

References Lang.Get(), and lang.

◆ OnSetText()

void UIText.OnSetText ( )
inlineprivate

Definition at line 219 of file UIText.cs.

220 {
221 if ((bool)typewriter)
222 {
224 }
225 }
void OnSetText()
Definition: Typewriter.cs:38
Typewriter typewriter
Definition: UIText.cs:25

References Typewriter.OnSetText(), and typewriter.

Referenced by SetText().

◆ SetColor()

void UIText.SetColor ( FontColor  c)
inline

Definition at line 234 of file UIText.cs.

235 {
236 fontColor = c;
237 ApplySkin();
238 }

References ApplySkin(), and fontColor.

Referenced by ContentChronicle.OnSwitchContent(), ContentHomeLog.RefreshLog(), and UIHomeInfo.RefreshReport().

◆ SetLang()

void UIText.SetLang ( string  idLang)
inline

Definition at line 240 of file UIText.cs.

241 {
242 lang = idLang;
243 text = Lang.Get(lang);
244 }

References Lang.Get(), and lang.

Referenced by Window.AddBottomButton(), Window.BuildTabs(), UIButtonLR.SelectOption(), UIButtonLR.SetOptions(), UIButtonLR.SetOptions< T >(), and UIHeader.Start().

◆ SetSize()

UIText UIText.SetSize ( int  a)
inline

Definition at line 227 of file UIText.cs.

228 {
229 size = a;
230 ApplySkin();
231 return this;
232 }

References ApplySkin(), and size.

Referenced by ButtonGrid.WriteReqMat(), and Recipe.WriteReqSkill().

◆ SetText() [1/3]

void UIText.SetText ( string  s)
inline

Definition at line 159 of file UIText.cs.

160 {
161 if (s == null)
162 {
163 s = "";
164 }
165 if ((bool)hyphenation)
166 {
168 {
170 {
172 {
173 if (this != null)
174 {
176 hyphenation.RebuildLayoutTo<Canvas>();
177 }
178 });
179 }
180 else
181 {
183 }
184 }
185 else
186 {
187 base.horizontalOverflow = HorizontalWrapMode.Wrap;
188 text = s;
189 }
190 }
191 else
192 {
193 text = s;
194 }
195 lang = null;
196 OnSetText();
197 }
static BaseCore Instance
Definition: BaseCore.cs:11
List< Action > actionsLateUpdate
Definition: BaseCore.cs:29
void _SetText(string str, bool useHypenation)
bool hyphenation
Definition: LangSetting.cs:38
static LangSetting setting
Definition: Lang.cs:54
void OnSetText()
Definition: UIText.cs:219

References HyphenationJpn._SetText(), BaseCore.actionsLateUpdate, HyphenationJpn.evaluateLate, LangSetting.hyphenation, hyphenation, BaseCore.Instance, lang, OnSetText(), and Lang.setting.

Referenced by Dialog._Confetti(), UIAutoTurn._Update(), Element._WriteNote(), UICurrency.Add(), WidgetInspector.AddButton(), WidgetInspector.AddLog(), WindowChara.AddNeeds(), LayerFaith.AddReligion(), WindowChara.AddStatus(), UINote.AddText(), ActionHint.AddToggle(), UINote.AddTopic(), MsgBlock.Append(), MsgLine.Append(), Dialog.Choice(), ItemGachaResult.Confirm(), Dialog.CreateNarration(), UIItem.Hyphenate(), BuildMenu.Init(), DramaEventEndRoll.Init(), Dialog.Keymap(), Dialog.List< TValue >(), UICharaMaker.ListModes(), Dialog.Ok(), UIQueue.OnAdd(), LayerNewspaper.OnClickPage(), LayerMod.OnInit(), LayerWorldSetting.OnInit(), NotificationBuff.OnRefresh(), ContentFaction.OnSwitchContent(), ContentKeyItem.OnSwitchContent(), ContentQuest.OnSwitchContent(), LayerConfig.OnSwitchContent(), LayerQuestBoard.OnSwitchContent(), InvOwner.OnWriteNote(), WidgetCurrentTool.RebuildSlots(), ButtonElement.Refresh(), ButtonResourceTrack.Refresh(), ButtonRoster.Refresh(), ContentGallery.Refresh(), ItemCulture.Refresh(), ItemQuestTracker.Refresh(), LayerTravel.Refresh(), LayerWorldSetting.Refresh(), PartialMapMenu.Refresh(), UICharaMaker.Refresh(), UIInspector.Refresh(), UIRecipeInfo.Refresh(), WindowCharaMini.Refresh(), UIRecipeInfo.RefreshBalance(), UIMagicChest.RefreshBottom(), LayerEditPortrait.RefreshButtons(), LayerNewspaper.RefreshChat(), LayerDragGrid.RefreshCost(), WindowChara.RefreshEquipment(), ContentCodex.RefreshInfo(), ContentHomeReport.RefreshInfo(), UIHomeInfo.RefreshInfo(), LayerLoadGame.RefreshInfo(), DropdownRecipe.RefreshLabel(), ContentCodex.RefreshList(), LayerEditPortrait.RefreshList(), LayerLoadGame.RefreshList(), UIInventory.RefreshList(), UIRecipeInfo.RefreshList(), LayerNewspaper.RefreshNews(), WindowChara.RefreshNote(), ContentPolicy.RefreshPolicyIcons(), LayerPolicy.RefreshPolicyIcons(), ContentPolicy.RefreshPolicyList(), LayerPolicy.RefreshPolicyList(), LayerQuestBoard.RefreshQuest(), LayerQuestBoard.RefreshRanking(), ContentConfigOther.RefreshRewardCode(), LayerGlobalMap.RefreshSummary(), LayerWorldSetting.RefreshTemplate(), UIBook.RefreshTopics(), LayerNewspaper.RefreshVote(), WidgetSearch.RefreshWords(), ContentKeyItem.SelectItem(), ContentQuest.SelectQuest(), ButtonAbility.SetAct(), UIRecipeInfo.SetArea(), CharaBody.SetBodyIndexText(), Window.SetCaption(), ButtonGeneral.SetCard(), ItemGeneral.SetChara(), UICharaMaker.SetChara(), ItemGachaResult.SetChara(), ButtonChara.SetChara(), ButtonElement.SetGrid(), ItemGeneral.SetMainText(), Trait.SetMainText(), TraitAbility.SetMainText(), TraitToolRange.SetMainText(), ItemQuest.SetQuest(), ItemGeneral.SetSubText(), ItemGeneral.SetSubText2(), BaseSticky.SetText(), DialogDrama.SetText(), PopfabText.SetText(), UIHeader.SetText(), ActionHint.SetText(), SetText(), PopItemText.SetText(), BaseStats.SetText(), Recipe.SetTextDifficulty(), FactionRelation.SetTextHostility(), Religion.SetTextRelation(), UIItem.SetTopic(), TerrainMenu.Show(), WidgetPopup.Show(), LayerShippingResult.Show(), UIBook.Show(), LayerInteraction.ShowPage(), Thing.ShowSplitMenu2(), WidgetInspector.SwitchPage(), Dialog.TryWarn(), Chara.WriteNote(), Thing.WriteNote(), and Dialog.YesNo().

◆ SetText() [2/3]

void UIText.SetText ( string  s,
Color  c 
)
inline

Definition at line 199 of file UIText.cs.

200 {
201 SetText(s);
202 fontColor = FontColor.DontChange;
203 orgColor = c;
204 color = c;
205 OnSetText();
206 }
void SetText(string s)
Definition: UIText.cs:159

References fontColor, OnSetText(), orgColor, and SetText().

◆ SetText() [3/3]

void UIText.SetText ( string  s,
FontColor  c 
)
inline

Definition at line 208 of file UIText.cs.

209 {
210 SetText(s);
211 if (c != FontColor.Ignore)
212 {
213 fontColor = c;
214 ApplySkin();
215 }
216 OnSetText();
217 }

References ApplySkin(), fontColor, OnSetText(), and SetText().

Member Data Documentation

◆ button

UIButton UIText.button

Definition at line 23 of file UIText.cs.

Referenced by ApplySkin().

◆ fontColor

FontColor UIText.fontColor

Definition at line 15 of file UIText.cs.

Referenced by ApplySkin(), SetColor(), and SetText().

◆ fontType

FontType UIText.fontType

Definition at line 13 of file UIText.cs.

Referenced by ApplySkin().

◆ globalSizeMod

int UIText.globalSizeMod
static

Definition at line 7 of file UIText.cs.

Referenced by ApplySkin().

◆ hyphenation

HyphenationJpn UIText.hyphenation

Definition at line 21 of file UIText.cs.

Referenced by ApplySkin(), and SetText().

◆ lang

◆ orgColor

Color UIText.orgColor = Color.white

Definition at line 30 of file UIText.cs.

Referenced by ApplySkin(), and SetText().

◆ orgSpacing

float UIText.orgSpacing

Definition at line 27 of file UIText.cs.

Referenced by ApplySkin().

◆ size

int UIText.size

Definition at line 19 of file UIText.cs.

Referenced by ApplySkin(), HUD.SetDragImage(), and SetSize().

◆ skinRoot

BaseSkinRoot UIText.skinRoot

Definition at line 11 of file UIText.cs.

Referenced by ApplySkin().

◆ skinType

SkinType UIText.skinType

Definition at line 17 of file UIText.cs.

Referenced by ApplySkin().

◆ typewriter

Typewriter UIText.typewriter

Definition at line 25 of file UIText.cs.

Referenced by OnSetText(), and DramaEventTalk.Play().


The documentation for this class was generated from the following file: