Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
Layer Class Reference
Inheritance diagram for Layer:
IUISkin ELayer Dialog LayerAbility LayerAdmin LayerArea LayerBaseCraft LayerBuild LayerChara LayerCollectible LayerColorPicker LayerConfig LayerConsole LayerCover LayerCraftFloat LayerCredit LayerDebug LayerDistribution LayerDrama LayerEditBio LayerEditHouse LayerEditPCC LayerEditPlaylist LayerEditPortrait LayerEmbark LayerEquip LayerFactions LayerFaith LayerFeedback LayerGacha LayerGachaResult LayerGlobalMap LayerHelp LayerHire LayerHoard LayerHome LayerHomeReport LayerImage LayerInfo LayerInspect LayerInteraction LayerInventory LayerJournal LayerList LayerLoadGame LayerLocation LayerMapList LayerMiniGame LayerMod LayerNewZone LayerNewspaper LayerPause LayerPauseMenu LayerPeople LayerPixelPaint LayerPolicy LayerProgress LayerQuestBoard LayerQuickMenu LayerRegisterHotbar LayerResource LayerShippingResult LayerSkinDeco LayerSleep LayerStockpile LayerTactics LayerTech LayerTextureViewer LayerTitle LayerTravel LayerTreasureMap LayerUploader LayerWidget LayerWorldSetting UI UIInspector

Classes

class  Option
 

Public Member Functions

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 ()
 

Static Public Member Functions

static T Create< T > ()
 
static T Create< T > (string path)
 
static Layer Create (string path)
 

Public Attributes

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
 

Static Public Attributes

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 Member Functions

virtual void Awake ()
 
virtual void _Close ()
 
virtual void Kill ()
 

Protected Attributes

RectTransform _rect
 
bool isDestroyed
 

Properties

Layer TopLayer [get]
 
string uid [get]
 
virtual RectTransform rectLayers [get]
 
virtual bool blockWidgetClick [get]
 

Private Member Functions

void _RemoveLayer (Layer l)
 

Detailed Description

Definition at line 8 of file Layer.cs.

Member Function Documentation

◆ _AddLayer()

void Layer._AddLayer ( string  id)
inline

Definition at line 332 of file Layer.cs.

333 {
334 ToggleLayer(id);
335 }
void ToggleLayer(string id)
Definition: Layer.cs:426

References ToggleLayer().

◆ _Close()

virtual void Layer._Close ( )
inlineprotectedvirtual

Reimplemented in ELayer.

Definition at line 475 of file Layer.cs.

476 {
477 if ((bool)parent)
478 {
479 parent.RemoveLayer(this);
480 }
481 else
482 {
483 Kill();
484 }
485 skipInput = 2;
486 }
void RemoveLayer(Layer l)
Definition: Layer.cs:520
Layer parent
Definition: Layer.cs:104
virtual void Kill()
Definition: Layer.cs:544
static int skipInput
Definition: Layer.cs:72

References Kill(), parent, RemoveLayer(), and skipInput.

Referenced by Close().

◆ _RemoveLayer()

void Layer._RemoveLayer ( Layer  l)
inlineprivate

Definition at line 525 of file Layer.cs.

526 {
527 l.Kill();
528 layers.Remove(l);
529 if (layers.Count > 0)
530 {
531 Layer layer = layers.LastItem();
532 if (!layer.isDestroyed)
533 {
534 CanvasGroup component = layer.GetComponent<CanvasGroup>();
535 if (layer.option.hideOnUnfocus && (bool)component)
536 {
537 component.alpha = 1f;
538 }
539 }
540 }
542 }
bool hideOnUnfocus
Definition: Layer.cs:51
Definition: Layer.cs:9
List< Layer > layers
Definition: Layer.cs:110
Option option
Definition: Layer.cs:84
virtual void OnChangeLayer()
Definition: Layer.cs:285
bool isDestroyed
Definition: Layer.cs:98

References Layer.Option.hideOnUnfocus, isDestroyed, Kill(), layers, OnChangeLayer(), and option.

Referenced by RemoveLayer().

◆ AddLayer() [1/2]

Layer Layer.AddLayer ( Layer  l)
inline

Definition at line 383 of file Layer.cs.

