Elin Modding Docs Doc
Loading...
Searching...
No Matches
LayerEquip.cs
1using System;
2using UnityEngine;
3
4// Token: 0x02000543 RID: 1347
5public class LayerEquip : ELayer
6{
7 // Token: 0x06002497 RID: 9367 RVA: 0x000CE43B File Offset: 0x000CC63B
8 public static void SetDirty()
9 {
10 LayerEquip.dirty = true;
11 }
12
13 // Token: 0x06002498 RID: 9368 RVA: 0x000CE444 File Offset: 0x000CC644
14 public override void OnInit()
15 {
16 this.windows[0].layer = this;
17 if (!Window.dictData.ContainsKey(this.windows[0].idWindow) && !ELayer.ui.widgets.GetWidget("BottomBar"))
18 {
19 RectTransform rectTransform = this.windows[0].Rect();
20 this.windows[0].Rect().anchoredPosition = new Vector2(rectTransform.anchoredPosition.x, 45f);
21 }
22 this.chara = ELayer.pc;
23 LayerEquip.Instance = this;
24 this.Rebuild();
25 }
26
27 // Token: 0x06002499 RID: 9369 RVA: 0x000CE4EF File Offset: 0x000CC6EF
28 public void Rebuild()
29 {
30 this.RefreshEquipment(this.listMain, false);
31 this.RefreshEquipment(this.listEtc, true);
32 this.RefreshToolBelt(false);
33 this.windows[0].RebuildLayout(true);
34 LayerEquip.dirty = true;
35 }
36
37 // Token: 0x0600249A RID: 9370 RVA: 0x000CE52A File Offset: 0x000CC72A
38 public void Redraw()
39 {
40 LayerEquip.dirty = false;
41 this.listMain.Redraw();
42 this.listEtc.Redraw();
43 }
44
45 // Token: 0x0600249B RID: 9371 RVA: 0x000CE548 File Offset: 0x000CC748
46 public void RefreshToolBelt(bool rebuildLayout = false)
47 {
48 }
49
50 // Token: 0x0600249C RID: 9372 RVA: 0x000CE54C File Offset: 0x000CC74C
51 public void RefreshEquipment(UIList list, bool etc = false)
52 {
53 list.Clear();
54 BaseList list2 = list;
55 UIList.Callback<BodySlot, ButtonGridDrag> callback = new UIList.Callback<BodySlot, ButtonGridDrag>();
56 callback.onInstantiate = delegate(BodySlot a, ButtonGridDrag b)
57 {
58 b.SetBodySlot(a, new InvOwnerEquip(this.chara, a, null, CurrencyType.None));
59 };
60 callback.onRedraw = delegate(BodySlot a, ButtonGridDrag b, int i)
61 {
62 b.SetBodySlot(a, new InvOwnerEquip(this.chara, a, null, CurrencyType.None));
63 };
64 callback.onSort = ((BodySlot a, UIList.SortMode b) => -a.element.sort);
65 callback.onList = delegate(UIList.SortMode m)
66 {
67 foreach (BodySlot bodySlot in this.chara.body.slots)
68 {
69 if (bodySlot.elementId != 44)
70 {
71 if (bodySlot.elementId == 36 || bodySlot.elementId == 31 || bodySlot.elementId == 37 || bodySlot.elementId == 45)
72 {
73 if (!etc)
74 {
75 continue;
76 }
77 }
78 else if (etc)
79 {
80 continue;
81 }
82 list.Add(bodySlot);
83 }
84 }
85 };
86 list2.callbacks = callback;
87 list.sortMode = UIList.SortMode.ByNumber;
88 list.List(false);
89 }
90
91 // Token: 0x04001410 RID: 5136
92 public static LayerEquip Instance;
93
94 // Token: 0x04001411 RID: 5137
95 public static bool dirty;
96
97 // Token: 0x04001412 RID: 5138
98 public UIList listMain;
99
100 // Token: 0x04001413 RID: 5139
101 public UIList listEtc;
102
103 // Token: 0x04001414 RID: 5140
104 public Chara chara;
105}
Definition Chara.cs:12