Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
advancedcommunication.c
Go to the documentation of this file.
2 {
6 
8  {
9  if (!GetGame().IsDedicatedServer())
10  {
11  if(GetGame().GetPlayer())
12  {
13  m_ActionsInitialize = false;
14  }
15  }
16  }
17 
18  //HUD
19  /*
20  protected Hud GetHud( PlayerBase player )
21  {
22  if ( !player )
23  {
24  return NULL;
25  }
26 
27  return player.m_Hud;
28  }
29 
30  void DisplayRadioInfo( string message, PlayerBase player )
31  {
32  Hud hud;
33  if ( player )
34  {
35  hud = GetHud( player );
36  }
37 
38  if ( hud )
39  {
40  hud.SetWalkieTalkieText( message );
41  hud.ShowWalkieTalkie( 3 );
42  }
43  }
44  */
45 
46  //control transmitter via user actions
47  void TurnOnTransmitter()
48  {
49  GetCompEM().SwitchOn();
50  }
51 
52  void TurnOffTransmitter()
53  {
54  GetCompEM().SwitchOff();
55  }
56 
57  void InitializeActions()
58  {
59  m_InputActionMap = m_AdvComTypeActionsMap.Get( this.Type() );
60  if(!m_InputActionMap)
61  {
63  m_InputActionMap = iam;
64  SetActions();
65  m_AdvComTypeActionsMap.Insert(this.Type(), m_InputActionMap);
66  }
67  }
68 
69  override void GetActions(typename action_input_type, out array<ActionBase_Basic> actions)
70  {
72  {
73  m_ActionsInitialize = true;
75  }
76 
77  actions = m_InputActionMap.Get(action_input_type);
78  }
79 
80  void SetActions()
81  {
85  }
86 
87  void AddAction(typename actionName)
88  {
89  ActionBase action = ActionManagerBase.GetAction(actionName);
90 
91  if (!action)
92  {
93  Debug.LogError("Action " + actionName + " dosn't exist!");
94  return;
95  }
96 
97  typename ai = action.GetInputType();
98  if (!ai)
99  {
100  m_ActionsInitialize = false;
101  return;
102  }
103 
104  array<ActionBase_Basic> action_array = m_InputActionMap.Get( ai );
105 
106  if (!action_array)
107  {
108  action_array = new array<ActionBase_Basic>;
109  m_InputActionMap.Insert(ai, action_array);
110  }
111 
112  if ( LogManager.IsActionLogEnable() )
113  {
114  Debug.ActionLog(action.ToString() + " -> " + ai, this.ToString() , "n/a", "Add action" );
115  }
116  action_array.Insert(action);
117  }
118 
119  void RemoveAction(typename actionName)
120  {
121  PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
122  ActionBase action = player.GetActionManager().GetAction(actionName);
123  typename ai = action.GetInputType();
124  array<ActionBase_Basic> action_array = m_InputActionMap.Get( ai );
125 
126  if (action_array)
127  {
128  action_array.RemoveItem(action);
129  }
130  }
131 }
132 
134 {
135  override bool IsInventoryVisible()
136  {
137  return false;
138  }
139 };
140 
142 {
143  proto native void SwitchOn(bool onOff);
144  proto native bool IsOn();
145 };
146 
148 {
149  proto native void SwitchOn(bool onOff);
150  proto native bool IsOn();
151  proto native void SetNextChannel();
152  proto native void SetPrevChannel();
153  proto native float GetTunedFrequency();
154  proto native void EnableBroadcast(bool state);
155  proto native void EnableReceive(bool state);
156  proto native bool IsBroadcasting();
157  proto native bool IsReceiving();
158  proto native int GetTunedFrequencyIndex();
159  proto native void SetFrequencyByIndex(int index);
160 };
InitializeActions
void InitializeActions()
Definition: advancedcommunication.c:56
GetGame
proto native CGame GetGame()
TurnOnTransmitter
void TurnOnTransmitter()
Definition: advancedcommunication.c:46
LogManager
Definition: debug.c:734
ActionDetachPowerSourceFromPanel
Definition: actiondetachpowersourcefrompanel.c:2
m_ActionsInitialize
bool m_ActionsInitialize
Definition: advancedcommunication.c:4
GetActions
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
Definition: advancedcommunication.c:68
PASReceiver
Definition: land_lamp_city1_amp.c:1
IsInventoryVisible
class PASBroadcaster extends AdvancedCommunication IsInventoryVisible
Definition: advancedcommunication.c:135
RemoveAction
void RemoveAction(typename actionName)
Definition: advancedcommunication.c:118
ActionManagerBase
void ActionManagerBase(PlayerBase player)
Definition: actionmanagerbase.c:62
PlayerBase
Definition: playerbaseclient.c:1
map
map
Definition: controlsxboxnew.c:3
AddAction
void AddAction(typename actionName)
Definition: advancedcommunication.c:86
SetActions
void SetActions()
Definition: advancedcommunication.c:79
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition: isboxcollidinggeometryproxyclasses.c:27
TurnOffTransmitter
void TurnOffTransmitter()
Definition: advancedcommunication.c:51
AdvancedCommunication
void AdvancedCommunication()
Definition: advancedcommunication.c:6
ActionBase
void ActionBase()
Definition: actionbase.c:73
ActionTurnOffTransmitterOnGround
Definition: actionturnofftransmitteronground.c:1
GetPlayer
protected void GetPlayer()
Definition: crosshairselector.c:127
TInputActionMap
map< typename, ref array< ActionBase_Basic > > TInputActionMap
Definition: actionmanagerclient.c:1
Debug
Definition: debug.c:13
Type
string Type
Definition: jsondatacontaminatedarea.c:11
StaticTransmitter
Definition: land_radio_panelbig.c:1
ActionTurnOnTransmitterOnGround
Definition: actionturnontransmitteronground.c:1
PASBroadcaster
Definition: land_radio_panelpas.c:1
AdvancedCommunication
Definition: advancedcommunication.c:141
EntityAI
Definition: building.c:5
m_InputActionMap
TInputActionMap m_InputActionMap
Definition: advancedcommunication.c:3