Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
BaseWidgetNotice Class Reference
Inheritance diagram for BaseWidgetNotice:
Widget EMono IChangeResolution ISkinRoot WidgetNotice WidgetStats

Public Member Functions

sealed override void OnActivate ()
 
virtual void _OnActivate ()
 
void _RefreshAll ()
 
virtual void OnRefresh ()
 
ItemNotice Add (BaseNotification n, Transform parent=null)
 
void Remove (BaseNotification n)
 
override void OnFlip ()
 
override void OnSetContextMenu (UIContextMenu m)
 
void RefreshLayout ()
 
override void OnApplySkin ()
 
- Public Member Functions inherited from Widget
void Test ()
 
bool IsInRightMode ()
 
void Activate ()
 
void RefreshOrder ()
 
virtual void OnActivate ()
 
virtual object CreateExtra ()
 
void Deactivate ()
 
virtual void OnDeactivate ()
 
void Close ()
 
void Reactivate ()
 
virtual void OnManagerActivate ()
 
virtual void OnManagerDeactivate ()
 
void SetAnchor (RectPosition p)
 
void SetPivot (RectPosition p)
 
virtual void OnChangePivot ()
 
void UpdateConfig ()
 
virtual void OnUpdateConfig ()
 
void ClampToScreen ()
 
virtual void OnChangeResolution ()
 
void OnChangePosition ()
 
virtual void OnChangeActionMode ()
 
virtual void OnFlip ()
 
bool IsAlignTop ()
 
Layer AddLayer (Layer l, Transform trans)
 
void RefreshTipPivotPosition ()
 
SkinSet GetSkin ()
 
SkinConfig GetSkinConfig ()
 
void SetSkin (int id, int v=0)
 
void TestSkin ()
 
virtual void ApplySkin ()
 
virtual void OnApplySkin ()
 
void InstantiateDeco (SkinDeco deco)
 
void AddDeco (SkinDeco deco)
 
void RemoveDeco (SkinDeco deco)
 
virtual bool CanShowContextMenu ()
 
void ShowContextMenu ()
 
void SetBaseContextMenu (UIContextMenu m)
 
virtual void OnSetContextMenu (UIContextMenu m)
 
void SetGridContextMenu (UIContextMenu m)
 
void SoundActivate ()
 
void OnChangeResolution ()
 
SkinSet GetSkin ()
 
SkinConfig GetSkinConfig ()
 

Public Attributes

Sprite[] sprites
 
List< BaseNotificationlist = new List<BaseNotification>()
 
VerticalLayoutGroup layout
 
VerticalLayoutGroup layout2
 
ItemNotice mold
 
- Public Attributes inherited from Widget
Image imageBG
 
SoundData soundActivate
 
UIDragPanel dragPanel
 
RectTransform tipPivotLeft
 
RectTransform tipPivotRight
 

Protected Attributes

bool dirty
 
- Protected Attributes inherited from Widget
bool flip
 

Private Member Functions

void OnEnable ()
 
void OnDisable ()
 

Private Attributes

bool activating = true
 

Additional Inherited Members

- Public Types inherited from Widget
enum  WidgetType { Default , ZoomMenu }
 
enum  State { Active , Inactive }
 
- Static Public Member Functions inherited from EMono
static int rnd (int a)
 
- Static Public Attributes inherited from EMono
static Core core
 
- Protected Member Functions inherited from Widget
void ClampToScreenEnsured (Component c, Vector2 anchoredPos)
 
void ClampToScreen (RectTransform rect, float margin=10f)
 
- Properties inherited from Widget
string ID [get]
 
Config config [get]
 
SkinRoot skinRoot [get]
 
bool IsSealed [get]
 
virtual bool ShowStyleMenu [get]
 
virtual bool AlwaysTop [get]
 
virtual bool IsStaticPosition [get]
 
virtual bool AlwaysBottom [get]
 
virtual Type SetSiblingAfter [get]
 
virtual bool ShowInBuildMode [get]
 
virtual bool RightClickToClose [get]
 
virtual bool AllowRightClickToClose [get]
 
- Properties inherited from EMono
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 5 of file BaseWidgetNotice.cs.

Member Function Documentation

◆ _OnActivate()

virtual void BaseWidgetNotice._OnActivate ( )
inlinevirtual

Reimplemented in WidgetNotice, and WidgetStats.

Definition at line 38 of file BaseWidgetNotice.cs.

39 {
40 }

Referenced by OnActivate().

◆ _RefreshAll()

void BaseWidgetNotice._RefreshAll ( )
inline

