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

Private Member Functions

void ActionUnplugThisByCord ()
 
override bool HasProgress ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteServer (ActionData action_data)
 

Detailed Description

Definition at line 1 of file ActionUnplugThisByCord.c.

Constructor & Destructor Documentation

◆ ActionUnplugThisByCord()

void ActionUnplugThisByCord::ActionUnplugThisByCord ( )
inlineprivate

Definition at line 3 of file ActionUnplugThisByCord.c.

4 {
5 m_Text = "#unplug_by_cord";
6 }
string m_Text
Definition ActionBase.c:49

References m_Text.

Member Function Documentation

◆ ActionCondition()

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

Definition at line 13 of file ActionUnplugThisByCord.c.

14 {
15 ItemBase targetItem = ItemBase.Cast(target.GetObject());
16
17 if (targetItem && targetItem.HasEnergyManager())
18 {
19 string selection = targetItem.GetActionComponentName(target.GetComponentIndex());
21 return true;
22
23 // Special case for unfolded spotlight
24 if (selection == Spotlight.SEL_CORD_PLUGGED_U)
25 return true;
26 }
27
28 return false;
29 }
static const string SEL_CORD_PLUGGED

References ComponentEnergyManager::SEL_CORD_PLUGGED.

◆ HasProgress()

override bool ActionUnplugThisByCord::HasProgress ( )
inlineprivate

Definition at line 8 of file ActionUnplugThisByCord.c.

9 {
10 return false;
11 }

◆ OnExecuteServer()

override void ActionUnplugThisByCord::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 31 of file ActionUnplugThisByCord.c.

32 {
33 ItemBase targetItem = ItemBase.Cast(action_data.m_Target.GetObject());
34 targetItem.GetCompEM().UnplugThis();
35
36 if (targetItem.IsInherited(Spotlight))
37 {
38 targetItem.HideSelection(Spotlight.SEL_CORD_PLUGGED_U);
39 targetItem.ShowSelection(Spotlight.SEL_CORD_FOLDED_U);
40 }
41 }

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