DayZ 1.24
Loading...
Searching...
No Matches
ActionViewBinoculars Class Reference
Inheritance diagram for ActionViewBinoculars:
[legend]
Collaboration diagram for ActionViewBinoculars:
[legend]

Private Member Functions

override void OnActionInfoUpdate (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void EnterOptics (ItemOptics optic, PlayerBase player)
 
override void ExitOptics (ItemOptics optic, PlayerBase player)
 

Private Attributes

bool m_workingRangefinder
 

Detailed Description

Definition at line 1 of file ActionViewBinoculars.c.

Member Function Documentation

◆ ActionCondition()

override bool ActionViewBinoculars::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 14 of file ActionViewBinoculars.c.

15 {
17 if (Class.CastTo(optic, item) && !optic.IsInOptics() && !player.IsNVGLowered())
18 return true;
19 return false;
20 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo().

◆ EnterOptics()

override void ActionViewBinoculars::EnterOptics ( ItemOptics optic,
PlayerBase player )
inlineprivate

Definition at line 22 of file ActionViewBinoculars.c.

23 {
24 player.SetIronsights(false);
25 player.SetHandheldOpticsInUse(true);
26 player.SetOptics(true);
27 optic.EnterOptics();
28 optic.HideSelection("hide");
29 if (NVGoggles.Cast(optic) && optic.ConfigIsExisting("simpleHiddenSelections"))
30 optic.SetSimpleHiddenSelectionState(0, false);
31
32 if (optic.HasEnergyManager())
33 {
35 if (!rf)
36 return;
37
38 rf.SetPlayer(player);
39 if (GetGame().IsServer())
40 rf.GetCompEM().SwitchOn();
41 }
42 }
proto native CGame GetGame()

References GetGame().

◆ ExitOptics()

override void ActionViewBinoculars::ExitOptics ( ItemOptics optic,
PlayerBase player )
inlineprivate

Definition at line 44 of file ActionViewBinoculars.c.

45 {
46 optic.ShowSelection("hide");
47 if (NVGoggles.Cast(optic) && optic.ConfigIsExisting("simpleHiddenSelections"))
48 optic.SetSimpleHiddenSelectionState(0, true);
49 player.SetHandheldOpticsInUse(false);
50 player.ExitSights();
51 if (optic.HasEnergyManager())
52 {
54 if (!rf)
55 return;
56
57 rf.SetPlayer(null);
58 if (GetGame().IsServer())
59 rf.GetCompEM().SwitchOff();
60 }
61 }

References GetGame().

◆ OnActionInfoUpdate()

override void ActionViewBinoculars::OnActionInfoUpdate ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 5 of file ActionViewBinoculars.c.

6 {
7 Rangefinder rangefinder = Rangefinder.Cast(item);
8 if (rangefinder)
9 m_Text = "#use_range_finder";
10 else
11 m_Text = "#Look_Through";
12 }
string m_Text
Definition ActionBase.c:49

References m_Text.

Member Data Documentation

◆ m_workingRangefinder

bool ActionViewBinoculars::m_workingRangefinder
private

Definition at line 3 of file ActionViewBinoculars.c.


The documentation for this class was generated from the following file: