Subversion Repositories spk

Rev

Rev 94 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 cycrow 1
#include "../StdAfx.h"
2
#include "AddShipPart.h"
3
 
4
#include "Form1.h"
5
 
6
namespace Creator {
7
	void AddShipPart::SetComponent(bool edit)
8
	{
9
		if ( edit )
10
			this->Text = "Edit Component Entry";
11
		else
12
			this->Text = "Add Component Entry";
13
 
14
		this->PanelSection2->Visible = true;
15
 
94 cycrow 16
		CGameDirectories *gameDir = _prepareSection();
197 cycrow 17
		for ( Utils::WString section = gameDir->firstComponentSection(); !section.empty(); section = gameDir->nextComponentSection() )
94 cycrow 18
			this->ComboSection->Items->Add(_US(section));
1 cycrow 19
	}
20
 
94 cycrow 21
	CGameDirectories *AddShipPart::_prepareSection()
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
 
1 cycrow 31
	void AddShipPart::SetDummy(bool edit)
32
	{
33
		if ( edit )
34
			this->Text = "Edit Dummy Entry";
35
		else
36
			this->Text = "Add Component Entry";
37
 
38
		this->PanelSection2->Visible = false;
39
 
94 cycrow 40
		CGameDirectories *gameDir = _prepareSection();
197 cycrow 41
		for ( Utils::WString section = gameDir->firstDummySection(); !section.empty(); section = gameDir->nextDummySection() )
94 cycrow 42
			this->ComboSection->Items->Add(_US(section));
1 cycrow 43
	}
44
 
45
	void AddShipPart::SetBodies(bool edit)
46
	{
47
		if ( edit )
48
			this->Text = "Edit Bodies Entry";
49
		else
50
			this->Text = "Add Bodies Entry";
51
 
52
		this->PanelSection2->Visible = false;
53
 
94 cycrow 54
		CGameDirectories *gameDir = _prepareSection();
197 cycrow 55
		for ( Utils::WString section = gameDir->firstBodiesSection(); !section.empty(); section = gameDir->nextBodiesSection() )
94 cycrow 56
			this->ComboSection->Items->Add(_US(section));
1 cycrow 57
	}
58
}