DayZ 1.24
Loading...
Searching...
No Matches
ActionAttachPowerSourceToPanel Class Reference

DEPRECATED. More...

Inheritance diagram for ActionAttachPowerSourceToPanel:
[legend]
Collaboration diagram for ActionAttachPowerSourceToPanel:
[legend]

Protected Member Functions

void OnExecuteImpl (ActionData action_data)
 
override void OnExecuteClient (ActionData action_data)
 
override void OnExecuteServer (ActionData action_data)
 
override void OnEndClient (ActionData action_data)
 

Private Member Functions

void ActionAttachPowerSourceToPanel ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 

Detailed Description

DEPRECATED.

Definition at line 2 of file ActionAttachPowerSourceToPanel.c.

Constructor & Destructor Documentation

◆ ActionAttachPowerSourceToPanel()

void ActionAttachPowerSourceToPanel::ActionAttachPowerSourceToPanel ( )
inlineprivate

Definition at line 4 of file ActionAttachPowerSourceToPanel.c.

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

References m_Text.

Member Function Documentation

◆ ActionCondition()

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

Definition at line 15 of file ActionAttachPowerSourceToPanel.c.

16 {
17 EntityAI target_entity = EntityAI.Cast(target.GetObject());
18 if (player && target_entity && item)
19 {
20 if (target_entity.IsStaticTransmitter() && target_entity.GetInventory().AttachmentCount() == 0) //has any power source attachment attached
21 return true;
22 }
23
24 return false;
25 }

◆ CreateConditionComponents()

override void ActionAttachPowerSourceToPanel::CreateConditionComponents ( )
inlineprivate

◆ OnEndClient()

override void ActionAttachPowerSourceToPanel::OnEndClient ( ActionData action_data)
inlineprotected

Definition at line 52 of file ActionAttachPowerSourceToPanel.c.

53 {
54 // Probably not needed since attaching is done server side.
55 /*
56 EntityAI target_entity = EntityAI.Cast( action_data.m_Target.GetObject() );
57 EntityAI item_entity = EntityAI.Cast( action_data.m_MainItem );
58
59 //find inventory location for attachment
60 InventoryLocation target_location = new InventoryLocation;
61
62 if( target_entity.GetInventory().FindFirstFreeLocationForNewEntity( item_entity.GetType(), FindInventoryLocationType.ATTACHMENT, target_location ) )
63 {
64 //target_entity.PredictiveTakeEntityToTargetAttachmentEx( target_entity, item_entity, target_location.GetSlot() );
65 target_entity.LocalTakeEntityAsAttachmentEx( item_entity, target_location.GetSlot() );
66 }
67 */
68 }

◆ OnExecuteClient()

override void ActionAttachPowerSourceToPanel::OnExecuteClient ( ActionData action_data)
inlineprotected

Definition at line 38 of file ActionAttachPowerSourceToPanel.c.

39 {
42 }
void ClearInventoryReservationEx(ActionData action_data)
Definition ActionBase.c:790

References ClearInventoryReservationEx(), and OnExecuteImpl().

◆ OnExecuteImpl()

void ActionAttachPowerSourceToPanel::OnExecuteImpl ( ActionData action_data)
inlineprotected

Definition at line 27 of file ActionAttachPowerSourceToPanel.c.

28 {
29 EntityAI target_entity = EntityAI.Cast(action_data.m_Target.GetObject());
30 EntityAI item_entity = action_data.m_MainItem;
31
32 //find inventory location for attachment
34 if (target_entity.GetInventory().FindFirstFreeLocationForNewEntity(item_entity.GetType(), FindInventoryLocationType.ATTACHMENT, target_location))
35 action_data.m_Player.PredictiveTakeEntityToTargetAttachmentEx(target_entity, item_entity, target_location.GetSlot());
36 }
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocation.

Referenced by OnExecuteClient(), and OnExecuteServer().

◆ OnExecuteServer()

override void ActionAttachPowerSourceToPanel::OnExecuteServer ( ActionData action_data)
inlineprotected

Definition at line 44 of file ActionAttachPowerSourceToPanel.c.

45 {
46 if (GetGame().IsMultiplayer())
47 return; // multiplayer handled on client side via OnExecuteClient
48 else
49 OnExecuteImpl(action_data); // single player
50 }
proto native CGame GetGame()

References GetGame(), and OnExecuteImpl().


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