10 public static void Refresh()
19 public void OnActivate()
21 UIResourceTrack.Instance =
this;
22 this.buttonAdd.SetOnClick(delegate
28 this.mold = this.layout.CreateMold(
null);
34 public void OnMoveZone()
36 this.dictProp.Clear();
38 this.layout.DestroyChildren(
false,
true);
43 public void _Refresh()
45 this.dirtyLayout =
false;
46 HashSet<string> trackedCards =
EMono.player.trackedCards;
47 HashSet<string> trackedCategories =
EMono.player.trackedCategories;
48 foreach (
string text
in trackedCards)
50 if (this.dictProp.ContainsKey(text))
52 this.dictProp[text].Refresh();
57 buttonResourceTrack.SetProp(text);
58 this.dictProp.Add(text, buttonResourceTrack);
59 this.dirtyLayout =
true;
62 foreach (
string text2
in trackedCategories)
64 if (this.dictCat.ContainsKey(text2))
66 this.dictCat[text2].Refresh();
71 buttonResourceTrack2.SetCat(text2);
72 this.dictCat.Add(text2, buttonResourceTrack2);
73 this.dirtyLayout =
true;
76 this.listRemove.Clear();
77 foreach (
string item
in this.dictProp.Keys)
79 if (!trackedCards.Contains(item))
81 this.listRemove.Add(item);
84 foreach (
string key
in this.listRemove)
86 UnityEngine.Object.DestroyImmediate(this.dictProp[key].gameObject);
87 this.dictProp.Remove(key);
88 this.dirtyLayout =
true;
90 this.listRemove.Clear();
91 foreach (
string item2
in this.dictCat.Keys)
93 if (!trackedCategories.Contains(item2))
95 this.listRemove.Add(item2);
98 foreach (
string key2
in this.listRemove)
100 UnityEngine.Object.DestroyImmediate(this.dictCat[key2].gameObject);
101 this.dictCat.Remove(key2);
102 this.dirtyLayout =
true;
104 if (this.dirtyLayout)
106 this.buttonAdd.transform.SetAsLastSibling();
107 this.layout.RebuildLayout(
true);
115 public LayoutGroup layout;
121 public UIButton buttonAdd;
124 public Dictionary<string, ButtonResourceTrack> dictProp =
new Dictionary<string, ButtonResourceTrack>();
127 public Dictionary<string, ButtonResourceTrack> dictCat =
new Dictionary<string, ButtonResourceTrack>();
130 private List<string> listRemove =
new List<string>();
133 private bool dirtyLayout;