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

Classes

class  CustomItem
 

Public Member Functions

override void OnInit ()
 
override void OnUpdateInput ()
 
LayerList SetMold (int index)
 
LayerList SetSize (float w=450f, float h=-1f)
 
LayerList SetPivot (float x, float y=-1f)
 
void RefreshSize ()
 
LayerList SetList< TValue > (ICollection< TValue > items, Func< TValue, string > getString, Action< int, string > onSelect, bool autoClose=true)
 
LayerList SetStringList (Func< ICollection< string > > getList, Action< int, string > onSelect, bool autoClose=true)
 
LayerList SetList2< TValue > (ICollection< TValue > _list, Func< TValue, string > getText, Action< TValue, ItemGeneral > onClick, Action< TValue, ItemGeneral > onInstantiate, bool autoClose=true)
 
LayerList SetListCheck< TValue > (ICollection< TValue > _list, Func< TValue, string > getText, Action< TValue, ItemGeneral > onClick, Action< List< UIList.ButtonPair > > onValidate)
 
LayerList EnableReroll ()
 
LayerList ManualList (Action< UIList, LayerList > onInit)
 
LayerList SetHeader (string lang)
 
LayerList SetNoSound ()
 
void SetHighlightTarget (UIButton _target)
 
override void OnKill ()
 
void Add (string lang, Action< int > action)
 
void Show (bool autoClose=true)
 
- Public Member Functions inherited from ELayer
override void OnBeforeAddLayer ()
 
void InitInspector ()
 
sealed override void Init ()
 
override void OnAfterAddLayer ()
 
void TryShowHelp ()
 
void AddLayerToUI (string id)
 
void TryShowHint (string _langHint=null)
 
void TalkHomeMemeber (string id)
 
void TalkMaid (string id)
 
override void OnRightClick ()
 
- Public Member Functions inherited from Layer
virtual string GetTextHeader (Window window)
 
virtual bool HeaderIsListOf (int id)
 
virtual void Init ()
 
virtual void OnInit ()
 
virtual void OnAfterInit ()
 
virtual void ApplySkin ()
 
void ShowScreenLock (string id)
 
void UpdateInput ()
 
virtual void OnUpdateInput ()
 
virtual void OnRightClick ()
 
virtual bool OnBack ()
 
virtual void OnChangeLayer ()
 
virtual void OnCreate ()
 
void _AddLayer (string id)
 
Layer AddLayer (string id)
 
AddLayer< T > ()
 
AddLayer< T > (string id)
 
AddLayerDontCloseOthers< T > ()
 
Layer AddLayerDontCloseOthers (Layer l)
 
GetOrAddLayer< T > ()
 
virtual void OnBeforeAddLayer ()
 
virtual void OnAfterAddLayer ()
 
Layer AddLayer (Layer l)
 
void ToggleLayer (string id)
 
ToggleLayer< T > (string id=null)
 
void WaitAndClose ()
 
void OnClickClose ()
 
virtual void Close ()
 
void CloseLayers ()
 
void RemoveLayers (bool removeImportant=false)
 
bool RemoveLayer< T > ()
 
void RemoveLayer (Layer l)
 
virtual void OnKill ()
 
Layer SetOnKill (Action action)
 
void DisableClose ()
 
void Delay (float duration=0.05f)
 
Layer SetDelay (float d)
 
Layer GetLayer (string id)
 
GetLayer< T > (bool fromTop=false)
 
Layer GetTopLayer ()
 
void SwitchContent (int idWindow, int i)
 
virtual void OnSwitchContent (Window window)
 
Layer SetTitles (string langList, string idHeaderRow=null)
 
bool IsBlockWidgetClick ()
 
bool IsHideHud ()
 
bool IsAllowGeneralInput ()
 
bool IsUseBlur ()
 
bool IsPointerOnLayer ()
 
void ApplySkin ()
 

Public Attributes

UIList list
 
UIButton buttonReroll
 
UIButton highlightTarget
 
