Add function to toggle lighting.
This commit is contained in:
parent
5481c73b20
commit
45363925fc
1 changed files with 26 additions and 0 deletions
|
@ -388,3 +388,29 @@ var weaponSelect = func(d) {
|
|||
#
|
||||
var ptt = func(b) setprop("/instrumentation/comm/ptt", b);
|
||||
|
||||
##
|
||||
# Lighting
|
||||
#
|
||||
var toggleLights = func () {
|
||||
if (getprop("/controls/switches/panel-lights")) {
|
||||
setprop("/controls/switches/panel-lights-factor", 0);
|
||||
setprop("/controls/switches/panel-lights", 0);
|
||||
setprop("/controls/switches/landing-light", 0);
|
||||
setprop("/controls/switches/flashing-beacon", 0);
|
||||
setprop("/controls/switches/strobe-lights", 0);
|
||||
setprop("/controls/switches/map-lights", 0);
|
||||
setprop("/controls/switches/cabin-lights", 0);
|
||||
setprop("/controls/switches/nav-lights", 0);
|
||||
} else {
|
||||
setprop("/controls/electric/battery-switch", 1);
|
||||
setprop("/controls/electric/alternator-switch", 1);
|
||||
setprop("/controls/switches/panel-lights-factor", 0.1);
|
||||
setprop("/controls/switches/panel-lights", 1);
|
||||
setprop("/controls/switches/landing-light", 1);
|
||||
setprop("/controls/switches/flashing-beacon", 1);
|
||||
setprop("/controls/switches/strobe-lights", 1);
|
||||
setprop("/controls/switches/map-lights", 1);
|
||||
setprop("/controls/switches/cabin-lights", 1);
|
||||
setprop("/controls/switches/nav-lights", 1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue