| Line 65... |
Line 65... |
| 65 |
{
|
65 |
{
|
| 66 |
Delete();
|
66 |
Delete();
|
| 67 |
}
|
67 |
}
|
| 68 |
|
68 |
|
| 69 |
|
69 |
|
| 70 |
Utils::String CBaseFile::getFullPackageName(int language, const Utils::String &byString) const
|
70 |
Utils::WString CBaseFile::getFullPackageName(int language, const Utils::WString &byString) const
|
| 71 |
{
|
71 |
{
|
| 72 |
return getFullPackageName(language, true, byString);
|
72 |
return getFullPackageName(language, true, byString);
|
| 73 |
}
|
73 |
}
|
| 74 |
Utils::String CBaseFile::getFullPackageName(int language, bool includeVersion, const Utils::String &byString) const
|
74 |
Utils::WString CBaseFile::getFullPackageName(int language, bool includeVersion, const Utils::WString &byString) const
|
| 75 |
{
|
75 |
{
|
| 76 |
Utils::String p = this->name(language);
|
76 |
Utils::WString p = this->name(language);
|
| 77 |
if (includeVersion)
|
77 |
if (includeVersion)
|
| 78 |
{
|
78 |
{
|
| 79 |
p += " V";
|
79 |
p += L" V";
|
| 80 |
p += this->version();
|
80 |
p += this->version().toWString();
|
| 81 |
}
|
81 |
}
|
| 82 |
p += " ";
|
82 |
p += L" ";
|
| 83 |
p += byString + " " + this->author();
|
83 |
p += byString + L" " + this->author();
|
| 84 |
return p;
|
84 |
return p;
|
| 85 |
}
|
85 |
}
|
| 86 |
|
86 |
|
| 87 |
Utils::String CBaseFile::getFullPackageName(const Utils::String &format, int lang) const
|
87 |
Utils::WString CBaseFile::getFullPackageName(const Utils::WString &format, int lang) const
|
| 88 |
{
|
88 |
{
|
| 89 |
if (format.empty())
|
89 |
if (format.empty())
|
| 90 |
return getFullPackageName(lang);
|
90 |
return getFullPackageName(lang);
|
| 91 |
|
91 |
|
| 92 |
Utils::String args[3] = { this->name(lang), this->version(), this->author()};
|
92 |
Utils::WString args[3] = { this->name(lang), this->version().toWString(), this->author() };
|
| 93 |
return format.args(args, 3);
|
93 |
return format.args(args, 3);
|
| 94 |
}
|
94 |
}
|
| 95 |
|
95 |
|
| 96 |
void CBaseFile::Delete ()
|
96 |
void CBaseFile::Delete ()
|
| 97 |
{
|
97 |
{
|
| Line 1038... |
Line 1038... |
| 1038 |
if ( !bEnabled )
|
1038 |
if ( !bEnabled )
|
| 1039 |
{
|
1039 |
{
|
| 1040 |
if ( !pFile->isInMod() )
|
1040 |
if ( !pFile->isInMod() )
|
| 1041 |
{
|
1041 |
{
|
| 1042 |
if ( pFile->IsFakePatch() )
|
1042 |
if ( pFile->IsFakePatch() )
|
| 1043 |
pFile->setFilename ( filename + L"PluginManager/Disabled/FakePatches/FakePatch_" + this->getNameValidFile() + L"_" + this->author().toWString() + L"_" + pFile->name());
|
1043 |
pFile->setFilename ( filename + L"PluginManager/Disabled/FakePatches/FakePatch_" + this->getNameValidFile() + L"_" + this->author() + L"_" + pFile->name());
|
| 1044 |
else if ( pFile->isAutoTextFile() )
|
1044 |
else if ( pFile->isAutoTextFile() )
|
| 1045 |
pFile->setFilename ( filename + L"PluginManager/Disabled/TextFiles/Text_" + this->getNameValidFile() + L"_" + this->author().toWString() + L"_" + pFile->name());
|
1045 |
pFile->setFilename ( filename + L"PluginManager/Disabled/TextFiles/Text_" + this->getNameValidFile() + L"_" + this->author() + L"_" + pFile->name());
|
| 1046 |
else
|
1046 |
else
|
| 1047 |
pFile->setFullDir ( filename + L"PluginManager/Disabled/" + pFile->getDirectory(this) );
|
1047 |
pFile->setFullDir ( filename + L"PluginManager/Disabled/" + pFile->getDirectory(this) );
|
| 1048 |
}
|
1048 |
}
|
| 1049 |
pFile->SetDisabled(true);
|
1049 |
pFile->SetDisabled(true);
|
| 1050 |
}
|
1050 |
}
|
| Line 1459... |
Line 1459... |
| 1459 |
else if ( first.Compare("ScriptName:") ) addName(ParseLanguage(rest.token(":", 1)), rest.token(":", 2));
|
1459 |
else if ( first.Compare("ScriptName:") ) addName(ParseLanguage(rest.token(":", 1)), rest.token(":", 2));
|
| 1460 |
else if ( first.Compare("GameChanging:") ) this->setGameChanging(rest);
|
1460 |
else if ( first.Compare("GameChanging:") ) this->setGameChanging(rest);
|
| 1461 |
else if ( first.Compare("EaseOfUse:") ) this->setEaseOfUse(rest);
|
1461 |
else if ( first.Compare("EaseOfUse:") ) this->setEaseOfUse(rest);
|
| 1462 |
else if ( first.Compare("Recommended:") ) this->setRecommended(rest);
|
1462 |
else if ( first.Compare("Recommended:") ) this->setRecommended(rest);
|
| 1463 |
else if ( first.Compare("NeededLibrary:") )
|
1463 |
else if ( first.Compare("NeededLibrary:") )
|
| 1464 |
this->AddNeededLibrary(rest.token("||", 1), rest.token("||", 2), rest.token("||", 3));
|
1464 |
this->addNeededLibrary(rest.token("||", 1), rest.token("||", 2), rest.token("||", 3));
|
| 1465 |
else if ( first.Compare("FakePatchBefore:") )
|
1465 |
else if ( first.Compare("FakePatchBefore:") )
|
| 1466 |
this->addFakePatchOrder(false, rest.token("||", 1), rest.token("||", 2));
|
1466 |
this->addFakePatchOrder(false, rest.token("||", 1), rest.token("||", 2));
|
| 1467 |
else if ( first.Compare("FakePatchAfter:") )
|
1467 |
else if ( first.Compare("FakePatchAfter:") )
|
| 1468 |
this->addFakePatchOrder(true, rest.token("||", 1), rest.token("||", 2));
|
1468 |
this->addFakePatchOrder(true, rest.token("||", 1), rest.token("||", 2));
|
| 1469 |
else if ( first.Compare("ForumLink:") ) this->setForumLink(rest);
|
1469 |
else if ( first.Compare("ForumLink:") ) this->setForumLink(rest);
|
| Line 1874... |
Line 1874... |
| 1874 |
return false;
|
1874 |
return false;
|
| 1875 |
}
|
1875 |
}
|
| 1876 |
|
1876 |
|
| 1877 |
Utils::String CBaseFile::createValuesLine () const
|
1877 |
Utils::String CBaseFile::createValuesLine () const
|
| 1878 |
{
|
1878 |
{
|
| 1879 |
Utils::String values("Name: ");
|
1879 |
Utils::WString values(L"Name: ");
|
| 1880 |
values += this->name() + "\n";
|
1880 |
values += this->name() + L"\n";
|
| 1881 |
values += "Author: " + this->author() + "\n";
|
1881 |
values += L"Author: " + this->author() + L"\n";
|
| 1882 |
values += "Version: " + this->version() + "\n";
|
1882 |
values += L"Version: " + this->version().toWString() + L"\n";
|
| 1883 |
if ( !this->creationDate().empty() )values += "Date: " + this->creationDate() + "\n";
|
1883 |
if ( !this->creationDate().empty() )values += L"Date: " + this->creationDate().toWString() + L"\n";
|
| 1884 |
if ( !this->webAddress().empty() ) values += "WebAddress: " + this->webAddress() + "\n";
|
1884 |
if ( !this->webAddress().empty() ) values += L"WebAddress: " + this->webAddress().toWString() + L"\n";
|
| 1885 |
if ( !this->webSite().empty() ) values += "WebSite: " + this->webSite() + "\n";
|
1885 |
if ( !this->webSite().empty() ) values += L"WebSite: " + this->webSite().toWString() + L"\n";
|
| 1886 |
if ( !this->email().empty() ) values += "Email: " + this->email() + "\n";
|
1886 |
if ( !this->email().empty() ) values += L"Email: " + this->email().toWString() + L"\n";
|
| 1887 |
if ( !this->forumLink().empty() ) values += "ForumLink: " + this->forumLink() + "\n";
|
1887 |
if ( !this->forumLink().empty() ) values += L"ForumLink: " + this->forumLink().toWString() + L"\n";
|
| 1888 |
|
1888 |
|
| 1889 |
for(auto itr = _lMirrors.begin(); itr != _lMirrors.end(); itr++)
|
1889 |
for(auto itr = _lMirrors.begin(); itr != _lMirrors.end(); itr++)
|
| 1890 |
values += Utils::String("WebMirror: ") + (*itr)->str + "\n";
|
1890 |
values += Utils::WString(L"WebMirror: ") + (*itr)->str.toWString() + L"\n";
|
| 1891 |
if ( !this->description().empty() ) {
|
1891 |
if ( !this->description().empty() ) {
|
| 1892 |
Utils::String desc = this->description();
|
1892 |
Utils::WString desc = this->description().toWString();
|
| 1893 |
desc = desc.findReplace("<newline>", "<br>");
|
1893 |
desc = desc.findReplace(L"<newline>", L"<br>");
|
| 1894 |
desc = desc.findReplace("\n", "<br>");
|
1894 |
desc = desc.findReplace(L"\n", "L<br>");
|
| 1895 |
desc.remove('\r');
|
1895 |
desc.remove(L'\r');
|
| 1896 |
values += "Desc: " + desc + "\n";
|
1896 |
values += L"Desc: " + desc + L"\n";
|
| 1897 |
}
|
1897 |
}
|
| 1898 |
|
1898 |
|
| 1899 |
for ( CListNode<SGameCompat> *gc = m_lGames.Front(); gc; gc = gc->next() ) {
|
1899 |
for ( CListNode<SGameCompat> *gc = m_lGames.Front(); gc; gc = gc->next() ) {
|
| 1900 |
if ( !gc->Data()->sVersion.empty() )
|
1900 |
if ( !gc->Data()->sVersion.empty() )
|
| 1901 |
values += Utils::String("GameCompatExact: ") + (long)gc->Data()->iGame + " " + gc->Data()->sVersion.toString() + "\n";
|
1901 |
values += Utils::WString(L"GameCompatExact: ") + (long)gc->Data()->iGame + L" " + gc->Data()->sVersion + L"\n";
|
| 1902 |
else
|
1902 |
else
|
| 1903 |
values += Utils::String("GameCompat: ") + (long)gc->Data()->iGame + " " + (long)gc->Data()->iVersion + "\n";
|
1903 |
values += Utils::WString(L"GameCompat: ") + (long)gc->Data()->iGame + L" " + (long)gc->Data()->iVersion + L"\n";
|
| 1904 |
}
|
1904 |
}
|
| 1905 |
|
1905 |
|
| 1906 |
if (computeSigned(true))
|
1906 |
if (computeSigned(true))
|
| 1907 |
values += "Signed\n";
|
1907 |
values += L"Signed\n";
|
| 1908 |
|
1908 |
|
| 1909 |
for ( int j = 0; j < 2; j++ ) {
|
1909 |
for ( int j = 0; j < 2; j++ ) {
|
| 1910 |
const CInstallText *text;
|
1910 |
const CInstallText *text;
|
| 1911 |
Utils::String textStart;
|
1911 |
Utils::WString textStart;
|
| 1912 |
switch(j) {
|
1912 |
switch(j) {
|
| 1913 |
case 0: textStart = "Uninstall"; text = this->uninstallText(); break;
|
1913 |
case 0: textStart = L"Uninstall"; text = this->uninstallText(); break;
|
| 1914 |
case 1: textStart = "Install"; text = this->installText(); break;
|
1914 |
case 1: textStart = L"Install"; text = this->installText(); break;
|
| 1915 |
}
|
1915 |
}
|
| 1916 |
for ( unsigned int i = 0; i < text->count(); i++ ) {
|
1916 |
for ( unsigned int i = 0; i < text->count(); i++ ) {
|
| 1917 |
int iLang = text->language(i);
|
1917 |
int iLang = text->language(i);
|
| 1918 |
if ( !text->getBefore(iLang).empty() ) values += textStart + "Before: " + (long)iLang + "|" + text->getBefore(iLang) + "\n";
|
1918 |
if ( !text->getBefore(iLang).empty() ) values += textStart + L"Before: " + (long)iLang + L"|" + text->getBefore(iLang).toWString() + L"\n";
|
| 1919 |
if ( !text->getAfter(iLang).empty() ) values += textStart + "After: " + (long)iLang + "|" + text->getAfter(iLang) + "\n";
|
1919 |
if ( !text->getAfter(iLang).empty() ) values += textStart + L"After: " + (long)iLang + L"|" + text->getAfter(iLang).toWString() + L"\n";
|
| 1920 |
}
|
1920 |
}
|
| 1921 |
}
|
1921 |
}
|
| 1922 |
|
1922 |
|
| 1923 |
values += Utils::String("GameChanging: ") + (long)gameChanging() + "\n";
|
1923 |
values += Utils::WString(L"GameChanging: ") + (long)gameChanging() + L"\n";
|
| 1924 |
values += Utils::String("EaseOfUse: ") + (long)easeOfUse() + "\n";
|
1924 |
values += Utils::WString(L"EaseOfUse: ") + (long)easeOfUse() + L"\n";
|
| 1925 |
values += Utils::String("Recommended: ") + (long)recommended() + "\n";
|
1925 |
values += Utils::WString(L"Recommended: ") + (long)recommended() + L"\n";
|
| 1926 |
|
1926 |
|
| 1927 |
for(auto itr = namesList()->begin(); itr != namesList()->end(); itr++)
|
1927 |
for(auto itr = namesList()->begin(); itr != namesList()->end(); itr++)
|
| 1928 |
values += Utils::String("ScriptName: ") + (long)(*itr)->iLanguage + ":" + (*itr)->sName + "\n";
|
1928 |
values += Utils::WString(L"ScriptName: ") + (long)(*itr)->iLanguage + L":" + (*itr)->sName.toWString() + L"\n";
|
| 1929 |
|
1929 |
|
| 1930 |
for ( CListNode<SNeededLibrary> *libNode = m_lNeededLibrarys.Front(); libNode; libNode = libNode->next() ) {
|
1930 |
for ( CListNode<SNeededLibrary> *libNode = m_lNeededLibrarys.Front(); libNode; libNode = libNode->next() ) {
|
| 1931 |
SNeededLibrary *l = libNode->Data();
|
1931 |
SNeededLibrary *l = libNode->Data();
|
| 1932 |
values += "NeededLibrary: " + l->sName + "||" + l->sAuthor + "||" + l->sMinVersion + "\n";
|
1932 |
values += L"NeededLibrary: " + l->sName + L"||" + l->sAuthor + L"||" + l->sMinVersion.toWString() + L"\n";
|
| 1933 |
}
|
1933 |
}
|
| 1934 |
|
1934 |
|
| 1935 |
for (auto itr = _lFakePatchBefore.begin(); itr != _lFakePatchBefore.end(); itr++)
|
1935 |
for (auto itr = _lFakePatchBefore.begin(); itr != _lFakePatchBefore.end(); itr++)
|
| 1936 |
values += "FakePatchBefore: " + (*itr)->str + "||" + (*itr)->data + "\n";
|
1936 |
values += L"FakePatchBefore: " + (*itr)->str.toWString() + L"||" + (*itr)->data.toWString() + L"\n";
|
| 1937 |
for (auto itr = _lFakePatchAfter.begin(); itr != _lFakePatchAfter.end(); itr++)
|
1937 |
for (auto itr = _lFakePatchAfter.begin(); itr != _lFakePatchAfter.end(); itr++)
|
| 1938 |
values += "FakePatchAfter: " + (*itr)->str + "||" + (*itr)->data + "\n";
|
1938 |
values += L"FakePatchAfter: " + (*itr)->str.toWString() + L"||" + (*itr)->data.toWString() + L"\n";
|
| 1939 |
|
1939 |
|
| 1940 |
values += Utils::String("PluginType: ") + (long)this->pluginType() + "\n";
|
1940 |
values += Utils::WString(L"PluginType: ") + (long)this->pluginType() + L"\n";
|
| 1941 |
|
1941 |
|
| 1942 |
return values;
|
1942 |
return values.toString();
|
| 1943 |
}
|
1943 |
}
|
| 1944 |
|
1944 |
|
| 1945 |
|
1945 |
|
| 1946 |
/*
|
1946 |
/*
|
| 1947 |
Func: WriteFile
|
1947 |
Func: WriteFile
|
| Line 2286... |
Line 2286... |
| 2286 |
{
|
2286 |
{
|
| 2287 |
m_bSigned = computeSigned(updateFiles);
|
2287 |
m_bSigned = computeSigned(updateFiles);
|
| 2288 |
return m_bSigned;
|
2288 |
return m_bSigned;
|
| 2289 |
}
|
2289 |
}
|
| 2290 |
|
2290 |
|
| 2291 |
bool CBaseFile::IsPackageNeeded(const Utils::String &scriptName, const Utils::String &author)
|
2291 |
bool CBaseFile::isPackageNeeded(const Utils::WString &scriptName, const Utils::WString &author)
|
| 2292 |
{
|
2292 |
{
|
| 2293 |
for ( CListNode<SNeededLibrary> *node = m_lNeededLibrarys.Front(); node; node = node->next() )
|
2293 |
for ( CListNode<SNeededLibrary> *node = m_lNeededLibrarys.Front(); node; node = node->next() )
|
| 2294 |
{
|
2294 |
{
|
| 2295 |
SNeededLibrary *l = node->Data();
|
2295 |
SNeededLibrary *l = node->Data();
|
| 2296 |
if ( l->sName.Compare(scriptName) && l->sAuthor.Compare(author) )
|
2296 |
if ( l->sName.Compare(scriptName) && l->sAuthor.Compare(author) )
|
| Line 2298... |
Line 2298... |
| 2298 |
}
|
2298 |
}
|
| 2299 |
|
2299 |
|
| 2300 |
return false;
|
2300 |
return false;
|
| 2301 |
}
|
2301 |
}
|
| 2302 |
|
2302 |
|
| 2303 |
SNeededLibrary *CBaseFile::FindPackageNeeded(const Utils::String &scriptName, const Utils::String &author)
|
2303 |
SNeededLibrary *CBaseFile::findPackageNeeded(const Utils::WString &scriptName, const Utils::WString &author)
|
| 2304 |
{
|
2304 |
{
|
| 2305 |
for ( CListNode<SNeededLibrary> *node = m_lNeededLibrarys.Front(); node; node = node->next() )
|
2305 |
for ( CListNode<SNeededLibrary> *node = m_lNeededLibrarys.Front(); node; node = node->next() )
|
| 2306 |
{
|
2306 |
{
|
| 2307 |
SNeededLibrary *l = node->Data();
|
2307 |
SNeededLibrary *l = node->Data();
|
| 2308 |
if ( l->sName.Compare(scriptName) && l->sAuthor.Compare(author) )
|
2308 |
if ( l->sName.Compare(scriptName) && l->sAuthor.Compare(author) )
|
| Line 2348... |
Line 2348... |
| 2348 |
removeFakePatchOrder(!after, scriptName, author);
|
2348 |
removeFakePatchOrder(!after, scriptName, author);
|
| 2349 |
|
2349 |
|
| 2350 |
list->pushBack(scriptName, author);
|
2350 |
list->pushBack(scriptName, author);
|
| 2351 |
}
|
2351 |
}
|
| 2352 |
}
|
2352 |
}
|
| 2353 |
void CBaseFile::AddNeededLibrary(const Utils::String &scriptName, const Utils::String &author, const Utils::String &minVersion)
|
2353 |
void CBaseFile::addNeededLibrary(const Utils::WString &scriptName, const Utils::WString &author, const Utils::String &minVersion)
|
| 2354 |
{
|
2354 |
{
|
| 2355 |
SNeededLibrary *l = this->FindPackageNeeded(scriptName, author);
|
2355 |
SNeededLibrary *l = this->findPackageNeeded(scriptName, author);
|
| 2356 |
if ( !l )
|
2356 |
if ( !l )
|
| 2357 |
{
|
2357 |
{
|
| 2358 |
l = new SNeededLibrary;
|
2358 |
l = new SNeededLibrary;
|
| 2359 |
l->sName = scriptName;
|
2359 |
l->sName = scriptName;
|
| 2360 |
l->sAuthor = author;
|
2360 |
l->sAuthor = author;
|
| 2361 |
m_lNeededLibrarys.push_back(l);
|
2361 |
m_lNeededLibrarys.push_back(l);
|
| 2362 |
}
|
2362 |
}
|
| 2363 |
l->sMinVersion = minVersion;
|
2363 |
l->sMinVersion = minVersion;
|
| 2364 |
}
|
2364 |
}
|
| 2365 |
|
2365 |
|
| 2366 |
void CBaseFile::RemovePackageNeeded(const Utils::String &scriptName, const Utils::String &author)
|
2366 |
void CBaseFile::removePackageNeeded(const Utils::WString &scriptName, const Utils::WString &author)
|
| 2367 |
{
|
2367 |
{
|
| 2368 |
SNeededLibrary *l = this->FindPackageNeeded(scriptName, author);
|
2368 |
SNeededLibrary *l = this->findPackageNeeded(scriptName, author);
|
| 2369 |
if ( l )
|
2369 |
if ( l )
|
| 2370 |
{
|
2370 |
{
|
| 2371 |
m_lNeededLibrarys.remove(l);
|
2371 |
m_lNeededLibrarys.remove(l);
|
| 2372 |
delete l;
|
2372 |
delete l;
|
| 2373 |
}
|
2373 |
}
|
| 2374 |
}
|
2374 |
}
|
| 2375 |
|
2375 |
|
| 2376 |
void CBaseFile::ClearNeededPackages()
|
2376 |
void CBaseFile::ClearNeededPackages()
|
| 2377 |
{
|
2377 |
{
|
| 2378 |
SNeededLibrary *ns = this->FindPackageNeeded("<package>", "<author>");
|
2378 |
SNeededLibrary *ns = this->findPackageNeeded(L"<package>", L"<author>");
|
| 2379 |
Utils::String version;
|
2379 |
Utils::String version;
|
| 2380 |
if ( ns ) version = ns->sMinVersion;
|
2380 |
if ( ns ) version = ns->sMinVersion;
|
| 2381 |
|
2381 |
|
| 2382 |
for ( CListNode<SNeededLibrary> *node = m_lNeededLibrarys.Front(); node; node = node->next() )
|
2382 |
for ( CListNode<SNeededLibrary> *node = m_lNeededLibrarys.Front(); node; node = node->next() )
|
| 2383 |
node->DeleteData();
|
2383 |
node->DeleteData();
|
| 2384 |
m_lNeededLibrarys.clear();
|
2384 |
m_lNeededLibrarys.clear();
|
| 2385 |
|
2385 |
|
| 2386 |
if ( !version.empty() ) this->AddNeededLibrary("<package>", "<author>", version);
|
2386 |
if ( !version.empty() ) this->addNeededLibrary(L"<package>", L"<author>", version);
|
| 2387 |
}
|
2387 |
}
|
| 2388 |
|
2388 |
|
| 2389 |
|
2389 |
|
| 2390 |
bool CBaseFile::GeneratePackagerScript(bool wildcard, Utils::CStringList *list, int game, const Utils::CStringList &gameAddons, bool datafile)
|
2390 |
bool CBaseFile::GeneratePackagerScript(bool wildcard, Utils::CStringList *list, int game, const Utils::CStringList &gameAddons, bool datafile)
|
| 2391 |
{
|
2391 |
{
|
| Line 2400... |
Line 2400... |
| 2400 |
list->pushBack("# $PATH variable is used to get the current path");
|
2400 |
list->pushBack("# $PATH variable is used to get the current path");
|
| 2401 |
list->pushBack("Variable: $GAMEDIR $PATH");
|
2401 |
list->pushBack("Variable: $GAMEDIR $PATH");
|
| 2402 |
list->pushBack("");
|
2402 |
list->pushBack("");
|
| 2403 |
}
|
2403 |
}
|
| 2404 |
list->pushBack("# The name of the script");
|
2404 |
list->pushBack("# The name of the script");
|
| 2405 |
list->pushBack("Name: " + this->name());
|
2405 |
list->pushBack("Name: " + this->name().toString());
|
| 2406 |
list->pushBack("");
|
2406 |
list->pushBack("");
|
| 2407 |
list->pushBack("# The author of the script, ie, you");
|
2407 |
list->pushBack("# The author of the script, ie, you");
|
| 2408 |
list->pushBack("Author: " + this->author());
|
2408 |
list->pushBack("Author: " + this->author().toString());
|
| 2409 |
list->pushBack("");
|
2409 |
list->pushBack("");
|
| 2410 |
list->pushBack("# The creation data, when it was created");
|
2410 |
list->pushBack("# The creation data, when it was created");
|
| 2411 |
if ( datafile )
|
2411 |
if ( datafile )
|
| 2412 |
list->pushBack("Date: " + this->creationDate());
|
2412 |
list->pushBack("Date: " + this->creationDate());
|
| 2413 |
else {
|
2413 |
else {
|
| Line 2496... |
Line 2496... |
| 2496 |
|
2496 |
|
| 2497 |
if ( m_lNeededLibrarys.size() )
|
2497 |
if ( m_lNeededLibrarys.size() )
|
| 2498 |
{
|
2498 |
{
|
| 2499 |
list->pushBack("# Needed Library dependacies, require these to be installed");
|
2499 |
list->pushBack("# Needed Library dependacies, require these to be installed");
|
| 2500 |
for ( CListNode<SNeededLibrary> *node = m_lNeededLibrarys.Front(); node; node = node->next() )
|
2500 |
for ( CListNode<SNeededLibrary> *node = m_lNeededLibrarys.Front(); node; node = node->next() )
|
| 2501 |
list->pushBack("Depend: " + node->Data()->sName + "|" + node->Data()->sMinVersion + "|" + node->Data()->sAuthor);
|
2501 |
list->pushBack("Depend: " + node->Data()->sName.toString() + "|" + node->Data()->sMinVersion + "|" + node->Data()->sAuthor.toString());
|
| 2502 |
|
2502 |
|
| 2503 |
list->pushBack("");
|
2503 |
list->pushBack("");
|
| 2504 |
}
|
2504 |
}
|
| 2505 |
|
2505 |
|
| 2506 |
if ( !_noRatings() )
|
2506 |
if ( !_noRatings() )
|
| Line 2661... |
Line 2661... |
| 2661 |
}
|
2661 |
}
|
| 2662 |
|
2662 |
|
| 2663 |
return true;
|
2663 |
return true;
|
| 2664 |
}
|
2664 |
}
|
| 2665 |
|
2665 |
|
| 2666 |
Utils::String CBaseFile::getAutosaveName() const
|
2666 |
Utils::WString CBaseFile::getAutosaveName() const
|
| 2667 |
{
|
2667 |
{
|
| 2668 |
return this->name() + "-V" + this->version() + "-" + this->creationDate().findReplace("/", ".");
|
2668 |
return this->name() + L"-V" + this->version().toWString() + L"-" + this->creationDate().findReplace("/", ".").toWString();
|
| 2669 |
}
|
2669 |
}
|
| 2670 |
|
2670 |
|
| 2671 |
bool CBaseFile::CheckGameCompatability(int game)
|
2671 |
bool CBaseFile::CheckGameCompatability(int game)
|
| 2672 |
{
|
2672 |
{
|
| 2673 |
if ( m_lGames.empty() )
|
2673 |
if ( m_lGames.empty() )
|
| Line 2758... |
Line 2758... |
| 2758 |
if (this->GetType() == TYPE_XSP)
|
2758 |
if (this->GetType() == TYPE_XSP)
|
| 2759 |
filename = filename.findReplace(L"$AUTOSAVE", L"$NAME-V$VERSION-$CDATE.xsp");
|
2759 |
filename = filename.findReplace(L"$AUTOSAVE", L"$NAME-V$VERSION-$CDATE.xsp");
|
| 2760 |
else
|
2760 |
else
|
| 2761 |
filename = filename.findReplace(L"$AUTOSAVE", L"$NAME-V$VERSION-$CDATE.spk");
|
2761 |
filename = filename.findReplace(L"$AUTOSAVE", L"$NAME-V$VERSION-$CDATE.spk");
|
| 2762 |
}
|
2762 |
}
|
| 2763 |
filename = filename.findReplace(L"$NAME", this->name().remove(' ').toWString());
|
2763 |
filename = filename.findReplace(L"$NAME", this->name().remove(L' '));
|
| 2764 |
filename = filename.findReplace(L"$AUTHOR", this->author().remove(' ').toWString());
|
2764 |
filename = filename.findReplace(L"$AUTHOR", this->author().remove(L' '));
|
| 2765 |
filename = filename.findReplace(L"$DATE", cdate);
|
2765 |
filename = filename.findReplace(L"$DATE", cdate);
|
| 2766 |
filename = filename.findReplace(L"$CDATE", cdate);
|
2766 |
filename = filename.findReplace(L"$CDATE", cdate);
|
| 2767 |
filename = filename.findReplace(L"$VERSION", this->version());
|
2767 |
filename = filename.findReplace(L"$VERSION", this->version());
|
| 2768 |
|
2768 |
|
| 2769 |
return filename;
|
2769 |
return filename;
|
| Line 2829... |
Line 2829... |
| 2829 |
{
|
2829 |
{
|
| 2830 |
Utils::WString version = sRest.token(L"|", 2);
|
2830 |
Utils::WString version = sRest.token(L"|", 2);
|
| 2831 |
Utils::WString name = sRest.token(L"|", 1);
|
2831 |
Utils::WString name = sRest.token(L"|", 1);
|
| 2832 |
Utils::WString author = sRest.tokens(L"|", 3);
|
2832 |
Utils::WString author = sRest.tokens(L"|", 3);
|
| 2833 |
|
2833 |
|
| 2834 |
this->AddNeededLibrary(name.toString(), author.toString(), version.toString());
|
2834 |
this->addNeededLibrary(name, author, version.toString());
|
| 2835 |
}
|
2835 |
}
|
| 2836 |
else if (sFirst.Compare(L"DependPackage"))
|
2836 |
else if (sFirst.Compare(L"DependPackage"))
|
| 2837 |
{
|
2837 |
{
|
| 2838 |
CPackages p;
|
2838 |
CPackages p;
|
| 2839 |
CBaseFile *spk = p.openPackage(sRest, 0, 0, SPKREAD_VALUES);
|
2839 |
CBaseFile *spk = p.openPackage(sRest, 0, 0, SPKREAD_VALUES);
|
| 2840 |
if (spk)
|
2840 |
if (spk)
|
| 2841 |
{
|
2841 |
{
|
| 2842 |
this->AddNeededLibrary(spk->name(), spk->author(), spk->version());
|
2842 |
this->addNeededLibrary(spk->name(), spk->author(), spk->version());
|
| 2843 |
delete spk;
|
2843 |
delete spk;
|
| 2844 |
}
|
2844 |
}
|
| 2845 |
}
|
2845 |
}
|
| 2846 |
else if (sFirst.Compare(L"Icon"))
|
2846 |
else if (sFirst.Compare(L"Icon"))
|
| 2847 |
{
|
2847 |
{
|
| Line 3192... |
Line 3192... |
| 3192 |
_changed();
|
3192 |
_changed();
|
| 3193 |
}
|
3193 |
}
|
| 3194 |
|
3194 |
|
| 3195 |
Utils::WString CBaseFile::createUpdateFile(const Utils::WString &dir) const
|
3195 |
Utils::WString CBaseFile::createUpdateFile(const Utils::WString &dir) const
|
| 3196 |
{
|
3196 |
{
|
| 3197 |
Utils::WString file = this->getNameValidFile() + L"_" + this->author().toWString() + L".dat";
|
3197 |
Utils::WString file = this->getNameValidFile() + L"_" + this->author() + L".dat";
|
| 3198 |
file.removeChar(' ');
|
3198 |
file.removeChar(' ');
|
| 3199 |
|
3199 |
|
| 3200 |
Utils::CStringList write;
|
3200 |
Utils::WStringList write;
|
| 3201 |
write.pushBack("Package: " + this->name());
|
3201 |
write.pushBack(L"Package: " + this->name());
|
| 3202 |
write.pushBack("Author: " + this->author());
|
3202 |
write.pushBack(L"Author: " + this->author());
|
| 3203 |
write.pushBack("Version: " + this->version());
|
3203 |
write.pushBack(L"Version: " + this->version().toWString());
|
| 3204 |
write.pushBack("File: " + CFileIO(this->filename()).filename().toString());
|
3204 |
write.pushBack(L"File: " + CFileIO(this->filename()).filename());
|
| 3205 |
|
3205 |
|
| 3206 |
CFileIO File(dir + L"/" + file);
|
3206 |
CFileIO File(dir + L"/" + file);
|
| 3207 |
if (File.writeFile(&write))
|
3207 |
if (File.writeFile(&write))
|
| 3208 |
return File.fullFilename();
|
3208 |
return File.fullFilename();
|
| 3209 |
return Utils::WString::Null();
|
3209 |
return Utils::WString::Null();
|