Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
UINote Class Reference
Inheritance diagram for UINote:
UIContent Content EContent UIContentView ContentHomeReport ContentChronicle ContentCodex ContentConfig ContentFaction ContentGallery ContentHallOfFame ContentHomeLog ContentHomeRanking ContentKeyItem ContentPolicy ContentPopulation ContentQuest ContentRanking ContentStatistics ContentTop

Public Member Functions

void Clear ()
 
void Build ()
 
void Space (int sizeY=0, int sizeX=1)
 
UINote AddNote (string id)
 
UIItem AddHeader (string text, Sprite sprite=null)
 
UIItem AddHeaderCard (string text, Sprite sprite=null)
 
UIItem AddHeaderTopic (string text, Sprite sprite=null)
 
UIItem AddHeader (string id, string text, Sprite sprite=null)
 
UIItem AddText (string text, FontColor color=FontColor.DontChange)
 
UIItem AddText (string id, string text, FontColor color=FontColor.DontChange)
 
UIItem AddText (string id, string text, Color color)
 
UIItem AddItem (string id)
 
UIItem AddTopic (string id, string text, string value=null)
 
UIItem AddTopic (string text, string value=null)
 
void AddImage (Sprite sprite)
 
void AddImage (string idFile)
 
UIButton AddButton (string text, Action onClick)
 
UIButton AddButtonLink (string text, string url)
 
UIDropdown AddDropdown (string id="DropdownDefault")
 
UIButton AddToggle (string idLang="", bool isOn=false, Action< bool > action=null)
 
Transform AddPrefab (string path)
 
AddExtra< T > (string path)
 

Public Attributes

RectTransform target
 
UINoteProfile prof
 
SkinType skinType
 
string idDefaultText
 
LayoutGroup layout
 
RectTransform cur
 
bool extraRebuild
 

Private Member Functions

void Awake ()
 
UIItem Load (string path)
 
Load< T > (string path)
 

Private Attributes

SkinRootStatic oldTempSkin
 

Detailed Description

Definition at line 5 of file UINote.cs.

Member Function Documentation

◆ AddButton()

UIButton UINote.AddButton ( string  text,
Action  onClick 
)
inline

Definition at line 182 of file UINote.cs.

183 {
184 UIButton uIButton = Load<UIButton>("UI/Element/Button/ButtonNote");
185 uIButton.mainText.text = text;
186 uIButton.onClick.AddListener(delegate
187 {
188 onClick();
189 });
190 return uIButton;
191 }

Referenced by WindowCharaMini.Refresh().

◆ AddButtonLink()

UIButton UINote.AddButtonLink ( string  text,
string  url 
)
inline

Definition at line 193 of file UINote.cs.

194 {
195 UIButton button = Load<UIItem>("UI/Element/Item/ItemNoteLink").button1;
196 button.mainText.text = text;
197 button.onClick.AddListener(delegate
198 {
199 SE.Click();
200 Application.OpenURL(url);
201 });
202 return button;
203 }

Referenced by UIBook.Page.BuildNote().

◆ AddDropdown()

UIDropdown UINote.AddDropdown ( string  id = "DropdownDefault")
inline

Definition at line 205 of file UINote.cs.

206 {
207 return Load<UIDropdown>("UI/Element/Other/" + id);
208 }

◆ AddExtra< T >()

T UINote.AddExtra< T > ( string  path)
inline
Type Constraints
T :Component 

Definition at line 223 of file UINote.cs.

223 : Component
224 {
225 return Util.Instantiate<T>("UI/Element/Note/Extra/" + path, this);
226 }
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References Util.

◆ AddHeader() [1/2]

UIItem UINote.AddHeader ( string  id,
string  text,
Sprite  sprite = null 
)
inline

Definition at line 94 of file UINote.cs.

95 {
96 UIItem uIItem = Load("UI/Element/Header/" + id);
97 uIItem.text1.text = text.lang();
98 if ((bool)uIItem.image1)
99 {
100 if ((bool)sprite)
101 {
102 uIItem.image1.sprite = sprite;
103 uIItem.image1.SetNativeSize();
104 }
105 else
106 {
107 uIItem.image1.SetActive(enable: false);
108 }
109 }
110 return uIItem;
111 }
Definition: UIItem.cs:5
Image image1
Definition: UIItem.cs:14
UIItem Load(string path)
Definition: UINote.cs:228

References UIItem.image1, and Load().

◆ AddHeader() [2/2]

◆ AddHeaderCard()

◆ AddHeaderTopic()

UIItem UINote.AddHeaderTopic ( string  text,
Sprite  sprite = null 
)
inline

◆ AddImage() [1/2]

