10 public override object CreateExtra()
26 public override void OnActivate()
28 WidgetSticky.Instance =
this;
35 WidgetSticky.Instance =
this;
36 this.mold = this.layout.CreateMold(
null);
41 base.InvokeRepeating(
"Refresh", 0f, 1f);
45 public static void Add(
BaseSticky sticky,
bool animate =
true)
55 public void _Add(
BaseSticky sticky,
bool animate =
true)
57 if (!sticky.AllowMultiple)
59 this.list.ForeachReverse(delegate(
BaseSticky i)
61 if (i.GetType().Equals(sticky.GetType()))
67 this.list.Add(sticky);
68 UIItem uiitem = sticky.item = Util.Instantiate<UIItem>(this.mold, this.layout);
69 uiitem.image1.transform.parent.SetActive(sticky.animate);
70 uiitem.SetActive(
true);
71 sticky.RefreshButton();
72 uiitem.transform.SetAsFirstSibling();
73 this.layout.RebuildLayout(
false);
76 this.anime.Play(uiitem.button1.transform,
null, -1f, 0f);
77 SE.Play(sticky.idSound);
84 this.list.Remove(sticky);
85 UnityEngine.Object.Destroy(sticky.item.gameObject);
93 bool shouldShow = baseSticky.ShouldShow;
94 baseSticky.item.SetActive(shouldShow);
103 public override void OnSetContextMenu(UIContextMenu m)
105 UIContextMenu uicontextMenu = m.AddChild(
"setting");
106 uicontextMenu.AddToggle(
"showDate", this.extra.showDate, delegate(
bool a)
108 this.extra.showDate = a;
111 uicontextMenu.AddToggle(
"showText", this.extra.showText, delegate(
bool a)
113 this.extra.showText = a;
116 uicontextMenu.AddToggle(
"showNerun", this.extra.showNerun, delegate(
bool a)
118 this.extra.showNerun = a;
121 m.AddChild(
"style").AddSlider(
"toggleButtonBG", (
float a) => a.ToString() ??
"", (
float)base.config.skin.button, delegate(
float a)
123 base.config.skin.button = (int)a;
125 }, 0f, (float)(base.config.skin.Skin.buttons.Count - 1),
true,
true,
false);
126 base.SetBaseContextMenu(m);
133 public LayoutGroup layout;
136 public List<BaseSticky> list =
new List<BaseSticky>();
139 public List<Sprite> icons;
151 public bool showDate;
154 public bool showText;
157 public bool showNerun;