get rid of pushback.nas by instantiating the aircraft.door when opening the dialog.
This commit is contained in:
parent
0734e178bc
commit
28018bd083
2 changed files with 9 additions and 21 deletions
|
@ -1,20 +0,0 @@
|
|||
# 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.
|
||||
|
||||
var tractor = nil;
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
_setlistener("/sim/signals/nasal-dir-initialized", func { tractor_init() });
|
|
@ -3,6 +3,14 @@
|
|||
|
||||
<name>pushback</name>
|
||||
<layout>vbox</layout>
|
||||
<nasal>
|
||||
<open>
|
||||
var pushback_position = aircraft.door.new("sim/model/pushback", 10.0);
|
||||
pushback_position.setpos(pushback_position.getpos());
|
||||
props.globals.initNode("/sim/model/pushback/enabled", 0, "BOOL" );
|
||||
props.globals.initNode("/sim/model/pushback/magnitude", 0.0 );
|
||||
</open>
|
||||
</nasal>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
|
@ -48,7 +56,7 @@
|
|||
<property>/sim/model/pushback/position-norm</property>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>pushback.tractor_connect();</script>
|
||||
<script>pushback_position.toggle();</script>
|
||||
</binding>
|
||||
</checkbox>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue