| 1 | cycrow | 1 | #include "../StdAfx.h"
 | 
        
           |  |  | 2 | #include "CustomiseWeapons1.h"
 | 
        
           |  |  | 3 |   | 
        
           |  |  | 4 | namespace Creator {
 | 
        
           |  |  | 5 | 	void CustomiseWeapons1::UpdateShields()
 | 
        
           |  |  | 6 | 	{
 | 
        
           |  |  | 7 | 		this->ComboShield->Items->Clear();
 | 
        
           |  |  | 8 |   | 
        
           |  |  | 9 | 		CyStringList *list = ((CustomiseShip ^)m_pParent)->GetShields();
 | 
        
           |  |  | 10 | 		if ( !list || list->Empty() )
 | 
        
           |  |  | 11 | 		{
 | 
        
           |  |  | 12 | 			for ( int i = 0; i < 6; i++ )
 | 
        
           |  |  | 13 | 				this->ComboShield->Items->Add("SS_SHIELD_" + Convert::ToString(i));
 | 
        
           |  |  | 14 | 			return;
 | 
        
           |  |  | 15 | 		}
 | 
        
           |  |  | 16 |   | 
        
           |  |  | 17 | 		for ( SStringList *str = list->Head(); str; str = str->next )
 | 
        
           |  |  | 18 | 			this->ComboShield->Items->Add(this->AddText(this->AddText(this->FindText(-1, TEXTPAGE_OBJECTS, str->str.GetToken(";", 7, 7).ToInt()), SystemStringFromCyString(str->data)), SystemStringFromCyString(str->str.GetToken(";", 21, 21))));
 | 
        
           |  |  | 19 | 	}
 | 
        
           |  |  | 20 |   | 
        
           |  |  | 21 | 	String ^CustomiseWeapons1::AddText(String ^text, String ^def) { return ((CustomiseShip ^)m_pParent)->AddText(text, def); }
 | 
        
           |  |  | 22 | 	String ^CustomiseWeapons1::FindText(int game, int page, int id) { return ((CustomiseShip ^)m_pParent)->FindText(game, page, id); }
 | 
        
           |  |  | 23 |   | 
        
           |  |  | 24 | 	void CustomiseWeapons1::UpdateDisplay()
 | 
        
           |  |  | 25 | 	{
 | 
        
           |  |  | 26 | 		m_bUpdateing = true;
 | 
        
           |  |  | 27 | 		if ( m_pShipData->iShieldType >= this->ComboShield->Items->Count )
 | 
        
           |  |  | 28 | 			this->ComboShield->SelectedIndex = this->ComboShield->Items->Count - 1;
 | 
        
           |  |  | 29 | 		else
 | 
        
           |  |  | 30 | 			this->ComboShield->SelectedIndex = m_pShipData->iShieldType;
 | 
        
           |  |  | 31 | 		this->NumShieldMax->Value = m_pShipData->iMaxShields;
 | 
        
           |  |  | 32 | 		this->NumHull->Value = m_pShipData->iHull;
 | 
        
           |  |  | 33 | 		this->NumReactor->Value = m_pShipData->iPower;
 | 
        
           |  |  | 34 | 		this->NumWeaponEnergy->Value = m_pShipData->iLaserEnergy;
 | 
        
           |  |  | 35 | 		this->TextRecharge->Text = Convert::ToString(Convert::ToDouble(m_pShipData->fLaserRecharge));
 | 
        
           |  |  | 36 | 		this->NumReaction->Value = m_pShipData->iReactionDelay;
 | 
        
           |  |  | 37 | 		this->NumMissiles->Value = m_pShipData->iMissileCount;
 | 
        
           |  |  | 38 | 		m_bUpdateing = false;
 | 
        
           |  |  | 39 | 	}
 | 
        
           |  |  | 40 | };
 |