Canvas ND: keep canvases through reinit
Make fdm listener single-fire, don't listen to /sim/signals/reinit. This allows the Canvas to stay with the same placement through reinit, after both the 777 and 747 were having problems. I don't see any reason for having to recreate it all, and the cleanup function is still there (e.g. for independent windows, to have their .del() call the ND's .del()). renamed handle_reinit() -> del()
This commit is contained in:
parent
99fb72d26a
commit
381aeb918e
1 changed files with 2 additions and 2 deletions
|
@ -385,7 +385,7 @@ update_apl_sym();
|
||||||
var NavDisplay = {
|
var NavDisplay = {
|
||||||
|
|
||||||
# reset handler
|
# reset handler
|
||||||
handle_reinit: func {
|
del: func {
|
||||||
print("Cleaning up NavDisplay");
|
print("Cleaning up NavDisplay");
|
||||||
# shut down all timers and other loops here
|
# shut down all timers and other loops here
|
||||||
me.update_timer.stop();
|
me.update_timer.stop();
|
||||||
|
@ -499,7 +499,7 @@ var NavDisplay = {
|
||||||
{
|
{
|
||||||
if (me.inited) die("MFD already was added to scene");
|
if (me.inited) die("MFD already was added to scene");
|
||||||
me.inited = 1;
|
me.inited = 1;
|
||||||
me.listen("/sim/signals/reinit", func(n) me.handle_reinit() );
|
#me.listen("/sim/signals/reinit", func(n) me.del() );
|
||||||
me.update_timer = maketimer(0.05, func me.update() ); # TODO: make interval configurable via ctor
|
me.update_timer = maketimer(0.05, func me.update() ); # TODO: make interval configurable via ctor
|
||||||
me.nd = canvas_group;
|
me.nd = canvas_group;
|
||||||
me.canvas_handle = parent;
|
me.canvas_handle = parent;
|
||||||
|
|
Loading…
Reference in a new issue