Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
head.c
Go to the documentation of this file.
1
class
Head_Default
extends
Head
2
{
3
bool
m_handling_exception
=
false
;
4
int
m_beard_idx
;
5
int
m_hair_idx
;
6
7
ref
map<int,ref SelectionTranslation>
m_HeadHairHidingStateMap
;
8
ref
array<string>
m_HeadHairSelectionArray
;
9
10
void
Head_Default
()
11
{
12
Init
();
13
}
14
15
void
Init
()
16
{
17
m_HeadHairHidingStateMap
=
new
map<int,ref SelectionTranslation>
;
18
m_HeadHairSelectionArray
=
new
array<string>
;
19
20
ConfigGetTextArray(
"simpleHiddenSelections"
,
m_HeadHairSelectionArray
);
21
22
m_beard_idx
=
m_HeadHairSelectionArray
.Find(
"beard"
);
23
m_hair_idx
=
m_HeadHairSelectionArray
.Find(
"hair"
);
24
if
(!ConfigIsExisting(
"HairHiding"
))
25
m_handling_exception
=
true
;
26
27
InitSelectionTranslation
();
28
}
29
30
void
InitSelectionTranslation
()
31
{
32
for
(
int
i = 0; i <
m_HeadHairSelectionArray
.Count(); i++)
33
{
34
SelectionTranslation
selTran =
new
SelectionTranslation
(
this
,i);
35
selTran.
SetSelectionState
(
true
);
36
m_HeadHairHidingStateMap
.Insert(i,selTran);
//all considered "shown" on init
37
}
38
}
39
40
bool
GetHeadHideableSelections
(out
array<string>
selections)
41
{
42
selections =
m_HeadHairSelectionArray
;
43
return
true
;
44
}
45
46
int
GetBeardIndex
()
47
{
48
return
m_beard_idx
;
49
}
50
51
int
GetHairIndex
()
52
{
53
return
m_hair_idx
;
54
}
55
56
int
GetSelectionIndex
(
string
str)
57
{
58
return
m_HeadHairSelectionArray
.Find(str);
59
}
60
61
bool
IsHandlingException
()
62
{
63
return
m_handling_exception
;
64
}
65
};
66
67
class
SelectionTranslation
68
{
69
bool
m_SelectionState
;
70
71
bool
m_TranslationFinished
=
false
;
72
string
m_BasePath
;
// = "cfgVehicles " + GetType() + " HairHiding";
73
ref
array<int>
m_TranslatedSelections
;
74
Head_Default
m_Head
;
75
76
void
SelectionTranslation
(Head_Default head,
int
idx)
77
{
78
m_Head
= head;
79
m_BasePath
=
"cfgVehicles "
+
m_Head
.GetType() +
" HairHiding"
;
80
InitTranslatedSelections
(idx);
81
}
82
83
void
InitTranslatedSelections
(
int
idx)
84
{
85
if
( !
m_Head
.ConfigIsExisting(
"HairHiding"
) )
86
return
;
87
88
string
path
;
89
int
selectionIdx = -1;
90
m_TranslatedSelections
=
new
array<int>
;
91
92
//Hair
93
path
=
m_BasePath
+
" Group_Hair"
;
94
SearchAndTranslate
(
path
,idx);
95
//Beard
96
path
=
m_BasePath
+
" Group_Beard"
;
97
SearchAndTranslate
(
path
,idx);
98
//Hair + Beard
99
path
=
m_BasePath
+
" Group_HairBeard"
;
100
SearchAndTranslate
(
path
,idx);
101
102
//other
103
for
(
int
i = 0; !
m_TranslationFinished
; i++)
104
{
105
path
=
m_BasePath
+
" Group_"
+ i;
106
if
(
g_Game
.ConfigIsExisting(
path
) )
107
{
108
SearchAndTranslate
(
path
,idx);
109
}
110
else
111
{
112
m_TranslationFinished
=
true
;
113
}
114
}
115
}
116
117
bool
SearchAndTranslate
(
string
path
,
int
idx)
118
{
119
if
(!
g_Game
.ConfigIsExisting(
path
))
120
return
false
;
121
122
array<string>
tempArrayStr =
new
array<string>
;
123
g_Game
.ConfigGetTextArray(
path
+
" memberSelections"
, tempArrayStr);
124
int
indexInOriginalArray = -2;
125
126
for
(
int
i = 0; i < tempArrayStr.Count(); i++)
127
{
128
indexInOriginalArray =
m_Head
.m_HeadHairSelectionArray.Find(tempArrayStr.Get(i));
129
if
( idx == indexInOriginalArray )
//found it
130
{
131
g_Game
.ConfigGetTextArray(
path
+
" simpleSelectionName"
, tempArrayStr);
132
for
(i = 0; i < tempArrayStr.Count(); i++)
133
{
134
m_TranslatedSelections
.Insert(
m_Head
.m_HeadHairSelectionArray.Find(tempArrayStr.Get(i)));
135
}
136
m_TranslationFinished
=
true
;
137
return
true
;
138
}
139
}
140
return
false
;
141
}
142
143
void
SetSelectionState
(
bool
state)
144
{
145
m_SelectionState
= state;
146
}
147
148
bool
GetSelectionState
()
149
{
150
return
m_SelectionState
;
151
}
152
153
ref
array<int>
GetTranslatedSelections
()
154
{
155
return
m_TranslatedSelections
;
156
}
157
};
Head
Definition
head.c:6
Head::GetSelectionIndex
int GetSelectionIndex(string str)
Definition
head.c:56
Head::m_HeadHairHidingStateMap
ref map< int, ref SelectionTranslation > m_HeadHairHidingStateMap
Definition
head.c:7
Head::m_beard_idx
int m_beard_idx
Definition
head.c:4
Head::Init
void Init()
Definition
head.c:15
Head::m_hair_idx
int m_hair_idx
Definition
head.c:5
Head::IsHandlingException
bool IsHandlingException()
Definition
head.c:61
Head::InitSelectionTranslation
void InitSelectionTranslation()
Definition
head.c:30
Head::m_handling_exception
bool m_handling_exception
Definition
head.c:3
Head::GetHeadHideableSelections
bool GetHeadHideableSelections(out array< string > selections)
Definition
head.c:40
Head::m_HeadHairSelectionArray
ref array< string > m_HeadHairSelectionArray
Definition
head.c:8
Head::GetHairIndex
int GetHairIndex()
Definition
head.c:51
Head::GetBeardIndex
int GetBeardIndex()
Definition
head.c:46
Head::Head_Default
void Head_Default()
Definition
head.c:10
SelectionTranslation
Definition
head.c:68
SelectionTranslation::SelectionTranslation
void SelectionTranslation(Head_Default head, int idx)
Definition
head.c:76
SelectionTranslation::m_Head
Head_Default m_Head
Definition
head.c:74
SelectionTranslation::GetSelectionState
bool GetSelectionState()
Definition
head.c:148
SelectionTranslation::m_SelectionState
bool m_SelectionState
Definition
head.c:69
SelectionTranslation::SetSelectionState
void SetSelectionState(bool state)
Definition
head.c:143
SelectionTranslation::m_TranslationFinished
bool m_TranslationFinished
Definition
head.c:71
SelectionTranslation::m_TranslatedSelections
ref array< int > m_TranslatedSelections
Definition
head.c:73
SelectionTranslation::m_BasePath
string m_BasePath
Definition
head.c:72
SelectionTranslation::GetTranslatedSelections
ref array< int > GetTranslatedSelections()
Definition
head.c:153
SelectionTranslation::InitTranslatedSelections
void InitTranslatedSelections(int idx)
Definition
head.c:83
SelectionTranslation::SearchAndTranslate
bool SearchAndTranslate(string path, int idx)
Definition
head.c:117
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
map
Definition
cachedequipmentstorage.c:4
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
path
string path
Definition
optionselectormultistate.c:142
Games
Dayz
scripts
4_world
entities
manbase
bodyparts
head.c
Generated by
1.17.0