Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
UIDistribution Class Reference
Inheritance diagram for UIDistribution:
EMono

Public Member Functions

void SetContainer (Card t, Window.SaveData d)
 
void Refresh ()
 

Public Attributes

Card container
 
UIList list
 
Window.SaveData data
 
bool needRefresh
 

Private Member Functions

void OnEnable ()
 

Additional Inherited Members

- Static Public Member Functions inherited from EMono
static int rnd (int a)
 
- Static Public Attributes inherited from EMono
static Core core
 
- 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 3 of file UIDistribution.cs.

Member Function Documentation

◆ OnEnable()

void UIDistribution.OnEnable ( )
inlineprivate

Definition at line 13 of file UIDistribution.cs.

14 {
15 if (needRefresh)
16 {
17 needRefresh = false;
18 Refresh();
19 }
20 }

References needRefresh, and Refresh().

◆ Refresh()

void UIDistribution.Refresh ( )
inline

Definition at line 30 of file UIDistribution.cs.

31 {
32 HashSet<int> cats = data.cats;
33 list.callbacks = new UIList.Callback<SourceCategory.Row, ButtonCategory>
34 {
35 onClick = delegate(SourceCategory.Row a, ButtonCategory b)
36 {
37 if (a.children.Count > 0)
38 {
39 b.buttonFold.onClick.Invoke();
40 }
41 },
42 onInstantiate = delegate(SourceCategory.Row a, ButtonCategory b)
43 {
44 b.uid = a.uid;
45 b.mainText.text = a.GetName().ToTitleCase();
46 bool flag3 = false;
47 foreach (int item in cats)
48 {
49 if (a.Contatin(item))
50 {
51 flag3 = true;
52 break;
53 }
54 }
55 b.SetFold(a.children.Count > 0, !flag3, delegate(UIList l)
56 {
57 foreach (SourceCategory.Row child in a.children)
58 {
59 l.Add(child);
60 }
61 });
62 b.buttonToggle.icon.SetActive(cats.Contains(a.uid));
63 b.buttonToggle.SetOnClick(delegate
64 {
65 bool flag4 = !cats.Contains(a.uid);
66 b.buttonToggle.icon.SetActive(flag4);
67 if (flag4)
68 {
69 cats.Add(a.uid);
70 }
71 else
72 {
73 cats.Remove(a.uid);
74 }
75 SetAll(a.uid, flag4);
76 SE.Click();
77 });
78 },
79 onRefresh = null
80 };
81 foreach (SourceCategory.Row row2 in EMono.sources.categories.rows)
82 {
83 if (row2.parent == null && row2.id != "new" && row2.id != "none")
84 {
85 list.Add(row2);
86 }
87 }
88 list.Refresh();
89 void SetAll(int uid, bool enable)
90 {
91 SourceCategory.Row row = EMono.sources.categories.rows.Find((SourceCategory.Row a) => a.uid == uid);
92 if (row != null)
93 {
94 foreach (SourceCategory.Row row3 in EMono.sources.categories.rows)
95 {
96 if (row.Contatin(row3.uid))
97 {
98 if (enable)
99 {
100 cats.Add(row3.uid);
101 }
102 else
103 {
104 cats.Remove(row3.uid);
105 }
106 }
107 else if (row.IsChildOf(row3.uid) && enable)
108 {
109 cats.Add(row3.uid);
110 }
111 }
112 bool flag;
113 do
114 {
115 flag = true;
116 foreach (SourceCategory.Row row4 in EMono.sources.categories.rows)
117 {
118 if (row4.children.Count != 0 && cats.Contains(row4.uid))
119 {
120 bool flag2 = false;
121 foreach (int item2 in cats)
122 {
123 if (item2 != row4.uid && row4.Contatin(item2))
124 {
125 flag2 = true;
126 break;
127 }
128 }
129 if (!flag2)
130 {
131 cats.Remove(row4.uid);
132 flag = false;
133 }
134 }
135 }
136 }
137 while (!flag);
138 ButtonCategory[] componentsInChildren = list.GetComponentsInChildren<ButtonCategory>();
139 foreach (ButtonCategory buttonCategory in componentsInChildren)
140 {
141 buttonCategory.buttonToggle.icon.SetActive(cats.Contains(buttonCategory.uid));
142 }
143 }
144 }
145 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
UIButton buttonFold
UIButton buttonToggle
void SetFold(bool show, bool folded)
Definition: EMono.cs:4
static SourceManager sources
Definition: EMono.cs:41
bool Contatin(int _uid)
List< Row > children
bool IsChildOf(string id)
SourceCategory categories
Image icon
Definition: UIButton.cs:110
Window.SaveData data
Definition: UIList.cs:9
override void Add(object item)
Definition: UIList.cs:302
virtual void Refresh(bool highlightLast=false)
Definition: UIList.cs:424

References UIList.Add(), ButtonCategory.buttonFold, ButtonCategory.buttonToggle, SourceManager.categories, SourceCategory.Row.children, SourceCategory.Row.Contatin(), data, UIButton.icon, if(), SourceCategory.Row.IsChildOf(), item, list, UIList.Refresh(), ButtonCategory.SetFold(), EMono.sources, and ButtonCategory.uid.

Referenced by OnEnable().

◆ SetContainer()

void UIDistribution.SetContainer ( Card  t,
Window::SaveData  d 
)
inline

Definition at line 22 of file UIDistribution.cs.

23 {
24 container = t;
25 data = d;
26 needRefresh = true;
27 this.SetActive(enable: false);
28 }

References container, data, and needRefresh.

Referenced by UIInventory.ShowAdvDistribution().

Member Data Documentation

◆ container

Card UIDistribution.container

Definition at line 5 of file UIDistribution.cs.

Referenced by SetContainer().

◆ data

Window.SaveData UIDistribution.data

Definition at line 9 of file UIDistribution.cs.

Referenced by Refresh(), and SetContainer().

◆ list

UIList UIDistribution.list

Definition at line 7 of file UIDistribution.cs.

Referenced by Refresh().

◆ needRefresh

bool UIDistribution.needRefresh

Definition at line 11 of file UIDistribution.cs.

Referenced by OnEnable(), and SetContainer().


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