2008-12-04 22:44:18 +00:00
|
|
|
# strobes ===========================================================
|
|
|
|
var strobe_switch = props.globals.getNode("controls/lighting/strobe", 1);
|
|
|
|
aircraft.light.new("sim/model/c172p/lighting/strobes", [0.015, 1.985], strobe_switch);
|
2008-10-11 23:17:23 +00:00
|
|
|
|
|
|
|
|
2008-12-04 22:44:18 +00:00
|
|
|
# beacons ===========================================================
|
|
|
|
var beacon_switch = props.globals.getNode("controls/lighting/beacon", 1);
|
2011-02-13 21:19:17 +00:00
|
|
|
aircraft.light.new("sim/model/c172p/lighting/beacon-top", [0.10, 0.90], beacon_switch);
|
|
|
|
|
|
|
|
|
2012-03-20 20:19:42 +00:00
|
|
|
# Control both panel and instrument light intensity with one property
|
2011-02-13 21:19:17 +00:00
|
|
|
var instrumentsNorm = props.globals.getNode("controls/lighting/instruments-norm", 1);
|
|
|
|
var instrumentLightFactor = props.globals.getNode("sim/model/material/instruments/factor", 1);
|
|
|
|
var panelLights = props.globals.getNode("controls/lighting/panel-norm", 1);
|
|
|
|
|
|
|
|
var update_intensity = func {
|
|
|
|
instrumentLightFactor.setDoubleValue(instrumentsNorm.getValue());
|
|
|
|
panelLights.setDoubleValue(instrumentsNorm.getValue());
|
|
|
|
|
2012-03-20 20:19:42 +00:00
|
|
|
settimer(update_intensity, 0.1);
|
2011-02-13 21:19:17 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 20:19:42 +00:00
|
|
|
# Setup listener call to start update loop once the fdm is initialized,
|
|
|
|
# but only start the update loop _once_.
|
|
|
|
var fdm_init_listener = setlistener("sim/signals/fdm-initialized", func {
|
|
|
|
removelistener(fdm_init_listener);
|
|
|
|
update_intensity();
|
|
|
|
});
|