void UINote.AddImage ( Sprite  sprite)
inline

Definition at line 158 of file UINote.cs.

159 {
160 Image image = Load("UI/Element/Deco/ImageNote").image1;
161 image.sprite = sprite;
162 image.SetNativeSize();
163 image.transform.parent.Rect().sizeDelta = image.Rect().sizeDelta;
164 if (sprite == null)
165 {
166 image.transform.parent.SetActive(enable: false);
167 }
168 }

References UIItem.image1, and Load().

Referenced by UIBook.Page.BuildNote().

◆ AddImage() [2/2]

void UINote.AddImage ( string  idFile)
inline

Definition at line 170 of file UINote.cs.

171 {
172 Image image = Load("UI/Element/Deco/ImageNote").image1;
173 Sprite sprite2 = (image.sprite = Resources.Load<Sprite>("Media/Graphics/Image/" + idFile));
174 image.SetNativeSize();
175 image.transform.parent.Rect().sizeDelta = image.Rect().sizeDelta;
176 if (sprite2 == null)
177 {
178 image.transform.parent.SetActive(enable: false);
179 }
180 }

References UIItem.image1, and Load().

◆ AddItem()

UIItem UINote.AddItem ( string  id)
inline

Definition at line 139 of file UINote.cs.

140 {
141 return Load("UI/Element/Item/" + id);
142 }

References Load().

Referenced by Element._WriteNote(), WindowCharaMini.Refresh(), and WindowChara.RefreshNote().

◆ AddNote()

UINote UINote.AddNote ( string  id)
inline

Definition at line 72 of file UINote.cs.

73 {
74 UINote componentInChildren = Load<Transform>("UI/Element/Note/" + id).gameObject.GetComponentInChildren<UINote>();
75 extraRebuild = true;
76 return componentInChildren;
77 }
Definition: UINote.cs:6
bool extraRebuild
Definition: UINote.cs:21

References extraRebuild.

Referenced by UIBook.Page.BuildNote().

◆ AddPrefab()

Transform UINote.AddPrefab ( string  path)
inline

Definition at line 218 of file UINote.cs.

219 {
220 return Util.Instantiate(path, this);
221 }

References Util.

Referenced by LayerGacha.PlayGacha().

◆ AddText() [1/3]

UIItem UINote.AddText ( string  id,
string  text,
Color  color 
)
inline

Definition at line 132 of file UINote.cs.

133 {
134 UIItem uIItem = Load("UI/Element/Text/" + id.IsEmpty(idDefaultText.IsEmpty("NoteText")));
135 uIItem.text1.SetText(text.lang(), color);
136 return uIItem;
137 }
UIText text1
Definition: UIItem.cs:6
string idDefaultText
Definition: UINote.cs:13
void SetText(string s)
Definition: UIText.cs:159

References idDefaultText, Load(), UIText.SetText(), and UIItem.text1.

◆ AddText() [2/3]

UIItem UINote.AddText ( string  id,
string  text,
FontColor  color = FontColor::DontChange 
)
inline

Definition at line 118 of file UINote.cs.

119 {
120 UIItem uIItem = Load("UI/Element/Text/" + id.IsEmpty(idDefaultText.IsEmpty("NoteText")));
121 if (color != 0)
122 {
123 uIItem.text1.SetText(text.lang(), color);
124 }
125 else
126 {
127 uIItem.text1.SetText(text.lang());
128 }
129 return uIItem;
130 }

References idDefaultText, Load(), UIText.SetText(), and UIItem.text1.

◆ AddText() [3/3]

UIItem UINote.AddText ( string  text,
FontColor  color = FontColor::DontChange 
)
inline

Definition at line 113 of file UINote.cs.

114 {
115 return AddText(null, text, color);
116 }
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113

References AddText().

