Elin Decompiled Documentation
EA 23.102 Nightly
Loading...
Searching...
No Matches
LayerEquip.cs
Go to the documentation of this file.
1
using
UnityEngine;
2
3
public
class
LayerEquip
:
ELayer
4
{
5
public
static
LayerEquip
Instance
;
6
7
public
static
bool
dirty
;
8
9
public
UIList
listMain
;
10
11
public
UIList
listEtc
;
12
13
public
Chara
chara
;
14
15
public
static
void
SetDirty
()
16
{
17
dirty
=
true
;
18
}
19
20
public
override
void
OnInit
()
21
{
22
windows
[0].layer =
this
;
23
if
(!
Window
.
dictData
.ContainsKey(
windows
[0].idWindow) && !
ELayer
.
ui
.widgets.GetWidget(
"BottomBar"
))
24
{
25
RectTransform rectTransform =
windows
[0].Rect();
26
windows
[0].Rect().anchoredPosition =
new
Vector2(rectTransform.anchoredPosition.x, 45f);
27
}
28
chara
=
ELayer
.
pc
;
29
Instance
=
this
;
30
Rebuild
();
31
}
32
33
public
void
Rebuild
()
34
{
35
RefreshEquipment
(
listMain
);
36
RefreshEquipment
(
listEtc
, etc:
true
);
37
RefreshToolBelt
();
38
windows
[0].RebuildLayout(recursive:
true
);
39
dirty
=
true
;
40
}
41
42
public
void
Redraw
()
43
{
44
dirty
=
false
;
45
listMain
.
Redraw
();
46
listEtc
.
Redraw
();
47
}
48
49
public
void
RefreshToolBelt
(
bool
rebuildLayout =
false
)
50
{
51
}
52
53
public
void
RefreshEquipment
(
UIList
list,
bool
etc =
false
)
54
{
55
list.
Clear
();
56
list.callbacks =
new
UIList
.
Callback
<
BodySlot
,
ButtonGridDrag
>
57
{
58
onInstantiate = delegate(
BodySlot
a,
ButtonGridDrag
b)
59
{
60
b.
SetBodySlot
(a,
new
InvOwnerEquip
(
chara
, a), showIndex:
true
);
61
},
62
onRedraw = delegate(
BodySlot
a,
ButtonGridDrag
b,
int
i)
63
{
64
b.
SetBodySlot
(a,
new
InvOwnerEquip
(
chara
, a), showIndex:
true
);
65
},
66
onSort = (
BodySlot
a,
UIList.SortMode
b) =>
chara
.
body
.
GetSortVal
(a),
67
onList = delegate
68
{
69
foreach
(
BodySlot
slot
in
chara
.
body
.
slots
)
70
{
71
if
(slot.
elementId
!= 44)
72
{
73
if
(slot.
elementId
== 36 || slot.
elementId
== 31 || slot.
elementId
== 37 || slot.
elementId
== 45)
74
{
75
if
(!etc)
76
{
77
continue
;
78
}
79
}
80
else
if
(etc)
81
{
82
continue
;
83
}
84
list.
Add
(slot);
85
}
86
}
87
}
88
};
89
list.sortMode =
UIList
.
SortMode
.ByNumber;
90
list.
List
();
91
}
92
}
BodySlot
Definition:
BodySlot.cs:4
BodySlot.elementId
int elementId
Definition:
BodySlot.cs:6
ButtonGridDrag
Definition:
ButtonGridDrag.cs:5
ButtonGrid.SetBodySlot
void SetBodySlot(BodySlot b, InvOwner owner, bool showIndex=false)
Definition:
ButtonGrid.cs:121
CharaBody.slots
List< BodySlot > slots
Definition:
CharaBody.cs:8
CharaBody.GetSortVal
int GetSortVal(BodySlot slot)
Definition:
CharaBody.cs:470
Chara
Definition:
Chara.cs:10
Chara.body
CharaBody body
Definition:
Chara.cs:91
ELayer
Definition:
ELayer.cs:4
ELayer.pc
static Chara pc
Definition:
ELayer.cs:15
ELayer.ui
static UI ui
Definition:
ELayer.cs:21
InvOwnerEquip
Definition:
InvOwnerEquip.cs:2
LayerEquip
Definition:
LayerEquip.cs:4
LayerEquip.listMain
UIList listMain
Definition:
LayerEquip.cs:9
LayerEquip.RefreshToolBelt
void RefreshToolBelt(bool rebuildLayout=false)
Definition:
LayerEquip.cs:49
LayerEquip.Instance
static LayerEquip Instance
Definition:
LayerEquip.cs:5
LayerEquip.chara
Chara chara
Definition:
LayerEquip.cs:13
LayerEquip.Redraw
void Redraw()
Definition:
LayerEquip.cs:42
LayerEquip.listEtc
UIList listEtc
Definition:
LayerEquip.cs:11
LayerEquip.dirty
static bool dirty
Definition:
LayerEquip.cs:7
LayerEquip.OnInit
override void OnInit()
Definition:
LayerEquip.cs:20
LayerEquip.Rebuild
void Rebuild()
Definition:
LayerEquip.cs:33
LayerEquip.RefreshEquipment
void RefreshEquipment(UIList list, bool etc=false)
Definition:
LayerEquip.cs:53
LayerEquip.SetDirty
static void SetDirty()
Definition:
LayerEquip.cs:15
Layer.windows
List< Window > windows
Definition:
Layer.cs:116
UIList.Callback
Definition:
UIList.cs:53
UIList
Definition:
UIList.cs:9
UIList.Clear
override void Clear()
Definition:
UIList.cs:349
UIList.SortMode
SortMode
Definition:
UIList.cs:27
UIList.Add
override void Add(object item)
Definition:
UIList.cs:302
UIList.Redraw
override void Redraw()
Definition:
UIList.cs:740
UIList.List
override void List()
Definition:
UIList.cs:717
Window
Definition:
Window.cs:13
Window.dictData
static Dictionary< string, SaveData > dictData
Definition:
Window.cs:594
Elin
LayerEquip.cs
Generated by
1.9.6