- New instruments, some little changes
[fg:toms-fgdata.git] / Aircraft / DH-88 / Nasal / light.nas
1 var sbc1 = aircraft.light.new( "/sim/model/lights/sbc1", [0.5, 0.3] );
2 sbc1.interval = 0.1;
3 sbc1.switch( 1 );
4
5 var sbc2 = aircraft.light.new( "/sim/model/lights/sbc2", [0.2, 0.3], "/sim/model/lights/sbc1/state" );
6 sbc2.interval = 0;
7 sbc2.switch( 1 );
8
9 setlistener( "/sim/model/lights/sbc2/state", func {
10   var bsbc1 = sbc1.stateN.getValue();
11   var bsbc2 = cmdarg().getBoolValue();
12   var b = 0;
13   if( bsbc1 and bsbc2 and getprop( "/controls/lighting/beacon") ) {
14     b = 1;
15   } else {
16     b = 0;
17   }
18   setprop( "/sim/model/lights/beacon/enabled", b );
19
20   if( bsbc1 and !bsbc2 and getprop( "/controls/lighting/strobe" ) ) {
21     b = 1;
22   } else {
23     b = 0;
24   }
25   setprop( "/sim/model/lights/strobe/enabled", b );
26 });
27
28 var beacon = aircraft.light.new( "/sim/model/lights/beacon", [0.05, 0.05] );
29 beacon.interval = 0;
30
31 var strobe = aircraft.light.new( "/sim/model/lights/strobe", [0.05, 0.05, 0.05, 1] );
32 strobe.interval = 0;
33
34 setprop( "/instrumentation/nav[0]/ident", 0 );
35 setprop( "/instrumentation/nav[1]/ident", 0 );
36