Generalize pilot model support
Adds standard view option to enable pilot models. Set /sim/rendering/pilot-model/available=true in aircraft using pilot models. /sim/rendering/pilot-model/enabled is used by users to enable/disable the pilot models from the View Options dialog. Note that pilot models are only visible for non-internal views.
This commit is contained in:
parent
71b66dce64
commit
0ce0e436ec
7 changed files with 113 additions and 30 deletions
|
@ -63,6 +63,18 @@
|
||||||
</legs>
|
</legs>
|
||||||
</params>
|
</params>
|
||||||
|
|
||||||
|
<animation>
|
||||||
|
<type>select</type>
|
||||||
|
<condition>
|
||||||
|
<and>
|
||||||
|
<not>
|
||||||
|
<property>/sim/current-view/internal</property>
|
||||||
|
</not>
|
||||||
|
<property>/sim/rendering/pilot-model/enabled</property>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
</animation>
|
||||||
|
|
||||||
<animation>
|
<animation>
|
||||||
<type>range</type>
|
<type>range</type>
|
||||||
<min-m>1</min-m>
|
<min-m>1</min-m>
|
||||||
|
@ -92,7 +104,7 @@
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<z>0</z>
|
<z>0</z>
|
||||||
</axis>
|
</axis>
|
||||||
</animation>
|
</animation>
|
||||||
<animation>
|
<animation>
|
||||||
<type>rotate</type>
|
<type>rotate</type>
|
||||||
<object-name>Head</object-name>
|
<object-name>Head</object-name>
|
||||||
|
|
|
@ -56,6 +56,18 @@
|
||||||
</legs>
|
</legs>
|
||||||
</params>
|
</params>
|
||||||
|
|
||||||
|
<animation>
|
||||||
|
<type>select</type>
|
||||||
|
<condition>
|
||||||
|
<and>
|
||||||
|
<not>
|
||||||
|
<property>/sim/current-view/internal</property>
|
||||||
|
</not>
|
||||||
|
<property>/sim/rendering/pilot-model/enabled</property>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
</animation>
|
||||||
|
|
||||||
<animation>
|
<animation>
|
||||||
<type>range</type>
|
<type>range</type>
|
||||||
<min-m>1</min-m>
|
<min-m>1</min-m>
|
||||||
|
@ -95,7 +107,7 @@
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<z>0</z>
|
<z>0</z>
|
||||||
</axis>
|
</axis>
|
||||||
</animation>
|
</animation>
|
||||||
<animation>
|
<animation>
|
||||||
<type>rotate</type>
|
<type>rotate</type>
|
||||||
<object-name>Head</object-name>
|
<object-name>Head</object-name>
|
||||||
|
|
|
@ -63,6 +63,18 @@
|
||||||
</legs>
|
</legs>
|
||||||
</params>
|
</params>
|
||||||
|
|
||||||
|
<animation>
|
||||||
|
<type>select</type>
|
||||||
|
<condition>
|
||||||
|
<and>
|
||||||
|
<not>
|
||||||
|
<property>/sim/current-view/internal</property>
|
||||||
|
</not>
|
||||||
|
<property>/sim/rendering/pilot-model/enabled</property>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
</animation>
|
||||||
|
|
||||||
<animation>
|
<animation>
|
||||||
<type>range</type>
|
<type>range</type>
|
||||||
<min-m>1</min-m>
|
<min-m>1</min-m>
|
||||||
|
@ -92,7 +104,7 @@
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<z>0</z>
|
<z>0</z>
|
||||||
</axis>
|
</axis>
|
||||||
</animation>
|
</animation>
|
||||||
<animation>
|
<animation>
|
||||||
<type>rotate</type>
|
<type>rotate</type>
|
||||||
<object-name>Head</object-name>
|
<object-name>Head</object-name>
|
||||||
|
|
|
@ -63,6 +63,18 @@
|
||||||
</legs>
|
</legs>
|
||||||
</params>
|
</params>
|
||||||
|
|
||||||
|
<animation>
|
||||||
|
<type>select</type>
|
||||||
|
<condition>
|
||||||
|
<and>
|
||||||
|
<not>
|
||||||
|
<property>/sim/current-view/internal</property>
|
||||||
|
</not>
|
||||||
|
<property>/sim/rendering/pilot-model/enabled</property>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
</animation>
|
||||||
|
|
||||||
<animation>
|
<animation>
|
||||||
<type>range</type>
|
<type>range</type>
|
||||||
<min-m>1</min-m>
|
<min-m>1</min-m>
|
||||||
|
@ -106,7 +118,7 @@
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<z>0</z>
|
<z>0</z>
|
||||||
</axis>
|
</axis>
|
||||||
</animation>
|
</animation>
|
||||||
<animation>
|
<animation>
|
||||||
<type>rotate</type>
|
<type>rotate</type>
|
||||||
<object-name>Head</object-name>
|
<object-name>Head</object-name>
|
||||||
|
|
|
@ -63,6 +63,18 @@
|
||||||
</legs>
|
</legs>
|
||||||
</params>
|
</params>
|
||||||
|
|
||||||
|
<animation>
|
||||||
|
<type>select</type>
|
||||||
|
<condition>
|
||||||
|
<and>
|
||||||
|
<not>
|
||||||
|
<property>/sim/current-view/internal</property>
|
||||||
|
</not>
|
||||||
|
<property>/sim/rendering/pilot-model/enabled</property>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
</animation>
|
||||||
|
|
||||||
<animation>
|
<animation>
|
||||||
<type>range</type>
|
<type>range</type>
|
||||||
<min-m>1</min-m>
|
<min-m>1</min-m>
|
||||||
|
@ -92,7 +104,7 @@
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<z>0</z>
|
<z>0</z>
|
||||||
</axis>
|
</axis>
|
||||||
</animation>
|
</animation>
|
||||||
<animation>
|
<animation>
|
||||||
<type>rotate</type>
|
<type>rotate</type>
|
||||||
<object-name>Head</object-name>
|
<object-name>Head</object-name>
|
||||||
|
|
|
@ -419,6 +419,13 @@ Started September 2000 by David Megginson, david@megginson.com
|
||||||
<compress-solid type="bool" userarchive="y">true</compress-solid>
|
<compress-solid type="bool" userarchive="y">true</compress-solid>
|
||||||
<compress type="bool" userarchive="y">true</compress>
|
<compress type="bool" userarchive="y">true</compress>
|
||||||
</texture-cache>
|
</texture-cache>
|
||||||
|
|
||||||
|
<pilot-model>
|
||||||
|
<!-- Controls for the availability (set by aircraft) and visibility
|
||||||
|
(set by the user) of pilot model(s) in the aircraft.-->
|
||||||
|
<available type="bool" userarchive="n">false</available>
|
||||||
|
<enabled type="bool" userarchive="y">true</enabled>
|
||||||
|
</pilot-model>
|
||||||
</rendering>
|
</rendering>
|
||||||
<model-hz type="int">120</model-hz>
|
<model-hz type="int">120</model-hz>
|
||||||
<sound>
|
<sound>
|
||||||
|
|
|
@ -2,21 +2,21 @@
|
||||||
|
|
||||||
<PropertyList>
|
<PropertyList>
|
||||||
<name>view</name>
|
<name>view</name>
|
||||||
|
|
||||||
<nasal>
|
<nasal>
|
||||||
<open>
|
<open>
|
||||||
|
|
||||||
var group = gui.findElementByName(cmdarg(), "active-views");
|
var group = gui.findElementByName(cmdarg(), "active-views");
|
||||||
var ac = getprop("/sim/aircraft");
|
var ac = getprop("/sim/aircraft");
|
||||||
group.removeChildren("checkbox");
|
group.removeChildren("checkbox");
|
||||||
group.removeChildren("hrule");
|
group.removeChildren("hrule");
|
||||||
group.removeChildren("text");
|
group.removeChildren("text");
|
||||||
|
|
||||||
var t = group.getChild("text", 0, 1);
|
var t = group.getChild("text", 0, 1);
|
||||||
t.getNode("label", 1).setValue("Standard Views");
|
t.getNode("label", 1).setValue("Standard Views");
|
||||||
t.getNode("halign", 1).setValue("left");
|
t.getNode("halign", 1).setValue("left");
|
||||||
|
|
||||||
|
|
||||||
var mode = 0;
|
var mode = 0;
|
||||||
foreach (var v; view.views) {
|
foreach (var v; view.views) {
|
||||||
var index = v.getIndex();
|
var index = v.getIndex();
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
} elsif (index >= 100) {
|
} elsif (index >= 100) {
|
||||||
aircraft.data.add(enabled);
|
aircraft.data.add(enabled);
|
||||||
if (mode != 1) {
|
if (mode != 1) {
|
||||||
mode = 1;
|
mode = 1;
|
||||||
group.getChild("empty", 0, 1).getChild("stretch", 0, 1).setValue(1);
|
group.getChild("empty", 0, 1).getChild("stretch", 0, 1).setValue(1);
|
||||||
var t = group.getChild("text", 1, 1);
|
var t = group.getChild("text", 1, 1);
|
||||||
t.getNode("label", 1).setValue("\"" ~ ac ~ "\" Specific Views");
|
t.getNode("label", 1).setValue("\"" ~ ac ~ "\" Specific Views");
|
||||||
|
@ -50,9 +50,9 @@
|
||||||
}
|
}
|
||||||
</open>
|
</open>
|
||||||
</nasal>
|
</nasal>
|
||||||
|
|
||||||
<modal>false</modal>
|
<modal>false</modal>
|
||||||
<layout>vbox</layout>
|
<layout>vbox</layout>
|
||||||
|
|
||||||
<group>
|
<group>
|
||||||
<layout>hbox</layout>
|
<layout>hbox</layout>
|
||||||
|
@ -77,13 +77,13 @@
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<hrule/>
|
<hrule/>
|
||||||
|
|
||||||
<group>
|
<group>
|
||||||
<layout>hbox</layout>
|
<layout>hbox</layout>
|
||||||
|
|
||||||
<group>
|
<group>
|
||||||
<layout>vbox</layout>
|
<layout>vbox</layout>
|
||||||
|
|
||||||
<text>
|
<text>
|
||||||
<label>Select Active Views</label>
|
<label>Select Active Views</label>
|
||||||
</text>
|
</text>
|
||||||
|
@ -97,7 +97,7 @@
|
||||||
<halign>left</halign>
|
<halign>left</halign>
|
||||||
<label>Standard Views</label>
|
<label>Standard Views</label>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
<checkbox-template>
|
<checkbox-template>
|
||||||
<halign>left</halign>
|
<halign>left</halign>
|
||||||
<label><!----></label>
|
<label><!----></label>
|
||||||
|
@ -108,14 +108,14 @@
|
||||||
</checkbox-template>
|
</checkbox-template>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<vrule/>
|
<vrule/>
|
||||||
|
|
||||||
<group>
|
<group>
|
||||||
<layout>vbox</layout>
|
<layout>vbox</layout>
|
||||||
<halign>center</halign>
|
<halign>center</halign>
|
||||||
<valign>top</valign>
|
<valign>top</valign>
|
||||||
|
|
||||||
<text>
|
<text>
|
||||||
<label>Display Options</label>
|
<label>Display Options</label>
|
||||||
</text>
|
</text>
|
||||||
|
@ -166,7 +166,7 @@
|
||||||
</binding>
|
</binding>
|
||||||
<enable>/sim/view-name-popup</enable>
|
<enable>/sim/view-name-popup</enable>
|
||||||
</checkbox>
|
</checkbox>
|
||||||
|
|
||||||
<checkbox>
|
<checkbox>
|
||||||
<halign>left</halign>
|
<halign>left</halign>
|
||||||
<label>Show tooltips</label>
|
<label>Show tooltips</label>
|
||||||
|
@ -175,7 +175,7 @@
|
||||||
<command>dialog-apply</command>
|
<command>dialog-apply</command>
|
||||||
</binding>
|
</binding>
|
||||||
</checkbox>
|
</checkbox>
|
||||||
|
|
||||||
<checkbox>
|
<checkbox>
|
||||||
<halign>left</halign>
|
<halign>left</halign>
|
||||||
<label>Show tooltip on mouse press</label>
|
<label>Show tooltip on mouse press</label>
|
||||||
|
@ -184,7 +184,7 @@
|
||||||
<command>dialog-apply</command>
|
<command>dialog-apply</command>
|
||||||
</binding>
|
</binding>
|
||||||
</checkbox>
|
</checkbox>
|
||||||
|
|
||||||
<checkbox>
|
<checkbox>
|
||||||
<halign>left</halign>
|
<halign>left</halign>
|
||||||
<label>Show 2D panel</label>
|
<label>Show 2D panel</label>
|
||||||
|
@ -193,7 +193,7 @@
|
||||||
<command>dialog-apply</command>
|
<command>dialog-apply</command>
|
||||||
</binding>
|
</binding>
|
||||||
</checkbox>
|
</checkbox>
|
||||||
|
|
||||||
<checkbox>
|
<checkbox>
|
||||||
<halign>left</halign>
|
<halign>left</halign>
|
||||||
<label>Hide 2D panel in non-centered view</label>
|
<label>Hide 2D panel in non-centered view</label>
|
||||||
|
@ -205,7 +205,7 @@
|
||||||
<command>dialog-apply</command>
|
<command>dialog-apply</command>
|
||||||
</binding>
|
</binding>
|
||||||
</checkbox>
|
</checkbox>
|
||||||
|
|
||||||
<checkbox>
|
<checkbox>
|
||||||
<halign>left</halign>
|
<halign>left</halign>
|
||||||
<label>Hide 2D panel in non-cockpit view</label>
|
<label>Hide 2D panel in non-cockpit view</label>
|
||||||
|
@ -217,7 +217,7 @@
|
||||||
<command>dialog-apply</command>
|
<command>dialog-apply</command>
|
||||||
</binding>
|
</binding>
|
||||||
</checkbox>
|
</checkbox>
|
||||||
|
|
||||||
<checkbox>
|
<checkbox>
|
||||||
<halign>left</halign>
|
<halign>left</halign>
|
||||||
<label>Autohide menubar</label>
|
<label>Autohide menubar</label>
|
||||||
|
@ -257,7 +257,7 @@
|
||||||
<label>sec.</label>
|
<label>sec.</label>
|
||||||
</text>
|
</text>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<checkbox>
|
<checkbox>
|
||||||
<halign>left</halign>
|
<halign>left</halign>
|
||||||
<label>Legacy multiplayer view selector</label>
|
<label>Legacy multiplayer view selector</label>
|
||||||
|
@ -266,7 +266,23 @@
|
||||||
<command>dialog-apply</command>
|
<command>dialog-apply</command>
|
||||||
</binding>
|
</binding>
|
||||||
</checkbox>
|
</checkbox>
|
||||||
|
|
||||||
|
<checkbox>
|
||||||
|
<halign>left</halign>
|
||||||
|
<label>Show Pilot Model</label>
|
||||||
|
<property>/sim/rendering/pilot-model/enabled</property>
|
||||||
|
<visible>
|
||||||
|
<equals>
|
||||||
|
<property>/sim/rendering/pilot-model/available</property>
|
||||||
|
<value>1</value>
|
||||||
|
</equals>
|
||||||
|
</visible>
|
||||||
|
|
||||||
|
<binding>
|
||||||
|
<command>dialog-apply</command>
|
||||||
|
</binding>
|
||||||
|
</checkbox>
|
||||||
|
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
</group>
|
</group>
|
||||||
|
|
Loading…
Reference in a new issue