Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
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
48 {
49 GetCompEM().SwitchOn();
50 }
51
53 {
54 GetCompEM().SwitchOff();
55 }
56
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 {
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;
139};
142{
143 proto native void SwitchOn(bool onOff);
144 proto native bool IsOn();
145};
146
147class StaticTransmitter extends AdvancedCommunication
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};
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
void AdvancedCommunication()
TInputActionMap m_InputActionMap
void TurnOnTransmitter()
void TurnOffTransmitter()
bool m_ActionsInitialize
class PASBroadcaster extends AdvancedCommunication IsInventoryVisible
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
void SetActions()
void InitializeActions()
Definition debug.c:2
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
string Type
PlayerBase GetPlayer()