384 {
386 if (l.option.persist && l.isDestroyed)
387 {
388 l.isDestroyed = false;
389 l.gameObject.SetActive(value: true);
390 layers.Add(l);
391 if (!ignoreSounds)
392 {
393 SoundManager.current.Play(l.option.soundActivate);
394 }
395 return l;
396 }
397 l.gameObject.SetActive(value: true);
398 l.parent = this;
399 l.transform.SetParent(rectLayers, worldPositionStays: false);
400 l.Init();
401 if (l.option.hideOthers)
402 {
403 foreach (Layer layer in layers)
404 {
405 if (layer.option.hideOnUnfocus)
406 {
407 CanvasGroup canvasGroup = layer.gameObject.GetComponent<CanvasGroup>();
408 if (!canvasGroup)
409 {
410 canvasGroup = layer.gameObject.AddComponent<CanvasGroup>();
411 }
412 canvasGroup.alpha = 0f;
413 }
414 }
415 }
416 layers.Add(l);
418 l._rect.anchorMin = Vector2.zero;
419 l._rect.anchorMax = Vector2.one;
420 l._rect.anchoredPosition = Vector2.zero;
421 l._rect.sizeDelta = Vector2.zero;
422 l.OnAfterAddLayer();
423 return l;
424 }
bool hideOthers
Definition: Layer.cs:53
SoundData soundActivate
Definition: Layer.cs:25
bool persist
Definition: Layer.cs:47
static bool ignoreSounds
Definition: Layer.cs:80
virtual void OnAfterAddLayer()
Definition: Layer.cs:379
virtual void Init()
Definition: Layer.cs:163
virtual void OnBeforeAddLayer()
Definition: Layer.cs:375
virtual RectTransform rectLayers
Definition: Layer.cs:127

References Layer.Option.hideOnUnfocus, Layer.Option.hideOthers, ignoreSounds, Init(), isDestroyed, layers, OnAfterAddLayer(), OnBeforeAddLayer(), OnChangeLayer(), option, Layer.Option.persist, rectLayers, and Layer.Option.soundActivate.

◆ AddLayer() [2/2]

◆ AddLayer< T >() [1/2]

T Layer.AddLayer< T > ( )
inline
Type Constraints
T :Layer 

Definition at line 342 of file Layer.cs.

342 : Layer
343 {
344 return AddLayer(typeof(T).Name) as T;
345 }

References AddLayer().

Referenced by GetOrAddLayer< T >(), and ToggleLayer< T >().

◆ AddLayer< T >() [2/2]

T Layer.AddLayer< T > ( string  id)
inline
Type Constraints
T :Layer 

Definition at line 347 of file Layer.cs.

347 : Layer
348 {
349 return AddLayer(id.IsEmpty(typeof(T).Name)) as T;
350 }

References AddLayer().

◆ AddLayerDontCloseOthers()

Layer Layer.AddLayerDontCloseOthers ( Layer  l)
inline

Definition at line 357 of file Layer.cs.

358 {
359 l.option.screenlockType = Option.ScreenlockType.Default;
360 l.closeOthers = false;
361 AddLayer(l);
362 return l;
363 }

References AddLayer().

Referenced by AddLayerDontCloseOthers< T >(), and LayerHire.Refresh().

◆ AddLayerDontCloseOthers< T >()

T Layer.AddLayerDontCloseOthers< T > ( )
inline
Type Constraints
T :Layer 

Definition at line 352 of file Layer.cs.

352 : Layer
353 {
354 return AddLayerDontCloseOthers(Create<T>()) as T;
355 }
static T Create< T >()
Definition: Layer.cs:289
Layer AddLayerDontCloseOthers(Layer l)
Definition: Layer.cs:357

References AddLayerDontCloseOthers(), and Create< T >().

◆ ApplySkin()

virtual void Layer.ApplySkin ( )
inlinevirtual

Implements IUISkin.

Definition at line 203 of file Layer.cs.

204 {
205 }

Referenced by Init().

◆ Awake()

virtual void Layer.Awake ( )
inlineprotectedvirtual

Reimplemented in LayerList, LayerShippingResult, and UI.

Definition at line 146 of file Layer.cs.

147 {
148 _rect = this.Rect();
149 foreach (Window componentsInDirectChild in this.GetComponentsInDirectChildren<Window>())
150 {
151 windows.Add(componentsInDirectChild);
152 }
153 for (int i = 0; i < windows.Count; i++)
154 {
155 windows[i].windowIndex = i;
156 }
157 if (windows.Count > 1 && windows[0].transform.position.x < windows[1].transform.position.x)
158 {
159 windows[0].transform.SetAsLastSibling();
160 }
161 }
RectTransform _rect
Definition: Layer.cs:96
List< Window > windows
Definition: Layer.cs:116
Definition: Window.cs:13

References _rect, and windows.

◆ Close()

virtual void Layer.Close ( )
inlinevirtual

Definition at line 463 of file Layer.cs.

464 {
465 if ((bool)animeOut)
466 {
467 animeOut.Play(rectLayers).OnComplete(_Close);
468 }
469 else
470 {
471 _Close();
472 }
473 }
virtual Tween Play(Transform trans, UnityAction onComplete=null, float duration=-1f, float delay=0f)
Definition: Anime.cs:7
virtual void _Close()
Definition: Layer.cs:475
Anime animeOut
Definition: Layer.cs:90

References _Close(), animeOut, Anime.Play(), and rectLayers.

Referenced by Dialog.AddButton(), LayerSleep.Advance(), LayerPeople.Confirm(), ItemGachaResult.Confirm(), MiniGame.Deactivate(), LayerNewZone.Embark(), Dialog.Gift(), Dialog.InputName(), LayerDrama.LateUpdate(), LayerEditPlaylist.ListBGM.List(), Dialog.Ok(), OnBack(), AI_UseCrafter.OnCancel(), LayerFeedback.OnCancel(), BaseListPeople.OnClick(), LayerColorPicker.OnClickCancel(), OnClickClose(), LayerColorPicker.OnClickConfirm(), LayerNewZone.OnClickExit(), Dialog.OnEnterInput(), LayerPixelPaint.OnInit(), InvOwnerDraglet.OnProcess(), LayerInventory.OnRightClick(), LayerFeedback.OnSubmit(), Dialog.OnUpdateInput(), LayerConsole.OnUpdateInput(), LayerInfo.OnUpdateInput(), LayerInventory.OnUpdateInput(), LayerMiniGame.OnUpdateInput(), LayerPause.OnUpdateInput(), LayerSkinDeco.OnUpdateInput(), Dialog.Recipe(), LayerCollectible.Refresh(), LayerTravel.Refresh(), LayerQuestBoard.RefreshQuest(), LayerFaith.RefreshSlots(), LayerPixelPaint.SetCanvas(), LayerList.SetList2< TValue >(), LayerList.SetStringList(), LayerList.Show(), LayerWorldSetting.StartGame(), Dialog.TryWarn(), Dialog.Update(), LayerProgress.Update(), UIBook.Update(), LayerSleep.Wait(), WaitAndClose(), LayerCraft.WaitUntilIdle(), and Dialog.YesNo().

◆ CloseLayers()

void Layer.CloseLayers ( )
inline

Definition at line 488 of file Layer.cs.

489 {
490 for (int num = layers.Count - 1; num >= 0; num--)
491 {
492 layers[num].Close();
493 }
494 }

References layers.

◆ Create()

static Layer Layer.Create ( string  path)
inlinestatic

Definition at line 299 of file Layer.cs.

300 {
301 Layer layer = null;
302 string text = path.Split('/').LastItem();
303 string[] array = searchPath;
304 foreach (string text2 in array)
305 {
306 layer = Resources.Load<Layer>("UI/" + text2 + "/" + path);
307 if (!layer)
308 {
309 layer = Resources.Load<Layer>("UI/" + text2 + "/" + path + "/" + text);
310 }
311 if ((bool)layer)
312 {
313 break;
314 }
315 }
316 if (!layer)
317 {
318 Debug.Log(path + " --- " + text);
319 }
320 layer = UnityEngine.Object.Instantiate(layer);
321 Layer layer2 = layer;
322 string text4 = (layer.name = text);
323 layer2.idLayer = text4;
324 layer.OnCreate();
325 return layer;
326 }
static string[] searchPath
Definition: Layer.cs:121
virtual void OnCreate()
Definition: Layer.cs:328

References Debug, OnCreate(), and searchPath.

Referenced by Dialog._Confetti(), LayerInventory._Create(), LayerDrama.Activate(), LayerDrama.ActivateNerun(), AddLayer(), Dialog.Choice(), LayerPeople.Create(), Create< T >(), Dialog.CreateNarration(), Dialog.Gift(), Dialog.InputName(), Dialog.Keymap(), Dialog.List< TValue >(), Dialog.Ok(), LayerGacha.PlayGacha(), Dialog.Recipe(), Dialog.TryWarn(), and Dialog.YesNo().

◆ Create< T >() [1/2]

static T Layer.Create< T > ( )
inlinestatic
Type Constraints
T :Layer 

Definition at line 289 of file Layer.cs.

289 : Layer
290 {
291 return Create(typeof(T).Name) as T;
292 }

References Create().

Referenced by AddLayerDontCloseOthers< T >().

◆ Create< T >() [2/2]

static T Layer.Create< T > ( string  path)
inlinestatic
Type Constraints
T :Layer 

Definition at line 294 of file Layer.cs.

294 : Layer
295 {
296 return Create(path) as T;
297 }

References Create().

◆ Delay()

void Layer.Delay ( float  duration = 0::05f)
inline

Definition at line 597 of file Layer.cs.

598 {
599 foreach (Window window in windows)
600 {
601 window.setting.anime = null;
602 }
603 _rect.anchoredPosition = new Vector2(10000f, 10000f);
604 TweenUtil.Tween(0.1f, delegate
605 {
607 {
608 if ((bool)this && (bool)base.gameObject)
609 {
610 _rect.anchoredPosition = new Vector2(0f, 0f);
611 foreach (Window window2 in windows)
612 {
613 window2.ClampToScreen();
614 }
616 }
617 });
618 });
619 }
void WaitForEndOfFrame(Action action)
Definition: BaseCore.cs:61
static BaseCore Instance
Definition: BaseCore.cs:11
static void TryShowTip(Transform root=null, bool highlight=true, bool ignoreWhenRightClick=true)
Definition: UIButton.cs:778

References BaseCore.Instance, UIButton.TryShowTip(), BaseCore.WaitForEndOfFrame(), and windows.

Referenced by ActionMode.DoFunc(), and UI.ToggleAbility().

◆ DisableClose()