Referenced by Element._WriteNote(), Element.BonusInfo.AddFix(), Element.BonusInfo.AddText(), AddText(), UIBook.Page.BuildNote(), Dialog.InputName(), UICharaMaker.ListJob(), UICharaMaker.ListRace(), Policy.ModHappiness(), ActionMode.OnShowExtraHint(), InvOwnerEquip.OnWriteNote(), InvOwnerGene.OnWriteNote(), LayerGacha.PlayGacha(), Dialog.Recipe(), UICharaMaker.Refresh(), UIRecipeInfo.Refresh(), WindowCharaMini.Refresh(), WindowCharaMini.RefreshEquipment(), WindowChara.RefreshEquipment(), UIHomeInfo.RefreshInfo(), LayerLoadGame.RefreshInfo(), WindowChara.RefreshNote(), UICardInfo.SetBlock(), ButtonGrid.SetCard(), ButtonGrid.SetCraftRecipe(), UICardInfo.SetFloor(), ButtonGrid.SetIngredient(), UICardInfo.SetLiquid(), UICardInfo.SetObj(), UICardInfo.SetRecipe(), UIFactionInfo.SetReligion(), UIFactionInfo.SetZone(), UIZoneInfo.SetZone(), LayerInfo.SetZone(), DNA.WriteNote(), Happiness.WriteNote(), HomeResourceSkill.WriteNote(), HomeResourceWorth.WriteNote(), Policy.WriteNote(), ResearchPlan.WriteNote(), SourceJob.Row.WriteNote(), UndoManager.WriteNote(), BaseStats.WriteNote(), BlockInfo.WriteNote(), Chara.WriteNote(), EloPos.WriteNote(), ObjInfo.WriteNote(), Thing.WriteNote(), TraitGene.WriteNote(), TraitItem.WriteNote(), TraitLetterOfWill.WriteNote(), TraitRecipe.WriteNote(), TraitSeed.WriteNote(), UIMapSelector.WriteNote(), Feat.WritePurchaseReq(), ButtonGrid.WriteReqMat(), and Recipe.WriteReqSkill().

◆ AddToggle()

UIButton UINote.AddToggle ( string  idLang = "",
bool  isOn = false,
Action< bool >  action = null 
)
inline

Definition at line 210 of file UINote.cs.

211 {
212 UIButton uIButton = Load<UIButton>("UI/Element/Button/ButtonToggle");
213 uIButton.SetToggle(isOn, action);
214 uIButton.mainText.text = idLang.lang().ToTitleCase();
215 return uIButton;
216 }
void SetToggle(bool isOn, Action< bool > onToggle=null)
Definition: UIButton.cs:341

References UIButton.SetToggle().

◆ AddTopic() [1/2]

UIItem UINote.AddTopic ( string  id,
string  text,
string  value = null 
)
inline

◆ AddTopic() [2/2]

UIItem UINote.AddTopic ( string  text,
string  value = null 
)
inline

Definition at line 153 of file UINote.cs.

154 {
155 return AddTopic("TopicDefault", text, value);
156 }
UIItem AddTopic(string id, string text, string value=null)
Definition: UINote.cs:144

References AddTopic().

◆ Awake()

void UINote.Awake ( )
inlineprivate

Definition at line 25 of file UINote.cs.

26 {
27 if (!target)
28 {
29 target = this.Rect();
30 }
31 cur = target;
32 layout = GetComponent<LayoutGroup>();
33 }
LayoutGroup layout
Definition: UINote.cs:16
RectTransform cur
Definition: UINote.cs:19
RectTransform target
Definition: UINote.cs:7

References cur, layout, and target.

◆ Build()

void UINote.Build ( )
inline

Definition at line 49 of file UINote.cs.

50 {
51 if (extraRebuild)
52 {
53 this.RebuildLayoutTo<Layer>();
54 }
55 this.RebuildLayout(recursive: true);
56 this.RebuildLayoutTo<Layer>();
57 this.RebuildLayoutTo<UIContent>();
58 this.RebuildLayoutTo<UIContent>();
59 SkinManager.tempSkin = oldTempSkin;
60 }
SkinRootStatic oldTempSkin
Definition: UINote.cs:23

References extraRebuild, and oldTempSkin.

Referenced by UICardInfo.Build(), UIFactionInfo.Clear(), UIRecipeInfo.Clear(), UICharaMaker.ListJob(), UICharaMaker.ListRace(), BaseListPeople.OnInstantiate(), LayerGacha.PlayGacha(), ExtraHint.Refresh(), UICharaMaker.Refresh(), UIRecipeInfo.Refresh(), WindowCharaMini.Refresh(), WindowCharaMini.RefreshEquipment(), WindowChara.RefreshEquipment(), ContentCodex.RefreshInfo(), UIHomeInfo.RefreshInfo(), LayerLoadGame.RefreshInfo(), UIHomeInfo.RefreshReport(), UIRecipeInfo.SetArea(), GridItemRecipe.SetButton(), ButtonGrid.SetCraftRecipe(), UIFactionInfo.SetFaction(), ButtonGrid.SetIngredient(), UIFactionInfo.SetReligion(), UIFactionInfo.SetZone(), UIZoneInfo.SetZone(), LayerInfo.SetZone(), BaseHomeResource.WriteNote(), Happiness.WriteNote(), HomeResourceSkill.WriteNote(), HomeResourceWorth.WriteNote(), Recipe.WriteNote(), RecipeCard.WriteNote(), ResearchPlan.WriteNote(), SourceJob.Row.WriteNote(), UndoManager.WriteNote(), BaseStats.WriteNote(), BaseArea.WriteNote(), BlockInfo.WriteNote(), Chara.WriteNote(), EloPos.WriteNote(), ObjInfo.WriteNote(), TaskPoint.WriteNote(), Element.WriteNote(), UIMapSelector.WriteNote(), and Element.WriteNoteWithRef().