Definition at line 52 of file BaseWidgetNotice.cs.

53 {
54 OnRefresh();
55 foreach (BaseNotification i in list)
56 {
57 i.Refresh();
58 i.item.SetActive(i.Visible, delegate(bool enabled)
59 {
60 if (enabled)
61 {
62 i.item.button.RebuildLayout(recursive: true);
63 }
64 dirty = true;
65 });
66 }
67 if (dirty)
68 {
69 layout.RebuildLayout();
70 if ((bool)layout2)
71 {
72 layout2.RebuildLayout(recursive: true);
73 }
74 dirty = false;
75 }
76 }
virtual bool Visible
VerticalLayoutGroup layout2
virtual void OnRefresh()
VerticalLayoutGroup layout
List< BaseNotification > list
UIButton button
Definition: ItemNotice.cs:11

References ItemNotice.button, dirty, BaseNotification.item, layout, layout2, list, OnRefresh(), BaseNotification.Refresh(), and BaseNotification.Visible.

Referenced by OnActivate(), WidgetNotice.RefreshAll(), and WidgetStats.RefreshAll().

◆ Add()

ItemNotice BaseWidgetNotice.Add ( BaseNotification  n,
Transform  parent = null 
)
inline

Definition at line 82 of file BaseWidgetNotice.cs.

83 {
84 list.Add(n);
85 LayoutGroup layoutGroup = n.GetLayoutGroup() ?? layout;
86 ItemNotice itemNotice = Util.Instantiate(n.GetMold() ?? mold, parent ?? layoutGroup.transform);
87 itemNotice.button.onClick.AddListener(delegate
88 {
90 {
91 BaseCore.Instance.WaitForEndOfFrame(n.OnClick);
92 }
93 else
94 {
95 n.OnClick();
96 }
97 });
98 Sprite sprite = n.Sprite;
99 if (n.idSprite != -1)
100 {
101 sprite = sprites[n.idSprite];
102 }
103 if ((bool)sprite)
104 {
105 itemNotice.button.icon.sprite = sprite;
106 }
107 itemNotice.button.image.raycastTarget = n.Interactable;
108 itemNotice.button.tooltip.enable = n.onShowTooltip != null;
109 itemNotice.button.tooltip.onShowTooltip = n.onShowTooltip;
110 n.item = itemNotice;
111 n.Refresh();
112 n.OnInstantiate();
113 if (!activating)
114 {
115 layoutGroup.RebuildLayout(recursive: true);
116 }
117 return itemNotice;
118 }
static AM_NoMap NoMap
Definition: ActionMode.cs:25
virtual ItemNotice GetMold()
virtual int idSprite
virtual Action< UITooltip > onShowTooltip
virtual void OnInstantiate()
virtual LayoutGroup GetLayoutGroup()
virtual bool Interactable
virtual Sprite Sprite
Definition: EMono.cs:4
static Scene scene
Definition: EMono.cs:27
ActionMode actionMode
Definition: Scene.cs:77
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References Scene.actionMode, activating, ItemNotice.button, BaseNotification.GetLayoutGroup(), BaseNotification.GetMold(), BaseNotification.idSprite, BaseNotification.Interactable, layout, list, mold, ActionMode.NoMap, BaseNotification.OnInstantiate(), BaseNotification.onShowTooltip, BaseNotification.Refresh(), EMono.scene, BaseNotification.Sprite, sprites, and Util.

Referenced by WidgetNotice._OnActivate(), WidgetStats._OnActivate(), and WidgetStats.OnRefresh().

◆ OnActivate()

sealed override void BaseWidgetNotice.OnActivate ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 21 of file BaseWidgetNotice.cs.

22 {
23 if (!mold)
24 {
25 mold = layout.CreateMold<ItemNotice>();
26 }
29 layout.RebuildLayout(recursive: true);
30 if ((bool)layout2)
31 {
32 layout2.RebuildLayout(recursive: true);
33 }
34 activating = false;
36 }
virtual void _OnActivate()

References _OnActivate(), _RefreshAll(), activating, layout, layout2, mold, and RefreshLayout().

◆ OnApplySkin()

override void BaseWidgetNotice.OnApplySkin ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 157 of file BaseWidgetNotice.cs.

158 {
160 }

References RefreshLayout().

◆ OnDisable()

void BaseWidgetNotice.OnDisable ( )
inlineprivate

Definition at line 47 of file BaseWidgetNotice.cs.

48 {
49 CancelInvoke();
50 }

