Elin Modding Docs Doc
Loading...
Searching...
No Matches
WidgetStockTracker.cs
1using System;
2using System.Collections.Generic;
3
4// Token: 0x0200064D RID: 1613
6{
7 // Token: 0x06002D5D RID: 11613 RVA: 0x000FCA7F File Offset: 0x000FAC7F
8 public override void OnActivate()
9 {
10 WidgetStockTracker.Instance = this;
11 WidgetStockTracker.Refresh();
12 }
13
14 // Token: 0x06002D5E RID: 11614 RVA: 0x000FCA8C File Offset: 0x000FAC8C
15 public static void Refresh()
16 {
17 if (WidgetStockTracker.Instance)
18 {
19 WidgetStockTracker.Instance._Refresh();
20 }
21 }
22
23 // Token: 0x06002D5F RID: 11615 RVA: 0x000FCAA4 File Offset: 0x000FACA4
24 public void _Refresh()
25 {
26 this.sb.Clear();
27 this.sbNum.Clear();
28 HashSet<string> trackedCards = EMono.player.trackedCards;
29 HashSet<string> trackedCategories = EMono.player.trackedCategories;
30 if (trackedCards.Count == 0 && trackedCategories.Count == 0)
31 {
32 this.sb.Append("何もトラックしてない\n");
33 }
34 else
35 {
36 foreach (string key in trackedCards)
37 {
38 PropSet propSet = EMono._map.Stocked.cardMap.TryGetValue(key, null);
39 int num = (propSet != null) ? propSet.num : 0;
40 this.sb.Append(EMono.sources.cards.map[key].GetName() + "\n");
41 this.sbNum.Append(num.ToString() + "\n");
42 }
43 foreach (string key2 in trackedCategories)
44 {
45 PropSetCategory propSetCategory = EMono._map.Stocked.categoryMap[key2];
46 this.sb.Append(propSetCategory.source.GetText("name", false) + "\n");
47 this.sbNum.Append(propSetCategory.sum.ToString() + "\n");
48 }
49 }
50 if (this.sb.Equals(this.lastSb) && this.sbNum.Equals(this.lastSbNum))
51 {
52 return;
53 }
54 this.text.text = this.sb.ToString();
55 this.textNum.text = this.sbNum.ToString();
56 this.lastSb.Set(this.sb);
57 this.lastSbNum.Set(this.sbNum);
58 this.RebuildLayout(false);
59 }
60
61 // Token: 0x04001935 RID: 6453
62 public static WidgetStockTracker Instance;
63
64 // Token: 0x04001936 RID: 6454
65 public UIText text;
66
67 // Token: 0x04001937 RID: 6455
68 public UIText textNum;
69
70 // Token: 0x04001938 RID: 6456
71 private FastString sb = new FastString(32);
72
73 // Token: 0x04001939 RID: 6457
74 private FastString lastSb = new FastString(32);
75
76 // Token: 0x0400193A RID: 6458
77 private FastString sbNum = new FastString(32);
78
79 // Token: 0x0400193B RID: 6459
80 private FastString lastSbNum = new FastString(32);
81}
Definition EMono.cs:6