Subversion Repositories spk

Rev

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

Rev 1 Rev 170
Line 10... Line 10...
10
	void CustomiseGuns::SetupControls()
10
	void CustomiseGuns::SetupControls()
11
	{
11
	{
12
		this->Dock = System::Windows::Forms::DockStyle::Fill;
12
		this->Dock = System::Windows::Forms::DockStyle::Fill;
13
 
13
 
14
		// update scene file entries
14
		// update scene file entries
15
		if ( !m_pModels || m_pModels->Empty() )
15
		if (!_pModels || _pModels->empty())
16
		{
16
		{
17
			// if no scene file
17
			// if no scene file
18
			if ( this->PageAuto )
18
			if ( this->PageAuto )
19
				delete this->PageAuto;
19
				delete this->PageAuto;
20
			this->PageAuto = nullptr;
20
			this->PageAuto = nullptr;
Line 23... Line 23...
23
		else
23
		else
24
		{
24
		{
25
			int i = 0;
25
			int i = 0;
26
			this->ComboAutoPrimary->Items->Add("None");
26
			this->ComboAutoPrimary->Items->Add("None");
27
			this->ComboAutoSecondary->Items->Add("None");
27
			this->ComboAutoSecondary->Items->Add("None");
28
			for ( SStringList *str = m_pModels->Head(); str; str = str->next )
28
			for(auto itr = _pModels->begin(); itr != _pModels->end(); itr++)
29
			{
29
			{
30
				String ^entry = SystemStringFromCyString(str->str) + ":" + Convert::ToString(i);
30
				String ^entry = _US((*itr)->str) + ":" + Convert::ToString(i);
31
				this->ComboAutoPrimary->Items->Add(entry);
31
				this->ComboAutoPrimary->Items->Add(entry);
32
				this->ComboAutoSecondary->Items->Add(entry);
32
				this->ComboAutoSecondary->Items->Add(entry);
33
				++i;
33
				++i;
34
			}
34
			}
35
		}
35
		}
Line 56... Line 56...
56
		SGunGroup *g = m_pShipData->lGuns.Get(Convert::ToInt32(this->ListTurrets->SelectedItems[0]->Tag));
56
		SGunGroup *g = m_pShipData->lGuns.Get(Convert::ToInt32(this->ListTurrets->SelectedItems[0]->Tag));
57
		SWeaponGroup *w = g->lWeapons.Get(Convert::ToInt32(this->ListGuns->SelectedItems[0]->Tag));
57
		SWeaponGroup *w = g->lWeapons.Get(Convert::ToInt32(this->ListGuns->SelectedItems[0]->Tag));
58
 
58
 
59
		if ( this->PageAuto )
59
		if ( this->PageAuto )
60
		{
60
		{
61
			if ( w->iNode1 == -1 || (w->iNode1 == 0 && w->sModel1 == "0") || w->sModel1.Empty() )
61
			if ( w->iNode1 == -1 || (w->iNode1 == 0 && w->sModel1 == "0") || w->sModel1.empty() )
62
				this->ComboAutoPrimary->SelectedIndex = 0;
62
				this->ComboAutoPrimary->SelectedIndex = 0;
63
			else
63
			else
64
				this->ComboAutoPrimary->SelectedIndex = w->iNode1 + 1;
64
				this->ComboAutoPrimary->SelectedIndex = w->iNode1 + 1;
65
 
65
 
66
			if ( w->iNode2 == -1 || (w->iNode2 == 0 && w->sModel2 == "0") || w->sModel2.Empty() )
66
			if ( w->iNode2 == -1 || (w->iNode2 == 0 && w->sModel2 == "0") || w->sModel2.empty() )
67
				this->ComboAutoSecondary->SelectedIndex = 0;
67
				this->ComboAutoSecondary->SelectedIndex = 0;
68
			else
68
			else
69
				this->ComboAutoSecondary->SelectedIndex = w->iNode2 + 1;
69
				this->ComboAutoSecondary->SelectedIndex = w->iNode2 + 1;
70
		}
70
		}
71
 
71
 
72
		if ( w->iNode1 == -1 || w->sModel1.Empty() || w->sModel1 == "0" )
72
		if ( w->iNode1 == -1 || w->sModel1.empty() || w->sModel1 == "0" )
73
			this->CheckManualPrimary->Checked = false;
73
			this->CheckManualPrimary->Checked = false;
74
		else
74
		else
75
			this->CheckManualPrimary->Checked = true;
75
			this->CheckManualPrimary->Checked = true;
76
		this->NumManualPrimary->Value = w->iNode1;
76
		this->NumManualPrimary->Value = w->iNode1;
77
		this->TextManualPrimary->Text = SystemStringFromCyString(w->sModel1);
77
		this->TextManualPrimary->Text = SystemStringFromCyString(w->sModel1);
78
 
78
 
79
		if ( w->iNode2 == -1 || w->sModel2.Empty() || w->sModel2 == "0" )
79
		if ( w->iNode2 == -1 || w->sModel2.empty() || w->sModel2 == "0" )
80
			this->CheckManualSecondary->Checked = false;
80
			this->CheckManualSecondary->Checked = false;
81
		else
81
		else
82
			this->CheckManualSecondary->Checked = true;
82
			this->CheckManualSecondary->Checked = true;
83
		this->NumManualSecondary->Value = w->iNode2;
83
		this->NumManualSecondary->Value = w->iNode2;
84
		this->TextManualSecondary->Text = SystemStringFromCyString(w->sModel2);
84
		this->TextManualSecondary->Text = SystemStringFromCyString(w->sModel2);
Line 106... Line 106...
106
			for ( SWeaponGroup *w = g->lWeapons.First(); w; w = g->lWeapons.Next(), i++ )
106
			for ( SWeaponGroup *w = g->lWeapons.First(); w; w = g->lWeapons.Next(), i++ )
107
			{
107
			{
108
				ListViewItem ^item = this->ListGuns->Items->Add(gcnew ListViewItem(Convert::ToString(i)));
108
				ListViewItem ^item = this->ListGuns->Items->Add(gcnew ListViewItem(Convert::ToString(i)));
109
				item->SubItems->Add(Convert::ToString(w->iGunIndex));
109
				item->SubItems->Add(Convert::ToString(w->iGunIndex));
110
				item->SubItems->Add(Convert::ToString(w->iLaser));
110
				item->SubItems->Add(Convert::ToString(w->iLaser));
111
				if ( w->iNode1 == -1 || (w->iNode1 == 0 && w->sModel1 == "0") || w->sModel1.Empty() )
111
				if ( w->iNode1 == -1 || (w->iNode1 == 0 && w->sModel1 == "0") || w->sModel1.empty() )
112
					item->SubItems->Add("None");
112
					item->SubItems->Add("None");
113
				else
113
				else
114
					item->SubItems->Add(SystemStringFromCyString(w->sModel1) + ":" + Convert::ToString(w->iNode1));
114
					item->SubItems->Add(_US(w->sModel1) + ":" + Convert::ToString(w->iNode1));
115
				if ( w->iNode2 == -1 || (w->iNode2 == 0 && w->sModel2 == "0") || w->sModel2.Empty() )
115
				if ( w->iNode2 == -1 || (w->iNode2 == 0 && w->sModel2 == "0") || w->sModel2.empty() )
116
					item->SubItems->Add("None");
116
					item->SubItems->Add("None");
117
				else
117
				else
118
					item->SubItems->Add(SystemStringFromCyString(w->sModel2) + ":" + Convert::ToString(w->iNode2));
118
					item->SubItems->Add(_US(w->sModel2) + ":" + Convert::ToString(w->iNode2));
119
				item->Tag = i;
119
				item->Tag = i;
120
				item->ImageKey = "gun";
120
				item->ImageKey = "gun";
121
				if ( i == selected )
121
				if ( i == selected )
122
					item->Selected = true;
122
					item->Selected = true;
123
			}
123
			}