◆ OnEnable()

void BaseWidgetNotice.OnEnable ( )
inlineprivate

Definition at line 42 of file BaseWidgetNotice.cs.

43 {
44 InvokeRepeating("_RefreshAll", 0.1f, 0.2f);
45 }

◆ OnFlip()

override void BaseWidgetNotice.OnFlip ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 129 of file BaseWidgetNotice.cs.

130 {
131 layout.childAlignment = (flip ? TextAnchor.MiddleRight : TextAnchor.MiddleLeft);
132 this.Rect().pivot = new Vector2(flip ? 1 : 0, this.Rect().pivot.y);
133 }
bool flip
Definition: Widget.cs:164

References Widget.flip.

◆ OnRefresh()

virtual void BaseWidgetNotice.OnRefresh ( )
inlinevirtual

Reimplemented in WidgetNotice, and WidgetStats.

Definition at line 78 of file BaseWidgetNotice.cs.

79 {
80 }

Referenced by _RefreshAll().

◆ OnSetContextMenu()

override void BaseWidgetNotice.OnSetContextMenu ( UIContextMenu  m)
inlinevirtual

Reimplemented from Widget.

Reimplemented in WidgetNotice.

Definition at line 135 of file BaseWidgetNotice.cs.

136 {
137 m.AddChild("style").AddSlider("toggleButtonBG", (float a) => a.ToString() ?? "", base.config.skin.button, delegate(float a)
138 {
139 base.config.skin.button = (int)a;
140 ApplySkin();
141 }, 0f, base.config.skin.Skin.buttons.Count - 1, isInt: true);
143 }
UIContextMenuItem AddSlider(string text, Func< float, string > textFunc, float value, Action< float > action, float min=0f, float max=1f, bool isInt=false, bool hideOther=true, bool useInput=false)
UIContextMenu AddChild(string idLang, TextAnchor anchor)
virtual void ApplySkin()
Definition: Widget.cs:556
void SetBaseContextMenu(UIContextMenu m)
Definition: Widget.cs:608

References UIContextMenu.AddChild(), UIContextMenu.AddSlider(), Widget.ApplySkin(), and Widget.SetBaseContextMenu().

◆ RefreshLayout()

void BaseWidgetNotice.RefreshLayout ( )
inline

Definition at line 145 of file BaseWidgetNotice.cs.

146 {
147 SkinAsset_Button button = GetComponent<SkinRoot>().Config.Button;
148 int y = button.size.y;
149 foreach (BaseNotification item in list)
150 {
151 RectTransform rectTransform = item.item.Rect();
152 rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, y);
153 }
154 layout.spacing = button.spacing.y;
155 }

References item, list, and SkinAsset_Button.size.

Referenced by OnActivate(), and OnApplySkin().

◆ Remove()

void BaseWidgetNotice.Remove ( BaseNotification  n)
inline

Definition at line 120 of file BaseWidgetNotice.cs.

121 {
122 list.Remove(n);
123 if ((bool)n.item)
124 {
125 Object.DestroyImmediate(n.item.gameObject);
126 }
127 }

References BaseNotification.item, and list.

Member Data Documentation

◆ activating

bool BaseWidgetNotice.activating = true
private

Definition at line 17 of file BaseWidgetNotice.cs.

Referenced by Add(), and OnActivate().

◆ dirty

bool BaseWidgetNotice.dirty
protected

Definition at line 19 of file BaseWidgetNotice.cs.

Referenced by _RefreshAll().

◆ layout

VerticalLayoutGroup BaseWidgetNotice.layout

Definition at line 11 of file BaseWidgetNotice.cs.

Referenced by _RefreshAll(), Add(), OnActivate(), and NotificationCondition.OnClick().

◆ layout2

VerticalLayoutGroup BaseWidgetNotice.layout2

Definition at line 13 of file BaseWidgetNotice.cs.

Referenced by _RefreshAll(), NotificationBuff.GetLayoutGroup(), and OnActivate().

◆ list

List<BaseNotification> BaseWidgetNotice.list = new List<BaseNotification>()

Definition at line 9 of file BaseWidgetNotice.cs.

Referenced by _RefreshAll(), Add(), RefreshLayout(), and Remove().

◆ mold

ItemNotice BaseWidgetNotice.mold

Definition at line 15 of file BaseWidgetNotice.cs.

Referenced by Add(), and OnActivate().

◆ sprites

Sprite [] BaseWidgetNotice.sprites

Definition at line 7 of file BaseWidgetNotice.cs.

Referenced by Add().


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