Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
land_radio_panelbig.c
Go to the documentation of this file.
1 class Land_Radio_PanelBig extends StaticTransmitter
2 {
3  override bool DisableVicinityIcon()
4  {
5  return true;
6  }
7 
8  // --- SYSTEM EVENTS
9  override void OnStoreSave( ParamsWriteContext ctx )
10  {
11  super.OnStoreSave( ctx );
12 
13  //store tuned frequency
14  ctx.Write( GetTunedFrequencyIndex() );
15  }
16 
17  override bool OnStoreLoad( ParamsReadContext ctx, int version )
18  {
19  if ( !super.OnStoreLoad( ctx, version ) )
20  return false;
21 
22  //--- Panel Radio data ---
23  //load and set tuned frequency
24  int tuned_frequency_idx;
25  if ( !ctx.Read( tuned_frequency_idx ) )
26  {
27  tuned_frequency_idx = 0; //set default
28  }
29  SetFrequencyByIndex( tuned_frequency_idx );
30  //---
31 
32  return true;
33  }
34 
35  //--- BASE
36  override bool IsStaticTransmitter()
37  {
38  return true;
39  }
40 
41  void SetNextFrequency( PlayerBase player = NULL )
42  {
43  SetNextChannel();
44 
45  /*
46  if ( player )
47  {
48  DisplayRadioInfo( GetTunedFrequency().ToString(), player );
49  }
50  */
51  }
52 
53  //--- POWER EVENTS
54  override void OnSwitchOn()
55  {
56  if ( !GetCompEM().CanWork() )
57  {
58  GetCompEM().SwitchOff();
59  }
60  }
61 
62  override void OnWorkStart()
63  {
64  //turn on broadcasting/receiving
65  EnableBroadcast ( true );
66  EnableReceive ( true );
67  SwitchOn ( true );
68  }
69 
70  override void OnWorkStop()
71  {
72  //auto switch off (EM)
73  GetCompEM().SwitchOff();
74 
75  //turn off broadcasting/receiving
76  EnableBroadcast ( false );
77  EnableReceive ( false );
78  SwitchOn ( false );
79  }
80 
81  override void SetActions()
82  {
83  super.SetActions();
84 
86  }
87 }
OnWorkStop
override void OnWorkStop()
Definition: m18smokegrenade_colorbase.c:2
Serializer
Serialization general interface. Serializer API works with:
Definition: serializer.c:55
PlayerBase
Definition: playerbaseclient.c:1
ActionTuneFrequencyOnGround
Definition: actiontunefrequencyonground.c:1
AddAction
void AddAction(typename actionName)
Definition: advancedcommunication.c:86
SetActions
void SetActions()
Definition: advancedcommunication.c:79
OnStoreSave
void OnStoreSave(ParamsWriteContext ctx)
Definition: modifierbase.c:229
StaticTransmitter
Definition: land_radio_panelbig.c:1
OnStoreLoad
bool OnStoreLoad(ParamsReadContext ctx, int version)
Definition: modifiersmanager.c:270
OnWorkStart
override void OnWorkStart()
Definition: smokegrenadebase.c:175