Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
land_radio_panelpas.c
Go to the documentation of this file.
1 class Land_Radio_PanelPAS extends PASBroadcaster
2 {
3  //Sounds
4  const string SOUND_PAS_TURN_ON = "pastransmitter_turnon_SoundSet";
5  const string SOUND_PAS_TURN_OFF = "pastransmitter_turnoff_SoundSet";
6  const string SOUND_PAS_TURNED_ON = "pastransmitter_staticnoise_SoundSet";
7 
8  protected EffectSound m_Sound;
9  protected EffectSound m_SoundLoop;
10 
11  //--- BASE
12  override bool IsStaticTransmitter()
13  {
14  return true;
15  }
16 
17  override bool DisableVicinityIcon()
18  {
19  return true;
20  }
21 
22  //--- POWER EVENTS
23  override void OnSwitchOn()
24  {
25  super.OnSwitchOn();
26 
27  if ( !GetCompEM().CanWork() )
28  {
29  GetCompEM().SwitchOff();
30  }
31 
32  //sound
33  SoundTurnOn();
34  }
35 
36  override void OnSwitchOff()
37  {
38  super.OnSwitchOff();
39 
40  //sound
41  SoundTurnOff();
42  }
43 
44  override void OnWorkStart()
45  {
46  super.OnWorkStart();
47 
48  //turn off device
49  SwitchOn ( true ); // start send/receive voice
50 
51  //sound
52  SoundTurnedOnNoiseStart();
53  }
54 
55  override void OnWorkStop()
56  {
57  super.OnWorkStop();
58 
59  //turn off device
60  SwitchOn ( false ); // stop send/receive voice
61 
62  //sound
63  SoundTurnedOnNoiseStop();
64  }
65 
66  //================================================================
67  // SOUNDS
68  //================================================================
69  //Static noise when the radio is turned on
70  protected void SoundTurnedOnNoiseStart()
71  {
72  PlaySoundSetLoop( m_SoundLoop, SOUND_PAS_TURNED_ON, 1.0, 1.0 );
73  }
74 
75  protected void SoundTurnedOnNoiseStop()
76  {
77  StopSoundSet( m_SoundLoop );
78  }
79 
80  protected void SoundTurnOn()
81  {
82  PlaySoundSet( m_Sound, SOUND_PAS_TURN_ON, 0, 0 );
83  }
84 
85  protected void SoundTurnOff()
86  {
87  PlaySoundSet( m_Sound, SOUND_PAS_TURN_OFF, 0, 0 );
88  }
89 }
m_Sound
EffectSound m_Sound
Definition: hungersoundhandler.c:18
OnWorkStop
override void OnWorkStop()
Definition: m18smokegrenade_colorbase.c:2
EffectSound
Wrapper class for managing sound through SEffectManager.
Definition: effectsound.c:4
PASBroadcaster
Definition: land_radio_panelpas.c:1
OnWorkStart
override void OnWorkStart()
Definition: smokegrenadebase.c:175