diff --git a/Nasal/gui.nas b/Nasal/gui.nas index 7ff1d3667..99fee657a 100644 --- a/Nasal/gui.nas +++ b/Nasal/gui.nas @@ -1387,6 +1387,7 @@ menuEnable("joystick-info", size(props.globals.getNode("/input/joysticks", 1).ge menuEnable("rendering-buffers", getprop("/sim/rendering/rembrandt/enabled")); menuEnable("rembrandt-buffers-choice", getprop("/sim/rendering/rembrandt/enabled")); menuEnable("stereoscopic-options", !getprop("/sim/rendering/rembrandt/enabled")); +menuEnable("vr-options", !getprop("/sim/rendering/rembrandt/enabled") and getprop("/sim/vr/built")); menuEnable("sound-config", getprop("/sim/sound/working")); menuEnable("swift_connection", getprop("/sim/swift/available")); diff --git a/Translations/default/menu.xml b/Translations/default/menu.xml index 76836d872..c9d6f619e 100644 --- a/Translations/default/menu.xml +++ b/Translations/default/menu.xml @@ -37,6 +37,7 @@ <replay>Instant Replay</replay> <earthview>Earthview orbital rendering</earthview> <stereoscopic-options>Stereoscopic View Options</stereoscopic-options> + <vr-options>VR Options</vr-options> <als-filter-effects>ALS Filter Effects</als-filter-effects> <!-- Location menu --> diff --git a/Translations/en_US/FlightGear-nonQt.xlf b/Translations/en_US/FlightGear-nonQt.xlf index 7a57ed136..54a4055d4 100644 --- a/Translations/en_US/FlightGear-nonQt.xlf +++ b/Translations/en_US/FlightGear-nonQt.xlf @@ -483,6 +483,10 @@ <source>View Options</source> <target /> </trans-unit> + <trans-unit id="menu/vr-options:0" translate="yes" approved="no"> + <source>VR Options</source> + <target /> + </trans-unit> <trans-unit id="menu/view-push:0" translate="yes" approved="no"> <source>Push Pair View</source> <target /> diff --git a/gui/dialogs/vr-options.xml b/gui/dialogs/vr-options.xml new file mode 100644 index 000000000..de7256b92 --- /dev/null +++ b/gui/dialogs/vr-options.xml @@ -0,0 +1,116 @@ +<?xml version="1.0"?> + +<PropertyList> + + <name>vr-options</name> + <modal>false</modal> + <resizable>false</resizable> + <layout>vbox</layout> + <default-padding>3</default-padding> + + <group> + <layout>hbox</layout> + <default-padding>1</default-padding> + + <empty> + <stretch>true</stretch> + </empty> + + <text> + <label>VR Options</label> + </text> + + <empty> + <stretch>true</stretch> + </empty> + + <button> + <legend></legend> + <key>Esc</key> + <pref-width>16</pref-width> + <pref-height>16</pref-height> + <border>2</border> + <binding> + <command>dialog-close</command> + </binding> + </button> + </group> + + <hrule/> + + <empty> + <stretch>true</stretch> + </empty> + + <group> + <layout>vbox</layout> + <padding>6</padding> + <checkbox> + <halign>left</halign> + <label>Enable VR</label> + <property>/sim/vr/enabled</property> + <live>false</live> + <binding> + <command>dialog-apply</command> + </binding> + </checkbox> + </group> + + <text> + <halign>center</halign> + <label>OpenXR Information</label> + <enable><property>/sim/vr/present</property></enable> + </text> + + <group> + <layout>vbox</layout> + <border>10</border> + <halign>center</halign> + <default-padding>2</default-padding> + + + <text> + <halign>left</halign> + <label>OpenXR Runtime: MMMMMMMMMMMMMMMMMMMMMMMM</label> + <format>OpenXR Runtime: %s</format> + <property>/sim/vr/openxr/runtime/name</property> + <live>true</live> + <enable><property>/sim/vr/present</property></enable> + </text> + + <text> + <halign>left</halign> + <label>OpenXR System: MMMMMMMMMMMMMMMMMMMMMMMM</label> + <format>OpenXR System: %s</format> + <property>/sim/vr/openxr/system/name</property> + <live>true</live> + <enable><property>/sim/vr/present</property></enable> + </text> + + <text> + <halign>left</halign> + <label>VR State: MMMMMMMMMMMMMMMMMMMMMMMM</label> + <format>VR State: %s</format> + <property>/sim/vr/state-string</property> + <live>true</live> + <enable><property>/sim/vr/present</property></enable> + </text> + </group> + + <empty> + <stretch>true</stretch> + </empty> + + <hrule/> + + <button> + <legend>Close</legend> + <default>true</default> + <key>Esc</key> + <binding> + <command>dialog-close</command> + </binding> + </button> + + +</PropertyList> diff --git a/gui/menubar.xml b/gui/menubar.xml index bac551201..fe2011d0d 100644 --- a/gui/menubar.xml +++ b/gui/menubar.xml @@ -199,6 +199,15 @@ <enabled>false</enabled> </item> + <item> + <name>vr-options</name> + <binding> + <command>dialog-show</command> + <dialog-name>vr-options</dialog-name> + </binding> + <enabled>false</enabled> + </item> + <item> <enabled> <property>/sim/rendering/shaders/skydome</property>