Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
advancedcommunication.c
Go to the documentation of this file.
1
class
AdvancedCommunication
extends
EntityAI
2
{
3
static
ref
map<typename, ref TInputActionMap>
m_AdvComTypeActionsMap
=
new
map<typename, ref TInputActionMap>
;
4
TInputActionMap
m_InputActionMap
;
5
bool
m_ActionsInitialize
;
6
7
void
AdvancedCommunication
()
8
{
9
if
(!
g_Game
.IsDedicatedServer())
10
{
11
if
(
g_Game
.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
{
62
TInputActionMap
iam =
new
TInputActionMap
;
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
{
71
if
(!
m_ActionsInitialize
)
72
{
73
m_ActionsInitialize
=
true
;
74
InitializeActions
();
75
}
76
77
actions =
m_InputActionMap
.Get(action_input_type);
78
}
79
80
void
SetActions
()
81
{
82
AddAction
(
ActionTurnOnTransmitterOnGround
);
83
AddAction
(
ActionTurnOffTransmitterOnGround
);
84
AddAction
(
ActionDetachPowerSourceFromPanel
);
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(
g_Game
.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
133
class
PASReceiver
extends
AdvancedCommunication
134
{
135
override
bool
IsInventoryVisible
()
136
{
137
return
false
;
138
}
139
};
140
141
class
PASBroadcaster
extends
AdvancedCommunication
142
{
143
proto native
void
SwitchOn
(
bool
onOff);
144
proto native
bool
IsOn
();
145
};
146
147
class
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
};
ActionManagerBase
void ActionManagerBase(PlayerBase player)
Definition
actionmanagerbase.c:63
TInputActionMap
map< typename, ref array< ActionBase_Basic > > TInputActionMap
Definition
actionmanagerclient.c:1
AddAction
void AddAction(typename actionName)
Definition
advancedcommunication.c:220
IsInventoryVisible
class PASBroadcaster extends AdvancedCommunication IsInventoryVisible
Definition
advancedcommunication.c:135
SetActions
void SetActions()
Definition
advancedcommunication.c:213
InitializeActions
void InitializeActions()
Definition
advancedcommunication.c:190
ActionBase
Definition
actionbase.c:59
ActionBase::GetInputType
GetInputType()
Definition
actionbase.c:221
ActionDetachPowerSourceFromPanel
Definition
actiondetachpowersourcefrompanel.c:3
ActionTurnOffTransmitterOnGround
Definition
actionturnofftransmitteronground.c:2
ActionTurnOnTransmitterOnGround
Definition
actionturnontransmitteronground.c:2
AdvancedCommunication
Definition
advancedcommunication.c:142
AdvancedCommunication::EnableReceive
proto native void EnableReceive(bool state)
AdvancedCommunication::SetFrequencyByIndex
proto native void SetFrequencyByIndex(int index)
AdvancedCommunication::SetPrevChannel
proto native void SetPrevChannel()
AdvancedCommunication::IsReceiving
proto native bool IsReceiving()
AdvancedCommunication::EnableBroadcast
proto native void EnableBroadcast(bool state)
AdvancedCommunication::GetTunedFrequency
proto native float GetTunedFrequency()
AdvancedCommunication::GetTunedFrequencyIndex
proto native int GetTunedFrequencyIndex()
AdvancedCommunication::SetNextChannel
proto native void SetNextChannel()
AdvancedCommunication::IsBroadcasting
proto native bool IsBroadcasting()
AdvancedCommunication::IsOn
proto native bool IsOn()
AdvancedCommunication::SwitchOn
proto native void SwitchOn(bool onOff)
Debug
Definition
debug.c:2
Debug::ActionLog
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition
debug.c:187
Debug::LogError
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Definition
debug.c:305
EntityAI
Definition
inventoryitem.c:2
EntityAI::m_InputActionMap
TInputActionMap m_InputActionMap
Definition
advancedcommunication.c:4
EntityAI::SetActions
void SetActions()
Definition
advancedcommunication.c:80
EntityAI::TurnOnTransmitter
void TurnOnTransmitter()
Definition
advancedcommunication.c:47
EntityAI::AddAction
void AddAction(typename actionName)
Definition
advancedcommunication.c:87
EntityAI::GetActions
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
Definition
advancedcommunication.c:69
EntityAI::m_ActionsInitialize
bool m_ActionsInitialize
Definition
advancedcommunication.c:5
EntityAI::AdvancedCommunication
void AdvancedCommunication()
Definition
advancedcommunication.c:7
EntityAI::m_AdvComTypeActionsMap
static ref map< typename, ref TInputActionMap > m_AdvComTypeActionsMap
Definition
advancedcommunication.c:3
EntityAI::RemoveAction
void RemoveAction(typename actionName)
Definition
advancedcommunication.c:119
EntityAI::TurnOffTransmitter
void TurnOffTransmitter()
Definition
advancedcommunication.c:52
EntityAI::InitializeActions
void InitializeActions()
Definition
advancedcommunication.c:57
LogManager
Definition
debug.c:692
LogManager::IsActionLogEnable
static bool IsActionLogEnable()
Definition
debug.c:736
PASBroadcaster
Definition
land_radio_panelpas.c:2
PASReceiver
Definition
land_lamp_city1_amp.c:2
PlayerBase
Definition
playerbaseclient.c:2
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
map
Definition
cachedequipmentstorage.c:4
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
Type
string Type
Definition
jsondatacontaminatedarea.c:11
Games
Dayz
scripts
4_world
entities
advancedcommunication
advancedcommunication.c
Generated by
1.17.0