UIItem moldItemCheck
 
Transform moldItemGeneral
 
Transform moldItemDetail
 
bool useItem
 
bool autoX
 
bool autoY
 
bool noSound
 
UIScrollView scroll
 
Vector2 sizeMin
 
Vector2 sizeMax
 
Vector2 paddings
 
List< CustomItemcustomItems = new List<CustomItem>()
 
- Public Attributes inherited from Layer
Option option
 
UnityEvent onKill
 
Anime animeIn
 
Anime animeOut
 
bool closeOthers
 
bool defaultActionMode = true
 
Button screenLock
 
Layer parent
 
string idLayer
 
List< Layerlayers = new List<Layer>()
 
Vector2 lastParentPos
 
List< Windowwindows = new List<Window>()
 
string langHint
 

Protected Member Functions

override void Awake ()
 
- Protected Member Functions inherited from ELayer
sealed override void _Close ()
 
sealed override void Kill ()
 
virtual void Awake ()
 
virtual void _Close ()
 
virtual void Kill ()
 

Private Member Functions

void Update ()
 
void LateUpdate ()
 

Private Attributes

bool initialized
 

Additional Inherited Members

- Static Public Member Functions inherited from ELayer
static int rnd (int a)
 
- Static Public Member Functions inherited from Layer
static T Create< T > ()
 
static T Create< T > (string path)
 
static Layer Create (string path)
 
- Static Public Attributes inherited from Layer
static int skipInput
 
static bool closeOnRightClick
 
static bool rightClicked
 
static bool cancelKeyDown
 
static bool ignoreSounds
 
static Transform blurStopInstance
 
static string[] searchPath = new string[3] { "Layer", "Layer/Dialog", "Layer/LayerHome" }
 
- Protected Attributes inherited from Layer
RectTransform _rect
 
bool isDestroyed
 
- Properties inherited from ELayer
static Core core [get]
 
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static FactionBranch Branch [get]
 
static Faction Home [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static CoreConfig config [get]
 
static GameSetting setting [get]
 
static ColorProfile Colors [get]
 
static SourceManager sources [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 
bool IsFloat [get]
 
virtual string IdHelp [get]
 
- Properties inherited from Layer
Layer TopLayer [get]
 
string uid [get]
 
virtual RectTransform rectLayers [get]
 
virtual bool blockWidgetClick [get]
 

Detailed Description

Definition at line 5 of file LayerList.cs.

Member Function Documentation

◆ Add()

void LayerList.Add ( string  lang,
Action< int >  action 
)
inline

Definition at line 340 of file LayerList.cs.

341 {
342 if (!initialized)
343 {
344 initialized = true;
345 }
346 customItems.Add(new CustomItem
347 {
348 lang = lang,
349 action = action,
350 id = customItems.Count
351 });
352 }
List< CustomItem > customItems
Definition: LayerList.cs:46
bool initialized
Definition: LayerList.cs:44

References customItems, and initialized.

Referenced by TraitMapBoard.TrySetAct().

◆ Awake()

override void LayerList.Awake ( )
inlineprotectedvirtual

Reimplemented from Layer.

Definition at line 48 of file LayerList.cs.

49 {
50 base.Awake();
51 if ((bool)buttonReroll)
52 {
53 buttonReroll.SetActive(enable: false);
54 }
55 }
UIButton buttonReroll
Definition: LayerList.cs:18

References buttonReroll.

◆ EnableReroll()

LayerList LayerList.EnableReroll ( )
inline

Definition at line 259 of file LayerList.cs.

260 {
261 buttonReroll.SetActive(enable: true);
262 buttonReroll.onClick.RemoveAllListeners();
263 buttonReroll.onClick.AddListener(delegate
264 {
265 list.List();
266 });
267 list.RebuildLayout(recursive: true);
268 RefreshSize();
269 return this;
270 }
UIList list
Definition: LayerList.cs:16
void RefreshSize()
Definition: LayerList.cs:117
override void List()
Definition: UIList.cs:717

References buttonReroll, list, UIList.List(), and RefreshSize().

Referenced by UICharaMaker.ListAlias(), and TraitFactionBoard.TrySetAct().

◆ LateUpdate()

void LayerList.LateUpdate ( )
inlineprivate

Definition at line 308 of file LayerList.cs.

309 {
310 if ((bool)highlightTarget)
311 {
313 }
314 }
UIButton highlightTarget
Definition: LayerList.cs:20
void DoHighlightTransition(bool instant=false)
Definition: UIButton.cs:526

References UIButton.DoHighlightTransition(), and highlightTarget.

◆ ManualList()

LayerList LayerList.ManualList ( Action< UIList, LayerList onInit)
inline

Definition at line 272 of file LayerList.cs.

273 {
274 buttonReroll.SetActive(enable: false);
275 list.moldItem = moldItemGeneral;
276 onInit(list, this);
277 list.List();
278 RefreshSize();
279 return this;
280 }
Transform moldItemGeneral
Definition: LayerList.cs:24

References buttonReroll, list, UIList.List(), moldItemGeneral, and RefreshSize().

◆ OnInit()

override void LayerList.OnInit ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 57 of file LayerList.cs.

58 {
59 if ((bool)highlightTarget)
60 {
62 }
64 }
Definition: EInput.cs:8
static void WaitReleaseKey()
Definition: EInput.cs:650

References UIButton.DoHighlightTransition(), highlightTarget, and EInput.WaitReleaseKey().

◆ OnKill()

override void LayerList.OnKill ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 316 of file LayerList.cs.

317 {
318 if ((bool)highlightTarget)
319 {
321 {
322 if ((bool)highlightTarget)
323 {
325 {
326 highlightTarget.DoNormalTransition();
327 }
328 else
329 {
330 highlightTarget.DoHighlightTransition();
331 }
332 }
333 });
334 }
335 TooltipManager.Instance.HideTooltips(immediate: true);
336 TooltipManager.Instance.disableHide = null;
338 }
void WaitForEndOfFrame(Action action)
Definition: BaseCore.cs:61
Definition: ELayer.cs:4
static Core core
Definition: ELayer.cs:7
static bool IsPointerOver(Component c)
static TooltipManager Instance
void HideTooltips(bool immediate=false)

References ELayer.core, TooltipManager.HideTooltips(), highlightTarget, TooltipManager.Instance, InputModuleEX.IsPointerOver(), BaseCore.WaitForEndOfFrame(), and EInput.WaitReleaseKey().

◆ OnUpdateInput()

override void LayerList.OnUpdateInput ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 66 of file LayerList.cs.

67 {
68 foreach (UIList.ButtonPair button in list.buttons)
69 {
70 ItemGeneral itemGeneral = button.component as ItemGeneral;
71 UIButton uIButton = (itemGeneral ? itemGeneral.button1 : (button.component as UIButton));
72 if ((bool)uIButton && uIButton.interactable && !EInput.waitReleaseAnyKey && (bool)uIButton.keyText && !uIButton.keyText.text.IsEmpty() && uIButton.keyText.text == Input.inputString)
73 {
74 SE.ClickOk();
75 uIButton.onClick.Invoke();
76 return;
77 }
78 }
79 base.OnUpdateInput();
80 }
UIText keyText
Definition: UIButton.cs:108
Definition: UIList.cs:9
List< ButtonPair > buttons
Definition: UIList.cs:244

References UIList.buttons, UIButton.keyText, and list.

◆ RefreshSize()

void LayerList.RefreshSize ( )
inline

Definition at line 117 of file LayerList.cs.

118 {
119 RectTransform rectTransform = windows[0].Rect();
120 float x = rectTransform.sizeDelta.x;
121 float y = rectTransform.sizeDelta.y;
122 this.RebuildLayout(recursive: true);
123 Vector2 sizeDelta = scroll.content.Rect().sizeDelta;
124 if (autoX)
125 {
126 x = Mathf.Clamp(sizeDelta.x, sizeMin.x, sizeMax.x) + paddings.x;
127 }
128 if (autoY)
129 {
130 y = Mathf.Clamp(sizeDelta.y, sizeMin.y, sizeMax.y) + paddings.y;
131 }
132 rectTransform.sizeDelta = new Vector2(x, y);
133 }
UIScrollView scroll
Definition: LayerList.cs:36
Vector2 sizeMax
Definition: LayerList.cs:40
bool autoY
Definition: LayerList.cs:32
Vector2 paddings
Definition: LayerList.cs:42
bool autoX
Definition: LayerList.cs:30
Vector2 sizeMin
Definition: LayerList.cs:38
List< Window > windows
Definition: Layer.cs:116

References autoX, autoY, paddings, scroll, sizeMax, sizeMin, and Layer.windows.

Referenced by EnableReroll(), ManualList(), SetList2< TValue >(), SetListCheck< TValue >(), SetStringList(), and Show().

◆ SetHeader()

LayerList LayerList.SetHeader ( string  lang)
inline

Definition at line 282 of file LayerList.cs.

283 {
284 windows[0].SetCaption(lang.lang());
285 return this;
286 }

References Layer.windows.

◆ SetHighlightTarget()

void LayerList.SetHighlightTarget ( UIButton  _target)
inline

Definition at line 294 of file LayerList.cs.

295 {
296 highlightTarget = _target;
298 }

References UIButton.DoHighlightTransition(), and highlightTarget.

◆ SetList2< TValue >()

LayerList LayerList.SetList2< TValue > ( ICollection< TValue >  _list,
Func< TValue, string >  getText,
Action< TValue, ItemGeneral onClick,
Action< TValue, ItemGeneral onInstantiate,
bool  autoClose = true 
)
inline

Definition at line 181 of file LayerList.cs.

182 {
183 list.callbacks = new UIList.Callback<TValue, ItemGeneral>
184 {
185 onClick = delegate(TValue a, ItemGeneral b)
186 {
187 onClick(a, b);
188 if (autoClose)
189 {
190 Close();
191 }
192 },
193 onInstantiate = delegate(TValue a, ItemGeneral item)
194 {
195 item.button1.mainText.text = getText(a);
196 item.DisableIcon();
197 item.Build();
198 if (noSound)
199 {
200 item.button1.soundClick = null;
201 }
202 if (onInstantiate != null)
203 {
204 onInstantiate(a, item);
205 }
206 },
207 onList = delegate
208 {
209 foreach (TValue item in _list)
210 {
211 list.Add(item);
212 }
213 }
214 };
215 list.List();
216 RefreshSize();
217 UIButton.TryShowTip(base.transform);
218 return this;
219 }
bool noSound
Definition: LayerList.cs:34
virtual void Close()
Definition: Layer.cs:463
static void TryShowTip(Transform root=null, bool highlight=true, bool ignoreWhenRightClick=true)
Definition: UIButton.cs:778
override void Add(object item)
Definition: UIList.cs:302

References UIList.Add(), Layer.Close(), item, list, UIList.List(), noSound, RefreshSize(), and UIButton.TryShowTip().

◆ SetList< TValue >()

LayerList LayerList.SetList< TValue > ( ICollection< TValue >  items,
Func< TValue, string >  getString,
Action< int, string >  onSelect,
bool  autoClose = true 
)
inline

Definition at line 135 of file LayerList.cs.

136 {
137 List<string> strs = new List<string>();
138 foreach (TValue item in items)
139 {
140 strs.Add(getString(item));
141 }
142 SetStringList(() => strs, onSelect, autoClose);
143 return this;
144 }
LayerList SetStringList(Func< ICollection< string > > getList, Action< int, string > onSelect, bool autoClose=true)
Definition: LayerList.cs:146

References item, and SetStringList().

◆ SetListCheck< TValue >()

LayerList LayerList.SetListCheck< TValue > ( ICollection< TValue >  _list,
Func< TValue, string >  getText,
Action< TValue, ItemGeneral onClick,
Action< List< UIList::ButtonPair > >  onValidate 
)
inline

Definition at line 221 of file LayerList.cs.

222 {
223 list.moldItem = moldItemCheck.transform;
224 list.callbacks = new UIList.Callback<TValue, ItemGeneral>
225 {
226 onClick = delegate
227 {
228 },
229 onInstantiate = delegate(TValue a, ItemGeneral item)
230 {
231 item.button1.mainText.text = getText(a);
232 item.DisableIcon();
233 item.Build();
234 item.button1.SetOnClick(delegate
235 {
236 onClick(a, item);
237 Validate();
238 });
239 },
240 onList = delegate
241 {
242 foreach (TValue item in _list)
243 {
244 list.Add(item);
245 }
246 }
247 };
248 list.List();
249 Validate();
250 RefreshSize();
251 UIButton.TryShowTip(base.transform);
252 return this;
253 void Validate()
254 {
255 onValidate(list.buttons);
256 }
257 }
UIItem moldItemCheck
Definition: LayerList.cs:22

References UIList.Add(), UIList.buttons, item, list, UIList.List(), moldItemCheck, RefreshSize(), and UIButton.TryShowTip().

◆ SetMold()

LayerList LayerList.SetMold ( int  index)
inline

Definition at line 82 of file LayerList.cs.

83 {
84 switch (index)
85 {
86 case 0:
87 list.moldItem = moldItemGeneral;
88 break;
89 case 1:
90 list.moldItem = moldItemDetail;
91 break;
92 }
93 return this;
94 }
Transform moldItemDetail
Definition: LayerList.cs:26

References moldItemDetail, and moldItemGeneral.

◆ SetNoSound()

LayerList LayerList.SetNoSound ( )
inline

Definition at line 288 of file LayerList.cs.

289 {
290 noSound = true;
291 return this;
292 }

References noSound.

◆ SetPivot()

LayerList LayerList.SetPivot ( float  x,
float  y = -1f 
)
inline

Definition at line 111 of file LayerList.cs.

112 {
113 windows[0].Rect().pivot = new Vector2(x, y);
114 return this;
115 }

References Layer.windows.

◆ SetSize()

LayerList LayerList.SetSize ( float  w = 450f,
float  h = -1f 
)
inline

Definition at line 96 of file LayerList.cs.

97 {
98 Vector2 sizeDelta = windows[0].Rect().sizeDelta;
99 windows[0].Rect().sizeDelta = new Vector2((w == -1f) ? sizeDelta.x : w, (h == -1f) ? sizeDelta.y : h);
100 if (w != -1f)
101 {
102 autoX = false;
103 }
104 if (h != -1f)
105 {
106 autoY = false;
107 }
108 return this;
109 }

References autoX, autoY, and Layer.windows.

Referenced by UICharaMaker.ListJob(), and UICharaMaker.ListRace().

◆ SetStringList()

LayerList LayerList.SetStringList ( Func< ICollection< string > >  getList,
Action< int, string >  onSelect,
bool  autoClose = true 
)
inline

Definition at line 146 of file LayerList.cs.

147 {
148 list.callbacks = new UIList.Callback<string, ItemGeneral>
149 {
150 onClick = delegate(string a, ItemGeneral b)
151 {
152 onSelect(list.items.IndexOf(a), a);
153 if (autoClose)
154 {
155 Close();
156 }
157 },
158 onInstantiate = delegate(string a, ItemGeneral item)
159 {
160 item.button1.mainText.text = a;
161 item.DisableIcon();
162 item.Build();
163 if (noSound)
164 {
165 item.button1.soundClick = null;
166 }
167 },
168 onList = delegate
169 {
170 foreach (string item in getList())
171 {
172 list.Add(item);
173 }
174 }
175 };
176 list.List();
177 RefreshSize();
178 return this;
179 }
List< object > items
Definition: UIList.cs:241

References UIList.Add(), Layer.Close(), item, UIList.items, list, UIList.List(), noSound, and RefreshSize().

Referenced by SetList< TValue >().

◆ Show()

void LayerList.Show ( bool  autoClose = true)
inline

Definition at line 354 of file LayerList.cs.

355 {
356 list.callbacks = new UIList.Callback<CustomItem, ItemGeneral>
357 {
358 onClick = delegate(CustomItem a, ItemGeneral b)
359 {
360 a.action(a.id);
361 if (autoClose)
362 {
363 Close();
364 }
365 },
366 onInstantiate = delegate(CustomItem a, ItemGeneral item)
367 {
368 item.button1.mainText.text = a.lang.lang();
369 item.DisableIcon();
370 item.Build();
371 },
372 onList = delegate
373 {
374 foreach (CustomItem customItem in customItems)
375 {
376 list.Add(customItem);
377 }
378 }
379 };
380 buttonReroll.SetActive(enable: false);
381 list.List();
382 RefreshSize();
383 if (!autoClose)
384 {
385 windows[0].AddBottomButton("back", Close, setFirst: true);
386 }
387 }

References LayerList.CustomItem.action, UIList.Add(), buttonReroll, Layer.Close(), customItems, LayerList.CustomItem.id, item, LayerList.CustomItem.lang, list, UIList.List(), RefreshSize(), and Layer.windows.

Referenced by TraitMapBoard.TrySetAct().

◆ Update()

void LayerList.Update ( )
inlineprivate

Definition at line 300 of file LayerList.cs.

301 {
302 if ((bool)highlightTarget)
303 {
305 }
306 }

References UIButton.DoHighlightTransition(), and highlightTarget.

Member Data Documentation

◆ autoX

bool LayerList.autoX

Definition at line 30 of file LayerList.cs.

Referenced by RefreshSize(), and SetSize().

◆ autoY

bool LayerList.autoY

Definition at line 32 of file LayerList.cs.

Referenced by RefreshSize(), and SetSize().

◆ buttonReroll

UIButton LayerList.buttonReroll

Definition at line 18 of file LayerList.cs.

Referenced by Awake(), EnableReroll(), ManualList(), and Show().

◆ customItems

List<CustomItem> LayerList.customItems = new List<CustomItem>()

Definition at line 46 of file LayerList.cs.

Referenced by Add(), and Show().

◆ highlightTarget

UIButton LayerList.highlightTarget

Definition at line 20 of file LayerList.cs.

Referenced by LateUpdate(), OnInit(), OnKill(), SetHighlightTarget(), and Update().

◆ initialized

bool LayerList.initialized
private

Definition at line 44 of file LayerList.cs.

Referenced by Add().

◆ list

◆ moldItemCheck

UIItem LayerList.moldItemCheck

Definition at line 22 of file LayerList.cs.

Referenced by SetListCheck< TValue >().

◆ moldItemDetail

Transform LayerList.moldItemDetail

Definition at line 26 of file LayerList.cs.

Referenced by SetMold().

◆ moldItemGeneral

Transform LayerList.moldItemGeneral

Definition at line 24 of file LayerList.cs.

Referenced by ManualList(), and SetMold().

◆ noSound

bool LayerList.noSound

Definition at line 34 of file LayerList.cs.

Referenced by SetList2< TValue >(), SetNoSound(), and SetStringList().

◆ paddings

Vector2 LayerList.paddings

Definition at line 42 of file LayerList.cs.

Referenced by RefreshSize().

◆ scroll

UIScrollView LayerList.scroll

Definition at line 36 of file LayerList.cs.

Referenced by RefreshSize().

◆ sizeMax

Vector2 LayerList.sizeMax

Definition at line 40 of file LayerList.cs.

Referenced by RefreshSize().

◆ sizeMin

Vector2 LayerList.sizeMin

Definition at line 38 of file LayerList.cs.

Referenced by RefreshSize().

◆ useItem

bool LayerList.useItem

Definition at line 28 of file LayerList.cs.


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