Subversion Repositories spk

Rev

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

Rev 212 Rev 214
Line 26... Line 26...
26
		m_iSelectedGame = -1;
26
		m_iSelectedGame = -1;
27
 
27
 
28
		this->Closing += gcnew CancelEventHandler(this, &PackageForm::PackageForm_Closing);
28
		this->Closing += gcnew CancelEventHandler(this, &PackageForm::PackageForm_Closing);
29
 
29
 
30
		_pPackages = new CPackages();
30
		_pPackages = new CPackages();
31
		_pPackages->startup(".", ".", ".");
31
		_pPackages->startup(L".", L".", L".");
32
		m_pPackage = NULL;
32
		m_pPackage = NULL;
33
		m_pTypeList = new CyStringList;
33
		m_pTypeList = new Utils::WStringList;
34
 
34
 
35
		this->ComboShipPart->SelectedIndex = 0;
35
		this->ComboShipPart->SelectedIndex = 0;
36
 
36
 
37
		m_bLoading = false;
37
		m_bLoading = false;
38
	}
38
	}
Line 173... Line 173...
173
		if ( this->ComboType->SelectedIndex == CSpkFile::SCRIPTTYPE_CUSTOM )
173
		if ( this->ComboType->SelectedIndex == CSpkFile::SCRIPTTYPE_CUSTOM )
174
		{
174
		{
175
			this->TextCustomType->Visible = true;
175
			this->TextCustomType->Visible = true;
176
			this->ComboType->Dock = Windows::Forms::DockStyle::Left;
176
			this->ComboType->Dock = Windows::Forms::DockStyle::Left;
177
			if ( !m_bLoading )
177
			if ( !m_bLoading )
178
				((CSpkFile *)m_pPackage)->SetScriptType(CyStringFromSystemString(this->TextCustomType->Text).ToString());
178
				((CSpkFile *)m_pPackage)->setScriptType(_WS(this->TextCustomType->Text));
179
		 }
179
		 }
180
		 else
180
		 else
181
		 {
181
		 {
182
			 this->TextCustomType->Visible = false;
182
			 this->TextCustomType->Visible = false;
183
			 this->ComboType->Dock = Windows::Forms::DockStyle::Fill;
183
			 this->ComboType->Dock = Windows::Forms::DockStyle::Fill;
Line 417... Line 417...
417
			{
417
			{
418
				this->RadioTypeScript->Checked = true;
418
				this->RadioTypeScript->Checked = true;
419
				this->ComboType->SelectedIndex = spk->GetScriptType();
419
				this->ComboType->SelectedIndex = spk->GetScriptType();
420
				this->ComboType->Enabled = true;
420
				this->ComboType->Enabled = true;
421
				if ( this->ComboType->SelectedIndex == CSpkFile::SCRIPTTYPE_CUSTOM )
421
				if ( this->ComboType->SelectedIndex == CSpkFile::SCRIPTTYPE_CUSTOM )
422
					this->TextCustomType->Text = _US(spk->GetCustomScriptType(m_pP->GetLanguage()));
422
					this->TextCustomType->Text = _US(spk->customScriptType(m_pP->GetLanguage()));
423
			}
423
			}
424
 
424
 
425
			this->CheckOther->Checked = spk->IsAnotherMod();
425
			this->CheckOther->Checked = spk->IsAnotherMod();
426
			this->TextOtherAuthor->Enabled = this->CheckOther->Checked;
426
			this->TextOtherAuthor->Enabled = this->CheckOther->Checked;
427
			this->TextOtherName->Enabled = this->CheckOther->Checked;
427
			this->TextOtherName->Enabled = this->CheckOther->Checked;
428
			this->ButFromFile->Enabled = this->CheckOther->Checked;
428
			this->ButFromFile->Enabled = this->CheckOther->Checked;
429
 
429
 
430
			if ( spk->IsAnotherMod() )
430
			if ( spk->IsAnotherMod() )
431
			{
431
			{
432
				this->TextOtherAuthor->Text = _US(spk->GetOtherAuthor());
432
				this->TextOtherAuthor->Text = _US(spk->otherAuthor());
433
				this->TextOtherName->Text = _US(spk->GetOtherName());
433
				this->TextOtherName->Text = _US(spk->otherName());
434
			}
434
			}
435
 
435
 
436
			this->UpdateWares();
436
			this->UpdateWares();
437
			this->UpdateScriptType();
437
			this->UpdateScriptType();
438
		}
438
		}
