Subversion Repositories spk

Rev

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

Rev 1 Rev 94
Line 11... Line 11...
11
		else
11
		else
12
			this->Text = "Add Component Entry";
12
			this->Text = "Add Component Entry";
13
 
13
 
14
		this->PanelSection2->Visible = true;
14
		this->PanelSection2->Visible = true;
15
 
15
 
16
		CyStringList *list = ((Form1 ^)m_pParent)->GetComponentSections();
16
		CGameDirectories *gameDir = _prepareSection();
-
 
17
		for ( Utils::String section = gameDir->firstComponentSection(); !section.empty(); section = gameDir->nextComponentSection() )
17
		this->FillCombo(list);
18
			this->ComboSection->Items->Add(_US(section));
18
	}
19
	}
19
 
20
 
20
	void AddShipPart::SetDummy(bool edit)
21
	CGameDirectories *AddShipPart::_prepareSection()
21
	{
22
	{
-
 
23
		CGameDirectories *gameDir = ((Form1 ^)m_pParent)->gameDirectories();
-
 
24
		gameDir->setSelectedGameDirectory(gameDir->highestGame());
-
 
25
 
-
 
26
		this->ComboSection->Items->Clear();
-
 
27
 
-
 
28
		return gameDir;
-
 
29
	}
-
 
30
 
-
 
31
	void AddShipPart::SetDummy(bool edit)
-
 
32
	{
22
		if ( edit )
33
		if ( edit )
23
			this->Text = "Edit Dummy Entry";
34
			this->Text = "Edit Dummy Entry";
24
		else
35
		else
25
			this->Text = "Add Component Entry";
36
			this->Text = "Add Component Entry";
26
 
37
 
27
		this->PanelSection2->Visible = false;
38
		this->PanelSection2->Visible = false;
28
 
39
 
29
		CyStringList *list = ((Form1 ^)m_pParent)->GetDummySections();
40
		CGameDirectories *gameDir = _prepareSection();
-
 
41
		for ( Utils::String section = gameDir->firstDummySection(); !section.empty(); section = gameDir->nextDummySection() )
30
		this->FillCombo(list);
42
			this->ComboSection->Items->Add(_US(section));
31
	}
43
	}
32
 
44
 
33
	void AddShipPart::SetBodies(bool edit)
45
	void AddShipPart::SetBodies(bool edit)
34
	{
46
	{
35
		if ( edit )
47
		if ( edit )
36
			this->Text = "Edit Bodies Entry";
48
			this->Text = "Edit Bodies Entry";
37
		else
49
		else
38
			this->Text = "Add Bodies Entry";
50
			this->Text = "Add Bodies Entry";
39
 
51
 
40
		this->PanelSection2->Visible = false;
52
		this->PanelSection2->Visible = false;
41
 
53
 
42
		CyStringList *list = ((Form1 ^)m_pParent)->GetBodiesSections();
54
		CGameDirectories *gameDir = _prepareSection();
43
		this->FillCombo(list);
-
 
44
	}
-
 
45
 
-
 
46
	void AddShipPart::FillCombo(CyStringList *list)
-
 
47
	{
-
 
48
		this->ComboSection->Items->Clear();
-
 
49
		for ( SStringList *str = list->Head(); str; str = str->next )
55
		for ( Utils::String section = gameDir->firstBodiesSection(); !section.empty(); section = gameDir->nextBodiesSection() )
50
			this->ComboSection->Items->Add(SystemStringFromCyString(str->str));
56
			this->ComboSection->Items->Add(_US(section));
51
	}
57
	}
52
}
58
}