<?xml version="1.0" encoding="UTF-8"?>
<!--
**************************************************************************

Beagle Pup Menu

Copyright (c) 2015 Richard Senior

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

**************************************************************************
-->

<PropertyList>

  <default>
    <menu n="100">
      <label>Beagle Pup</label>
      <item>
        <label>Autostart</label>
        <binding>
          <command>nasal</command>
          <script><![CDATA[
            if (props.globals.getNode("sim/checklists/auto") == nil) {
                setprop("sim/messages/copilot",
                    "Automated checklists need FGDATA 3.5 or higher"
                );
                return;
            }
            if (!getprop("gear/gear/wow")) {
                setprop("sim/messages/copilot",
                    "Autostart in the air is not yet supported"
                );
                return;
            }
            if (pup.is_near_runway()) {
                setprop("sim/checklists/auto/completed-message",
                    "Checklists complete, ready for takeoff"
                );
                generic.complete_checklists("runway-start");
            } else {
                setprop("sim/checklists/auto/completed-message",
                    "Checklists complete, ready to taxi"
                );
                generic.complete_checklists("apron-start");
            }
          ]]></script>
        </binding>
      </item>
      <item>
        <label>Lights</label>
        <binding>
          <command>dialog-show</command>
          <dialog-name>lights</dialog-name>
        </binding>
      </item>
      <item>
        <label>Preferences</label>
        <binding>
          <command>dialog-show</command>
          <dialog-name>preferences</dialog-name>
        </binding>
      </item>
      <item>
        <label>Select Livery</label>
        <binding>
          <command>nasal</command>
          <script>aircraft.livery.dialog.open();</script>
        </binding>
      </item>
    </menu>
  </default>

</PropertyList>
