Subversion Repositories spk

Rev

Rev 1 | Rev 211 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 170
Line 14... Line 14...
14
	/// Summary for CustomiseGuns
14
	/// Summary for CustomiseGuns
15
	/// </summary>
15
	/// </summary>
16
	public ref class CustomiseGuns : public System::Windows::Forms::UserControl
16
	public ref class CustomiseGuns : public System::Windows::Forms::UserControl
17
	{
17
	{
18
	public:
18
	public:
19
		CustomiseGuns(Windows::Forms::Form ^parent, ImageList ^imagesSmall, ImageList ^imagesLarge, CShipData *shipData, CyStringList *models)
19
		CustomiseGuns(Windows::Forms::Form ^parent, ImageList ^imagesSmall, ImageList ^imagesLarge, CShipData *shipData, const Utils::CStringList *models)
20
		{
20
		{
21
			InitializeComponent();
21
			InitializeComponent();
22
 
22
 
23
			m_bUpdatingGunLists = false;
23
			m_bUpdatingGunLists = false;
24
			m_pParent = parent;
24
			m_pParent = parent;
25
			m_pShipData = shipData;
25
			m_pShipData = shipData;
26
			m_pModels = models;
26
			_pModels = models;
27
 
27
 
28
			this->ListTurrets->SmallImageList = imagesSmall;
28
			this->ListTurrets->SmallImageList = imagesSmall;
29
			this->ListGuns->SmallImageList = imagesSmall;
29
			this->ListGuns->SmallImageList = imagesSmall;
30
			this->ListTurrets->LargeImageList = imagesLarge;
30
			this->ListTurrets->LargeImageList = imagesLarge;
31
			this->ListGuns->LargeImageList = imagesLarge;
31
			this->ListGuns->LargeImageList = imagesLarge;
Line 40... Line 40...
40
		void UpdateGunEntrys();
40
		void UpdateGunEntrys();
41
		void UpdateGunsList();
41
		void UpdateGunsList();
42
		void UpdateGunTurrets();
42
		void UpdateGunTurrets();
43
 
43
 
44
	protected:
44
	protected:
45
		Windows::Forms::Form	^m_pParent;
45
		Windows::Forms::Form		^m_pParent;
46
		CShipData				*m_pShipData;
46
		CShipData					*m_pShipData;
47
		bool					 m_bUpdatingGunLists;
47
		bool						 m_bUpdatingGunLists;
48
		CyStringList			*m_pModels;
48
		const Utils::CStringList	*_pModels;
49
		/// <summary>
49
		/// <summary>
50
		/// Clean up any resources being used.
50
		/// Clean up any resources being used.
51
		/// </summary>
51
		/// </summary>
52
		~CustomiseGuns()
52
		~CustomiseGuns()
53
		{
53
		{
Line 546... Line 546...
546
				 w->sModel1 = "0";
546
				 w->sModel1 = "0";
547
			 }
547
			 }
548
			 else
548
			 else
549
			 {
549
			 {
550
				 w->iNode1 = this->ComboAutoPrimary->SelectedIndex - 1;
550
				 w->iNode1 = this->ComboAutoPrimary->SelectedIndex - 1;
551
				 w->sModel1 = m_pModels->GetAt(w->iNode1)->str;
551
				 w->sModel1 = _pModels->get(w->iNode1)->str;
552
			 }
552
			 }
553
 
553
 
554
			 m_pShipData->UpdateGunEntries();
554
			 m_pShipData->UpdateGunEntries();
555
			 this->ChangeGunValues();
555
			 this->ChangeGunValues();
556
		 }
556
		 }
Line 568... Line 568...
568
				 w->sModel2 = "";
568
				 w->sModel2 = "";
569
			 }
569
			 }
570
			 else
570
			 else
571
			 {
571
			 {
572
				 w->iNode2 = this->ComboAutoSecondary->SelectedIndex - 1;
572
				 w->iNode2 = this->ComboAutoSecondary->SelectedIndex - 1;
573
				 w->sModel2 = m_pModels->GetAt(w->iNode2)->str;
573
				 w->sModel2 = _pModels->get(w->iNode2)->str;
574
			 }
574
			 }
575
 
575
 
576
			 m_pShipData->UpdateGunEntries();
576
			 m_pShipData->UpdateGunEntries();
577
			 this->ChangeGunValues();
577
			 this->ChangeGunValues();
578
		 }
578
		 }
Line 622... Line 622...
622
			 SWeaponGroup *w = g->lWeapons.Get(Convert::ToInt32(this->ListGuns->SelectedItems[0]->Tag));
622
			 SWeaponGroup *w = g->lWeapons.Get(Convert::ToInt32(this->ListGuns->SelectedItems[0]->Tag));
623
 
623
 
624
			 if ( this->CheckManualPrimary->Checked )
624
			 if ( this->CheckManualPrimary->Checked )
625
			 {
625
			 {
626
				 w->iNode1 = Convert::ToInt32(this->NumManualPrimary->Value);
626
				 w->iNode1 = Convert::ToInt32(this->NumManualPrimary->Value);
627
				 w->sModel1 = CyStringFromSystemString(this->TextManualPrimary->Text);
627
				 w->sModel1 = _S(this->TextManualPrimary->Text);
628
			 }
628
			 }
629
			 else
629
			 else
630
			 {
630
			 {
631
				 w->iNode1 = 0;
631
				 w->iNode1 = 0;
632
				 w->sModel1 = "0";
632
				 w->sModel1 = "0";
633
			 }
633
			 }
634
			 if ( this->CheckManualSecondary->Checked )
634
			 if ( this->CheckManualSecondary->Checked )
635
			 {
635
			 {
636
				 w->iNode2 = Convert::ToInt32(this->NumManualSecondary->Value);
636
				 w->iNode2 = Convert::ToInt32(this->NumManualSecondary->Value);
637
				 w->sModel2 = CyStringFromSystemString(this->TextManualSecondary->Text);
637
				 w->sModel2 = _S(this->TextManualSecondary->Text);
638
			 }
638
			 }
639
			 else
639
			 else
640
			 {
640
			 {
641
				 w->iNode2 = -1;
641
				 w->iNode2 = -1;
642
				 w->sModel2 = "";
642
				 w->sModel2 = "";