◆ Clear()

void UINote.Clear ( )
inline

Definition at line 35 of file UINote.cs.

36 {
37 if (!layout)
38 {
39 layout = GetComponent<LayoutGroup>();
40 }
41 layout.DestroyChildren(destroyInactive: true);
43 if (skinType != 0)
44 {
45 SkinManager.tempSkin = SkinManager.CurrentSkin.GetSkin(skinType);
46 }
47 }
static SkinRootStatic CurrentSkin
Definition: SkinManager.cs:82
static SkinRootStatic tempSkin
Definition: SkinManager.cs:63
SkinRootStatic GetSkin(SkinType type)
SkinType skinType
Definition: UINote.cs:11

References SkinManager.CurrentSkin, SkinRootStatic.GetSkin(), layout, oldTempSkin, skinType, and SkinManager.tempSkin.

Referenced by UIFactionInfo.Clear(), UIRecipeInfo.Clear(), UICharaMaker.ListJob(), UICharaMaker.ListRace(), BaseListPeople.OnInstantiate(), InvOwnerEquip.OnWriteNote(), ExtraHint.Refresh(), UICharaMaker.Refresh(), WindowCharaMini.Refresh(), WindowCharaMini.RefreshEquipment(), WindowChara.RefreshEquipment(), ContentCodex.RefreshInfo(), UIHomeInfo.RefreshInfo(), LayerLoadGame.RefreshInfo(), WindowChara.RefreshNote(), UIHomeInfo.RefreshReport(), WindowChara.RefreshSkill(), UIRecipeInfo.SetArea(), GridItemRecipe.SetButton(), ButtonGrid.SetCraftRecipe(), UIFactionInfo.SetFaction(), ButtonGrid.SetIngredient(), UICardInfo.SetRecipe(), UIFactionInfo.SetReligion(), UIFactionInfo.SetZone(), UIZoneInfo.SetZone(), LayerInfo.SetZone(), UIBook.Show(), BaseListPeople.WriteHobbies(), BaseHomeResource.WriteNote(), FortuneRollData.WriteNote(), Happiness.WriteNote(), HomeResourceSkill.WriteNote(), HomeResourceWorth.WriteNote(), Recipe.WriteNote(), RecipeCard.WriteNote(), ResearchPlan.WriteNote(), SourceJob.Row.WriteNote(), UndoManager.WriteNote(), BaseStats.WriteNote(), BaseArea.WriteNote(), BlockInfo.WriteNote(), Chara.WriteNote(), EloPos.WriteNote(), ObjInfo.WriteNote(), TaskPoint.WriteNote(), Thing.WriteNote(), Element.WriteNote(), UIMapSelector.WriteNote(), and Element.WriteNoteWithRef().

◆ Load()

UIItem UINote.Load ( string  path)
inlineprivate

Definition at line 228 of file UINote.cs.

229 {
230 return Load<UIItem>(path);
231 }

Referenced by AddHeader(), AddImage(), AddItem(), AddText(), and AddTopic().

◆ Load< T >()

T UINote.Load< T > ( string  path)
inlineprivate
Type Constraints
T :Component 

Definition at line 233 of file UINote.cs.

233 : Component
234 {
235 return Util.Instantiate<T>(path, layout);
236 }

References layout, and Util.

◆ Space()

Member Data Documentation

◆ cur

RectTransform UINote.cur

Definition at line 19 of file UINote.cs.

Referenced by Awake().

◆ extraRebuild

bool UINote.extraRebuild

Definition at line 21 of file UINote.cs.

Referenced by AddNote(), and Build().

◆ idDefaultText

string UINote.idDefaultText

Definition at line 13 of file UINote.cs.

Referenced by AddText().

◆ layout

LayoutGroup UINote.layout

Definition at line 16 of file UINote.cs.

Referenced by Awake(), Clear(), and Load< T >().

◆ oldTempSkin

SkinRootStatic UINote.oldTempSkin
private

Definition at line 23 of file UINote.cs.

Referenced by Build(), and Clear().

◆ prof

UINoteProfile UINote.prof

Definition at line 9 of file UINote.cs.

Referenced by Space().

◆ skinType

SkinType UINote.skinType

Definition at line 11 of file UINote.cs.

Referenced by Clear().

◆ target

RectTransform UINote.target

Definition at line 7 of file UINote.cs.

Referenced by Awake().


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