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

Private Member Functions

void ActionToggleNVMode ()
 
override void CreateConditionComponents ()
 
override bool HasTarget ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteServer (ActionData action_data)
 
override void OnExecuteClient (ActionData action_data)
 
void SwitchMode (ActionData action_data)
 

Detailed Description

Definition at line 2 of file ActionToggleNVMode.c.

Constructor & Destructor Documentation

◆ ActionToggleNVMode()

void ActionToggleNVMode::ActionToggleNVMode ( )
inlineprivate

Definition at line 4 of file ActionToggleNVMode.c.

5 {
6 //m_CallbackClass = ActionTurnOnTransmitterCB;
7 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_ITEM_ON;
8 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_ITEM_ON;
9 m_Text = "#switch_mode";
10 }
string m_Text
Definition ActionBase.c:49
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CommandUID, AnimatedActionBase::m_CommandUIDProne, and m_Text.

Member Function Documentation

◆ ActionCondition()

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

Definition at line 23 of file ActionToggleNVMode.c.

24 {
26 if (Class.CastTo(optics, item) && optics.IsNVOptic())
27 return true;
28
29 return false;
30 }
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().

◆ CreateConditionComponents()

override void ActionToggleNVMode::CreateConditionComponents ( )
inlineprivate

Definition at line 12 of file ActionToggleNVMode.c.

13 {
16 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ HasTarget()

override bool ActionToggleNVMode::HasTarget ( )
inlineprivate

Definition at line 18 of file ActionToggleNVMode.c.

19 {
20 return false;
21 }

◆ OnExecuteClient()

override void ActionToggleNVMode::OnExecuteClient ( ActionData action_data)
inlineprivate

Definition at line 37 of file ActionToggleNVMode.c.

38 {
40 }
void SwitchMode(ActionData action_data)

References SwitchMode().

◆ OnExecuteServer()

override void ActionToggleNVMode::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 32 of file ActionToggleNVMode.c.

33 {
35 }

References SwitchMode().

◆ SwitchMode()

void ActionToggleNVMode::SwitchMode ( ActionData action_data)
inlineprivate

Definition at line 42 of file ActionToggleNVMode.c.

43 {
44 ItemOptics optics = ItemOptics.Cast(action_data.m_MainItem);
45 switch (optics.GetCurrentOpticMode())
46 {
49 //TODO: animate
50 break;
51
53 optics.SetCurrentOpticMode(GameConstants.OPTICS_STATE_DAY);
54 //TODO: animate
55 break;
56 }
57 }
const int OPTICS_STATE_DAY
Definition constants.c:800
const int OPTICS_STATE_NIGHTVISION
Definition constants.c:801

References GameConstants::OPTICS_STATE_DAY, and GameConstants::OPTICS_STATE_NIGHTVISION.

Referenced by OnExecuteClient(), and OnExecuteServer().


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