DayZ 1.24
Loading...
Searching...
No Matches
Land_Radio_PanelBig.c
Go to the documentation of this file.
2{
3 override bool DisableVicinityIcon()
4 {
5 return true;
6 }
7
8 // --- SYSTEM EVENTS
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
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
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 GetCompEM().SwitchOff();
58 }
59
60 override void OnWorkStart()
61 {
62 //turn on broadcasting/receiving
63 EnableBroadcast(true);
64 EnableReceive(true);
65 SwitchOn(true);
66 }
67
68 override void OnWorkStop()
69 {
70 //auto switch off (EM)
71 GetCompEM().SwitchOff();
72
73 //turn off broadcasting/receiving
74 EnableBroadcast(false);
75 EnableReceive(false);
76 SwitchOn(false);
77 }
78
79 override void SetActions()
80 {
81 super.SetActions();
82
84 }
85}
void AddAction(typename actionName)
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
override void OnWorkStop()
override void OnWorkStart()
override bool DisableVicinityIcon()
override void SetActions()
override void OnStoreSave(ParamsWriteContext ctx)
override void OnSwitchOn()
void SetNextFrequency(PlayerBase player=NULL)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override bool IsStaticTransmitter()