- Now the pushback "door" will be created only if /sim/model/pushback has
already been created by the modeler via the <aircraft>-set.xml file. - Varified the code, removed the class structure, tests the nasal dir initialization first. - As part of the Nasal dir, the script must *not* be declared in the <aircraft>-set.xml file.
This commit is contained in:
parent
343538a5d8
commit
6a66414638
1 changed files with 14 additions and 20 deletions
|
@ -1,26 +1,20 @@
|
|||
# Properties under /sim/model/pushback:
|
||||
# + position-norm - Position of pushback. 1 if connected.
|
||||
|
||||
# =====
|
||||
# Pushback
|
||||
# =====
|
||||
# =============================================================================
|
||||
# Creates an object to move the pushback to or out of the towing position.
|
||||
# Needs /sim/model/pushback to exist in order to be executed.
|
||||
|
||||
Pushback = {};
|
||||
var tractor = nil;
|
||||
|
||||
Pushback.new = func {
|
||||
obj = { parents : [Pushback],
|
||||
pushback : aircraft.door.new("sim/model/pushback", 10.0),
|
||||
};
|
||||
return obj;
|
||||
};
|
||||
Pushback.pushbackexport = func {
|
||||
me.pushback.toggle();
|
||||
var tractor_init = func() {
|
||||
var pushback_node = props.globals.getNode("sim/model/pushback");
|
||||
if (pushback_node != nil) {
|
||||
tractor = aircraft.door.new("sim/model/pushback", 10.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var tractor_connect = func() {
|
||||
tractor.toggle();
|
||||
}
|
||||
|
||||
# ==============
|
||||
# Initialization
|
||||
# ==============
|
||||
|
||||
# objects must be here, otherwise local to init()
|
||||
pushbacksystem = Pushback.new();
|
||||
_setlistener("/sim/signals/nasal-dir-initialized", func { tractor_init() });
|
||||
|
|
Loading…
Add table
Reference in a new issue