Elin Modding Docs Doc
Loading...
Searching...
No Matches
DragItemCard.cs
1using System;
2using System.Collections.Generic;
3
4// Token: 0x020005D2 RID: 1490
5public class DragItemCard : DragItem
6{
7 // Token: 0x06002909 RID: 10505 RVA: 0x000E7FD8 File Offset: 0x000E61D8
8 public DragItemCard(ButtonGrid _button, bool setDragImage = true)
9 {
10 this.button = _button;
11 this.from = new DragItemCard.DragInfo(this.button);
12 if (setDragImage)
13 {
14 EClass.ui.hud.SetDragImage(this.button.icon, null, this.button.mainText);
15 }
16 }
17
18 // Token: 0x17000BDD RID: 3037
19 // (get) Token: 0x0600290A RID: 10506 RVA: 0x000E802C File Offset: 0x000E622C
20 public override UIButton Button
21 {
22 get
23 {
24 return this.button;
25 }
26 }
27
28 // Token: 0x0600290B RID: 10507 RVA: 0x000E8034 File Offset: 0x000E6234
29 public override void OnStartDrag()
30 {
31 this.from.invOwner.OnStartDrag(this.from);
32 if (LayerDragGrid.Instance && LayerDragGrid.Instance.owner.ShouldShowGuide(this.from.thing))
33 {
34 LayerDragGrid.Instance.CurrentButton.Attach("guide", false);
35 }
36 }
37
38 // Token: 0x0600290C RID: 10508 RVA: 0x000E8095 File Offset: 0x000E6295
39 public override void OnEndDrag()
40 {
41 WidgetEquip.dragEquip = null;
42 WidgetEquip.Redraw();
43 if (LayerDragGrid.Instance)
44 {
45 LayerDragGrid.Instance.CurrentButton.Dettach("guide");
46 }
47 }
48
49 // Token: 0x0600290D RID: 10509 RVA: 0x000E80C4 File Offset: 0x000E62C4
50 public override bool OnDrag(bool execute, bool cancel = false)
51 {
52 DragItemCard.DragInfo dragInfo = new DragItemCard.DragInfo(InputModuleEX.GetComponentOf<ButtonGrid>());
53 bool flag = this.from.invOwner.OnDrag(this.from, dragInfo, execute, cancel);
54 if (flag && EClass.core.config.game.doubleClickToHold && EClass.ui.dragDuration < 0.35f && dragInfo.button == this.from.button && this.from.thing != null)
55 {
56 dragInfo.button.invOwner.TryHold(this.from.thing);
57 }
58 return flag;
59 }
60
61 // Token: 0x0400172E RID: 5934
62 public ButtonGrid button;
63
64 // Token: 0x0400172F RID: 5935
65 public DragItemCard.DragInfo from;
66
67 // Token: 0x04001730 RID: 5936
68 public DragItemCard.DragInfo to;
69
70 // Token: 0x02000B38 RID: 2872
71 public class DragInfo
72 {
73 // Token: 0x06004356 RID: 17238 RVA: 0x00159784 File Offset: 0x00157984
74 public DragInfo(ButtonGrid b)
75 {
76 this.button = b;
77 if (b && b.invOwner != null)
78 {
79 if (b.card != null)
80 {
81 this.thing = b.card.Thing;
82 this.invX = this.thing.invX;
83 this.invY = this.thing.invY;
84 if (this.thing.isEquipped && this.thing.GetRootCard() == this.invOwner.owner)
85 {
86 this.equippedSlot = this.invOwner.owner.Chara.body.slots[this.thing.c_equippedSlot - 1];
87 return;
88 }
89 }
90 else
91 {
92 this.invX = b.index;
93 this.invY = b.invOwner.destInvY;
94 }
95 }
96 }
97
98 // Token: 0x170011E9 RID: 4585
99 // (get) Token: 0x06004357 RID: 17239 RVA: 0x00159867 File Offset: 0x00157A67
100 public List<Thing> grid
101 {
102 get
103 {
104 return this.container.things.grid;
105 }
106 }
107
108 // Token: 0x170011EA RID: 4586
109 // (get) Token: 0x06004358 RID: 17240 RVA: 0x00159879 File Offset: 0x00157A79
110 public InvOwner invOwner
111 {
112 get
113 {
114 return this.button.invOwner;
115 }
116 }
117
118 // Token: 0x170011EB RID: 4587
119 // (get) Token: 0x06004359 RID: 17241 RVA: 0x00159886 File Offset: 0x00157A86
120 public Card container
121 {
122 get
123 {
124 return this.invOwner.Container;
125 }
126 }
127
128 // Token: 0x170011EC RID: 4588
129 // (get) Token: 0x0600435A RID: 17242 RVA: 0x00159893 File Offset: 0x00157A93
130 public BaseList list
131 {
132 get
133 {
134 return this.button.GetComponentInParent<BaseList>();
135 }
136 }
137
138 // Token: 0x170011ED RID: 4589
139 // (get) Token: 0x0600435B RID: 17243 RVA: 0x001598A0 File Offset: 0x00157AA0
140 public ContainerType ContainerType
141 {
142 get
143 {
144 return this.container.trait.ContainerType;
145 }
146 }
147
148 // Token: 0x04002D1E RID: 11550
149 public ButtonGrid button;
150
151 // Token: 0x04002D1F RID: 11551
152 public BodySlot equippedSlot;
153
154 // Token: 0x04002D20 RID: 11552
155 public int invX;
156
157 // Token: 0x04002D21 RID: 11553
158 public int invY;
159
160 // Token: 0x04002D22 RID: 11554
161 public Thing thing;
162 }
163}
Definition Card.cs:13
Definition Thing.cs:10