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

Private Member Functions

void ActionViewOptics ()
 
override void CreateConditionComponents ()
 
override bool IsFullBody (PlayerBase player)
 
override bool HasProgress ()
 
override bool HasTarget ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool ActionConditionContinue (ActionData action_data)
 
override void OnStartClient (ActionData action_data)
 
override void OnStartServer (ActionData action_data)
 
override void OnStartAnimationLoopServer (ActionData action_data)
 
override void OnStartAnimationLoopClient (ActionData action_data)
 
override void OnEndClient (ActionData action_data)
 
override void OnEndServer (ActionData action_data)
 
override void OnEndAnimationLoopClient (ActionData action_data)
 
override void OnEndAnimationLoopServer (ActionData action_data)
 
bool CanWork (ItemBase item)
 
void EnterOptics (ItemOptics optic, PlayerBase player)
 
void ExitOptics (ItemOptics optic, PlayerBase player)
 
- Private Member Functions inherited from ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Detailed Description

Definition at line 1 of file ActionViewOptics.c.

Constructor & Destructor Documentation

◆ ActionViewOptics()

void ActionViewOptics::ActionViewOptics ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

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

Definition at line 32 of file ActionViewOptics.c.

33 {
35 if (Class.CastTo(optic, item) && !optic.IsInOptics() && !player.IsNVGLowered())
36 return true;
37 return false;
38 }
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().

◆ ActionConditionContinue()

override bool ActionViewOptics::ActionConditionContinue ( ActionData action_data)
inlineprivate

Definition at line 40 of file ActionViewOptics.c.

41 {
42 return true;
43 }

◆ CanWork()

bool ActionViewOptics::CanWork ( ItemBase item)
inlineprivate

Definition at line 112 of file ActionViewOptics.c.

113 {
114 if (!item.HasEnergyManager())
115 return true;
116 else if (item.GetCompEM() && item.GetCompEM().CanWork())
117 return true;
118
119 return false;
120 }

◆ CreateConditionComponents()

override void ActionViewOptics::CreateConditionComponents ( )
inlineprivate

Definition at line 11 of file ActionViewOptics.c.

12 {
15 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ EnterOptics()

void ActionViewOptics::EnterOptics ( ItemOptics optic,
PlayerBase player )
inlineprivate

Definition at line 122 of file ActionViewOptics.c.

123 {
124 player.SetIronsights(false);
125 player.SetHandheldOpticsInUse(true);
126 player.SetOptics(true);
127 optic.EnterOptics();
128 optic.HideSelection("hide");
129 if (optic.HasEnergyManager())
130 optic.GetCompEM().SwitchOn();
131 player.GetAimingModel().SetAimNoiseAllowed(false);
132 }

Referenced by OnStartAnimationLoopClient(), and OnStartAnimationLoopServer().

◆ ExitOptics()

void ActionViewOptics::ExitOptics ( ItemOptics optic,
PlayerBase player )
inlineprivate

Definition at line 134 of file ActionViewOptics.c.

135 {
136 optic.ShowSelection("hide");
137 player.ExitSights();
138 player.SetHandheldOpticsInUse(false);
139 if (optic.HasEnergyManager())
140 optic.GetCompEM().SwitchOff();
141 player.GetAimingModel().SetAimNoiseAllowed(true);
142 }

Referenced by OnEndAnimationLoopClient(), OnEndAnimationLoopServer(), OnEndClient(), and OnEndServer().

◆ HasProgress()

override bool ActionViewOptics::HasProgress ( )
inlineprivate

Definition at line 22 of file ActionViewOptics.c.

23 {
24 return false;
25 }

◆ HasTarget()

override bool ActionViewOptics::HasTarget ( )
inlineprivate

Definition at line 27 of file ActionViewOptics.c.

28 {
29 return false;
30 }

◆ IsFullBody()

override bool ActionViewOptics::IsFullBody ( PlayerBase player)
inlineprivate

Definition at line 17 of file ActionViewOptics.c.

18 {
19 return true;
20 }

◆ OnEndAnimationLoopClient()

override void ActionViewOptics::OnEndAnimationLoopClient ( ActionData action_data)
inlineprivate

Definition at line 98 of file ActionViewOptics.c.

99 {
101 if (Class.CastTo(optic, action_data.m_MainItem))
102 ExitOptics(optic, action_data.m_Player);
103 }
void ExitOptics(ItemOptics optic, PlayerBase player)

References Class::CastTo(), and ExitOptics().

◆ OnEndAnimationLoopServer()

override void ActionViewOptics::OnEndAnimationLoopServer ( ActionData action_data)
inlineprivate

Definition at line 105 of file ActionViewOptics.c.

106 {
108 if (Class.CastTo(optic, action_data.m_MainItem))
109 ExitOptics(optic, action_data.m_Player);
110 }

References Class::CastTo(), and ExitOptics().

◆ OnEndClient()

override void ActionViewOptics::OnEndClient ( ActionData action_data)
inlineprivate

Definition at line 80 of file ActionViewOptics.c.

81 {
83 if (Class.CastTo(optic, action_data.m_MainItem) && optic.IsInOptics())
84 ExitOptics(optic, action_data.m_Player);
85 GetGame().GetMission().RemoveActiveInputExcludes({"actonViewOpticExcl"});
86 }
proto native CGame GetGame()

References Class::CastTo(), ExitOptics(), and GetGame().

◆ OnEndServer()

override void ActionViewOptics::OnEndServer ( ActionData action_data)
inlineprivate

Definition at line 88 of file ActionViewOptics.c.

89 {
91 if (Class.CastTo(optic, action_data.m_MainItem) && optic.IsInOptics())
92 ExitOptics(optic, action_data.m_Player);
93
94 if (!GetGame().IsMultiplayer())
95 GetGame().GetMission().RemoveActiveInputExcludes({"actonViewOpticExcl"});
96 }

References Class::CastTo(), ExitOptics(), and GetGame().

◆ OnStartAnimationLoopClient()

override void ActionViewOptics::OnStartAnimationLoopClient ( ActionData action_data)
inlineprivate

Definition at line 70 of file ActionViewOptics.c.

71 {
73 if (Class.CastTo(optic, action_data.m_MainItem))
74 {
75 if (!optic.IsInOptics())
76 EnterOptics(optic, action_data.m_Player);
77 }
78 }
void EnterOptics(ItemOptics optic, PlayerBase player)

References Class::CastTo(), and EnterOptics().

◆ OnStartAnimationLoopServer()

override void ActionViewOptics::OnStartAnimationLoopServer ( ActionData action_data)
inlineprivate

Definition at line 60 of file ActionViewOptics.c.

61 {
63 if (Class.CastTo(optic, action_data.m_MainItem))
64 {
65 if (!optic.IsInOptics())
66 EnterOptics(optic, action_data.m_Player);
67 }
68 }

References Class::CastTo(), and EnterOptics().

◆ OnStartClient()

override void ActionViewOptics::OnStartClient ( ActionData action_data)
inlineprivate

Definition at line 45 of file ActionViewOptics.c.

46 {
47 super.OnStartClient(action_data);
48
49 GetGame().GetMission().AddActiveInputExcludes({"actonViewOpticExcl"});
50 }

References GetGame().

◆ OnStartServer()

override void ActionViewOptics::OnStartServer ( ActionData action_data)
inlineprivate

Definition at line 52 of file ActionViewOptics.c.

53 {
54 super.OnStartServer(action_data);
55
56 if (!GetGame().IsMultiplayer())
57 GetGame().GetMission().AddActiveInputExcludes({"actonViewOpticExcl"});
58 }

References GetGame().


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