diff --git a/gui/dialogs/replay.xml b/gui/dialogs/replay.xml index acaef886c..d584a4c83 100644 --- a/gui/dialogs/replay.xml +++ b/gui/dialogs/replay.xml @@ -20,14 +20,40 @@ new : func( dlgRoot ) { var obj = { parents: [ReplayDialogController] }; obj.dlgRoot = dlgRoot; + obj.initViews(1); return obj; }, + # Populate the view combo box with a list of the available views + initViews : func(update) { + var combo = me.findElementByName( me.dlgRoot, "view-selector" ); + if (update) + combo.removeChildren("value"); + + var current_view = getprop("/sim/current-view/view-number"); + var i = 0; + foreach (var v; view.views) { + var name = "Unnamed view " ~ v.getIndex(); + if (v.getNode("name") != nil) { + name = v.getNode("name").getValue(); + } + + # Pre-populate the combo box selected value + if (i == current_view) { + setprop("/sim/replay/view-name", name); + } + if (update) + combo.getNode("value[" ~ i ~ "]", 1).setValue(name); + i = i + 1; + } + }, + open : func { var replaySlider = me.findElementByName( me.dlgRoot, "replay-time-slider" ); me.maxProp = replaySlider.getChild("max"); me.minProp = replaySlider.getChild("min"); - me.maxListenerId = setlistener( "/sim/speed-up", func(n) { me.updateListener(n); }, 1, 1 ); + me.speedUpListenerId = setlistener( "/sim/speed-up", func(n) { me.updateListener(n); }, 1, 1 ); + me.viewListenerId = setlistener( "/sim/current-view/view-number", func(n) { me.updateListener(n); }, 1, 1 ); if (getprop("/sim/replay/end-time")!=nil) { # update max/min range of replay-time slider @@ -45,10 +71,12 @@ SpeedUp = "1/" ~ SpeedUp; } setprop("/sim/gui/dialogs/replay/time-factor","" ~ SpeedUp ~ "x"); + me.initViews(0); }, close : func { - #removelistener( me.maxListenerId ); + removelistener( me.speedUpListenerId ); + removelistener( me.viewListenerId ); }, findElementByName : func(base,name) { @@ -66,6 +94,8 @@ var controller = ReplayDialogController.new( cmdarg() ); controller.open(); + if (props.globals.getNode("/rotors",0)!=nil) + setprop("/sim/replay/disable-my-controls",1); ]]> 1 - + + 80 + - + + + + + diff --git a/preferences.xml b/preferences.xml index f9bd58988..41e014afe 100644 --- a/preferences.xml +++ b/preferences.xml @@ -785,6 +785,9 @@ Started September 2000 by David Megginson, david@megginson.com /Aircraft/Generic/flightrecorder/generic-piston-propeller-4.xml + + false +