Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
WidgetNotice.cs
Go to the documentation of this file.
1using System;
2using UnityEngine;
3
5{
6 public class Extra
7 {
8 public bool showStock;
9 }
10
11 public static WidgetNotice Instance;
12
13 public Transform H1;
14
15 public Transform H2;
16
17 public Transform H3;
18
19 public Transform H4;
20
22
24
25 [NonSerialized]
26 public int battles;
27
28 [NonSerialized]
29 public int guests;
30
31 public Extra extra => base.config.extra as Extra;
32
33 public override object CreateExtra()
34 {
35 return new Extra();
36 }
37
38 public static void RefreshAll()
39 {
40 if ((bool)Instance)
41 {
43 }
44 }
45
46 public override void _OnActivate()
47 {
48 Instance = this;
49 LittlePopper.showStock = extra.showStock;
50 Add(new NotificationHome(), H1);
53 }
54
55 public override void OnRefresh()
56 {
57 battles = 0;
58 guests = 0;
59 foreach (Chara chara in EMono._map.charas)
60 {
61 if (chara.IsHomeMember())
62 {
63 if (chara.enemy != null && chara.IsAliveInCurrentZone)
64 {
65 battles++;
66 }
67 }
68 else if (chara.IsGuest())
69 {
70 guests++;
71 }
72 }
73 H4.SetActive(itemBattle.gameObject.activeSelf || itemGuest.gameObject.activeSelf);
74 }
75
76 public override void OnSetContextMenu(UIContextMenu m)
77 {
78 m.AddToggle("showStockPop", extra.showStock, delegate(bool a)
79 {
80 extra.showStock = (LittlePopper.showStock = a);
81 });
82 base.OnSetContextMenu(m);
83 }
84}
ItemNotice Add(BaseNotification n, Transform parent=null)
Definition: Chara.cs:10
override bool IsAliveInCurrentZone
Definition: Chara.cs:546
bool IsHomeMember()
Definition: Chara.cs:5942
bool IsGuest()
Definition: Chara.cs:5967
Chara enemy
Definition: Chara.cs:83
Definition: EMono.cs:4
static Map _map
Definition: EMono.cs:17
List< Chara > charas
Definition: Map.cs:81
UIContextMenuItem AddToggle(string idLang="", bool isOn=false, UnityAction< bool > action=null)
override void OnSetContextMenu(UIContextMenu m)
Definition: WidgetNotice.cs:76
Transform H1
Definition: WidgetNotice.cs:13
override void OnRefresh()
Definition: WidgetNotice.cs:55
Transform H2
Definition: WidgetNotice.cs:15
static WidgetNotice Instance
Definition: WidgetNotice.cs:11
static void RefreshAll()
Definition: WidgetNotice.cs:38
override void _OnActivate()
Definition: WidgetNotice.cs:46
Transform H3
Definition: WidgetNotice.cs:17
Transform H4
Definition: WidgetNotice.cs:19
ItemNotice itemGuest
Definition: WidgetNotice.cs:23
ItemNotice itemBattle
Definition: WidgetNotice.cs:21
override object CreateExtra()
Definition: WidgetNotice.cs:33