DayZ 1.24
Loading...
Searching...
No Matches
HuntingOptic.c
Go to the documentation of this file.
1class HuntingOptic extends ItemOptics
2{
4
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;
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 {
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
67 {
68 if (m_Parent && m_Parent.ConfigIsExisting("winchesterTypeOpticsMount"))
69 return m_Parent.ConfigGetBool("winchesterTypeOpticsMount");
70
71 return false;
72 }
73}
Widget m_Parent
Definition SizeToChild.c:86
EntityAI m_Parent
Definition HuntingOptic.c:3
void HuntingOptic()
Definition HuntingOptic.c:5
override void ShowSelection(string selection_name)
override void HideSelection(string selection_name)
override void OnWasAttached(EntityAI parent, int slot_id)
bool ParentUsesWinchesterTypeMount()
override void OnWasDetached(EntityAI parent, int slot_id)