Elin Decompiled Documentation EA 23.200 Stable
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 ()
 
void Sort ()
 
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 Sort();
68 if (dirty)
69 {
70 layout.RebuildLayout();
71 if ((bool)layout2)
72 {
73 layout2.RebuildLayout(recursive: true);
74 }
75 dirty = false;
76 }
77 }
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(), Sort(), and BaseNotification.Visible.

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

◆ Add()

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

Definition at line 93 of file BaseWidgetNotice.cs.

94 {
95 list.Add(n);
96 LayoutGroup layoutGroup = n.GetLayoutGroup() ?? layout;
97 ItemNotice itemNotice = Util.Instantiate(n.GetMold() ?? mold, parent ?? layoutGroup.transform);
98 itemNotice.button.onClick.AddListener(delegate
99 {
101 {
102 BaseCore.Instance.WaitForEndOfFrame(n.OnClick);
103 }
104 else
105 {
106 n.OnClick();
107 }
108 });
109 Sprite sprite = n.Sprite;
110 if (n.idSprite != -1)
111 {
112 sprite = sprites[n.idSprite];
113 }
114 if ((bool)sprite)
115 {
116 itemNotice.button.icon.sprite = sprite;
117 }
118 itemNotice.button.image.raycastTarget = n.Interactable;
119 itemNotice.button.tooltip.enable = n.onShowTooltip != null;
120 itemNotice.button.tooltip.onShowTooltip = n.onShowTooltip;
121 n.item = itemNotice;
122 n.Refresh();
123 n.OnInstantiate();
124 if (!activating)
125 {
126 layoutGroup.RebuildLayout(recursive: true);
127 Sort();
128 }
129 return itemNotice;
130 }
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:79
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, Sort(), 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 169 of file BaseWidgetNotice.cs.

170 {
172 }

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 141 of file BaseWidgetNotice.cs.

142 {
143 layout.childAlignment = (flip ? TextAnchor.MiddleRight : TextAnchor.MiddleLeft);
144 this.Rect().pivot = new Vector2(flip ? 1 : 0, this.Rect().pivot.y);
145 }
bool flip
Definition: Widget.cs:164

References Widget.flip.

◆ OnRefresh()

virtual void BaseWidgetNotice.OnRefresh ( )
inlinevirtual

Reimplemented in WidgetNotice, and WidgetStats.

Definition at line 89 of file BaseWidgetNotice.cs.

90 {
91 }

Referenced by _RefreshAll().

◆ OnSetContextMenu()

override void BaseWidgetNotice.OnSetContextMenu ( UIContextMenu  m)
inlinevirtual

Reimplemented from Widget.

Reimplemented in WidgetNotice, and WidgetStats.

Definition at line 147 of file BaseWidgetNotice.cs.

148 {
149 m.AddChild("style").AddSlider("toggleButtonBG", (float a) => a.ToString() ?? "", base.config.skin.button, delegate(float a)
150 {
151 base.config.skin.button = (int)a;
152 ApplySkin();
153 }, 0f, base.config.skin.Skin.buttons.Count - 1, isInt: true);
155 }
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 157 of file BaseWidgetNotice.cs.

158 {
159 SkinAsset_Button button = GetComponent<SkinRoot>().Config.Button;
160 int y = button.size.y;
161 foreach (BaseNotification item in list)
162 {
163 RectTransform rectTransform = item.item.Rect();
164 rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, y);
165 }
166 layout.spacing = button.spacing.y;
167 }

References item, list, and SkinAsset_Button.size.

Referenced by OnActivate(), and OnApplySkin().

◆ Remove()

void BaseWidgetNotice.Remove ( BaseNotification  n)
inline

Definition at line 132 of file BaseWidgetNotice.cs.

133 {
134 list.Remove(n);
135 if ((bool)n.item)
136 {
137 Object.DestroyImmediate(n.item.gameObject);
138 }
139 }

References BaseNotification.item, and list.

◆ Sort()

void BaseWidgetNotice.Sort ( )
inline

Definition at line 79 of file BaseWidgetNotice.cs.

80 {
81 IList<BaseNotification> list = this.list.Copy();
83 for (int i = 0; i < list.Count; i++)
84 {
85 list[i].item.transform.SetSiblingIndex(4 + i);
86 }
87 }
virtual int GetSortVal()

References BaseNotification.GetSortVal(), and list.

Referenced by _RefreshAll(), and Add().

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(), and OnActivate().

◆ list

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

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