Elin Decompiled Documentation EA 23.351 Nightly
Loading...
Searching...
No Matches
Layer Class Reference
Inheritance diagram for Layer:
IUISkin ELayer Dialog LayerAbility LayerAdmin LayerArea LayerBaseCraft LayerBuild LayerCalendar LayerChara LayerCollectible LayerColorPicker LayerConfig LayerConsole LayerCover LayerCraftFloat LayerCredit LayerDebug LayerDistribution LayerDrama LayerEditBio LayerEditHouse LayerEditPCC LayerEditPlaylist LayerEditPortrait LayerEditSkin 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 LayerModConfig LayerNewZone LayerNewspaper LayerPause LayerPauseMenu LayerPeople LayerPickPCC 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)
 
T AddLayer< T > ()
 
T AddLayer< T > (string id)
 
T AddLayerDontCloseOthers< T > ()
 
T AddLayerDontCloseOthers< T > (string path)
 
Layer AddLayerDontCloseOthers (Layer l)
 
T GetOrAddLayer< T > ()
 
virtual void OnBeforeAddLayer ()
 
virtual void OnAfterAddLayer ()
 
Layer AddLayer (Layer l)
 
void ToggleLayer (string id)
 
T 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)
 
T 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< Layer > layers = new List<Layer>()
 
Vector2 lastParentPos
 
List< Window > windows = 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:431

References ToggleLayer().

◆ _Close()

virtual void Layer._Close ( )
inlineprotectedvirtual

Reimplemented in ELayer.

Definition at line 480 of file Layer.cs.

481 {
482 if ((bool)parent)
483 {
484 parent.RemoveLayer(this);
485 }
486 else
487 {
488 Kill();
489 }
490 skipInput = 2;
491 }
void RemoveLayer(Layer l)
Definition: Layer.cs:525
Layer parent
Definition: Layer.cs:104
virtual void Kill()
Definition: Layer.cs:549
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 530 of file Layer.cs.

531 {
532 l.Kill();
533 layers.Remove(l);
534 if (layers.Count > 0)
535 {
536 Layer layer = layers.LastItem();
537 if (!layer.isDestroyed)
538 {
539 CanvasGroup component = layer.GetComponent<CanvasGroup>();
540 if (layer.option.hideOnUnfocus && (bool)component)
541 {
542 component.alpha = 1f;
543 }
544 }
545 }
547 }
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 388 of file Layer.cs.

389 {
391 if (l.option.persist && l.isDestroyed)
392 {
393 l.isDestroyed = false;
394 l.gameObject.SetActive(value: true);
395 layers.Add(l);
396 if (!ignoreSounds)
397 {
398 SoundManager.current.Play(l.option.soundActivate);
399 }
400 return l;
401 }
402 l.gameObject.SetActive(value: true);
403 l.parent = this;
404 l.transform.SetParent(rectLayers, worldPositionStays: false);
405 l.Init();
406 if (l.option.hideOthers)
407 {
408 foreach (Layer layer in layers)
409 {
410 if (layer.option.hideOnUnfocus)
411 {
412 CanvasGroup canvasGroup = layer.gameObject.GetComponent<CanvasGroup>();
413 if (!canvasGroup)
414 {
415 canvasGroup = layer.gameObject.AddComponent<CanvasGroup>();
416 }
417 canvasGroup.alpha = 0f;
418 }
419 }
420 }
421 layers.Add(l);
423 l._rect.anchorMin = Vector2.zero;
424 l._rect.anchorMax = Vector2.one;
425 l._rect.anchoredPosition = Vector2.zero;
426 l._rect.sizeDelta = Vector2.zero;
427 l.OnAfterAddLayer();
428 return l;
429 }
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:384
virtual void Init()
Definition: Layer.cs:163
virtual void OnBeforeAddLayer()
Definition: Layer.cs:380
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 362 of file Layer.cs.

363 {
364 l.option.screenlockType = Option.ScreenlockType.Default;
365 l.closeOthers = false;
366 AddLayer(l);
367 return l;
368 }

References AddLayer().

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

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

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:362

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

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

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

Definition at line 357 of file Layer.cs.

357 : Layer
358 {
359 return AddLayerDontCloseOthers(Create<T>(path)) as T;
360 }

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 468 of file Layer.cs.

469 {
470 if ((bool)animeOut)
471 {
472 animeOut.Play(rectLayers).OnComplete(_Close);
473 }
474 else
475 {
476 _Close();
477 }
478 }
virtual Tween Play(Transform trans, UnityAction onComplete=null, float duration=-1f, float delay=0f)
Definition: Anime.cs:7
virtual void _Close()
Definition: Layer.cs:480
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(), LayerPixelPaint.InitPaint(), 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(), 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(), DramaManager.Update(), LayerPixelPaint.Update(), LayerProgress.Update(), UIBook.Update(), LayerSleep.Wait(), WaitAndClose(), LayerCraft.WaitUntilIdle(), and Dialog.YesNo().

