<?xml version="1.0" encoding="ISO-8859-1"?>

<panel name="weapons">


<panel>
  <label 
    text="Starting weapons"
    class="text_1"
    y="-2"
  ></label>

  <list_box
    name="weapon_set"
    class="list_box_1"
    command="use_weapon_set $value"
    info_command="use_weapon_set"
    list_command="weapon_sets"
    empty_name="By game mode"
    empty_command="use_weapon_set By game mode"
    x="150"
    y="-5"
    size="10"
  >
  </list_box>
</panel>


  <panel y="35">
    <label 
      text="Weapon sets"
      class="text_1"
      y="3"
    ></label>
  </panel>


  <selection_list
    name="set_list"
    list_command="weapon_sets"
    class="selection_list_1"
    lines="11"
    line_height="16"
    y="65"
    width="200"
    double_click_command="edit_weapon_set $value"
  >
    <!--
    <context_menu_item name="Edit" value="edit_weapon_set $value"></context_menu_item>
    <context_menu_item name="Delete" value="delete_weapon_set $value"></context_menu_item>
    -->
  </selection_list>


  <button 
    name="add_new"
    text="Add new"
    class="text_button_1"
    command="edit_weapon_set"
    x="215"
    y="70"
  ></button>

  <button 
    name="edit"
    text="Edit"
    class="text_button_1"
    value_command="@weapons @set_list get_value"
    command="edit_weapon_set $value"
    x="215"
    y="95"
  ></button>

  <button 
    name="delete"
    text="Delete"
    class="text_button_1"
    value_command="@weapons @set_list get_value"
    command="delete_weapon_set $value"
    info_command="can_delete_weapon_set"
    enable_if="true"
    x="215"
    y="120"
  ></button>
  
  
<if info_command="editing_weapon_set" req_value="true">

<dialog
  name="weapon_set_dialog"
  x="-20"
  y="-5"
  width="385"
  height="253"
>

  <panel name="p1" x="20" y="10">

  <panel name="name_panel" y="5">
    <label 
      text="Set name"
      class="text_1"
      y="3"
    ></label>
    
    <text_field
      name="set_name"
      info_command="weapon_set_name"
      command="weapon_set_name $value"
      class="text_field_1"
      width="154"
      x="80"
    ></text_field>
  </panel>


  <panel y="35">
  <panel>
  <label 
    text="Ship"
    class="text_1"
    x="85"
  ></label>
  <label 
    text="Pilot"
    class="text_1"
    x="222"
  ></label>
  </panel>

  <panel y="19">


  <list
    x="0"
    y="0"
    width="350"
    height="300"
    x_space="175"
    y_space="24"
  >

    <panel>
    <label 
      text="Weapon 1"
      class="text_1"
      y="3"
    ></label>

    <list_box
      name="ship_weapon_1"
      class="list_box_1"
      command="ship_starting_weapon 1 $value"
      info_command="ship_starting_weapon 1"
      list_command="ship_weapons"
      x="80"
      size="8"
    ></list_box>
    <list_box
      name="pilot_weapon_1"
      class="list_box_1"
      command="pilot_starting_weapon 1 $value"
      info_command="pilot_starting_weapon 1"
      list_command="pilot_weapons"
      x="217"
      size="8"
    ></list_box>
    </panel>

    <panel>
    <label 
      text="Weapon 2"
      class="text_1"
      y="3"
    ></label>

    <list_box
      name="ship_weapon_2"
      class="list_box_1"
      command="ship_starting_weapon 2 $value"
      info_command="ship_starting_weapon 2"
      list_command="ship_weapons"
      x="80"
      size="8"
    ></list_box>
    <list_box
      name="pilot_weapon_2"
      class="list_box_1"
      command="pilot_starting_weapon 2 $value"
      info_command="pilot_starting_weapon 2"
      list_command="pilot_weapons"
      x="217"
      size="8"
    ></list_box>
    </panel>

    <panel>
    <label 
      text="Weapon 3"
      class="text_1"
      y="3"
    ></label>

    <list_box
      name="ship_weapon_3"
      class="list_box_1"
      command="ship_starting_weapon 3 $value"
      info_command="ship_starting_weapon 3"
      list_command="ship_weapons"
      x="80"
      size="8"
    ></list_box>
    <list_box
      name="pilot_weapon_3"
      class="list_box_1"
      command="pilot_starting_weapon 3 $value"
      info_command="pilot_starting_weapon 3"
      list_command="pilot_weapons"
      x="217"
      size="8"
    ></list_box>
    </panel>

    <panel>
    <label 
      text="Weapon 4"
      class="text_1"
      y="3"
    ></label>

    <list_box
      name="ship_weapon_4"
      class="list_box_1"
      command="ship_starting_weapon 4 $value"
      info_command="ship_starting_weapon 4"
      list_command="ship_weapons"
      x="80"
      size="8"
    ></list_box>
    <list_box
      name="pilot_weapon_4"
      class="list_box_1"
      command="pilot_starting_weapon 4 $value"
      info_command="pilot_starting_weapon 4"
      list_command="pilot_weapons"
      x="217"
      size="8"
    ></list_box>
    </panel>

  </list>


  <panel y="102">
    <label 
      text="Use for mode"
      class="text_1"
      y="3"
    ></label>

    <list_box
      name="config_weapon_set"
      class="list_box_1"
      command="weapon_set_game_mode $value"
      info_command="weapon_set_game_mode"
      list_command="game_modes"
      empty_name="-"
      empty_command="weapon_set_game_mode -"
      x="150"
      size="10"
    >
    </list_box>
  </panel>


  <panel y="145">
    <button 
      x="75"
      name="ok"
      text="Ok"
      class="text_button_1"
      command="confirm_edit_weapon_set"
      remove_focus="true"
      info_command="@weapon_set_dialog @p1 @name_panel @set_name get_value"
      enable_if="!empty"
    ></button>

    <button 
      x="215"
      name="cancel"
      text="Cancel"
      class="text_button_1"
      command="cancel_edit_weapon_set"
      remove_focus="true"
    ></button>
  </panel>



  </panel>
  </panel>
  </panel>


</dialog>
</if>



<if info_command="deleting_weapon_set" req_value="true">
<dialog
  name="delete_dialog"
  x="205"
  y="150"
  width="120"
  height="60"
>

  <label 
    text="Delete set?"
    class="text_1"
    y="10"
    x="20"
  ></label>

  <panel y="30">
    <button 
      x="15"
      name="ok"
      text="Ok"
      class="text_button_1"
      command="confirm_delete_weapon_set"
      remove_focus="true"
    ></button>

    <button 
      x="52"
      name="cancel"
      text="Cancel"
      class="text_button_1"
      command="cancel_delete_weapon_set"
      remove_focus="true"
    ></button>
  </panel>


</dialog>
</if>




</panel>



