Subversion Repositories spk

Rev

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

Rev 36 Rev 68
Line 5... Line 5...
5
 
5
 
6
	void SelectFilesystem::update()
6
	void SelectFilesystem::update()
7
	{
7
	{
8
		for ( int i = 1; i <= m_iHighestGame; i++ ) {
8
		for ( int i = 1; i <= m_iHighestGame; i++ ) {
9
			for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() ) {
9
			for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() ) {
10
				int game = gd->sGame.GetToken(" ", 1, 1).ToInt();
-
 
11
				if ( i == game ) {
10
				if ( i == gd->iGame ) {
12
					this->comboBox1->Items->Add(SystemStringFromCyString(gd->sGame.GetToken(" ", 2)));
11
					this->comboBox1->Items->Add(_US(gd->name));
13
					break;
12
					break;
14
				}
13
				}
15
			}
14
			}
16
		}
15
		}
17
 
16
 
Line 20... Line 19...
20
 
19
 
21
	void SelectFilesystem::selectedGame()
20
	void SelectFilesystem::selectedGame()
22
	{
21
	{
23
		this->comboBox2->Items->Clear();
22
		this->comboBox2->Items->Clear();
24
 
23
 
-
 
24
		// find the game to match the currently selected one
-
 
25
		int iCurrentGame = this->comboBox1->SelectedIndex + 1;
-
 
26
		Utils::String gameName = _S(this->comboBox1->SelectedItem->ToString());
25
		for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() ) {
27
		for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() ) {
26
			int game = gd-&gt;sGame.GetToken(" ", 1, 1).ToInt();
28
			if ( gameName.Compare(gd-&gt;name) ) {
27
			if ( game == this->comboBox1->SelectedIndex + 1 ) {
29
				iCurrentGame = gd->iGame;
28
				this->comboBox2->Items->Add(SystemStringFromCyString(gd->sDir));
30
				break;
29
			}
31
			}
30
		}
32
		}
31
 
33
 
-
 
34
		for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() ) {
-
 
35
			if ( gd->iGame == iCurrentGame ) {
32
		this->comboBox2->SelectedIndex = 0;
36
				this->comboBox2->Items->Add(_US(gd->dir));
-
 
37
			}
-
 
38
		}
-
 
39
 
-
 
40
		this->comboBox2->SelectedIndex = (!this->comboBox2->Items->Count) ? -1 : 0;
33
	}
41
	}
34
 
42
 
35
	void SelectFilesystem::selectedDir()
43
	void SelectFilesystem::selectedDir()
36
	{
44
	{
37
		this->comboBox3->Items->Clear();
45
		this->comboBox3->Items->Clear();
Line 51... Line 59...
51
	}
59
	}
52
 
60
 
53
	SGameDir *SelectFilesystem::gameDir()
61
	SGameDir *SelectFilesystem::gameDir()
54
	{
62
	{
55
		for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() ) {
63
		for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() ) {
56
			if ( gd->sDir.Compare(CyStringFromSystemString(this->comboBox2->Items[this->comboBox2->SelectedIndex]->ToString())) ) {
64
			if ( gd->dir.Compare(_S(this->comboBox2->Items[this->comboBox2->SelectedIndex]->ToString())) ) {
57
				return gd;
65
				return gd;
58
			}
66
			}
59
		}
67
		}
60
 
68
 
61
		return NULL;
69
		return NULL;