◆ CloseLayers()

void Layer.CloseLayers ( )
inline

Definition at line 493 of file Layer.cs.

494 {
495 for (int num = layers.Count - 1; num >= 0; num--)
496 {
497 layers[num].Close();
498 }
499 }

References layers.

Referenced by InvOwnerChoose.Process().

◆ 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 text3 = (layer.name = text);
323 layer2.idLayer = text3;
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 602 of file Layer.cs.

603 {
604 foreach (Window window in windows)
605 {
606 window.setting.anime = null;
607 }
608 _rect.anchoredPosition = new Vector2(10000f, 10000f);
609 TweenUtil.Tween(0.1f, delegate
610 {
612 {
613 if ((bool)this && (bool)base.gameObject)
614 {
615 _rect.anchoredPosition = new Vector2(0f, 0f);
616 foreach (Window window2 in windows)
617 {
618 window2.ClampToScreen();
619 }
621 }
622 });
623 });
624 }
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 593 of file Layer.cs.

594 {
595 option.canClose = false;
596 foreach (Window window in windows)
597 {
598 window.buttonClose.SetActive(enable: false);
599 }
600 }
Button buttonClose
Definition: Window.cs:624

References Window.buttonClose, and windows.

◆ GetLayer()

Layer Layer.GetLayer ( string  id)
inline

Definition at line 637 of file Layer.cs.

638 {
639 foreach (Layer layer in layers)
640 {
641 if (layer.idLayer == id)
642 {
643 return layer;
644 }
645 }
646 return null;
647 }
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 649 of file Layer.cs.

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

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

◆ GetOrAddLayer< T >()

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

Definition at line 370 of file Layer.cs.

370 : Layer
371 {
372 T val = GetLayer<T>();
373 if (!val)
374 {
375 val = AddLayer<T>();
376 }
377 return val;
378 }
T GetLayer< T >(bool fromTop=false)
Definition: Layer.cs:649
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 675 of file Layer.cs.

676 {
677 if (layers.Count > 0)
678 {
679 return layers.LastItem().GetTopLayer();
680 }
681 return this;
682 }

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 723 of file Layer.cs.

724 {
725 foreach (Layer layer in layers)
726 {
727 if (!layer.IsAllowGeneralInput())
728 {
729 return false;
730 }
731 }
733 }
bool allowGeneralInput
Definition: Layer.cs:41
bool IsAllowGeneralInput()
Definition: Layer.cs:723

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

Referenced by IsAllowGeneralInput().

◆ IsBlockWidgetClick()

bool Layer.IsBlockWidgetClick ( )
inline

Definition at line 699 of file Layer.cs.

700 {
701 foreach (Layer layer in layers)
702 {
703 if (layer.blockWidgetClick)
704 {
705 return true;
706 }
707 }
708 return blockWidgetClick;
709 }
virtual bool blockWidgetClick
Definition: Layer.cs:129

References blockWidgetClick.

◆ IsHideHud()

bool Layer.IsHideHud ( )
inline

Definition at line 711 of file Layer.cs.

712 {
713 foreach (Layer layer in layers)
714 {
715 if (layer.IsHideHud())
716 {
717 return true;
718 }
719 }
720 return option.hideHud;
721 }
bool hideHud
Definition: Layer.cs:39
bool IsHideHud()
Definition: Layer.cs:711

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

Referenced by IsHideHud().

◆ IsPointerOnLayer()

bool Layer.IsPointerOnLayer ( )
inline

Definition at line 751 of file Layer.cs.

752 {
753 foreach (GameObject item in InputModuleEX.GetPointerEventData().hovered)
754 {
755 if (item.GetComponentInParent<Layer>() == this)
756 {
757 return true;
758 }
759 }
760 return false;
761 }
static PointerEventData GetPointerEventData(int pointerId=-1)

References InputModuleEX.GetPointerEventData(), and item.

◆ IsUseBlur()

bool Layer.IsUseBlur ( )
inline

Definition at line 735 of file Layer.cs.

736 {
737 if ((bool)blurStopInstance)
738 {
739 return false;
740 }
741 foreach (Layer layer in layers)
742 {
743 if (layer.IsUseBlur())
744 {
745 return true;
746 }
747 }
748 return option.blur;
749 }
bool blur
Definition: Layer.cs:49
static Transform blurStopInstance
Definition: Layer.cs:82
bool IsUseBlur()
Definition: Layer.cs:735

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

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

