| Line 3... |
Line 3... |
| 3 |
#include "InputBox.h"
|
3 |
#include "InputBox.h"
|
| 4 |
#include "Form1.h"
|
4 |
#include "Form1.h"
|
| 5 |
#include "AddWareText.h"
|
5 |
#include "AddWareText.h"
|
| 6 |
#include "AddCockpit.h"
|
6 |
#include "AddCockpit.h"
|
| 7 |
#include "SaveDialog.h"
|
7 |
#include "SaveDialog.h"
|
| - |
|
8 |
|
| - |
|
9 |
#include <Package/InstallText.h>
|
| 8 |
|
10 |
|
| 9 |
namespace Creator {
|
11 |
namespace Creator {
|
| 10 |
bool PackageForm::LoadPackage(CBaseFile *base, System::String ^filename)
|
12 |
bool PackageForm::LoadPackage(CBaseFile *base, System::String ^filename)
|
| 11 |
{
|
13 |
{
|
| 12 |
m_sFilename = filename;
|
14 |
m_sFilename = filename;
|
| Line 98... |
Line 100... |
| 98 |
}
|
100 |
}
|
| 99 |
|
101 |
|
| 100 |
void PackageForm::UpdateScriptType()
|
102 |
void PackageForm::UpdateScriptType()
|
| 101 |
{
|
103 |
{
|
| 102 |
if ( this->ComboType->SelectedIndex == CSpkFile::SCRIPTTYPE_CUSTOM )
|
104 |
if ( this->ComboType->SelectedIndex == CSpkFile::SCRIPTTYPE_CUSTOM )
|
| 103 |
{
|
105 |
{
|
| 104 |
this->TextCustomType->Visible = true;
|
106 |
this->TextCustomType->Visible = true;
|
| 105 |
this->ComboType->Dock = Windows::Forms::DockStyle::Left;
|
107 |
this->ComboType->Dock = Windows::Forms::DockStyle::Left;
|
| 106 |
if ( !m_bLoading )
|
108 |
if ( !m_bLoading )
|
| 107 |
((CSpkFile *)m_pPackage)->SetScriptType(CyStringFromSystemString(this->TextCustomType->Text).ToString());
|
109 |
((CSpkFile *)m_pPackage)->SetScriptType(CyStringFromSystemString(this->TextCustomType->Text).ToString());
|
| 108 |
}
|
110 |
}
|
| Line 112... |
Line 114... |
| 112 |
this->ComboType->Dock = Windows::Forms::DockStyle::Fill;
|
114 |
this->ComboType->Dock = Windows::Forms::DockStyle::Fill;
|
| 113 |
}
|
115 |
}
|
| 114 |
}
|
116 |
}
|
| 115 |
void PackageForm::UpdateText()
|
117 |
void PackageForm::UpdateText()
|
| 116 |
{
|
118 |
{
|
| - |
|
119 |
const SPK::Package::CInstallText *pText = NULL;
|
| - |
|
120 |
|
| 117 |
this->TextText->Tag = 1;
|
121 |
this->TextText->Tag = 1;
|
| 118 |
CLinkList<SInstallText> *list = NULL;
|
- |
|
| 119 |
if ( this->RadioInstallAfter->Checked || this->RadioInstallBefore->Checked )
|
122 |
if ( this->RadioInstallAfter->Checked || this->RadioInstallBefore->Checked )
|
| 120 |
list = m_pPackage->GetInstallTextList();
|
123 |
pText = m_pPackage->installText();
|
| 121 |
else if ( this->RadioUninstallAfter->Checked || this->RadioUninstallBefore->Checked )
|
124 |
else if ( this->RadioUninstallAfter->Checked || this->RadioUninstallBefore->Checked )
|
| 122 |
list = m_pPackage->GetUninstallTextList();
|
125 |
pText = m_pPackage->uninstallText();
|
| 123 |
else
|
126 |
else
|
| 124 |
{
|
127 |
{
|
| 125 |
this->ListLang->Enabled = false;
|
128 |
this->ListLang->Enabled = false;
|
| 126 |
this->ButTextAdd->Enabled = false;
|
129 |
this->ButTextAdd->Enabled = false;
|
| 127 |
this->UpdateTextLang();
|
130 |
this->UpdateTextLang();
|
| 128 |
return;
|
131 |
return;
|
| 129 |
}
|
132 |
}
|
| 130 |
|
133 |
|
| 131 |
this->ListLang->Enabled = true;
|
134 |
this->ListLang->Enabled = true;
|
| 132 |
this->ButTextAdd->Enabled = true;
|
135 |
this->ButTextAdd->Enabled = true;
|
| 133 |
|
136 |
|
| 134 |
int selected = this->ListLang->SelectedIndex;
|
137 |
int selected = this->ListLang->SelectedIndex;
|
| 135 |
if ( selected >= 1 )
|
- |
|
| 136 |
selected = Convert::ToInt32(this->ListLang->Text);
|
138 |
if ( selected >= 1 ) selected = Convert::ToInt32(this->ListLang->Text);
|
| 137 |
else
|
- |
|
| 138 |
selected = -1;
|
139 |
else selected = -1;
|
| 139 |
|
140 |
|
| 140 |
this->ListLang->Items->Clear();
|
141 |
this->ListLang->Items->Clear();
|
| 141 |
this->ListLang->Items->Add("- Default -");
|
142 |
this->ListLang->Items->Add("- Default -");
|
| 142 |
|
- |
|
| 143 |
if ( !list )
|
- |
|
| 144 |
{
|
- |
|
| 145 |
this->UpdateTextLang();
|
- |
|
| 146 |
return;
|
- |
|
| 147 |
}
|
- |
|
| 148 |
|
- |
|
| 149 |
bool before = false;
|
- |
|
| 150 |
if ( this->RadioInstallBefore->Checked || this->RadioUninstallBefore->Checked )
|
- |
|
| 151 |
before = true;
|
- |
|
| 152 |
|
143 |
|
| 153 |
// add languages
|
144 |
// add languages
|
| 154 |
for ( SInstallText *t = list->First(); t; t = list->Next() )
|
145 |
for ( unsigned int i = 0; i < pText->count(); i++ ) {
|
| 155 |
{
|
- |
|
| 156 |
if ( t->iLanguage <= 0 )
|
146 |
int iLang = pText->language(i);
|
| 157 |
continue;
|
147 |
if ( iLang <= 0 ) continue;
|
| 158 |
this->ListLang->Items->Add(System::Convert::ToString(t->iLanguage));
|
148 |
this->ListLang->Items->Add(System::Convert::ToString(iLang));
|
| 159 |
}
|
149 |
}
|
| 160 |
|
150 |
|
| 161 |
if ( selected == -1 )
|
151 |
if ( selected == -1 )
|
| 162 |
this->ListLang->SelectedIndex = 0;
|
152 |
this->ListLang->SelectedIndex = 0;
|
| 163 |
else
|
153 |
else
|
| 164 |
this->ListLang->Text = Convert::ToString(selected);
|
154 |
this->ListLang->Text = Convert::ToString(selected);
|
| - |
|
155 |
|
| 165 |
if ( this->ListLang->SelectedIndex == -1 )
|
156 |
if ( this->ListLang->SelectedIndex == -1 )
|
| 166 |
this->ListLang->SelectedIndex = 0;
|
157 |
this->ListLang->SelectedIndex = 0;
|
| 167 |
|
158 |
|
| 168 |
this->UpdateTextLang();
|
159 |
this->UpdateTextLang();
|
| 169 |
}
|
160 |
}
|
| 170 |
|
161 |
|
| 171 |
void PackageForm::UpdateTextLang()
|
162 |
void PackageForm::UpdateTextLang()
|
| 172 |
{
|
163 |
{
|
| 173 |
this->TextText->Tag = 1;
|
164 |
this->TextText->Tag = 1;
|
| 174 |
this->TextText->Enabled = false;
|
165 |
this->TextText->Enabled = false;
|
| 175 |
this->TextText->Text = "";
|
166 |
this->TextText->Text = "";
|
| 176 |
|
167 |
|
| 177 |
if ( this->ListLang->SelectedIndex >= 0 )
|
168 |
if ( this->ListLang->SelectedIndex >= 0 )
|
| 178 |
{
|
169 |
{
|
| 179 |
int lang = CyStringFromSystemString(this->ListLang->Text).ToInt();
|
170 |
int lang = CyStringFromSystemString(this->ListLang->Text).ToInt();
|
| 180 |
CyString desc;
|
171 |
Utils::String desc;
|
| 181 |
if ( this->RadioInstallAfter->Checked )
|
172 |
if ( this->RadioInstallAfter->Checked ) desc = m_pPackage->installText(lang, false, false);
|
| 182 |
desc = m_pPackage->GetInstallAfterText(lang, true);
|
- |
|
| 183 |
else if ( this->RadioInstallBefore->Checked )
|
173 |
else if ( this->RadioInstallBefore->Checked ) desc = m_pPackage->installText(lang, true, false);
|
| 184 |
desc = m_pPackage->GetInstallBeforeText(lang, true);
|
- |
|
| 185 |
else if ( this->RadioUninstallAfter->Checked )
|
174 |
else if ( this->RadioUninstallAfter->Checked ) desc = m_pPackage->uninstallText(lang, false, false);
|
| 186 |
desc = m_pPackage->GetUninstallAfterText(lang, true);
|
- |
|
| 187 |
else if ( this->RadioUninstallBefore->Checked )
|
175 |
else if ( this->RadioUninstallBefore->Checked ) desc = m_pPackage->uninstallText(lang, true, false);
|
| 188 |
desc = m_pPackage->GetUninstallBeforeText(lang, true);
|
- |
|
| - |
|
176 |
|
| 189 |
this->TextText->Text = SystemStringFromCyString(desc);
|
177 |
this->TextText->Text = _US(desc);
|
| 190 |
this->TextText->Enabled = true;
|
178 |
this->TextText->Enabled = true;
|
| 191 |
}
|
179 |
}
|
| 192 |
|
180 |
|
| 193 |
this->ButTextDel->Enabled = false;
|
181 |
this->ButTextDel->Enabled = false;
|
| 194 |
if ( this->ListLang->SelectedIndex >= 1 )
|
182 |
if ( this->ListLang->SelectedIndex >= 1 )
|
| Line 734... |
Line 722... |
| 734 |
this->PicRec2->BackColor = System::Drawing::Color::Transparent;
|
722 |
this->PicRec2->BackColor = System::Drawing::Color::Transparent;
|
| 735 |
this->PicRec3->BackColor = System::Drawing::Color::Transparent;
|
723 |
this->PicRec3->BackColor = System::Drawing::Color::Transparent;
|
| 736 |
this->PicRec4->BackColor = System::Drawing::Color::Transparent;
|
724 |
this->PicRec4->BackColor = System::Drawing::Color::Transparent;
|
| 737 |
this->PicRec5->BackColor = System::Drawing::Color::Transparent;
|
725 |
this->PicRec5->BackColor = System::Drawing::Color::Transparent;
|
| 738 |
|
726 |
|
| 739 |
if ( m_pPackage->GetEaseOfUse() >= 1 )
|
727 |
if ( m_pPackage->easeOfUse() >= 1 )
|
| 740 |
this->PicEase1->BackColor = System::Drawing::Color::Red;
|
728 |
this->PicEase1->BackColor = System::Drawing::Color::Red;
|
| 741 |
if ( m_pPackage->GetEaseOfUse() >= 2 )
|
729 |
if ( m_pPackage->easeOfUse() >= 2 )
|
| 742 |
this->PicEase2->BackColor = System::Drawing::Color::Red;
|
730 |
this->PicEase2->BackColor = System::Drawing::Color::Red;
|
| 743 |
if ( m_pPackage->GetEaseOfUse() >= 3 )
|
731 |
if ( m_pPackage->easeOfUse() >= 3 )
|
| 744 |
this->PicEase3->BackColor = System::Drawing::Color::Red;
|
732 |
this->PicEase3->BackColor = System::Drawing::Color::Red;
|
| 745 |
if ( m_pPackage->GetEaseOfUse() >= 4 )
|
733 |
if ( m_pPackage->easeOfUse() >= 4 )
|
| 746 |
this->PicEase4->BackColor = System::Drawing::Color::Red;
|
734 |
this->PicEase4->BackColor = System::Drawing::Color::Red;
|
| 747 |
if ( m_pPackage->GetEaseOfUse() >= 5 )
|
735 |
if ( m_pPackage->easeOfUse() >= 5 )
|
| 748 |
this->PicEase5->BackColor = System::Drawing::Color::Red;
|
736 |
this->PicEase5->BackColor = System::Drawing::Color::Red;
|
| 749 |
|
737 |
|
| 750 |
if ( m_pPackage->GetRecommended() >= 1 )
|
738 |
if ( m_pPackage->recommended() >= 1 )
|
| 751 |
this->PicRec1->BackColor = System::Drawing::Color::Red;
|
739 |
this->PicRec1->BackColor = System::Drawing::Color::Red;
|
| 752 |
if ( m_pPackage->GetRecommended() >= 2 )
|
740 |
if ( m_pPackage->recommended() >= 2 )
|
| 753 |
this->PicRec2->BackColor = System::Drawing::Color::Red;
|
741 |
this->PicRec2->BackColor = System::Drawing::Color::Red;
|
| 754 |
if ( m_pPackage->GetRecommended() >= 3 )
|
742 |
if ( m_pPackage->recommended() >= 3 )
|
| 755 |
this->PicRec3->BackColor = System::Drawing::Color::Red;
|
743 |
this->PicRec3->BackColor = System::Drawing::Color::Red;
|
| 756 |
if ( m_pPackage->GetRecommended() >= 4 )
|
744 |
if ( m_pPackage->recommended() >= 4 )
|
| 757 |
this->PicRec4->BackColor = System::Drawing::Color::Red;
|
745 |
this->PicRec4->BackColor = System::Drawing::Color::Red;
|
| 758 |
if ( m_pPackage->GetRecommended() >= 5 )
|
746 |
if ( m_pPackage->recommended() >= 5 )
|
| 759 |
this->PicRec5->BackColor = System::Drawing::Color::Red;
|
747 |
this->PicRec5->BackColor = System::Drawing::Color::Red;
|
| 760 |
|
748 |
|
| 761 |
if ( m_pPackage->GetGameChanging() >= 1 )
|
749 |
if ( m_pPackage->gameChanging() >= 1 )
|
| 762 |
this->PicChange1->BackColor = System::Drawing::Color::Red;
|
750 |
this->PicChange1->BackColor = System::Drawing::Color::Red;
|
| 763 |
if ( m_pPackage->GetGameChanging() >= 2 )
|
751 |
if ( m_pPackage->gameChanging() >= 2 )
|
| 764 |
this->PicChange2->BackColor = System::Drawing::Color::Red;
|
752 |
this->PicChange2->BackColor = System::Drawing::Color::Red;
|
| 765 |
if ( m_pPackage->GetGameChanging() >= 3 )
|
753 |
if ( m_pPackage->gameChanging() >= 3 )
|
| 766 |
this->PicChange3->BackColor = System::Drawing::Color::Red;
|
754 |
this->PicChange3->BackColor = System::Drawing::Color::Red;
|
| 767 |
if ( m_pPackage->GetGameChanging() >= 4 )
|
755 |
if ( m_pPackage->gameChanging() >= 4 )
|
| 768 |
this->PicChange4->BackColor = System::Drawing::Color::Red;
|
756 |
this->PicChange4->BackColor = System::Drawing::Color::Red;
|
| 769 |
if ( m_pPackage->GetGameChanging() >= 5 )
|
757 |
if ( m_pPackage->gameChanging() >= 5 )
|
| 770 |
this->PicChange5->BackColor = System::Drawing::Color::Red;
|
758 |
this->PicChange5->BackColor = System::Drawing::Color::Red;
|
| 771 |
|
759 |
|
| 772 |
if ( m_pPackage->GetEaseOfUse() < 0 )
|
760 |
if ( m_pPackage->easeOfUse() < 0 )
|
| 773 |
this->GroupEase->Text = "Ease of Use";
|
761 |
this->GroupEase->Text = "Ease of Use";
|
| 774 |
else
|
762 |
else
|
| 775 |
this->GroupEase->Text = "Ease of Use (" + System::Convert::ToString(m_pPackage->GetEaseOfUse()) + ")";
|
763 |
this->GroupEase->Text = "Ease of Use (" + System::Convert::ToString(m_pPackage->easeOfUse()) + ")";
|
| 776 |
|
764 |
|
| 777 |
if ( m_pPackage->GetGameChanging() < 0 )
|
765 |
if ( m_pPackage->gameChanging() < 0 )
|
| 778 |
this->GroupChange->Text = "Game Changing";
|
766 |
this->GroupChange->Text = "Game Changing";
|
| 779 |
else
|
767 |
else
|
| 780 |
this->GroupChange->Text = "Game Changing (" + System::Convert::ToString(m_pPackage->GetGameChanging()) + ")";
|
768 |
this->GroupChange->Text = "Game Changing (" + System::Convert::ToString(m_pPackage->gameChanging()) + ")";
|
| 781 |
|
769 |
|
| 782 |
if ( m_pPackage->GetRecommended() < 0 )
|
770 |
if ( m_pPackage->recommended() < 0 )
|
| 783 |
this->GroupRec->Text = "Recommended";
|
771 |
this->GroupRec->Text = "Recommended";
|
| 784 |
else
|
772 |
else
|
| 785 |
this->GroupRec->Text = "Recommended (" + System::Convert::ToString(m_pPackage->GetRecommended()) + ")";
|
773 |
this->GroupRec->Text = "Recommended (" + System::Convert::ToString(m_pPackage->recommended()) + ")";
|
| 786 |
}
|
774 |
}
|
| 787 |
|
775 |
|
| 788 |
void PackageForm::Setup()
|
776 |
void PackageForm::Setup()
|
| 789 |
{
|
777 |
{
|
| 790 |
m_bLoading = true;
|
778 |
m_bLoading = true;
|
| Line 854... |
Line 842... |
| 854 |
{
|
842 |
{
|
| 855 |
this->ListGames->Items->Clear();
|
843 |
this->ListGames->Items->Clear();
|
| 856 |
for ( SGameCompat *game = m_pPackage->GetGameCompatabilityList()->First(); game; game = m_pPackage->GetGameCompatabilityList()->Next() ) {
|
844 |
for ( SGameCompat *game = m_pPackage->GetGameCompatabilityList()->First(); game; game = m_pPackage->GetGameCompatabilityList()->Next() ) {
|
| 857 |
ListViewItem ^item = gcnew ListViewItem(SystemStringFromCyString(m_pP->GetGameNameFromType(game->iGame)));
|
845 |
ListViewItem ^item = gcnew ListViewItem(SystemStringFromCyString(m_pP->GetGameNameFromType(game->iGame)));
|
| 858 |
item->ImageIndex = (game->iGame < 0) ? -1 : (game->iGame - 1);
|
846 |
item->ImageIndex = (game->iGame < 0) ? -1 : (game->iGame - 1);
|
| 859 |
if ( !game->sVersion.Empty() ) {
|
847 |
if ( !game->sVersion.empty() ) {
|
| 860 |
item->SubItems->Add("Exact: " + SystemStringFromCyString(game->sVersion));
|
848 |
item->SubItems->Add("Exact: " + SystemStringFromCyString(game->sVersion));
|
| 861 |
}
|
849 |
}
|
| 862 |
else {
|
850 |
else {
|
| 863 |
item->SubItems->Add(SystemStringFromCyString(m_pP->GetGameVersionFromType(game->iGame, game->iVersion, game->sVersion)));
|
851 |
item->SubItems->Add(SystemStringFromCyString(m_pP->GetGameVersionFromType(game->iGame, game->iVersion, game->sVersion)));
|
| 864 |
}
|
852 |
}
|
| Line 1281... |
Line 1269... |
| 1281 |
if ( this->TextText->Text->Length )
|
1269 |
if ( this->TextText->Text->Length )
|
| 1282 |
{
|
1270 |
{
|
| 1283 |
if ( this->ListLang->SelectedIndex >= 0 )
|
1271 |
if ( this->ListLang->SelectedIndex >= 0 )
|
| 1284 |
{
|
1272 |
{
|
| 1285 |
int lang = CyStringFromSystemString(this->ListLang->Text).ToInt();
|
1273 |
int lang = CyStringFromSystemString(this->ListLang->Text).ToInt();
|
| 1286 |
if ( this->RadioInstallAfter->Checked )
|
- |
|
| 1287 |
m_pPackage->AddInstallAfterText(lang, CyStringFromSystemString(this->TextText->Text));
|
1274 |
if ( this->RadioInstallAfter->Checked ) m_pPackage->addInstallText(lang, false, _S(this->TextText->Text));
|
| 1288 |
else if ( this->RadioInstallBefore->Checked )
|
- |
|
| 1289 |
m_pPackage->AddInstallBeforeText(lang, CyStringFromSystemString(this->TextText->Text));
|
1275 |
else if ( this->RadioInstallBefore->Checked ) m_pPackage->addInstallText(lang, true, _S(this->TextText->Text));
|
| 1290 |
else if ( this->RadioUninstallBefore->Checked )
|
- |
|
| 1291 |
m_pPackage->AddUninstallBeforeText(lang, CyStringFromSystemString(this->TextText->Text));
|
1276 |
else if ( this->RadioUninstallBefore->Checked ) m_pPackage->addUninstallText(lang, true, _S(this->TextText->Text));
|
| 1292 |
else if ( this->RadioUninstallAfter->Checked )
|
- |
|
| 1293 |
m_pPackage->AddUninstallAfterText(lang, CyStringFromSystemString(this->TextText->Text));
|
1277 |
else if ( this->RadioUninstallAfter->Checked ) m_pPackage->addUninstallText(lang, false, _S(this->TextText->Text));
|
| 1294 |
this->UpdateChanged();
|
1278 |
this->UpdateChanged();
|
| 1295 |
}
|
1279 |
}
|
| 1296 |
}
|
1280 |
}
|
| 1297 |
}
|
1281 |
}
|
| 1298 |
|
1282 |
|
| Line 1812... |
Line 1796... |
| 1812 |
{
|
1796 |
{
|
| 1813 |
if ( builtin )
|
1797 |
if ( builtin )
|
| 1814 |
{
|
1798 |
{
|
| 1815 |
SNeededLibrary *ns = m_pPackage->FindPackageNeeded("<package>", "<author>");
|
1799 |
SNeededLibrary *ns = m_pPackage->FindPackageNeeded("<package>", "<author>");
|
| 1816 |
if ( ns )
|
1800 |
if ( ns )
|
| 1817 |
ns->sMinVersion = CyStringFromSystemString(depend->GetVersion());
|
1801 |
ns->sMinVersion = _S(depend->GetVersion());
|
| 1818 |
}
|
1802 |
}
|
| 1819 |
else
|
1803 |
else
|
| 1820 |
{
|
1804 |
{
|
| 1821 |
m_pPackage->RemovePackageNeeded(CyStringFromSystemString(m_pSelectedItem->Text), CyStringFromSystemString(m_pSelectedItem->SubItems[1]->Text));
|
1805 |
m_pPackage->RemovePackageNeeded(_S(m_pSelectedItem->Text), _S(m_pSelectedItem->SubItems[1]->Text));
|
| 1822 |
m_pPackage->AddNeededLibrary(CyStringFromSystemString(depend->GetName()), CyStringFromSystemString(depend->GetAuthor()), CyStringFromSystemString(depend->GetVersion()));
|
1806 |
m_pPackage->AddNeededLibrary(_S(depend->GetName()), _S(depend->GetAuthor()), _S(depend->GetVersion()));
|
| 1823 |
}
|
1807 |
}
|
| 1824 |
this->UpdateDependacies();
|
1808 |
this->UpdateDependacies();
|
| 1825 |
this->UpdateChanged();
|
1809 |
this->UpdateChanged();
|
| 1826 |
}
|
1810 |
}
|
| 1827 |
}
|
1811 |
}
|