void Layer.DisableClose ( )
inline

Definition at line 588 of file Layer.cs.

589 {
590 option.canClose = false;
591 foreach (Window window in windows)
592 {
593 window.buttonClose.SetActive(enable: false);
594 }
595 }
Button buttonClose
Definition: Window.cs:624

References Window.buttonClose, and windows.

◆ GetLayer()

Layer Layer.GetLayer ( string  id)
inline

Definition at line 632 of file Layer.cs.

633 {
634 foreach (Layer layer in layers)
635 {
636 if (layer.idLayer == id)
637 {
638 return layer;
639 }
640 }
641 return null;
642 }
string idLayer
Definition: Layer.cs:107

References idLayer.

Referenced by InvOwnerHotbar.OnClick(), and ToggleLayer().

◆ GetLayer< T >()

T Layer.GetLayer< T > ( bool  fromTop = false)
inline
Type Constraints
T :Layer 

Definition at line 644 of file Layer.cs.

644 : Layer
645 {
646 if (fromTop)
647 {
648 for (int num = layers.Count - 1; num >= 0; num--)
649 {
650 Layer layer = layers[num];
651 if (layer is T)
652 {
653 return layer as T;
654 }
655 }
656 }
657 else
658 {
659 foreach (Layer layer2 in layers)
660 {
661 if (layer2 is T)
662 {
663 return layer2 as T;
664 }
665 }
666 }
667 return null;
668 }

Referenced by GetOrAddLayer< T >(), and ToggleLayer< T >().

◆ GetOrAddLayer< T >()

T Layer.GetOrAddLayer< T > ( )
inline
Type Constraints
T :Layer 

Definition at line 365 of file Layer.cs.

365 : Layer
366 {
367 T val = GetLayer<T>();
368 if (!val)
369 {
370 val = AddLayer<T>();
371 }
372 return val;
373 }
T GetLayer< T >(bool fromTop=false)
Definition: Layer.cs:644
T AddLayer< T >()
Definition: Layer.cs:342

References AddLayer< T >(), and GetLayer< T >().

◆ GetTextHeader()

virtual string Layer.GetTextHeader ( Window  window)
inlinevirtual

Reimplemented in LayerConfig, and LayerCraft.

Definition at line 131 of file Layer.cs.

132 {
133 string text = (window.CurrentTab?.idLang ?? window.setting.textCaption).lang();
134 if (!HeaderIsListOf(window.idTab))
135 {
136 return text;
137 }
138 return "_listOf".lang(text);
139 }
virtual bool HeaderIsListOf(int id)
Definition: Layer.cs:141
string textCaption
Definition: Window.cs:53
Setting.Tab CurrentTab
Definition: Window.cs:787
Setting setting
Definition: Window.cs:606
int idTab
Definition: Window.cs:694

References Window.CurrentTab, HeaderIsListOf(), Window.idTab, Window.setting, and Window.Setting.textCaption.

Referenced by ContentFaction.OnSwitchContent(), and Window.SwitchContent().

◆ GetTopLayer()

Layer Layer.GetTopLayer ( )
inline

Definition at line 670 of file Layer.cs.

671 {
672 if (layers.Count > 0)
673 {
674 return layers.LastItem().GetTopLayer();
675 }
676 return this;
677 }

References GetTopLayer().

Referenced by GetTopLayer().

◆ HeaderIsListOf()

virtual bool Layer.HeaderIsListOf ( int  id)
inlinevirtual

Reimplemented in LayerFactions, LayerHome, LayerInventory, LayerJournal, LayerLocation, and LayerPeople.

Definition at line 141 of file Layer.cs.

142 {
143 return false;
144 }

Referenced by GetTextHeader().

◆ Init()

virtual void Layer.Init ( )
inlinevirtual

Reimplemented in ELayer.

Definition at line 163 of file Layer.cs.

164 {
165 if (option.screenlockType != Option.ScreenlockType.None && !screenLock)
166 {
168 }
169 OnInit();
170 for (int i = 0; i < windows.Count; i++)
171 {
172 windows[i].Init(this);
173 }
174 ApplySkin();
175 OnAfterInit();
176 SoundManager.current.Play(option.soundActivate);
177 if ((bool)animeIn)
178 {
180 }
181 if ((bool)option.bgm)
182 {
183 SoundManager.current.PlayBGM(option.bgm);
184 }
185 if ((bool)option.playlist)
186 {
187 SoundManager.current.SwitchPlaylist(option.playlist);
188 }
190 {
191 this.RebuildLayout(recursive: true);
192 }
193 }
SoundData bgm
Definition: Layer.cs:23
Playlist playlist
Definition: Layer.cs:21
ScreenlockType screenlockType
Definition: Layer.cs:69
bool rebuildLayout
Definition: Layer.cs:45
virtual void OnInit()
Definition: Layer.cs:195
virtual void OnAfterInit()
Definition: Layer.cs:199
void ShowScreenLock(string id)
Definition: Layer.cs:207
virtual void ApplySkin()
Definition: Layer.cs:203
Button screenLock
Definition: Layer.cs:101
Anime animeIn
Definition: Layer.cs:88

References animeIn, ApplySkin(), Layer.Option.bgm, OnAfterInit(), OnInit(), option, Anime.Play(), Layer.Option.playlist, Layer.Option.rebuildLayout, rectLayers, screenLock, Layer.Option.screenlockType, ShowScreenLock(), Layer.Option.soundActivate, and windows.

Referenced by AddLayer(), and Widget.AddLayer().

◆ IsAllowGeneralInput()

bool Layer.IsAllowGeneralInput ( )
inline

Definition at line 718 of file Layer.cs.

719 {
720 foreach (Layer layer in layers)
721 {
722 if (!layer.IsAllowGeneralInput())
723 {
724 return false;
725 }
726 }
728 }
bool allowGeneralInput
Definition: Layer.cs:41
bool IsAllowGeneralInput()
Definition: Layer.cs:718

References Layer.Option.allowGeneralInput, and IsAllowGeneralInput().

Referenced by IsAllowGeneralInput().

◆ IsBlockWidgetClick()

bool Layer.IsBlockWidgetClick ( )
inline

Definition at line 694 of file Layer.cs.

695 {
696 foreach (Layer layer in layers)
697 {
698 if (layer.blockWidgetClick)
699 {
700 return true;
701 }
702 }
703 return blockWidgetClick;
704 }
virtual bool blockWidgetClick
Definition: Layer.cs:129

References blockWidgetClick.

◆ IsHideHud()

bool Layer.IsHideHud ( )
inline

Definition at line 706 of file Layer.cs.

707 {
708 foreach (Layer layer in layers)
709 {
710 if (layer.IsHideHud())
711 {
712 return true;
713 }
714 }
715 return option.hideHud;
716 }
bool hideHud
Definition: Layer.cs:39
bool IsHideHud()
Definition: Layer.cs:706

References Layer.Option.hideHud, and IsHideHud().

Referenced by IsHideHud().

◆ IsPointerOnLayer()

bool Layer.IsPointerOnLayer ( )
inline

Definition at line 746 of file Layer.cs.

747 {
748 foreach (GameObject item in InputModuleEX.GetPointerEventData().hovered)
749 {
750 if (item.GetComponentInParent<Layer>() == this)
751 {
752 return true;
753 }
754 }
755 return false;
756 }
static PointerEventData GetPointerEventData(int pointerId=-1)

References InputModuleEX.GetPointerEventData(), and item.

◆ IsUseBlur()

bool Layer.IsUseBlur ( )
inline

Definition at line 730 of file Layer.cs.

731 {
732 if ((bool)blurStopInstance)
733 {
734 return false;
735 }
736 foreach (Layer layer in layers)
737 {
738 if (layer.IsUseBlur())
739 {
740 return true;
741 }
742 }
743 return option.blur;
744 }
bool blur
Definition: Layer.cs:49
static Transform blurStopInstance
Definition: Layer.cs:82
bool IsUseBlur()
Definition: Layer.cs:730

References Layer.Option.blur, and IsUseBlur().

Referenced by IsUseBlur(), and UI.OnUpdate().

◆ Kill()

virtual void Layer.Kill ( )
inlineprotectedvirtual

Reimplemented in ELayer.

Definition at line 544 of file Layer.cs.

545 {
546 if (isDestroyed || base.gameObject == null)
547 {
548 return;
549 }
550 isDestroyed = true;
551 foreach (Layer layer in layers)
552 {
553 layer.Kill();
554 }
555 if (windows.Count > 0)
556 {
558 foreach (Window window in windows)
559 {
560 window.OnKill();
561 }
562 }
563 OnKill();
564 onKill.Invoke();
565 if (option.persist)
566 {
567 base.gameObject.SetActive(value: false);
568 }
569 else
570 {
571 UnityEngine.Object.DestroyImmediate(base.gameObject);
572 }
573 }
static void SetCursor(CursorInfo info=null, int _priority=0)
UnityEvent onKill
Definition: Layer.cs:86
virtual void OnKill()
Definition: Layer.cs:575
void OnKill()
Definition: Window.cs:1116

References isDestroyed, Kill(), layers, onKill, OnKill(), Window.OnKill(), option, Layer.Option.persist, CursorSystem.SetCursor(), and windows.

Referenced by _Close(), _RemoveLayer(), and Kill().

◆ OnAfterAddLayer()

virtual void Layer.OnAfterAddLayer ( )
inlinevirtual

Reimplemented in ELayer, LayerEditBio, and LayerEmbark.

Definition at line 379 of file Layer.cs.

380 {
381 }

Referenced by AddLayer(), and Widget.AddLayer().

◆ OnAfterInit()

virtual void Layer.OnAfterInit ( )
inlinevirtual

Reimplemented in Dialog, LayerCollectible, LayerConsole, LayerCraft, LayerGacha, LayerHelp, LayerHire, LayerHoard, LayerInfo, LayerInventory, LayerMiniGame, and LayerSleep.