◆ Kill()

virtual void Layer.Kill ( )
inlineprotectedvirtual

Reimplemented in ELayer.

Definition at line 549 of file Layer.cs.

550 {
551 if (isDestroyed || base.gameObject == null)
552 {
553 return;
554 }
555 isDestroyed = true;
556 foreach (Layer layer in layers)
557 {
558 layer.Kill();
559 }
560 if (windows.Count > 0)
561 {
563 foreach (Window window in windows)
564 {
565 window.OnKill();
566 }
567 }
568 OnKill();
569 onKill.Invoke();
570 if (option.persist)
571 {
572 base.gameObject.SetActive(value: false);
573 }
574 else
575 {
576 UnityEngine.Object.DestroyImmediate(base.gameObject);
577 }
578 }
static void SetCursor(CursorInfo info=null, int _priority=0)
UnityEvent onKill
Definition: Layer.cs:86
virtual void OnKill()
Definition: Layer.cs:580
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 384 of file Layer.cs.

385 {
386 }

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 Dialog, 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:468

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 380 of file Layer.cs.

381 {
382 }

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 460 of file Layer.cs.

461 {
462 if (!BaseCore.BlockInput())
463 {
464 Close();
465 }
466 }
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 525 of file Layer.cs.

526 {
527 _RemoveLayer(l);
528 }
void _RemoveLayer(Layer l)
Definition: Layer.cs:530

References _RemoveLayer().

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

◆ RemoveLayer< T >()

bool Layer.RemoveLayer< T > ( )
inline

Definition at line 512 of file Layer.cs.

513 {
514 for (int num = layers.Count - 1; num >= 0; num--)
515 {
516 if (layers[num] is T)
517 {
518 RemoveLayer(layers[num]);
519 return true;
520 }
521 }
522 return false;
523 }

References layers, and RemoveLayer().

◆ RemoveLayers()

void Layer.RemoveLayers ( bool  removeImportant = false)
inline

Definition at line 501 of file Layer.cs.

502 {
503 for (int num = layers.Count - 1; num >= 0; num--)
504 {
505 if (removeImportant || (!layers[num].option.important && !layers[num].option.persist))
506 {
507 RemoveLayer(layers[num]);
508 }
509 }
510 }
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 626 of file Layer.cs.

627 {
628 CanvasGroup cg = GetComponent<CanvasGroup>() ?? base.gameObject.AddComponent<CanvasGroup>();
629 cg.alpha = 0f;
630 TweenUtil.Tween(d, null, delegate
631 {
632 cg.alpha = 1f;
633 });
634 return this;
635 }

◆ SetOnKill()

◆ SetTitles()

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

Definition at line 693 of file Layer.cs.

694 {
695 windows[0].SetTitles(langList, idHeaderRow);
696 return this;
697 }

References SetTitles().

Referenced by UICharaMaker.ListAlias(), UICharaMaker.ListModes(), TraitSkyHelm.OnUse(), ActEffect.Proc(), 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 684 of file Layer.cs.

685 {
686 windows[idWindow].SwitchContent(i);
687 }

◆ ToggleLayer()

void Layer.ToggleLayer ( string  id)
inline

Definition at line 431 of file Layer.cs.

432 {
433 Layer layer = GetLayer(id);
434 if ((bool)layer)
435 {
436 RemoveLayer(layer);
437 }
438 else
439 {
440 AddLayer(id);
441 }
442 }
Layer GetLayer(string id)
Definition: Layer.cs:637

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 444 of file Layer.cs.

444 : Layer
445 {
446 T layer = GetLayer<T>();
447 if ((bool)layer)
448 {
449 RemoveLayer(layer);
450 return null;
451 }
452 return AddLayer<T>(id);
453 }

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:360
static ButtonState rightMouse
Definition: EInput.cs:362
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 455 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(), LayerPixelPaint.InitPaint(), LayerMod.InitSearchUI(), 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(), LayerMod.OnInit(), LayerModConfig.OnInit(), LayerQuestBoard.OnInit(), LayerResource.OnInit(), LayerTextureViewer.OnInit(), ContentFaction.OnSwitchContent(), LayerAbility.OnSwitchContent(), LayerQuestBoard.OnSwitchContent(), Scene.OnUpdate(), TraitSkyHelm.OnUse(), LayerGacha.PlayGacha(), LayerEquip.Rebuild(), LayerTravel.Refresh(), LayerAbility.RefreshConfig(), LayerFactions.RefreshFactions(), LayerMod.RefreshFilterButton(), LayerLoadGame.RefreshList(), LayerMod.RefreshLists(), 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: