DayZ
1.27
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
HuntingOptic.c
См. документацию.
1
class
HuntingOptic
extends
ItemOptics
2
{
3
EntityAI
m_Parent
;
4
5
void
HuntingOptic
()
6
{
7
HideSelection
(
"rings_ris"
);
8
HideSelection
(
"rings_ris_pilot"
);
9
}
10
11
override
void
OnWasAttached
(
EntityAI
parent,
int
slot_id )
12
{
13
super.OnWasAttached(parent, slot_id);
14
m_Parent
= parent;
15
if
(!
ParentUsesWinchesterTypeMount
())
16
{
17
HideSelection
(
"rings_winchester"
);
18
HideSelection
(
"rings_winchester_pilot"
);
19
ShowSelection
(
"rings_ris"
);
20
ShowSelection
(
"rings_ris_pilot"
);
21
}
22
}
23
24
override
void
OnWasDetached
(
EntityAI
parent,
int
slot_id )
25
{
26
super.OnWasDetached(parent, slot_id);
27
m_Parent
= null;
28
HideSelection
(
"rings_ris"
);
29
HideSelection
(
"rings_ris_pilot"
);
30
ShowSelection
(
"rings_winchester"
);
31
ShowSelection
(
"rings_winchester_pilot"
);
32
}
33
34
override
void
HideSelection
(
string
selection_name )
35
{
36
super.HideSelection( selection_name );
37
if
(selection_name ==
"hide"
)
//hides pilotview selections in order not to obstruct view
38
{
39
HideSelection
(
"rings_ris_pilot"
);
40
HideSelection
(
"rings_winchester_pilot"
);
41
}
42
}
43
44
override
void
ShowSelection
(
string
selection_name )
45
{
46
super.ShowSelection( selection_name );
47
if
(selection_name ==
"hide"
)
48
{
49
if
(!
ParentUsesWinchesterTypeMount
())
50
{
51
HideSelection
(
"rings_winchester"
);
52
HideSelection
(
"rings_winchester_pilot"
);
53
ShowSelection
(
"rings_ris"
);
54
ShowSelection
(
"rings_ris_pilot"
);
55
}
56
else
57
{
58
HideSelection
(
"rings_ris"
);
59
HideSelection
(
"rings_ris_pilot"
);
60
ShowSelection
(
"rings_winchester"
);
61
ShowSelection
(
"rings_winchester_pilot"
);
62
}
63
}
64
}
65
66
bool
ParentUsesWinchesterTypeMount
()
67
{
68
if
(
m_Parent
&&
m_Parent
.ConfigIsExisting(
"winchesterTypeOpticsMount"
))
69
return
m_Parent
.ConfigGetBool(
"winchesterTypeOpticsMount"
);
70
71
return
false
;
72
}
73
}
EntityAI
Определения
Building.c:6
ItemOptics::m_Parent
EntityAI m_Parent
Определения
HuntingOptic.c:3
ItemOptics::HuntingOptic
void HuntingOptic()
Определения
HuntingOptic.c:5
ItemOptics::ShowSelection
override void ShowSelection(string selection_name)
Определения
HuntingOptic.c:44
ItemOptics::HideSelection
override void HideSelection(string selection_name)
Определения
HuntingOptic.c:34
ItemOptics::OnWasAttached
override void OnWasAttached(EntityAI parent, int slot_id)
Определения
HuntingOptic.c:11
ItemOptics::ParentUsesWinchesterTypeMount
bool ParentUsesWinchesterTypeMount()
Определения
HuntingOptic.c:66
ItemOptics::OnWasDetached
override void OnWasDetached(EntityAI parent, int slot_id)
Определения
HuntingOptic.c:24
ItemOptics
Определения
ItemOptics.c:2
Ishodniki
scripts
4_World
Entities
ItemBase
Inventory_Base
HuntingOptic.c
Создано системой
1.13.2