<?xml version="1.0"?>

<?FlightGear-tr context="dialog-vr-options"?>

<PropertyList>

  <name>vr-options</name>
  <ui-version>2</ui-version>
  <modal>false</modal>
  <resizable>false</resizable>
  <layout>vbox</layout>
  <default-padding>3</default-padding>
  <title translate="y">
    vr-options-title
    <?FlightGear-tr text="VR Options"
      comment="Dialog title (VR = virtual reality)"?>
  </title>

  <empty>
    <stretch>true</stretch>
  </empty>

  <group>
    <layout>vbox</layout>
    <padding>6</padding>
    <checkbox>
      <halign>left</halign>
      <label translate="y">
        enable-vr
        <?FlightGear-tr text="Enable VR"
          comment="Checkbox label (VR = virtual reality)"?>
      </label>
      <property>/sim/vr/enabled</property>
      <live>false</live>
      <binding>
        <command>dialog-apply</command>
      </binding>
    </checkbox>
  </group>

  <text>
    <halign>center</halign>
    <label translate="y">
      openxr-info
      <?FlightGear-tr text="OpenXR Information"
        comment="Subtitle before VR status information (VR = virtual reality)"?>
    </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>
      <format translate="y">
        openxr-runtime-format
        <?FlightGear-tr text="OpenXR Runtime: %s"
          comment="%s = OpenXR runtime name as provided by the runtime"?>
      </format>
      <property>/sim/vr/openxr/runtime/name</property>
      <live>true</live>
      <enable><property>/sim/vr/present</property></enable>
    </text>

    <text>
      <halign>left</halign>
      <format translate="y">
        openxr-system-format
        <?FlightGear-tr text="OpenXR System: %s"
          comment="%s = OpenXR system name as provided by the OpenXR runtime"?>
      </format>
      <property>/sim/vr/openxr/system/name</property>
      <live>true</live>
      <enable><property>/sim/vr/present</property></enable>
    </text>

    <text>
      <halign>left</halign>
      <format translate="y">
        vr-state-format
        <?FlightGear-tr text="VR State: %s"
          comment="%s = VR current state string (VR = virtual reality)"?>
      </format>
      <property>/sim/vr/state-string</property>
      <live>true</live>
      <enable><property>/sim/vr/present</property></enable>
    </text>
    <text>
      <halign>left</halign>
    </text>
    <text>
      <halign>left</halign>
    </text>
  </group>

  <group>
    <layout>hbox</layout>
    <halign>left</halign>
    <default-padding>1</default-padding>
    <checkbox>
      <halign>left</halign>
      <label translate="y">
        vr-desktop-mirror
        <?FlightGear-tr text="Desktop Mirror"
          unwrap-comment="true"
          comment="Checkbox label - Enables preview of VR display in desktop
          window (VR = virtual reality)"?>
      </label>
      <property>/sim/vr/mirror-enabled</property>
      <live>true</live>
      <binding>
        <command>dialog-apply</command>
      </binding>
      <binding>
        <command>nasal</command>
        <script>
          if (getprop("/sim/rendering/compositor-reload-required")) {
            fgcommand("reload-compositor");
          }
        </script>
      </binding>
    </checkbox>
  </group>

  <group>
    <layout>hbox</layout>
    <halign>left</halign>
    <default-padding>1</default-padding>
    <text>
      <label translate="y">
        vr-desktop-mirror-mode
        <?FlightGear-tr text="Desktop mirror mode"
          unwrap-comment="true"
          comment="Combobox label - Choose what to show on desktop preview of
          VR display (VR = virtual reality)"?>
      </label>
      <enable><property>/sim/vr/mirror-enabled</property></enable>
    </text>
    <empty><stretch>true</stretch></empty>
    <combo>
      <pref-width>250</pref-width>
      <live>true</live>
      <property>/sim/vr/mirror-mode</property>
      <enable><property>/sim/vr/mirror-enabled</property></enable>
      <item>
        <label translate="y">
          vr-desktop-mirror-automatic
          <?FlightGear-tr text="Automatic"
            unwrap-comment="true"
            comment="Combo item label - Choose what to show on desktop preview
            of VR display automatically (VR = virtual reality)"?>
        </label>
        <value>AUTOMATIC</value>
      </item>
      <item>
        <label translate="y">
          vr-desktop-mirror-none
          <?FlightGear-tr text="None"
            unwrap-comment="true"
            comment="Combo item label - Show nothing on desktop preview of VR
            display (VR = virtual reality)"?>
        </label>
        <value>NONE</value>
      </item>
      <item>
        <label translate="y">
          vr-desktop-mirror-left
          <?FlightGear-tr text="Left"
            unwrap-comment="true"
            comment="Combo item label - Show left eye view on desktop preview
            of VR display (VR = virtual reality)"?>
        </label>
        <value>LEFT</value>
      </item>
      <item>
        <label translate="y">
          vr-desktop-mirror-right
          <?FlightGear-tr text="Right"
            unwrap-comment="true"
            comment="Combo item label - Show right eye view on desktop preview
            of VR display (VR = virtual reality)"?>
        </label>
        <value>RIGHT</value>
      </item>
      <item>
        <label translate="y">
          vr-desktop-mirror-left-right
          <?FlightGear-tr text="Left & Right"
            unwrap-comment="true"
            comment="Combo item label - Show side-by-side left & right eye
            views on desktop preview of VR display (VR = virtual reality)"?>
        </label>
        <value>LEFT_RIGHT</value>
      </item>
      <binding>
        <command>dialog-apply</command>
      </binding>
      <binding>
        <command>nasal</command>
        <script>
          if (getprop("/sim/rendering/compositor-reload-required")) {
            fgcommand("reload-compositor");
          }
        </script>
      </binding>
    </combo>
  </group>

  <group>
    <layout>hbox</layout>
    <halign>left</halign>
    <default-padding>1</default-padding>
    <checkbox>
      <halign>left</halign>
      <label translate="y">
        head-tracked-sound
        <?FlightGear-tr text="Head tracked sound (for headphones)"
          unwrap-comment="true"
          comment="Checkbox label - makes surround sound relative to VR tracked
          head orientation (VR = virtual reality)"?>
      </label>
      <property>/sim/sound/head-tracked</property>
      <live>true</live>
      <binding>
        <command>dialog-apply</command>
      </binding>
    </checkbox>
  </group>

  <group>
    <layout>hbox</layout>
    <halign>left</halign>
    <default-padding>1</default-padding>
    <checkbox>
      <halign>left</halign>
      <label translate="y">
        show-3d-mouse-cursor-in-vr
        <?FlightGear-tr text="Show 3D mouse cursor in VR"
          unwrap-comment="true"
          comment="Checkbox label - Shows the 3D mouse cursor when VR is
          running (VR = virtual reality)"?>
      </label>
      <property>/sim/vr/cursors/mouse[0]/show-vr-running</property>
      <live>true</live>
      <binding>
        <command>dialog-apply</command>
      </binding>
    </checkbox>
  </group>

  <group>
    <layout>hbox</layout>
    <halign>left</halign>
    <default-padding>1</default-padding>
    <checkbox>
      <halign>left</halign>
      <label translate="y">
        show-3d-mouse-cursor-always
        <?FlightGear-tr text="Always show 3D mouse cursor"
          unwrap-comment="true"
          comment="Checkbox label - Shows the 3D mouse cursor always, even when
          VR is not running (VR = virtual reality)"?>
      </label>
      <property>/sim/vr/cursors/mouse[0]/show-always</property>
      <live>true</live>
      <binding>
        <command>dialog-apply</command>
      </binding>
    </checkbox>
  </group>

  <group>
    <layout>hbox</layout>
    <halign>left</halign>
    <default-padding>1</default-padding>
    <checkbox>
      <halign>left</halign>
      <label translate="y">
        enable-360-mouse-vr-present
        <?FlightGear-tr text="Enable 360 mouse when VR is in use"
          unwrap-comment="true"
          comment="Checkbox label - Enables/disables VR/360-degree captured
          mouse mode automatically depending on VR user presence - normally via
          a proximity sensor in the headset (VR = virtual reality)"?>
      </label>
      <property>/sim/vr/cursors/mouse[0]/vr-mode-user-presence</property>
      <enable><property>/sim/vr/openxr/system/supports-user-presence</property></enable>
      <live>true</live>
      <binding>
        <command>dialog-apply</command>
      </binding>
    </checkbox>
  </group>

  <group>
    <layout>hbox</layout>
    <halign>left</halign>
    <default-padding>1</default-padding>
    <text>
      <label translate="y">
        vr-mouse-sensitivity
        <?FlightGear-tr text="360 mouse sensitivity"
          unwrap-comment="true"
          comment="Slider label - controls sensitivity of VR/360-degree
          captured mouse mode (VR = virtual reality)"?>
      </label>
    </text>
    <slider>
      <name>vr-mouse-sensitivity</name>
      <min>0.01</min>
      <max>0.20</max>
      <step>0.01</step>
      <live>true</live>
      <property>/sim/vr/config/cursors/px-angle-deg</property>
      <binding>
        <command>dialog-apply</command>
        <object-name>vr-mouse-sensitivity</object-name>
      </binding>
    </slider>
    <text>
      <format translate="y">
        vr-mouse-sensitivity-format
        <?FlightGear-tr text="%.2f deg/px"
          unwrap-comment="true"
          comment="Slider value format - VR/360-degree captured mouse mode
          sensitivity, in degrees of angular motion per pixel of mouse motion
          (VR = virtual reality)"?>
      </format>
      <live>true</live>
      <property>/sim/vr/config/cursors/px-angle-deg</property>
    </text>
  </group>

  <empty>
    <stretch>true</stretch>
  </empty>

  <hrule/>

  <button>
    <legend translate="y">
      vr-options-close
      <?FlightGear-tr text="Close"
        comment="Dialog button legend"?>
    </legend>
    <default>true</default>
    <key>Esc</key>
    <binding>
      <command>dialog-close</command>
    </binding>
  </button>


</PropertyList>
