<?xml version="1.0"?>

<PropertyList>
	<name>ai-objects</name>
	<layout>vbox</layout>
	<modal>false</modal>
	<width>400</width>

	<group>

		<layout>hbox</layout>

		<text>
			<label>Control Nearby AI Objects</label>
		</text>

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

		<button>
			<legend>X</legend>
			<key>Esc</key>
			<pref-width>20</pref-width>
			<pref-height>20</pref-height>
			<binding>
				<command>dialog-close</command>
			</binding>
		</button>

	</group>

	<hrule/>

 <group>
    <layout>table</layout>
  
    <text>
      <label>Select an AI object to bring up its own control dialog</label>
      <halign>left</halign>
      <row>0</row>
      <col>0</col>
    </text>

  	<combo>
       		 <row>1</row>
        	 <col>0</col>
        	 <name>object-selection</name>
        	 <halign>left</halign>
        	 <stretch>true</stretch>
        	 <pref-width>300</pref-width>
        	 <property>/ai/control/object-selected</property>
        	 <properties>/ai/control/objects-nearby/</properties>
		 <value>Truman</value>
        	 <binding>
             	 	<command>dialog-apply</command>
          	 	<object-name>object-selection</object-name>
        	 </binding>
      	</combo>



</group>


        <empty>
		<pref-height>12</pref-height>
	</empty>

	<hrule/>

 <group>
    <layout>table</layout>

	<button>
       		<row>0</row>
        	<col>0</col>
		<legend>OK</legend>
		<default>true</default>
		<equal>true</equal>
		<binding>
			<command>dialog-apply</command>
		</binding>

		 <binding>
			<command>nasal</command>
			<script>
			var obj_dlg_id = getprop("/ai/control/object-selected");

			var dlg = gui.Dialog.new(obj_dlg_id);
			dlg.open();
					
			</script>
		</binding>

		<binding>
			<command>dialog-close</command>
		</binding>
	</button>

	<button>
       		<row>0</row>
        	<col>1</col>
		<legend>Close</legend>
		<default>true</default>
		<binding>
			<command>dialog-close</command>
		</binding>
	</button>

</group>

</PropertyList>