Line 934... Line 934...
934
		this->ComboGameFilter->SelectedIndex = 0;
934
		this->ComboGameFilter->SelectedIndex = 0;
935
 
935
 
936
		this->ButGame->Text = "- Select Game -";
936
		this->ButGame->Text = "- Select Game -";
937
		this->ButGameAdd->Enabled = false;
937
		this->ButGameAdd->Enabled = false;
938
 
938
 
939
		m_pTypeList->Clear();
939
		m_pTypeList->clear();
940
		for ( int i = 0; i < CSpkFile::SCRIPTTYPE_MAX; i++ )
940
		for ( int i = 0; i < CSpkFile::SCRIPTTYPE_MAX; i++ )
941
		{
941
		{
942
			m_pTypeList->PushBack(CSpkFile::GetScriptTypeStringStatic(i).c_str());
942
			m_pTypeList->pushBack(CSpkFile::GetScriptTypeStringStatic(i));
943
			ComboType->Items->Add(_US(CSpkFile::GetScriptTypeStringStatic(i)));
943
			ComboType->Items->Add(_US(CSpkFile::GetScriptTypeStringStatic(i)));
944
		}
944
		}
945
 
945
 
946
		this->CreationDate->Value = DateTime::Today;
946
		this->CreationDate->Value = DateTime::Today;
947
 
947
 
Line 1203... Line 1203...
1203
					return false;
1203
					return false;
1204
				}
1204
				}
1205
			}
1205
			}
1206
			else if ( ((CSpkFile *)m_pPackage)->IsPatch() )
1206
			else if ( ((CSpkFile *)m_pPackage)->IsPatch() )
1207
			{
1207
			{
1208
				if ( ((CSpkFile *)m_pPackage)->GetOtherAuthor().empty() || ((CSpkFile *)m_pPackage)->GetOtherName().empty() )
1208
				if ( ((CSpkFile *)m_pPackage)->otherAuthor().empty() || ((CSpkFile *)m_pPackage)->otherName().empty() )
1209
				{
1209
				{
1210
					MessageBox::Show(this, "For a mod patch, you must specify the parent mod that this will be patching\nEnter the parent mod name and author", "Invalid Entry", MessageBoxButtons::OK, MessageBoxIcon::Stop);
1210
					MessageBox::Show(this, "For a mod patch, you must specify the parent mod that this will be patching\nEnter the parent mod name and author", "Invalid Entry", MessageBoxButtons::OK, MessageBoxIcon::Stop);
1211
					return false;
1211
					return false;
1212
				}
1212
				}
1213
			}
1213
			}
1214
		}
1214
		}
1215
 
1215
 
1216
		 System::DateTime ^time = DateTime(this->CreationDate->Value);
1216
		 System::DateTime ^time = DateTime(this->CreationDate->Value);
1217
		 m_pPackage->setCreationDate(_S(System::Convert::ToString(time->Day) + "/" + System::Convert::ToString(time->Month) + "/" + System::Convert::ToString(time->Year)));
1217
		 m_pPackage->setCreationDate(_WS(System::Convert::ToString(time->Day) + "/" + System::Convert::ToString(time->Month) + "/" + System::Convert::ToString(time->Year)));
1218
 
1218
 
1219
		return true;
1219
		return true;
1220
	}
1220
	}
1221
 
1221
 
1222
	void PackageForm::Save()
1222
	void PackageForm::Save()