Merge branch 'master' of gitorious.org:fg/fgdata
This commit is contained in:
commit
56e77e393d
5 changed files with 913 additions and 665 deletions
|
@ -125,8 +125,10 @@ var handle_key = func(key)
|
|||
{
|
||||
input = substr(input, 0, size(input) - 1);
|
||||
gui.popupTip(input, 1000000);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Always handle key so excessive backspacing doesn't toggle the heading autopilot
|
||||
return 1;
|
||||
}
|
||||
elsif (key == 27)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
var set_runway_from_metar_wind = func {
|
||||
if (!getprop("/environment/params/real-world-weather-fetch"))
|
||||
if (!getprop("/environment/realwx/enabled"))
|
||||
return printlog("info", "metar-rwy: no live weather");
|
||||
if (!getprop("/environment/metar/valid"))
|
||||
return printlog("info", "metar-rwy: no valid metar");
|
||||
if (!getprop("/sim/startup/options/airport"))
|
||||
return printlog("info", "metar-rwy: no airport requested");
|
||||
if (getprop("/sim/startup/options/runway"))
|
||||
|
|
1326
Nasal/view.nas
1326
Nasal/view.nas
File diff suppressed because it is too large
Load diff
237
gui/dialogs/formation.xml
Normal file
237
gui/dialogs/formation.xml
Normal file
|
@ -0,0 +1,237 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
|
||||
<PropertyList>
|
||||
<name>formation</name>
|
||||
<modal>false</modal>
|
||||
<layout>vbox</layout>
|
||||
|
||||
<!-- AI Wingman options -->
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Wingman Controls</label>
|
||||
<color>
|
||||
<red>0.5</red>
|
||||
<green>0.5</green>
|
||||
<blue>0.5</blue>
|
||||
<alpha>1</alpha>
|
||||
</color>
|
||||
</text>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<empty>
|
||||
<pref-width>10</pref-width>
|
||||
</empty>
|
||||
|
||||
<group>
|
||||
<layout>vbox</layout>
|
||||
|
||||
<radio>
|
||||
<halign>left</halign>
|
||||
<label>Formate</label>
|
||||
<property>/sim/ai/models/wingman/controls/formate-to-ac</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
var v = getprop("/sim/ai/models/wingman/controls/formate-to-ac");
|
||||
setprop("/sim/ai/models/wingman/controls/break",0);
|
||||
setprop("/sim/ai/models/wingman/controls/join",0);
|
||||
foreach (var c; props.globals.getNode("/ai/models").getChildren("wingman")){
|
||||
c.getNode("controls/formate-to-ac").setBoolValue(v);
|
||||
c.getNode("controls/break").setBoolValue(0);
|
||||
c.getNode("controls/join").setBoolValue(0);
|
||||
}
|
||||
</script>
|
||||
</binding>
|
||||
</radio>
|
||||
|
||||
<radio>
|
||||
<halign>left</halign>
|
||||
<label>Break Formation</label>
|
||||
<property>/sim/ai/models/wingman/controls/break</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
var v = getprop("/sim/ai/models/wingman/controls/break");
|
||||
setprop("/sim/ai/models/wingman/controls/formate-to-ac",0);
|
||||
setprop("/sim/ai/models/wingman/controls/join",0);
|
||||
|
||||
foreach (var c; props.globals.getNode("/ai/models").getChildren("wingman")){
|
||||
c.getNode("controls/break").setBoolValue(v);
|
||||
c.getNode("controls/formate-to-ac").setBoolValue(0);
|
||||
c.getNode("controls/join").setBoolValue(0);
|
||||
}
|
||||
</script>
|
||||
</binding>
|
||||
</radio>
|
||||
|
||||
<radio>
|
||||
<halign>left</halign>
|
||||
<label>Join</label>
|
||||
<property>/sim/ai/models/wingman/controls/join</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
var v = getprop("/sim/ai/models/wingman/controls/join");
|
||||
setprop("/sim/ai/models/wingman/controls/formate-to-ac",0);
|
||||
setprop("/sim/ai/models/wingman/controls/break",0);
|
||||
|
||||
foreach (var c; props.globals.getNode("/ai/models").getChildren("wingman")){
|
||||
c.getNode("controls/join").setBoolValue(v);
|
||||
c.getNode("controls/break").setBoolValue(0);
|
||||
c.getNode("controls/formate-to-ac").setBoolValue(0);
|
||||
}
|
||||
</script>
|
||||
</binding>
|
||||
</radio>
|
||||
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<layout>vbox</layout>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Break Heading Degrees Relative</label>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<label>Left/Right</label>
|
||||
</text>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>-180</label>
|
||||
</text>
|
||||
<slider>
|
||||
<width>75</width>
|
||||
<height>25</height>
|
||||
<min>-180</min>
|
||||
<max>180</max>
|
||||
<property>/ai/models/wingman/controls/break-deg-rel</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
var v = getprop("/ai/models/wingman/controls/break-deg-rel");
|
||||
foreach (var c; props.globals.getNode("/ai/models").getChildren("wingman")){
|
||||
print("FFF ", v, " ", c.getNode("name").getValue());
|
||||
c.getNode("controls/break-deg-rel",1).setDoubleValue(v);
|
||||
}
|
||||
</script>
|
||||
</binding>
|
||||
</slider>
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
|
||||
<label>180</label>
|
||||
|
||||
</text>
|
||||
</group>
|
||||
|
||||
<text>
|
||||
<label>-100.00</label>
|
||||
<format>%-0.1f deg</format>
|
||||
<live>true</live>
|
||||
<property>/ai/models/wingman/controls/break-deg-rel</property>
|
||||
</text>
|
||||
|
||||
</group>
|
||||
|
||||
|
||||
|
||||
|
||||
</group>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Target Heading Degrees True</label>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>-100.00</label>
|
||||
<format>%-0.1f deg</format>
|
||||
<live>true</live>
|
||||
<property>/ai/models/wingman/controls/tgt-heading-deg</property>
|
||||
</text>
|
||||
</group>
|
||||
|
||||
<empty>
|
||||
<stretch>true</stretch>
|
||||
</empty>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<default-padding>6</default-padding>
|
||||
<empty>
|
||||
<stretch>true</stretch>
|
||||
</empty>
|
||||
|
||||
<button>
|
||||
<legend>OK</legend>
|
||||
<default>true</default>
|
||||
<equal>true</equal>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<legend>Apply</legend>
|
||||
<equal>true</equal>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<legend>Reset</legend>
|
||||
<equal>true</equal>
|
||||
<binding>
|
||||
<command>dialog-update</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<legend>Cancel</legend>
|
||||
<equal>true</equal>
|
||||
<key>Esc</key>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<empty>
|
||||
<stretch>true</stretch>
|
||||
</empty>
|
||||
</group>
|
||||
</PropertyList>
|
|
@ -474,6 +474,13 @@
|
|||
</item>
|
||||
|
||||
-->
|
||||
<item>
|
||||
<label>AI Formation</label>
|
||||
<binding>
|
||||
<command>dialog-show</command>
|
||||
<dialog-name>formation</dialog-name>
|
||||
</binding>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<label>AI Tanker</label>
|
||||
|
|
Loading…
Reference in a new issue