Elin Decompiled Documentation EA 23.102 Nightly
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Pages
WidgetSticky Class Reference
Inheritance diagram for WidgetSticky:
Widget EMono IChangeResolution ISkinRoot

Classes

class  Extra
 

Public Member Functions

override object CreateExtra ()
 
override void OnActivate ()
 
void Init ()
 
void _Add (BaseSticky sticky, bool animate=true)
 
void _Remove (BaseSticky sticky)
 
void Refresh ()
 
override void OnSetContextMenu (UIContextMenu m)
 
- 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 ()
 

Static Public Member Functions

static void Add (BaseSticky sticky, bool animate=true)
 
- Static Public Member Functions inherited from EMono
static int rnd (int a)
 

Public Attributes

LayoutGroup layout
 
List< BaseStickylist = new List<BaseSticky>()
 
List< Sprite > icons
 
UIItem mold
 
Anime anime
 
- Public Attributes inherited from Widget
Image imageBG
 
SoundData soundActivate
 
UIDragPanel dragPanel
 
RectTransform tipPivotLeft
 
RectTransform tipPivotRight
 

Static Public Attributes

static WidgetSticky Instance
 
- Static Public Attributes inherited from EMono
static Core core
 

Properties

Extra extra [get]
 
- 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]
 

Additional Inherited Members

- Public Types inherited from Widget
enum  WidgetType { Default , ZoomMenu }
 
enum  State { Active , Inactive }
 
- Protected Member Functions inherited from Widget
void ClampToScreenEnsured (Component c, Vector2 anchoredPos)
 
void ClampToScreen (RectTransform rect, float margin=10f)
 
- Protected Attributes inherited from Widget
bool flip
 

Detailed Description

Definition at line 5 of file WidgetSticky.cs.

Member Function Documentation

◆ _Add()

void WidgetSticky._Add ( BaseSticky  sticky,
bool  animate = true 
)
inline

Definition at line 60 of file WidgetSticky.cs.

61 {
62 if (!sticky.AllowMultiple)
63 {
64 list.ForeachReverse(delegate(BaseSticky i)
65 {
66 if (i.GetType().Equals(sticky.GetType()))
67 {
68 _Remove(i);
69 }
70 });
71 }
72 list.Add(sticky);
73 UIItem uIItem = (sticky.item = Util.Instantiate(mold, layout));
74 uIItem.image1.transform.parent.SetActive(sticky.animate);
75 uIItem.SetActive(enable: true);
76 sticky.RefreshButton();
77 uIItem.transform.SetAsFirstSibling();
78 layout.RebuildLayout();
79 if (animate)
80 {
81 anime.Play(uIItem.button1.transform);
82 SE.Play(sticky.idSound);
83 }
84 }
virtual Tween Play(Transform trans, UnityAction onComplete=null, float duration=-1f, float delay=0f)
Definition: Anime.cs:7
virtual void RefreshButton()
Definition: BaseSticky.cs:42
virtual string idSound
Definition: BaseSticky.cs:7
virtual bool AllowMultiple
Definition: BaseSticky.cs:21
virtual bool animate
Definition: BaseSticky.cs:11
Definition: UIItem.cs:5
UIButton button1
Definition: UIItem.cs:18
Image image1
Definition: UIItem.cs:14
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67
List< BaseSticky > list
Definition: WidgetSticky.cs:20
LayoutGroup layout
Definition: WidgetSticky.cs:18

References BaseSticky.AllowMultiple, BaseSticky.animate, anime, UIItem.button1, BaseSticky.idSound, UIItem.image1, layout, list, mold, Anime.Play(), BaseSticky.RefreshButton(), and Util.

Referenced by Add(), and Init().

◆ _Remove()

void WidgetSticky._Remove ( BaseSticky  sticky)
inline

Definition at line 86 of file WidgetSticky.cs.

87 {
88 list.Remove(sticky);
89 Object.Destroy(sticky.item.gameObject);
90 }
UIItem item
Definition: BaseSticky.cs:5

References BaseSticky.item, and list.

Referenced by BaseSticky.RefreshButton().

◆ Add()

static void WidgetSticky.Add ( BaseSticky  sticky,
bool  animate = true 
)
inlinestatic

Definition at line 52 of file WidgetSticky.cs.

53 {
54 if ((bool)Instance)
55 {
56 Instance._Add(sticky);
57 }
58 }
static WidgetSticky Instance
Definition: WidgetSticky.cs:16
void _Add(BaseSticky sticky, bool animate=true)
Definition: WidgetSticky.cs:60

References _Add(), and Instance.

Referenced by GameDate.AdvanceDay().

◆ CreateExtra()

override object WidgetSticky.CreateExtra ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 30 of file WidgetSticky.cs.

31 {
32 return new Extra();
33 }

◆ Init()

void WidgetSticky.Init ( )
inline

Definition at line 41 of file WidgetSticky.cs.

42 {
43 Instance = this;
44 mold = layout.CreateMold<UIItem>();
45 _Add(new StickyMenu(), animate: false);
46 _Add(new StickyDate(), animate: false);
47 _Add(new StickyWelcome(), animate: false);
48 _Add(new StickyGacha(), animate: false);
49 InvokeRepeating("Refresh", 0f, 1f);
50 }

References _Add(), Instance, layout, and mold.

Referenced by OnActivate().

◆ OnActivate()

override void WidgetSticky.OnActivate ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 35 of file WidgetSticky.cs.

36 {
37 Instance = this;
38 Init();
39 }

References Init(), and Instance.

◆ OnSetContextMenu()

override void WidgetSticky.OnSetContextMenu ( UIContextMenu  m)
inlinevirtual

Reimplemented from Widget.

Definition at line 105 of file WidgetSticky.cs.

106 {
107 UIContextMenu uIContextMenu = m.AddChild("setting");
108 uIContextMenu.AddToggle("showDate", extra.showDate, delegate(bool a)
109 {
110 extra.showDate = a;
111 Refresh();
112 });
113 uIContextMenu.AddToggle("showText", extra.showText, delegate(bool a)
114 {
115 extra.showText = a;
116 Refresh();
117 });
118 uIContextMenu.AddToggle("showNerun", extra.showNerun, delegate(bool a)
119 {
120 extra.showNerun = a;
121 Refresh();
122 });
123 m.AddChild("style").AddSlider("toggleButtonBG", (float a) => a.ToString() ?? "", base.config.skin.button, delegate(float a)
124 {
125 base.config.skin.button = (int)a;
126 ApplySkin();
127 }, 0f, base.config.skin.Skin.buttons.Count - 1, isInt: true);
129 }
UIContextMenuItem AddToggle(string idLang="", bool isOn=false, UnityAction< bool > action=null)
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)
void Refresh()
Definition: WidgetSticky.cs:92
virtual void ApplySkin()
Definition: Widget.cs:556
void SetBaseContextMenu(UIContextMenu m)
Definition: Widget.cs:608

References UIContextMenu.AddChild(), UIContextMenu.AddSlider(), UIContextMenu.AddToggle(), Widget.ApplySkin(), extra, Refresh(), Widget.SetBaseContextMenu(), WidgetSticky.Extra.showDate, WidgetSticky.Extra.showNerun, and WidgetSticky.Extra.showText.

◆ Refresh()

void WidgetSticky.Refresh ( )
inline

Definition at line 92 of file WidgetSticky.cs.

93 {
94 foreach (BaseSticky item in list)
95 {
96 bool shouldShow = item.ShouldShow;
97 item.item.SetActive(shouldShow);
98 if (shouldShow)
99 {
100 item.Refresh();
101 }
102 }
103 }

References item, and list.

Referenced by StickyGacha.OnClick(), and OnSetContextMenu().

Member Data Documentation

◆ anime

Anime WidgetSticky.anime

Definition at line 26 of file WidgetSticky.cs.

Referenced by _Add().

◆ icons

List<Sprite> WidgetSticky.icons

Definition at line 22 of file WidgetSticky.cs.

Referenced by BaseSticky.RefreshButton().

◆ Instance

WidgetSticky WidgetSticky.Instance
static

Definition at line 16 of file WidgetSticky.cs.

Referenced by Add(), Init(), OnActivate(), and BaseSticky.RefreshButton().

◆ layout

LayoutGroup WidgetSticky.layout

Definition at line 18 of file WidgetSticky.cs.

Referenced by _Add(), and Init().

◆ list

List<BaseSticky> WidgetSticky.list = new List<BaseSticky>()

Definition at line 20 of file WidgetSticky.cs.

Referenced by _Add(), _Remove(), and Refresh().

◆ mold

UIItem WidgetSticky.mold

Definition at line 24 of file WidgetSticky.cs.

Referenced by _Add(), and Init().

Property Documentation

◆ extra

Extra WidgetSticky.extra
get

Definition at line 28 of file WidgetSticky.cs.

Referenced by OnSetContextMenu(), and BaseSticky.RefreshButton().


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