Elin Modding Docs Doc
Loading...
Searching...
No Matches
UIDistribution.cs
1using System;
2
3// Token: 0x020005CA RID: 1482
4public class UIDistribution : EMono
5{
6 // Token: 0x0600289D RID: 10397 RVA: 0x000E5EBC File Offset: 0x000E40BC
7 private void OnEnable()
8 {
9 if (this.needRefresh)
10 {
11 this.needRefresh = false;
12 this.Refresh();
13 }
14 }
15
16 // Token: 0x0600289E RID: 10398 RVA: 0x000E5ED3 File Offset: 0x000E40D3
17 public void SetContainer(Card t, Window.SaveData d)
18 {
19 this.container = t;
20 this.data = d;
21 this.needRefresh = true;
22 this.SetActive(false);
23 }
24
25 // Token: 0x0600289F RID: 10399 RVA: 0x000E5EF4 File Offset: 0x000E40F4
26 public void Refresh()
27 {
28 UIDistribution.<>c__DisplayClass6_0 CS$<>8__locals1 = new UIDistribution.<>c__DisplayClass6_0();
29 CS$<>8__locals1.<>4__this = this;
30 CS$<>8__locals1.cats = this.data.cats;
31 BaseList baseList = this.list;
32 UIList.Callback<SourceCategory.Row, ButtonCategory> callback = new UIList.Callback<SourceCategory.Row, ButtonCategory>();
33 callback.onClick = delegate(SourceCategory.Row a, ButtonCategory b)
34 {
35 if (a.children.Count > 0)
36 {
37 b.buttonFold.onClick.Invoke();
38 }
39 };
40 callback.onInstantiate = delegate(SourceCategory.Row a, ButtonCategory b)
41 {
42 b.uid = a.uid;
43 b.mainText.text = a.GetName().ToTitleCase(false);
44 bool flag = false;
45 foreach (int uid in CS$<>8__locals1.cats)
46 {
47 if (a.Contatin(uid))
48 {
49 flag = true;
50 break;
51 }
52 }
53 b.SetFold(a.children.Count > 0, !flag, delegate(UIList l)
54 {
55 foreach (SourceCategory.Row o in a.children)
56 {
57 l.Add(o);
58 }
59 });
60 b.buttonToggle.icon.SetActive(CS$<>8__locals1.cats.Contains(a.uid));
61 b.buttonToggle.SetOnClick(delegate
62 {
63 bool flag2 = !CS$<>8__locals1.cats.Contains(a.uid);
64 b.buttonToggle.icon.SetActive(flag2);
65 if (flag2)
66 {
67 CS$<>8__locals1.cats.Add(a.uid);
68 }
69 else
70 {
71 CS$<>8__locals1.cats.Remove(a.uid);
72 }
73 CS$<>8__locals1.<Refresh>g__SetAll|0(a.uid, flag2);
74 SE.Click();
75 });
76 };
77 callback.onRefresh = null;
78 baseList.callbacks = callback;
79 foreach (SourceCategory.Row row in EMono.sources.categories.rows)
80 {
81 if (row.parent == null && row.id != "new" && row.id != "none")
82 {
83 this.list.Add(row);
84 }
85 }
86 this.list.Refresh(false);
87 }
88
89 // Token: 0x040016DA RID: 5850
90 public Card container;
91
92 // Token: 0x040016DB RID: 5851
93 public UIList list;
94
95 // Token: 0x040016DC RID: 5852
96 public Window.SaveData data;
97
98 // Token: 0x040016DD RID: 5853
99 public bool needRefresh;
100}
Definition Card.cs:13
Definition EMono.cs:6