| 1 | <?xml version="1.0"?> |
| 2 | <PropertyList> |
| 3 | <name>NTPS-target-task</name> |
| 4 | <layout>vbox</layout> |
| 5 | |
| 6 | <nasal> |
| 7 | <open> |
| 8 | p = props.globals.getNode("/sim/gui/dialogs/NTPS/task", 1); |
| 9 | mode = { |
| 10 | straight: p.getNode("straight", 1), |
| 11 | turns: p.getNode("turns", 1), |
| 12 | pitch: p.getNode("pitch", 1), |
| 13 | both: p.getNode("both", 1), |
| 14 | }; |
| 15 | |
| 16 | set_radio = func(m) { |
| 17 | foreach (k; keys(mode)) { |
| 18 | mode[k].setBoolValue(m == k); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | initialized = 0; |
| 23 | foreach (k; keys(mode)) { |
| 24 | if (mode[k].getType() == "NONE") { |
| 25 | mode[k].setBoolValue(0); |
| 26 | } |
| 27 | initialized += mode[k].getBoolValue(); |
| 28 | } |
| 29 | if (!initialized) { |
| 30 | set_radio("straight"); |
| 31 | } |
| 32 | </open> |
| 33 | |
| 34 | <close># just kept for educational purposes :-)</close> |
| 35 | </nasal> |
| 36 | |
| 37 | <text> |
| 38 | <label>Target Task Selection</label> |
| 39 | </text> |
| 40 | |
| 41 | <hrule/> |
| 42 | |
| 43 | <group> |
| 44 | <layout>hbox</layout> |
| 45 | <default-padding>8</default-padding> |
| 46 | |
| 47 | <group> |
| 48 | <layout>table</layout> |
| 49 | <radio> |
| 50 | <row>0</row><col>0</col> |
| 51 | <property>/sim/gui/dialogs/NTPS/task/straight</property> |
| 52 | <live>true</live> |
| 53 | <binding> |
| 54 | <command>nasal</command> |
| 55 | <script>set_radio("straight"); setprop("/autopilot/lead-target/task", "straight")</script> |
| 56 | </binding> |
| 57 | </radio> |
| 58 | <text> |
| 59 | <label>Straight and Level</label> |
| 60 | <halign>left</halign> |
| 61 | <row>0</row><col>1</col> |
| 62 | </text> |
| 63 | |
| 64 | <radio> |
| 65 | <row>1</row><col>0</col> |
| 66 | <property>/sim/gui/dialogs/NTPS/task/turns</property> |
| 67 | <live>true</live> |
| 68 | <binding> |
| 69 | <command>nasal</command> |
| 70 | <script>set_radio("turns"); setprop("/autopilot/lead-target/task", "turns");</script> |
| 71 | </binding> |
| 72 | </radio> |
| 73 | <text> |
| 74 | <label>Level Turns</label> |
| 75 | <halign>left</halign> |
| 76 | <row>1</row><col>1</col> |
| 77 | </text> |
| 78 | |
| 79 | <radio> |
| 80 | <row>2</row><col>0</col> |
| 81 | <property>/sim/gui/dialogs/NTPS/task/pitch</property> |
| 82 | <live>true</live> |
| 83 | <binding> |
| 84 | <command>nasal</command> |
| 85 | <script>set_radio("pitch"); setprop("/autopilot/lead-target/task", "pitch");</script> |
| 86 | </binding> |
| 87 | </radio> |
| 88 | <text> |
| 89 | <label>Straight Pitch Changes</label> |
| 90 | <halign>left</halign> |
| 91 | <row>2</row><col>1</col> |
| 92 | </text> |
| 93 | |
| 94 | <radio> |
| 95 | <row>3</row><col>0</col> |
| 96 | <property>/sim/gui/dialogs/NTPS/task/both</property> |
| 97 | <live>true</live> |
| 98 | <binding> |
| 99 | <command>nasal</command> |
| 100 | <script>set_radio("both"); setprop("/autopilot/lead-target/task", "lazy-eights");</script> |
| 101 | </binding> |
| 102 | </radio> |
| 103 | <text> |
| 104 | <label>Lazy Eights</label> |
| 105 | <halign>left</halign> |
| 106 | <row>3</row><col>1</col> |
| 107 | </text> |
| 108 | |
| 109 | </group> |
| 110 | </group> |
| 111 | |
| 112 | <button> |
| 113 | <legend>Close</legend> |
| 114 | <default>true</default> |
| 115 | <key>Esc</key> |
| 116 | <padding>10</padding> |
| 117 | <binding> |
| 118 | <command>dialog-apply</command> |
| 119 | </binding> |
| 120 | <binding> |
| 121 | <command>dialog-close</command> |
| 122 | </binding> |
| 123 | </button> |
| 124 | |
| 125 | </PropertyList> |