cmdarg() in listener functions is no longer supported; use regular func args
This commit is contained in:
parent
0b453c6da3
commit
832c035499
2 changed files with 8 additions and 8 deletions
|
@ -31,18 +31,18 @@ setlistener("/sim/signals/fdm-initialized", func {
|
|||
print("KING RDR-160 ... OK");
|
||||
});
|
||||
|
||||
setlistener("/instrumentation/radar/switch-pos", func {
|
||||
setlistener("/instrumentation/radar/switch-pos", func(n) {
|
||||
if(FDM_ON != 0){
|
||||
var swtch = cmdarg().getValue();
|
||||
var swtch = n.getValue();
|
||||
RADAR.getNode("switch",1).setValue(P_Str[swtch]);
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/instrumentation/radar/set-range", func {
|
||||
setlistener("/instrumentation/radar/set-range", func(n) {
|
||||
if(FDM_ON != 0){
|
||||
var rng = RADAR.getNode("range").getValue();
|
||||
var num = cmdarg().getValue();
|
||||
cmdarg().setValue(0);
|
||||
var num = n.getValue();
|
||||
n.setValue(0);
|
||||
if(num > 0){
|
||||
rng *= 2;
|
||||
if(rng > 160){rng = 160.0;}
|
||||
|
|
|
@ -14,10 +14,10 @@ setlistener("/sim/signals/fdm-initialized", func {
|
|||
print("KY-196 Comm System ... OK");
|
||||
});
|
||||
|
||||
setlistener("/instrumentation/ky-196/volume-adjust", func {
|
||||
setlistener("/instrumentation/ky-196/volume-adjust", func(n) {
|
||||
if(FDM_ON == 0){return;}
|
||||
var setting = cmdarg().getValue();
|
||||
cmdarg().setDoubleValue(0);
|
||||
var setting = n.getValue();
|
||||
n.setDoubleValue(0);
|
||||
comm_num = KY196.getNode("comm-num").getValue();
|
||||
var commNode = props.globals.getNode("instrumentation/comm[" ~ comm_num ~"]");
|
||||
var vol = commNode.getNode("volume").getValue() + setting;
|
||||
|
|
Loading…
Add table
Reference in a new issue