Definition at line 199 of file Layer.cs.

200 {
201 }

Referenced by Init().

◆ OnBack()

virtual bool Layer.OnBack ( )
inlinevirtual

Reimplemented in LayerColorPicker, LayerEmbark, and LayerMiniGame.

Definition at line 267 of file Layer.cs.

268 {
269 if (layers.Count > 0)
270 {
271 return layers.LastItem().OnBack();
272 }
273 if (!parent)
274 {
275 return false;
276 }
277 if (option.canClose)
278 {
279 Close();
280 return true;
281 }
282 return false;
283 }
bool canClose
Definition: Layer.cs:29
virtual void Close()
Definition: Layer.cs:463

References Layer.Option.canClose, Close(), layers, option, and parent.

Referenced by OnRightClick(), and UpdateInput().

◆ OnBeforeAddLayer()

virtual void Layer.OnBeforeAddLayer ( )
inlinevirtual

Reimplemented in ELayer, and LayerConfig.

Definition at line 375 of file Layer.cs.

376 {
377 }

Referenced by AddLayer(), and Widget.AddLayer().

◆ OnChangeLayer()

virtual void Layer.OnChangeLayer ( )
inlinevirtual

Reimplemented in UI.

Definition at line 285 of file Layer.cs.

286 {
287 }

Referenced by _RemoveLayer(), and AddLayer().

◆ OnClickClose()

void Layer.OnClickClose ( )
inline

Definition at line 455 of file Layer.cs.

456 {
457 if (!BaseCore.BlockInput())
458 {
459 Close();
460 }
461 }
static Func< bool > BlockInput
Definition: BaseCore.cs:15

References BaseCore.BlockInput, and Close().

Referenced by Window.Close().

◆ OnCreate()

virtual void Layer.OnCreate ( )
inlinevirtual

Definition at line 328 of file Layer.cs.

329 {
330 }

Referenced by Create().

◆ OnInit()

◆ OnKill()

◆ OnRightClick()

virtual void Layer.OnRightClick ( )
inlinevirtual

Reimplemented in ELayer, LayerDragGrid, LayerHelp, and LayerInventory.

Definition at line 259 of file Layer.cs.

260 {
262 {
263 OnBack();
264 }
265 }
virtual bool OnBack()
Definition: Layer.cs:267
static bool closeOnRightClick
Definition: Layer.cs:74

References closeOnRightClick, and OnBack().

Referenced by UpdateInput().

◆ OnSwitchContent()

virtual void Layer.OnSwitchContent ( Window  window)
inlinevirtual

◆ OnUpdateInput()

virtual void Layer.OnUpdateInput ( )
inlinevirtual

◆ RemoveLayer()

void Layer.RemoveLayer ( Layer  l)
inline

Definition at line 520 of file Layer.cs.

521 {
522 _RemoveLayer(l);
523 }
void _RemoveLayer(Layer l)
Definition: Layer.cs:525

References _RemoveLayer().

Referenced by _Close(), RemoveLayer< T >(), RemoveLayers(), ToggleLayer(), and ToggleLayer< T >().

◆ RemoveLayer< T >()

bool Layer.RemoveLayer< T > ( )
inline

Definition at line 507 of file Layer.cs.

508 {
509 for (int num = layers.Count - 1; num >= 0; num--)
510 {
511 if (layers[num] is T)
512 {
513 RemoveLayer(layers[num]);
514 return true;
515 }
516 }
517 return false;
518 }

References layers, and RemoveLayer().

◆ RemoveLayers()

void Layer.RemoveLayers ( bool  removeImportant = false)
inline

Definition at line 496 of file Layer.cs.

497 {
498 for (int num = layers.Count - 1; num >= 0; num--)
499 {
500 if (removeImportant || (!layers[num].option.important && !layers[num].option.persist))
501 {
502 RemoveLayer(layers[num]);
503 }
504 }
505 }
bool important
Definition: Layer.cs:37

References Layer.Option.important, layers, option, and RemoveLayer().

Referenced by UI.OnClickAction(), and UI.OnKillGame().

◆ SetDelay()

Layer Layer.SetDelay ( float  d)
inline

Definition at line 621 of file Layer.cs.

622 {
623 CanvasGroup cg = GetComponent<CanvasGroup>() ?? base.gameObject.AddComponent<CanvasGroup>();
624 cg.alpha = 0f;
625 TweenUtil.Tween(d, null, delegate
626 {
627 cg.alpha = 1f;
628 });
629 return this;
630 }

◆ SetOnKill()

Layer Layer.SetOnKill ( Action  action)
inline

◆ SetTitles()

Layer Layer.SetTitles ( string  langList,
string  idHeaderRow = null 
)
inline

Definition at line 688 of file Layer.cs.

689 {
690 windows[0].SetTitles(langList, idHeaderRow);
691 return this;
692 }

References SetTitles().

Referenced by UICharaMaker.ListAlias(), UICharaMaker.ListModes(), and SetTitles().

◆ ShowScreenLock()

void Layer.ShowScreenLock ( string  id)
inline

Definition at line 207 of file Layer.cs.

208 {
209 if ((bool)screenLock)
210 {
211 UnityEngine.Object.DestroyImmediate(screenLock.gameObject);
212 }
213 screenLock = Util.Instantiate<Button>("UI/Screenlock" + id, rectLayers);
214 screenLock.transform.SetAsFirstSibling();
215 }
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References Button, rectLayers, screenLock, and Util.

Referenced by Init(), and DramaManager.ParseLine().

◆ SwitchContent()

void Layer.SwitchContent ( int  idWindow,
int  i 
)
inline

Definition at line 679 of file Layer.cs.

680 {
681 windows[idWindow].SwitchContent(i);
682 }

◆ ToggleLayer()

void Layer.ToggleLayer ( string  id)
inline

Definition at line 426 of file Layer.cs.

427 {
428 Layer layer = GetLayer(id);
429 if ((bool)layer)
430 {
431 RemoveLayer(layer);
432 }
433 else
434 {
435 AddLayer(id);
436 }
437 }
Layer GetLayer(string id)
Definition: Layer.cs:632

References AddLayer(), GetLayer(), and RemoveLayer().

Referenced by _AddLayer(), TraitScrollMapTreasure.OnUse(), LayerHelp.Toggle(), TraitHomeBoard.TrySetAct(), and TraitResidentBoard.TrySetAct().

◆ ToggleLayer< T >()

T Layer.ToggleLayer< T > ( string  id = null)
inline
Type Constraints
T :Layer 

Definition at line 439 of file Layer.cs.

439 : Layer
440 {
441 T layer = GetLayer<T>();
442 if ((bool)layer)
443 {
444 RemoveLayer(layer);
445 return null;
446 }
447 return AddLayer<T>(id);
448 }

References AddLayer< T >(), GetLayer< T >(), and RemoveLayer().

◆ UpdateInput()

void Layer.UpdateInput ( )
inline

Definition at line 217 of file Layer.cs.

218 {
220 {
221 skipInput--;
222 }
223 else if (layers.Count > 0)
224 {
225 layers.LastItem().UpdateInput();
226 }
227 else if ((EInput.leftMouse.down || (EInput.rightMouse.down && option.screenClickCloseRight)) && (((bool)screenLock && InputModuleEX.IsPointerOver(screenLock)) || (!InputModuleEX.IsPointerOverRoot(this) && !InputModuleEX.GetComponentOf<RectTransform>())))
228 {
230 {
231 OnBack();
232 }
233 }
234 else if (rightClicked || cancelKeyDown)
235 {
236 if ((bool)UIDropdown.activeInstance)
237 {
239 }
240 else if (rightClicked)
241 {
242 OnRightClick();
243 }
244 else
245 {
246 OnBack();
247 }
248 }
249 else
250 {
252 }
253 }
Definition: EInput.cs:8
static ButtonState leftMouse
Definition: EInput.cs:349
static ButtonState rightMouse
Definition: EInput.cs:351
static bool IsPointerOver(Component c)
static bool IsPointerOverRoot(Component c)
bool screenClickClose
Definition: Layer.cs:31
bool screenClickCloseRight
Definition: Layer.cs:33
virtual void OnUpdateInput()
Definition: Layer.cs:255
static bool rightClicked
Definition: Layer.cs:76
virtual void OnRightClick()
Definition: Layer.cs:259
static bool cancelKeyDown
Definition: Layer.cs:78
static UIContextMenuManager Instance
static UIDropdown activeInstance
Definition: UIDropdown.cs:12

References UIDropdown.activeInstance, cancelKeyDown, ButtonState.down, UIContextMenuManager.Instance, UIContextMenuManager.isActive, InputModuleEX.IsPointerOver(), InputModuleEX.IsPointerOverRoot(), layers, EInput.leftMouse, OnBack(), OnRightClick(), OnUpdateInput(), option, rightClicked, EInput.rightMouse, Layer.Option.screenClickClose, Layer.Option.screenClickCloseRight, screenLock, and skipInput.

◆ WaitAndClose()

void Layer.WaitAndClose ( )
inline

Definition at line 450 of file Layer.cs.

References Close(), BaseCore.Instance, and BaseCore.WaitForEndOfFrame().

Member Data Documentation

◆ _rect

RectTransform Layer._rect
protected

Definition at line 96 of file Layer.cs.

Referenced by Awake().

◆ animeIn

Anime Layer.animeIn

Definition at line 88 of file Layer.cs.

Referenced by Init().

◆ animeOut

Anime Layer.animeOut

Definition at line 90 of file Layer.cs.

Referenced by Close().

◆ blurStopInstance

Transform Layer.blurStopInstance
static

Definition at line 82 of file Layer.cs.

◆ cancelKeyDown

bool Layer.cancelKeyDown
static

Definition at line 78 of file Layer.cs.

Referenced by UpdateInput().

