function BattleConfig::OnWake()
{
   ResetBattleConfig();   
}

function ResetBattleConfig()
{
   // reset all slots first
   
   for(%i=1;%i<=10;%i++)
   {
      %control = "bc_player" @ %i;      
      %control.SetBitmap(expandfilename("~/data/images/gui/square_btn.png"));                  
      %control.ToolTip = "";                      
   }
   
   
   // display player vehicles
   
   for(%i=1;%i<=10;%i++)
   {
      if($vehicles[%i, vehicle] !$= "")
      {
         %j++;
         %control = "bc_player" @ %j;
         %control.SetBitmap(expandfilename("~/data/images/icons/" @ $vehicles[%i, vehicle] @ ".png"));     
         %control.ToolTip = GetVehicleDisplayName($vehicles[%i, vehicle]);             
      }
   }
   
   for(%i=1;%i<=10;%i++)
   {
      if($Enemyvehicles[%i, vehicle] !$= "")
      {
         %control = "bc_enemy" @ %i;
         %control.SetBitmap(expandfilename("~/data/images/icons/r_" @ $enemyvehicles[%i, vehicle] @ ".png"));                  
         %control.ToolTip = GetVehicleDisplayName($enemyvehicles[%i, vehicle]);             
      }
      else
      {
         %control = "bc_enemy" @ %i;
         %control.SetBitmap(expandfilename("~/data/images/gui/square_btn.png"));                  
         %control.ToolTip = "";                      
      }
   }
   
   if($battleformation $= "")
      ChooseBattleFormation("line");
   else
      ChooseBattleFormation($battleformation);
      
   vehicleretreat.Visible = true;
}


