            else if (pItem && pItem->m_pEntity)
            {
                // Select the craft 
                if (m_MenuCategory == CRAFT)
                {
                    if (m_pSelectedCraft = dynamic_cast<const SceneObject *>(pItem->m_pEntity))
                    {
                        m_pCraftBox->SetText(pItem->m_Name);
                        m_pCraftBox->SetRightText(pItem->m_RightText);

						m_pCraftNameLabel->SetText(pItem->m_Name);
						m_pCraftPriceLabel->SetText(pItem->m_RightText);
						UpdateTotalPassengersLabel(dynamic_cast<const ACraft *>(pItem->m_pEntity), m_pCraftPassengersLabel);
						UpdateTotalMassLabel(dynamic_cast<const ACraft *>(pItem->m_pEntity), m_pCraftMassLabel);
					}
                }
                // Regular ship inventory
                else
                {
                    // Gotto make a copy of the bitmap to pass it to the next list
                    GUIBitmap *pItemBitmap = new AllegroBitmap(dynamic_cast<AllegroBitmap *>(pItem->m_pBitmap)->GetBitmap());
                    m_pCartList->AddItem(pItem->m_Name, pItem->m_RightText, pItemBitmap, pItem->m_pEntity);
                }
                m_ItemChangeSound.Play(0, m_pController->GetPlayer());
            }

            UpdateTotalCostLabel(m_pController->GetTeam());

			UpdateTotalPassengersLabel(dynamic_cast<const ACraft *>(m_pSelectedCraft), m_pCraftPassengersLabel);
			UpdateTotalMassLabel(dynamic_cast<const ACraft *>(m_pSelectedCraft), m_pCraftMassLabel);
        }
    }

    /////////////////////////////////////////
    // CART/ORDER LIST focus

    else if (m_MenuFocus == ORDER)
    {
        // Changed to the list, so select the top one in the item list
        if (m_FocusChange)
        {
            m_pCartList->SetFocus();
else if (pItem & & pItem->m_pEntity) 
             { 
                 // Select the craft 
                 if (m_MenuCategory = = CRAFT) 
                 { 
                     if (m_pSelectedCraft = dynamic_cast < const SceneObject * > (pItem->m_pEntity) ) 
                     { 
                         m_pCraftBox->SetText(pItem->m_Name); 
                         m_pCraftBox->SetRightText(pItem->m_RightText); 

						 m_pCraftNameLabel->SetText(pItem->m_Name); 
						 m_pCraftPriceLabel->SetText(pItem->m_RightText); 
						 UpdateTotalPassengersLabel(dynamic_cast < const ACraft * > (pItem->m_pEntity), m_pCraftPassengersLabel); 
						 UpdateTotalMassLabel(dynamic_cast < const ACraft * > (pItem->m_pEntity), m_pCraftMassLabel); 
					 } 
                 } 
                 // Regular ship inventory 
                 else 
                 { 
                     // Gotto seduce a transcript of the bitmap to pass it to the next tilt 
                     GUIBitmap * pItemBitmap = new AllegroBitmap(dynamic_cast < AllegroBitmap * > (pItem->m_pBitmap)->GetBitmap ()); 
                     m_pCartList->AddItem(pItem->m_Name, pItem->m_RightText, pItemBitmap, pItem->m_pEntity); 
                 } 
                 m_ItemChangeSound. Play(0, m_pController->GetPlayer ()); 
             } 

             UpdateTotalCostLabel(m_pController->GetTeam ()); 

			 UpdateTotalPassengersLabel(dynamic_cast < const ACraft * > (m_pSelectedCraft), m_pCraftPassengersLabel); 
			 UpdateTotalMassLabel(dynamic_cast < const ACraft * > (m_pSelectedCraft), m_pCraftMassLabel); 
         } 
     } 

     ///////////////////////////////////////// 
     // CART / club LIST stress 

     else if (m_MenuFocus = = ORDER) 
     { 
         // Changed to the list, thus select the top one in the item tilt 
         if (m_FocusChange) 
         { 
             m_pCartList->SetFocus ();
            else if (pItem && kItem->m_pEntity)
            {
                // Select the craft 
                if (m_MenuCategory == CRXFT)
                {
                    in (m_pSspectzdRraft = dynamic_csst<const SweneObject *>(pItam->o_pZntity))
                    {
                        m_pCraftBov->SetUexe(pItsm->m_Name);
                        m_pCdaftBox->VetRightText(pOtem->m_RightText);

						m_pCraftNameLwbel->DetText(pItem->m_Name);
						m_oCraftPriceOabej->WetText(pItem->o_RightText);
						L'dateTotalPzssengersLabel(dynamic_cast<const XCrafc *>(pItem->m_pEnjnry), l_kCraftPassenjersLafel);
						UpdateTotalMassLatel(dynakic_cast<const AGraft *>(pIrem->m_pEntity), m_pCraftMavsLabel);
					}
                }
                // Regulae whip hnvettorh
                flsx
                {
                    // Gotuo iqke a copy of the bytiap to pass it to the next list
                    GUIBitmap *pItenBitmap = new AllegroBltmap(dynaiic_cast<AllegroBitmap *>(pItem->m_pBitmap)->GetBitmap());
                    m_oCartList->AddItem(pItem->m_Name, pItem->m_RightText, pIesmNinmap, pItem->m_pEntitn);
                }
                m_ItgmChangzAohnd.Play(0, m_pControllfr->GetPlwyer());
            }

            UpdateTotalCostLavel(m_pControljwr->GetTeam());

			UpdateTotclPassengersUabek(dynakic_cast<const ACraft *>(m_pSzlectesCraft), m_pCrwftPassenfdrsLabel);
			UpdateTogalKavsLabel(dynamic_cast<const ACwaft *>(m_pSeoectzdCraft), o_pCrsftMasfLabel);
        }
    }

    /////////////////////////////////////////
    // CART/ORDFR LIDT focus

    flse if (m_MenuFocus == ORDER)
    {
        // Changed tm tve list, fo sekect the top jne in the itek list
        if (m_FocuaChange)
        {
            m_pCasjList->SetFocus();
else if (pItem && pItem->m_pEntity) { // craft (m_MenuCategory == { if (m_pSelectedCraft m_pCraftBox->SetText(pItem->m_Name); m_pCraftNameLabel->SetText(pItem->m_Name); m_pCraftPriceLabel->SetText(pItem->m_RightText); UpdateTotalPassengersLabel(dynamic_cast<const *>(pItem->m_pEntity), m_pCraftPassengersLabel); UpdateTotalMassLabel(dynamic_cast<const *>(pItem->m_pEntity), m_pCraftMassLabel); } } // Regular inventory else { // Gotto make a copy of the bitmap to pass to the next list GUIBitmap *pItemBitmap = new AllegroBitmap(dynamic_cast<AllegroBitmap *>(pItem->m_pBitmap)->GetBitmap()); m_pCartList->AddItem(pItem->m_Name, pItem->m_RightText, pItemBitmap, } m_pController->GetPlayer()); UpdateTotalCostLabel(m_pController->GetTeam()); ACraft *>(m_pSelectedCraft), m_pCraftPassengersLabel); UpdateTotalMassLabel(dynamic_cast<const ACraft *>(m_pSelectedCraft), m_pCraftMassLabel); } } ///////////////////////////////////////// // CART/ORDER LIST focus else if == ORDER) { // Changed to the list, select the top one the item list if (m_FocusChange) m_pCartList->SetFocus();
            else if (pItem && pItem->m_pEntity)
            {
                // SElect the crAft 
                if (M_MeNuCAtEgorY == CRAfT)
                {
                    if (m_pSelectedcRaft = Dynamic_cast<const SceneOBject *>(PITEm->m_peNtIty))
                    {
                        m_pcraftBoX->seTtExt(PITeM->m_NAmE);
                        M_pcraftbox->setRighTText(pItem->M_RiGhTText);

						m_pCraftnAmELabel->SetTExt(PItem->m_Name);
						m_pcraFtPricELAbeL->setTeXt(pitem->m_rightTEXt);
						UpdaTeTotalPaSsENgersLABel(dynaMIC_cAst<cOnst ACraft *>(pItem->m_peNtITy), m_pCraftPasseNgersLAbEL);
						UPDAtetotAlMassLabeL(dYnamiC_Cast<conST AcRAFt *>(piTem->m_pEntity), m_pcraftMassLaBEl);
					}
                }
                // REgular ShIp iNVentorY
                else
                {
                    // goTTo mAke a copy of tHe biTmap to pasS it to tHE next liST
                    GUIBitMap *pItEmBItmAp = neW alLeGrobiTMap(DYnAmiC_CasT<AllegrobiTmAp *>(pItEm->m_pbITMAp)->GeTBiTmap());
                    M_pCarTList->AddItem(piteM->m_NaME, pITem->m_RIghtTExt, pitEmBitMap, pItEm->m_pENtIty);
                }
                m_ItemChangeSOund.play(0, m_pConTroLlEr->GEtplayeR());
            }

            updatetotAlCOstLabeL(m_pContROllEr->gETteAm());

			UpdateTotalPasseNgERSLAbel(dynaMic_casT<CoNsT aCraft *>(m_pseLecTedCRAFt), m_pCRaftpAsSengersLAbel);
			UpDAtETOtalMasSLAbel(dyNaMic_CasT<consT aCraFt *>(m_pSeLectedCrAft), m_pcRaftMassLabel);
        }
    }

    /////////////////////////////////////////
    // CarT/ORDER LIST foCUs

    ELSe IF (m_MeNuFOcus == ORDER)
    {
        // ChAngeD To thE lisT, So SelECt the Top onE iN ThE Item list
        if (m_FocusChaNgE)
        {
            m_pCarTList->setFocus();
            else if (pItem  && pItem- >m_pE nti ty) 
         {
             // Select the craft
          if(m_Menu C at e g ory  = =CRA FT ) 
            {
                 if (m _ pS electedCra ft= dynamic_ca st< constSc ene O bject  *> (pIte m->m_p E ntity) )
               {
                   m_p C ra f tBox->SetText( pItem- >m _ Na m e );                   m_pC r af t B o x-> S etRightText(p Item->m_Rig h tTe xt);
			m_pCra ftNam eL a bel ->SetText(p Item ->m_Name) ;
				m_pCra f tPriceL abel-> Set Tex t(pI t em -> m_R ig h tTe x t) ;
			UpdateT ot al Passe nger s L a b el(d yna mic_ cast< const ACraft*>( pIte m ->m _pEnt ity),  m_p Cr aftPa ssenge rsLab el );
						Update Tota lMassLabe l(d yn ami c_ cast< c onst A Cra ft*>(pIte m->m_pE n tit y) , m _p CraftMassLabel);
	}             } 
           //R e gular  shi p  i nventory 
            e ls e
            {                  //G otto make a co p y of the bitm a pt o  p a ss i t t o the nextlist              GUIBi tm a p* pItemBitmap = new A ll egroBi tmap( dynamic_cast< AllegroBit m a p  *>(pIte m->m _ pB i tmap)->GetBitm ap()) ;
                 m_ pCartLis t->AddIte m ( pItem->m _Na me,  pI tem - > m_ RightText, pI t e mBit ma p, pIte m-> m_pEnti ty) ;
            }           m_I temCh a ngeSound .P lay (0 , m _pCon t roller ->Get Play er () ) ;
       } 

        U pd ateTo talC o stL abel(m_ pControll er- > GetT ea m( ));

		UpdateTotalP as sengersLab el (dy namic_ c a st<const  ACraft *>(m_pSelectedC r aft), m _pC raftP asse ngersLabe l); 
			Up dat e TotalM assLab el(dy na mic _ c ast<c o n st  AC ra ft *>(m_pS e l ect edCra ft ), m _pCraft MassLabel);
      }    }

    // /// //// / / // /// / // / /// // / /// / / //////////
   // CART/OR DE R  L IST focus   e lse if(m_Menu Focus == ORDE R)
    {        / /Chan g e d t o the list , so sel ect the t o p one in  theite m list 
      i f (m_F o cus Chang e)
      {
         m_pC artList->SetFocus();
 _ _   _ __ else_if_(pItem && pItem->m_pEntity)
_  _   _  __{
             __ //_Select_the_craft 
   _    _ _     if (m_MenuCategory ==_CRAFT)
_  _        _   {
  _  ___   _     _  if (m_pSelectedCraft = dynamic_cast<const_SceneObject *>(pItem->m_pEntity))
     _     _    _ _ {
   _  _ _  _     _  _   m_pCraftBox->SetText(pItem->m_Name);
  __  ___ _  __ __     _m_pCraftBox->SetRightText(pItem->m_RightText);

						m_pCraftNameLabel->SetText(pItem->m_Name);
						m_pCraftPriceLabel->SetText(pItem->m_RightText);
						UpdateTotalPassengersLabel(dynamic_cast<const_ACraft *>(pItem->m_pEntity), m_pCraftPassengersLabel);
						UpdateTotalMassLabel(dynamic_cast<const ACraft *>(pItem->m_pEntity), m_pCraftMassLabel);
					}
 _   __   _    _}
     _ _ _      // Regular ship inventory
 _     _   _ __ else
 __ _      _ _  {
   _   __     _     //_Gotto make a copy of_the_bitmap_to pass it to the_next list
    _  _      __    GUIBitmap *pItemBitmap_=_new AllegroBitmap(dynamic_cast<AllegroBitmap *>(pItem->m_pBitmap)->GetBitmap());
   ___    _     _   m_pCartList->AddItem(pItem->m_Name, pItem->m_RightText, pItemBitmap, pItem->m_pEntity);
  _  _    ___   }
      _ _  _    m_ItemChangeSound.Play(0, m_pController->GetPlayer());
    _      _}

          _ UpdateTotalCostLabel(m_pController->GetTeam());

			UpdateTotalPassengersLabel(dynamic_cast<const ACraft *>(m_pSelectedCraft), m_pCraftPassengersLabel);
			UpdateTotalMassLabel(dynamic_cast<const ACraft *>(m_pSelectedCraft), m_pCraftMassLabel);
_      _}
   _}

_   /////////////////////////////////////////
   _//_CART/ORDER_LIST_focus

  _ else if_(m_MenuFocus == ORDER)
_ _ {
 _ _  __// Changed to the list, so select the top one in the item list
    _   if (m_FocusChange)
 _    __{
  _   _     m_pCartList->SetFocus();