From ab1e00a81e052cb569fc2e7e449421b6e4409ae6 Mon Sep 17 00:00:00 2001 From: mfranz Date: Sat, 31 Jan 2009 21:22:18 +0000 Subject: [PATCH] - re-open after gui-reinit - only update once per sec - cosmetics --- Nasal/multiplayer.nas | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Nasal/multiplayer.nas b/Nasal/multiplayer.nas index e2d92ae1b..a88d4db0c 100644 --- a/Nasal/multiplayer.nas +++ b/Nasal/multiplayer.nas @@ -187,6 +187,7 @@ var dialog = { me.listeners=[]; append(me.listeners, setlistener("/sim/startup/xsize", func me._redraw_())); append(me.listeners, setlistener("/sim/startup/ysize", func me._redraw_())); + append(me.listeners, setlistener("/sim/signals/reinit-gui", func me._redraw_())); append(me.listeners, setlistener("/sim/signals/multiplayer-updated", func me.update())); }, create: func { @@ -261,7 +262,7 @@ var dialog = { }, update: func { var self = geo.aircraft_position(); - foreach(var mp; model.list) { + foreach (var mp; model.list) { var n = mp.node; var ac = geo.Coord.new().set_xyz( n.getNode("position/global-x").getValue(), @@ -278,7 +279,7 @@ var dialog = { }); } if (PILOTSDLG_RUNNING) - settimer( func me.update(), 0.4, 1); + settimer(func me.update(), 1, 1); }, _redraw_: func { if (me.dialog != nil) { @@ -288,16 +289,13 @@ var dialog = { }, toggle_unit: func { me.unit = !me.unit; - if(me.unit) - { + if (me.unit) { me.alt_node = "position/altitude-m"; me.alt_hdr = "alt-m"; me.dist_hdr = "dist-km"; me.dist_node = "distance-to-km"; me.unit_button = "IM"; - } - else - { + } else { me.alt_node = "position/altitude-ft"; me.dist_node = "distance-to-nm"; me.alt_hdr = "alt-ft";