From: Flightgear-commitlogs <ma...@hy...> - 2012-04-30 18:14:14
|
The branch, master has been updated - Log ----------------------------------------------------------------- commit 63fc9ad7e42972c3de02140a2bf3b7faef92fc31 Author: ThorstenB Date: Mon Apr 30 19:22:00 2012 +0200 Improve scenario dialog Support optional name for scenarios. Add explicit scenario enable/disable switch. - Summary ------------------------------------------------------------- AI/ICE3_demo.xml | 1 + AI/KSFO_AirTrain.xml | 4 ++-- AI/aircraft_demo.xml | 1 + AI/balloon_demo.xml | 1 + AI/bigstorm_demo.xml | 2 +- AI/nimitz_demo.xml | 1 + AI/railway_demo.xml | 3 ++- AI/ship_demo.xml | 2 +- AI/steam_train_demo.xml | 1 + AI/thermal_demo.xml | 2 +- gui/dialogs/scenario.xml | 32 ++++++++++++++++++++++++++++---- preferences.xml | 10 +++------- 12 files changed, 43 insertions(+), 17 deletions(-) - Diff ---------------------------------------------------------------- diff --git a/AI/ICE3_demo.xml b/AI/ICE3_demo.xml index 0bcdaf1..970d57a 100644 --- a/AI/ICE3_demo.xml +++ b/AI/ICE3_demo.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <PropertyList> + <name>ICE3 train demo (Frankfurt to Essen)</name> <description> This scenario runs an ICE3 train from Frankfurt Hbf to Essen Hbf. diff --git a/AI/KSFO_AirTrain.xml b/AI/KSFO_AirTrain.xml index 6eaa20d..6ac9290 100644 --- a/AI/KSFO_AirTrain.xml +++ b/AI/KSFO_AirTrain.xml @@ -2,7 +2,7 @@ <PropertyList> <scenario> - + <name>KSFO AirTrain (San Francisco)</name> <entry> <type>groundvehicle</type> <model>Models/Transport/KSFO_AirTrain.xml</model> @@ -95,4 +95,4 @@ </scenario> -</PropertyList> \ No newline at end of file +</PropertyList> diff --git a/AI/aircraft_demo.xml b/AI/aircraft_demo.xml index a190cb4..2c0a87f 100644 --- a/AI/aircraft_demo.xml +++ b/AI/aircraft_demo.xml @@ -4,6 +4,7 @@ <scenario> + <name>737 takeoff from KSFO/28L (San Francisco)</name> <description> This scenario has a 737 takeoff from runway 28L at KSFO and fly the Porte Departure to the south. You can diff --git a/AI/balloon_demo.xml b/AI/balloon_demo.xml index c76c075..62c6d73 100644 --- a/AI/balloon_demo.xml +++ b/AI/balloon_demo.xml @@ -4,6 +4,7 @@ <scenario> + <name>Flying balloons</name> <description> Places 7 balloons that will drift with the wind. nasal code by Detlef Faber and Torsten Dreyer diff --git a/AI/bigstorm_demo.xml b/AI/bigstorm_demo.xml index 37aff24..7fbd861 100644 --- a/AI/bigstorm_demo.xml +++ b/AI/bigstorm_demo.xml @@ -3,7 +3,7 @@ <PropertyList> <scenario> - + <name>Thunderstorm (San Francisco)</name> <description> This scenario puts a thunderstorm with lightning and turbulence over San Francisco at 5000 feet MSL. The diff --git a/AI/nimitz_demo.xml b/AI/nimitz_demo.xml index 234e41c..e58b8aa 100644 --- a/AI/nimitz_demo.xml +++ b/AI/nimitz_demo.xml @@ -1,6 +1,7 @@ <?xml version="1.0"?> <PropertyList> <scenario> + <name>Nimitz Carrier (San Francisco)</name> <description> Places 2 Nimitz-class Carriers in the environment - diff --git a/AI/railway_demo.xml b/AI/railway_demo.xml index fd5b9b7..6d22a0c 100644 --- a/AI/railway_demo.xml +++ b/AI/railway_demo.xml @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="iso-8859-1"?> <PropertyList> + <name>Trains and Buses (Wakefield, UK)</name> <description> - This scenario runs a variety of trains and buses along + This scenario runs a variety of trains and buses along tracks or roads near Wakefield, Yorshire, UK Note: diff --git a/AI/ship_demo.xml b/AI/ship_demo.xml index f6286df..3869188 100644 --- a/AI/ship_demo.xml +++ b/AI/ship_demo.xml @@ -3,7 +3,7 @@ <PropertyList> <scenario> - + <name>Sailboat at KSFO (San Francisco)</name> <description> This scenario puts a sailboat in the bay just east of KSFO. The <rudder> tag works similarly to the diff --git a/AI/steam_train_demo.xml b/AI/steam_train_demo.xml index 1a8d72e..59d3701 100644 --- a/AI/steam_train_demo.xml +++ b/AI/steam_train_demo.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <PropertyList> + <name>Steamtrain (North Yorkshire Moors, UK)</name> <description> This scenario runs a steam Steamtrain comprising the A4 Class, Mallard and 8 coaches along the track of the diff --git a/AI/thermal_demo.xml b/AI/thermal_demo.xml index 0d53941..16861bb 100644 --- a/AI/thermal_demo.xml +++ b/AI/thermal_demo.xml @@ -3,7 +3,7 @@ <PropertyList> <scenario> - + <name>Thermals above KSFO (San Francisco)</name> <description> The <height> tag defines the upper limit of the thermal. AI thermals have some limitations, i.e. they don't lean diff --git a/gui/dialogs/scenario.xml b/gui/dialogs/scenario.xml index dc2749f..abc852a 100644 --- a/gui/dialogs/scenario.xml +++ b/gui/dialogs/scenario.xml @@ -30,7 +30,7 @@ <empty><stretch>true</stretch></empty> <text> - <label>AI Scenario Select</label> + <label>AI Scenario Selection</label> </text> <empty><stretch>true</stretch></empty> @@ -49,8 +49,24 @@ <hrule/> + <checkbox> + <halign>left</halign> + <label>Enable AI scenarios</label> + <name>enable-ai-scenarios</name> + <property>/sim/ai/scenarios-enabled</property> + <binding> + <command>dialog-apply</command> + <object-name>enable-ai-scenarios</object-name> + </binding> + </checkbox> + + <text><label/></text> + <text> <label>Choose active scenario(s) for the next program start</label> + <enable> + <property>/sim/ai/scenarios-enabled</property> + </enable> </text> <hrule/> @@ -120,8 +136,12 @@ var scenarioN = rootN.getNode("scenario"); if( scenarioN == nil ) return; var descriptionN = rootN.getNode("description"); - if( descriptionN == nil ) - var descriptionN = scenarioN.getNode("description"); + var nameN = rootN.getNode("name"); + if( (descriptionN == nil)and(nameN == nil) ) + { + descriptionN = scenarioN.getNode("description"); + nameN = scenarioN.getNode("name"); + } var description = descriptionN != nil ? descriptionN.getValue() : ""; var propertyRoot = props.globals.getNode("sim/gui/dialogs/scenario",1).getChild( "scenario", nr, 1 ); propertyRoot.getNode("selected",1).setBoolValue(isEnabledScenario(file)); @@ -131,8 +151,12 @@ group.getNode("layout",1).setValue("hbox"); var cb = group.getNode("checkbox",1); cb.getNode("property",1).setValue(propertyRoot.getNode("selected").getPath()); - cb.getNode("label",1).setValue(file); + var label = string.replace(file, "_", " "); + if (nameN != nil) + label = nameN.getValue(); + cb.getNode("label",1).setValue(label); cb.getNode("name",1).setValue(file); + cb.getNode("enable/property",1).setValue("/sim/ai/scenarios-enabled"); group.getNode("empty",1).getNode("stretch",1).setValue("true"); } diff --git a/preferences.xml b/preferences.xml index ff39245..987dd0c 100644 --- a/preferences.xml +++ b/preferences.xml @@ -63,7 +63,7 @@ Started September 2000 by David Megginson, da...@me... <season type="string" preserve="y">summer</season> </startup> <rendering> - <materials-file>Materials/default/materials.xml</materials-file> + <materials-file>Materials/default/materials.xml</materials-file> <rembrandt type="bool">false</rembrandt> <show-buffers type="bool" userarchive="y">true</show-buffers> <ambient-occlusion type="bool" userarchive="y">false</ambient-occlusion> @@ -748,13 +748,9 @@ Started September 2000 by David Megginson, da...@me... <ai> <enabled type="bool">true</enabled> + <scenarios-enabled type="bool" userarchive="y">true</scenarios-enabled> <scenario>nimitz_demo</scenario> - <groundnet-cache type="bool">true</groundnet-cache> - <!-- <scenario>balloon_demo</scenario> --> - <!-- <scenario>aircraft_demo</scenario> --> - <!-- <scenario>refueling_demo</scenario> --> - <!-- <scenario>lead_aircraft</scenario> --> - <!-- <scenario>vinson_demo</scenario> --> + <groundnet-cache type="bool">true</groundnet-cache> </ai> <multiplay preserve="y"> ----------------------------------------------------------------------- FlightGear Base Package |