◆ closeOnRightClick

bool Layer.closeOnRightClick
static

Definition at line 74 of file Layer.cs.

Referenced by OnRightClick().

◆ closeOthers

bool Layer.closeOthers

Definition at line 92 of file Layer.cs.

Referenced by ELayer.Init().

◆ defaultActionMode

bool Layer.defaultActionMode = true

Definition at line 94 of file Layer.cs.

Referenced by ELayer.OnBeforeAddLayer().

◆ idLayer

string Layer.idLayer

Definition at line 107 of file Layer.cs.

Referenced by GetLayer().

◆ ignoreSounds

bool Layer.ignoreSounds
static

Definition at line 80 of file Layer.cs.

Referenced by AddLayer().

◆ isDestroyed

◆ langHint

string Layer.langHint

◆ lastParentPos

Vector2 Layer.lastParentPos

Definition at line 113 of file Layer.cs.

◆ layers

◆ onKill

UnityEvent Layer.onKill

Definition at line 86 of file Layer.cs.

Referenced by Kill(), LayerEditBio.SetChara(), LayerCover.SetDuration(), and SetOnKill().

◆ option

◆ parent

Layer Layer.parent

Definition at line 104 of file Layer.cs.

Referenced by _Close(), UIDynamicList.List(), and OnBack().

◆ rightClicked

bool Layer.rightClicked
static

Definition at line 76 of file Layer.cs.

Referenced by UpdateInput().

◆ screenLock

Button Layer.screenLock

Definition at line 101 of file Layer.cs.

Referenced by Init(), ShowScreenLock(), and UpdateInput().

◆ searchPath

string [] Layer.searchPath = new string[3] { "Layer", "Layer/Dialog", "Layer/LayerHome" }
static

Definition at line 121 of file Layer.cs.

Referenced by Create().

◆ skipInput

int Layer.skipInput
static

Definition at line 72 of file Layer.cs.

Referenced by _Close(), and UpdateInput().

◆ windows

List<Window> Layer.windows = new List<Window>()

Definition at line 116 of file Layer.cs.

Referenced by LayerEditPortrait.Activate(), LayerEditPCC.Activate(), LayerEditPlaylist.Activate(), Widget.AddLayer(), Awake(), Window.BringToTop(), LayerInventory.CreateBuy(), LayerInventory.CreateContainer(), LayerInventory.CreateContainer< T >(), LayerInventory.CreateContainerAlly(), LayerInventory.CreateContainerPC(), LayerInventory.CreatePCBackpack(), Delay(), DisableClose(), ActionMode.DoFunc(), Init(), LayerLoadGame.Init(), Card.Inspect(), UIInspector.Inspect(), Kill(), Dialog.OnAfterInit(), LayerConfig.OnBeforeAddLayer(), WidgetExp.OnClick(), WidgetExpHome.OnClick(), BaseListPeople.OnClick(), LayerCraft.OnCompleteCraft(), LayerAbility.OnInit(), LayerConfig.OnInit(), LayerEditHouse.OnInit(), LayerEquip.OnInit(), LayerPixelPaint.OnInit(), LayerQuestBoard.OnInit(), LayerResource.OnInit(), LayerTextureViewer.OnInit(), ContentFaction.OnSwitchContent(), LayerAbility.OnSwitchContent(), LayerQuestBoard.OnSwitchContent(), Scene.OnUpdate(), LayerGacha.PlayGacha(), LayerEquip.Rebuild(), LayerTravel.Refresh(), LayerAbility.RefreshConfig(), LayerFactions.RefreshFactions(), LayerLoadGame.RefreshList(), LayerCraftFloat.RefreshSize(), LayerList.RefreshSize(), LayerTech.RefreshTech(), LayerLocation.RefreshZones(), LayerInfo.Resize(), LayerInfo.SetBlock(), LayerInfo.SetElement(), LayerCraft.SetFactory(), LayerInfo.SetFloor(), LayerList.SetHeader(), LayerInventory.SetInv(), LayerInfo.SetLiquid(), LayerInfo.SetObj(), LayerList.SetPivot(), LayerList.SetSize(), LayerInfo.SetThing(), LayerList.Show(), LayerJournal.SwitchPopulation(), UI.ToggleAbility(), ELayer.TryShowHelp(), LayerCraftFloat.Update(), and ActionMode.UpdateInput().

Property Documentation

◆ blockWidgetClick

virtual bool Layer.blockWidgetClick
get

Definition at line 129 of file Layer.cs.

Referenced by IsBlockWidgetClick().

◆ rectLayers

virtual RectTransform Layer.rectLayers
get

Definition at line 127 of file Layer.cs.

Referenced by AddLayer(), Close(), Init(), and ShowScreenLock().

◆ TopLayer

Layer Layer.TopLayer
get

Definition at line 123 of file Layer.cs.

Referenced by UI.OnChangeLayer().

◆ uid

string Layer.uid
get

Definition at line 125 of file Layer.cs.

Referenced by LayerRegisterHotbar.SetItem().


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