| Line 2415... |
Line 2415... |
| 2415 |
if ( m_sCurrentDir.Empty() )
|
2415 |
if ( m_sCurrentDir.Empty() )
|
| 2416 |
return true;
|
2416 |
return true;
|
| 2417 |
if ( !m_bLoaded )
|
2417 |
if ( !m_bLoaded )
|
| 2418 |
return true;
|
2418 |
return true;
|
| 2419 |
|
2419 |
|
| - |
|
2420 |
CLog::log(CLog::Log_Directory, 1, "closing directory: " + m_sCurrentDir.ToString());
|
| 2420 |
m_sActiveDir = m_sCurrentDir;
|
2421 |
m_sActiveDir = m_sCurrentDir;
|
| 2421 |
|
2422 |
|
| 2422 |
if ( m_bRenameText )
|
2423 |
if ( m_bRenameText ) {
|
| - |
|
2424 |
CLog::log(CLog::Log_Directory, 2, "Creating other language files for game");
|
| 2423 |
CreateLanguageTextFiles(errors);
|
2425 |
CreateLanguageTextFiles(errors);
|
| - |
|
2426 |
}
|
| 2424 |
|
2427 |
|
| - |
|
2428 |
CLog::log(CLog::Log_Directory, 2, "Backing up save game files");
|
| 2425 |
this->BackupSaves();
|
2429 |
this->BackupSaves();
|
| 2426 |
|
2430 |
|
| 2427 |
if ( CFileIO(m_sCurrentDir + "/mods/PluginManager.dat").ExistsOld() )
|
2431 |
if ( CFileIO(m_sCurrentDir + "/mods/PluginManager.dat").ExistsOld() ) {
|
| - |
|
2432 |
CLog::log(CLog::Log_IO, 3, "Removing old PluginManager.dat file");
|
| 2428 |
CFileIO::Remove(m_sCurrentDir.ToString() + "/mods/PluginManager.dat");
|
2433 |
CFileIO::Remove(m_sCurrentDir.ToString() + "/mods/PluginManager.dat");
|
| - |
|
2434 |
}
|
| 2429 |
if ( CFileIO(m_sCurrentDir + "/mods/PluginManager.cat").ExistsOld() )
|
2435 |
if ( CFileIO(m_sCurrentDir + "/mods/PluginManager.cat").ExistsOld() ) {
|
| - |
|
2436 |
CLog::log(CLog::Log_IO, 3, "Removing old PluginManager.cat file");
|
| 2430 |
CFileIO::Remove(m_sCurrentDir.ToString() + "/mods/PluginManager.cat");
|
2437 |
CFileIO::Remove(m_sCurrentDir.ToString() + "/mods/PluginManager.cat");
|
| - |
|
2438 |
}
|
| 2431 |
|
2439 |
|
| 2432 |
if ( !m_bVanilla )
|
2440 |
if ( !m_bVanilla )
|
| 2433 |
{
|
2441 |
{
|
| 2434 |
// base mode for Reunion
|
2442 |
// base mode for Reunion
|
| 2435 |
if ( m_iGame == GAME_X3 && m_pEnabledMod )
|
2443 |
if ( m_iGame == GAME_X3 && m_pEnabledMod )
|
| Line 2451... |
Line 2459... |
| 2451 |
}
|
2459 |
}
|
| 2452 |
}
|
2460 |
}
|
| 2453 |
}
|
2461 |
}
|
| 2454 |
else if ( m_iGame == GAME_X3 && !m_sSetMod.Empty() && CFileIO(m_sCurrentDir + "/mods/" + m_sSetMod + ".cat").ExistsOld() && CFileIO(m_sCurrentDir + "/mods/" + m_sSetMod + ".dat").ExistsOld() )
|
2462 |
else if ( m_iGame == GAME_X3 && !m_sSetMod.Empty() && CFileIO(m_sCurrentDir + "/mods/" + m_sSetMod + ".cat").ExistsOld() && CFileIO(m_sCurrentDir + "/mods/" + m_sSetMod + ".dat").ExistsOld() )
|
| 2455 |
{
|
2463 |
{
|
| - |
|
2464 |
CLog::log(CLog::Log_Directory, 2, "Copying mod file: " + m_sSetMod.ToString() + ", to PluginManager.cat");
|
| 2456 |
CFileIO(m_sCurrentDir + "/mods/" + m_sSetMod + ".dat").copy(m_sCurrentDir.ToString() + "/mods/PluginManager.dat");
|
2465 |
CFileIO(m_sCurrentDir + "/mods/" + m_sSetMod + ".dat").copy(m_sCurrentDir.ToString() + "/mods/PluginManager.dat");
|
| 2457 |
CFileIO(m_sCurrentDir + "/mods/" + m_sSetMod + ".cat").copy(m_sCurrentDir.ToString() + "/mods/PluginManager.cat");
|
2466 |
CFileIO(m_sCurrentDir + "/mods/" + m_sSetMod + ".cat").copy(m_sCurrentDir.ToString() + "/mods/PluginManager.cat");
|
| 2458 |
}
|
2467 |
}
|
| 2459 |
|
2468 |
|
| 2460 |
if ( !CDirIO(m_sCurrentDir).Exists("mods") )
|
2469 |
if ( !CDirIO(m_sCurrentDir).Exists("mods") )
|
| Line 2517... |
Line 2526... |
| 2517 |
|
2526 |
|
| 2518 |
}
|
2527 |
}
|
| 2519 |
|
2528 |
|
| 2520 |
bool CPackages::RestoreFakePatch()
|
2529 |
bool CPackages::RestoreFakePatch()
|
| 2521 |
{
|
2530 |
{
|
| - |
|
2531 |
CLog::log(CLog::Log_Directory, 1, "Restoring PluginManager fake patch into game");
|
| 2522 |
m_iFakePatch = -1;
|
2532 |
m_iFakePatch = -1;
|
| 2523 |
|
2533 |
|
| 2524 |
CFileIO catFile(m_sCurrentDir + "/PluginManager/PlugMan_Fake.cat");
|
2534 |
CFileIO catFile(m_sCurrentDir + "/PluginManager/PlugMan_Fake.cat");
|
| 2525 |
CFileIO datFile(m_sCurrentDir + "/PluginManager/PlugMan_Fake.dat");
|
2535 |
CFileIO datFile(m_sCurrentDir + "/PluginManager/PlugMan_Fake.dat");
|
| 2526 |
|
2536 |
|
| 2527 |
// if only 1 exists, remove it
|
2537 |
// if only 1 exists, remove it
|
| 2528 |
if ( catFile.exists() && !datFile.exists() ) {
|
2538 |
if ( catFile.exists() && !datFile.exists() ) {
|
| - |
|
2539 |
CLog::log(CLog::Log_Directory, 1, "WARNING: cat/dat file mismatch, dat file seems to be missing, removing cat file");
|
| 2529 |
if ( !catFile.remove() ) return false;
|
2540 |
if ( !catFile.remove() ) return false;
|
| 2530 |
}
|
2541 |
}
|
| 2531 |
else if ( !catFile.exists() && datFile.exists() ) {
|
2542 |
else if ( !catFile.exists() && datFile.exists() ) {
|
| - |
|
2543 |
CLog::log(CLog::Log_Directory, 1, "WARNING: cat/dat file mismatch, cat file seems to be missing, removing dat file");
|
| 2532 |
if ( !datFile.remove() ) return false;
|
2544 |
if ( !datFile.remove() ) return false;
|
| 2533 |
}
|
2545 |
}
|
| 2534 |
|
2546 |
|
| 2535 |
// if both exists, lets rename them
|
2547 |
// if both exists, lets rename them
|
| 2536 |
if ( catFile.exists() && datFile.exists() )
|
2548 |
if ( catFile.exists() && datFile.exists() )
|
| 2537 |
{
|
2549 |
{
|
| - |
|
2550 |
CLog::log(CLog::Log_Directory, 3, "Creating pluginmanagerfake.txt file to add to Fake Patch");
|
| 2538 |
// we need to add the plugin manager file in
|
2551 |
// we need to add the plugin manager file in
|
| 2539 |
CyString file = m_sTempDir;
|
2552 |
CyString file = m_sTempDir;
|
| 2540 |
if ( !file.Empty() )
|
2553 |
if ( !file.Empty() )
|
| 2541 |
file += "/";
|
2554 |
file += "/";
|
| 2542 |
file += "pluginmanagerfake.txt";
|
2555 |
file += "pluginmanagerfake.txt";
|
| 2543 |
file = file.FindReplace("\\", "/");
|
2556 |
file = file.FindReplace("\\", "/");
|
| 2544 |
CFileIO fakeFile(file);
|
2557 |
CFileIO fakeFile(file);
|
| 2545 |
std::vector<CyString> lines;
|
2558 |
std::vector<CyString> lines;
|
| 2546 |
lines.push_back("//pluginmanager fake patch");
|
2559 |
lines.push_back("//pluginmanager fake patch");
|
| - |
|
2560 |
CLog::log(CLog::Log_Directory, 3, "Writing pluginmanagerfake.txt file to add to Fake Patch");
|
| 2547 |
fakeFile.WriteFile(&lines);
|
2561 |
if ( !fakeFile.WriteFile(&lines) ) {
|
| - |
|
2562 |
CLog::log(CLog::Log_Directory, 3, "Writing pluginmanagerfake.txt failed!!");
|
| 2548 |
|
2563 |
}
|
| - |
|
2564 |
else {
|
| - |
|
2565 |
CLog::log(CLog::Log_Directory, 2, "Adding TFake.pck file into FakePatch");
|
| 2549 |
CCatFile fakePatch;
|
2566 |
CCatFile fakePatch;
|
| 2550 |
if ( fakePatch.Open(m_sCurrentDir + "/PluginManager/PlugMan_Fake.cat", this->GetAddonDir(), CATREAD_DAT, false) == CATERR_NONE )
|
2567 |
if ( fakePatch.Open(m_sCurrentDir + "/PluginManager/PlugMan_Fake.cat", this->GetAddonDir(), CATREAD_DAT, false) == CATERR_NONE )
|
| 2551 |
{
|
- |
|
| 2552 |
if ( fakePatch.AppendFile(file.ToString(), "PlugMan\\TFake.pck") )
|
- |
|
| 2553 |
{
|
2568 |
{
|
| 2554 |
// find next available fake patch
|
- |
|
| 2555 |
m_iFakePatch = this->FindNextFakePatch();
|
2569 |
if ( fakePatch.AppendFile(file.ToString(), "PlugMan\\TFake.pck") )
|
| 2556 |
fakePatch.WriteCatFile();
|
2570 |
fakePatch.WriteCatFile();
|
| - |
|
2571 |
}
|
| - |
|
2572 |
}
|
| 2557 |
|
2573 |
|
| 2558 |
CyString filename = CyString::Number(m_iFakePatch).PadNumber(2);
|
2574 |
// find next available fake patch
|
| 2559 |
if ( catFile.Rename(m_sCurrentDir + "/" + filename + ".cat") )
|
2575 |
m_iFakePatch = this->FindNextFakePatch();
|
| 2560 |
{
|
- |
|
| 2561 |
if ( datFile.Rename(m_sCurrentDir + "/" + filename + ".dat") ){
|
2576 |
CLog::log(CLog::Log_Directory, 2, "Finding next available fake patch number: " + (long)m_iFakePatch);
|
| 2562 |
fakeFile.remove();
|
- |
|
| 2563 |
return true;
|
- |
|
| 2564 |
}
|
- |
|
| 2565 |
|
2577 |
|
| - |
|
2578 |
Utils::String filename = Utils::String::PadNumber(m_iFakePatch, 2);
|
| - |
|
2579 |
CLog::log(CLog::Log_Directory, 2, "Renaming cat file to: " + filename + ".cat");
|
| - |
|
2580 |
if ( catFile.Rename(m_sCurrentDir + "/" + filename + ".cat") )
|
| - |
|
2581 |
{
|
| - |
|
2582 |
CLog::log(CLog::Log_Directory, 2, "Renaming dat file to: " + filename + ".dat");
|
| - |
|
2583 |
if ( datFile.Rename(m_sCurrentDir + "/" + filename + ".dat") ){
|
| - |
|
2584 |
CLog::log(CLog::Log_Directory, 3, "Deleting pluginmanagerfake.txt temporary file");
|
| 2566 |
// TODO: restore cat file
|
2585 |
fakeFile.remove();
|
| - |
|
2586 |
return true;
|
| 2567 |
}
|
2587 |
}
|
| - |
|
2588 |
else {
|
| - |
|
2589 |
CLog::log(CLog::Log_Directory, 2, "ERROR: failed to rename dat file");
|
| 2568 |
}
|
2590 |
}
|
| - |
|
2591 |
|
| - |
|
2592 |
// TODO: restore cat file
|
| - |
|
2593 |
}
|
| - |
|
2594 |
else {
|
| - |
|
2595 |
CLog::log(CLog::Log_Directory, 2, "ERROR: failed to rename cat file");
|
| 2569 |
}
|
2596 |
}
|
| 2570 |
|
2597 |
|
| - |
|
2598 |
CLog::log(CLog::Log_Directory, 3, "Deleting pluginmanagerfake.txt temporary file");
|
| 2571 |
fakeFile.remove();
|
2599 |
fakeFile.remove();
|
| 2572 |
return false;
|
2600 |
return false;
|
| 2573 |
}
|
2601 |
}
|
| 2574 |
|
2602 |
|
| 2575 |
return true;
|
2603 |
return true;
|
| Line 2584... |
Line 2612... |
| 2584 |
void CPackages::WriteData()
|
2612 |
void CPackages::WriteData()
|
| 2585 |
{
|
2613 |
{
|
| 2586 |
if ( m_sCurrentDir.Empty() )
|
2614 |
if ( m_sCurrentDir.Empty() )
|
| 2587 |
return;
|
2615 |
return;
|
| 2588 |
|
2616 |
|
| - |
|
2617 |
CLog::log(CLog::Log_Directory, 1, "Writing data file for current directory: " + m_sCurrentDir.ToString());
|
| - |
|
2618 |
|
| 2589 |
CyStringList lines;
|
2619 |
CyStringList lines;
|
| 2590 |
CyString version;
|
2620 |
CyString version;
|
| 2591 |
version.FromFloat(GetLibraryVersion(), 2);
|
2621 |
version.FromFloat(GetLibraryVersion(), 2);
|
| 2592 |
version.Prepend("SpkInstaller: ");
|
2622 |
version.Prepend("SpkInstaller: ");
|
| 2593 |
lines.PushBack(version);
|
2623 |
lines.PushBack(version);
|
| Line 2767... |
Line 2797... |
| 2767 |
lines.PushBack(fileline);
|
2797 |
lines.PushBack(fileline);
|
| 2768 |
}
|
2798 |
}
|
| 2769 |
|
2799 |
|
| 2770 |
lines.PushBack("</scripts>");
|
2800 |
lines.PushBack("</scripts>");
|
| 2771 |
|
2801 |
|
| 2772 |
CFileIO datFile(m_sCurrentDir + "/PluginManager/PluginManager.dat");
|
2802 |
CFileIO datFile(m_sCurrentDir + "/PluginManager/PluginManager.new");
|
| 2773 |
|
2803 |
|
| 2774 |
CDirIO Dir(m_sCurrentDir);
|
2804 |
CDirIO Dir(m_sCurrentDir);
|
| 2775 |
if ( !Dir.Exists("PluginManager") )
|
2805 |
if ( !Dir.Exists("PluginManager") ) {
|
| - |
|
2806 |
CLog::log(CLog::Log_IO, 2, "Creating PluginManager directory");
|
| 2776 |
Dir.Create("PluginManager");
|
2807 |
Dir.Create("PluginManager");
|
| 2777 |
|
2808 |
}
|
| 2778 |
|
2809 |
|
| - |
|
2810 |
CLog::log(CLog::Log_IO, 2, "Writing data file: " + m_sCurrentDir.ToString() + "/PluginManager/PluginManager.new");
|
| 2779 |
if ( !datFile.WriteFile(&lines) )
|
2811 |
if ( !datFile.WriteFile(&lines) )
|
| 2780 |
{
|
2812 |
{
|
| - |
|
2813 |
CLog::log(CLog::Log_IO, 1, "ERROR: Failed to write data file");
|
| - |
|
2814 |
}
|
| - |
|
2815 |
else {
|
| - |
|
2816 |
CLog::log(CLog::Log_IO, 2, "Removing old data file: " + m_sCurrentDir.ToString() + "/PluginManager/PluginManager.dat");
|
| - |
|
2817 |
if ( !CFileIO::Exists(m_sCurrentDir.ToString() + "/PluginManager/PluginManager.dat") || CFileIO::Remove(m_sCurrentDir.ToString() + "/PluginManager/PluginManager.dat") ) {
|
| - |
|
2818 |
CLog::log(CLog::Log_IO, 2, "Renaming data file: PluginManager.new => PluginManager.dat");
|
| - |
|
2819 |
datFile.Rename(m_sCurrentDir + "/PluginManager/PluginManager.dat");
|
| - |
|
2820 |
}
|
| 2781 |
}
|
2821 |
}
|
| 2782 |
}
|
2822 |
}
|
| 2783 |
|
2823 |
|
| 2784 |
|
2824 |
|
| 2785 |
/**
|
2825 |
/**
|
| Line 5416... |
Line 5456... |
| 5416 |
CLEANSPLIT(empStr, empEntries);
|
5456 |
CLEANSPLIT(empStr, empEntries);
|
| 5417 |
}
|
5457 |
}
|
| 5418 |
}
|
5458 |
}
|
| 5419 |
}
|
5459 |
}
|
| 5420 |
|
5460 |
|
| 5421 |
CyString parseXmlText(const CyString &str)
|
5461 |
Utils::String parseXmlText(const Utils::String &str)
|
| 5422 |
{
|
5462 |
{
|
| 5423 |
CyString newStr(str);
|
5463 |
Utils::String newStr(str);
|
| 5424 |
CyStringList changes;
|
5464 |
CyStringList changes;
|
| 5425 |
|
5465 |
|
| 5426 |
// find all XML commands, &<command>;
|
5466 |
// find all XML commands, &<command>;
|
| 5427 |
std::string sStr = str.ToString();
|
5467 |
Utils::String sStr = str;
|
| 5428 |
std::string::size_type pos = sStr.find_first_of("&", 0);
|
5468 |
Utils::String::size_type pos = sStr.find_first_of("&", 0);
|
| 5429 |
while ( pos != std::string::npos ) {
|
5469 |
while ( pos != Utils::String::npos ) {
|
| 5430 |
// find the next space and next ;. If ; comes first, assume its acommand
|
5470 |
// find the next space and next ;. If ; comes first, assume its acommand
|
| 5431 |
std::string::size_type spacePos = sStr.find_first_of(" ", pos);
|
5471 |
Utils::String::size_type spacePos = sStr.find_first_of(" ", pos);
|
| 5432 |
std::string::size_type colonPos = sStr.find_first_of(";", pos);
|
5472 |
Utils::String::size_type colonPos = sStr.find_first_of(";", pos);
|
| 5433 |
if ( colonPos != std::string::npos && colonPos < spacePos ) {
|
5473 |
if ( colonPos != Utils::String::npos && colonPos < spacePos ) {
|
| 5434 |
// replace with <::command::> so they the & doesn't get replaced
|
5474 |
// replace with <::command::> so they the & doesn't get replaced
|
| 5435 |
std::string repStr = sStr.substr(pos, (colonPos + 1) - pos);
|
5475 |
Utils::String repStr = sStr.substr(pos, (colonPos + 1) - pos);
|
| 5436 |
std::string repWithStr = "<::" + sStr.substr(pos + 1, colonPos - pos - 1) + "::>";
|
5476 |
Utils::String repWithStr = "<::" + sStr.substr(pos + 1, colonPos - pos - 1) + "::>";
|
| 5437 |
newStr.FindReplace(repStr, repWithStr);
|
5477 |
newStr = newStr.findReplace(repStr, repWithStr);
|
| 5438 |
changes.PushBack(repStr, repWithStr);
|
5478 |
changes.PushBack(CyString(repStr), CyString(repWithStr));
|
| 5439 |
}
|
5479 |
}
|
| 5440 |
|
5480 |
|
| 5441 |
// find the next command
|
5481 |
// find the next command
|
| 5442 |
pos = sStr.find_first_of("&", pos + 1);
|
5482 |
pos = sStr.find_first_of("&", pos + 1);
|
| 5443 |
}
|
5483 |
}
|
| 5444 |
|
5484 |
|
| 5445 |
// replace the & now
|
5485 |
// replace the & now
|
| 5446 |
newStr = newStr.FindReplace("&", "&");
|
5486 |
newStr = newStr.findReplace("&", "&");
|
| 5447 |
|
5487 |
|
| 5448 |
// restore the commands
|
5488 |
// restore the commands
|
| 5449 |
for ( SStringList *strNode = changes.Head(); strNode; strNode = strNode->next ) {
|
5489 |
for ( SStringList *strNode = changes.Head(); strNode; strNode = strNode->next ) {
|
| 5450 |
newStr.FindReplace(strNode->data, strNode->str);
|
5490 |
newStr = newStr.findReplace(strNode->data.ToString(), strNode->str.ToString());
|
| 5451 |
}
|
5491 |
}
|
| 5452 |
|
5492 |
|
| 5453 |
return newStr;
|
5493 |
return newStr;
|
| 5454 |
}
|
5494 |
}
|
| 5455 |
|
5495 |
|
| 5456 |
CyString CPackages::ConvertTextString(CyString text)
|
5496 |
Utils::String CPackages::ConvertTextString(const Utils::String &sText)
|
| 5457 |
{
|
5497 |
{
|
| 5458 |
//process any &
|
5498 |
//process any &
|
| 5459 |
text = parseXmlText(text);
|
5499 |
Utils::String text = parseXmlText(sText);
|
| 5460 |
|
5500 |
|
| 5461 |
// change special cases
|
5501 |
// change special cases
|
| 5462 |
text = text.FindReplace("(", "\\(");
|
5502 |
text = text.findReplace("(", "\\(");
|
| 5463 |
text = text.FindReplace(")", "\\)");
|
5503 |
text = text.findReplace(")", "\\)");
|
| 5464 |
text = text.FindReplace("[", "{");
|
5504 |
text = text.findReplace("[", "{");
|
| 5465 |
text = text.FindReplace("]", "}");
|
5505 |
text = text.findReplace("]", "}");
|
| 5466 |
text = text.FindReplace(">", ">");
|
5506 |
text = text.findReplace(">", ">");
|
| 5467 |
text = text.FindReplace("<", "<");
|
5507 |
text = text.findReplace("<", "<");
|
| 5468 |
return text;
|
5508 |
return text;
|
| 5469 |
}
|
5509 |
}
|
| 5470 |
|
5510 |
|
| 5471 |
int CPackages::_gameTextNumber() const
|
5511 |
int CPackages::_gameTextNumber() const
|
| 5472 |
{
|
5512 |
{
|
| Line 5598... |
Line 5638... |
| 5598 |
|
5638 |
|
| 5599 |
CyString sTextCount((long)textCount);
|
5639 |
CyString sTextCount((long)textCount);
|
| 5600 |
writeData.push_back(CyString(" <t id=\"") + (long)start + "\">" + this->ConvertTextString(p->name()) + "</t>");
|
5640 |
writeData.push_back(CyString(" <t id=\"") + (long)start + "\">" + this->ConvertTextString(p->name()) + "</t>");
|
| 5601 |
writeData.push_back(CyString(" <t id=\"") + (long)(start + 1) + "\">" + this->ConvertTextString(p->author()) + "</t>");
|
5641 |
writeData.push_back(CyString(" <t id=\"") + (long)(start + 1) + "\">" + this->ConvertTextString(p->author()) + "</t>");
|
| 5602 |
writeData.push_back(CyString(" <t id=\"") + (long)(start + 2) + "\">" + this->ConvertTextString(p->version()) + "</t>");
|
5642 |
writeData.push_back(CyString(" <t id=\"") + (long)(start + 2) + "\">" + this->ConvertTextString(p->version()) + "</t>");
|
| 5603 |
writeData.push_back(CyString(" <t id=\"") + (long)(start + 3) + "\">" + this->ConvertTextString(p->GetLanguageName(lang)) + "</t>");
|
5643 |
writeData.push_back(CyString(" <t id=\"") + (long)(start + 3) + "\">" + this->ConvertTextString(p->GetLanguageName(lang).ToString()) + "</t>");
|
| 5604 |
|
5644 |
|
| 5605 |
CLinkList<SSettingType> *settings = spk->GetSettingsList();
|
5645 |
CLinkList<SSettingType> *settings = spk->GetSettingsList();
|
| 5606 |
if ( settings && settings->size() )
|
5646 |
if ( settings && settings->size() )
|
| 5607 |
{
|
5647 |
{
|
| 5608 |
writeData.push_back(CyString(" <t id=\"") + (long)(start + 4) + "\">" + (long)settings->size() + "</t>");
|
5648 |
writeData.push_back(CyString(" <t id=\"") + (long)(start + 4) + "\">" + (long)settings->size() + "</t>");
|
| Line 5631... |
Line 5671... |
| 5631 |
writeData.push_back(CyString(" <t id=\"5\">") + CyString::Number(start) + "</t>");
|
5671 |
writeData.push_back(CyString(" <t id=\"5\">") + CyString::Number(start) + "</t>");
|
| 5632 |
for ( CListNode<SGameWare> *node = lWares.Front(); node; node = node->next() )
|
5672 |
for ( CListNode<SGameWare> *node = lWares.Front(); node; node = node->next() )
|
| 5633 |
{
|
5673 |
{
|
| 5634 |
SGameWare *w = node->Data();
|
5674 |
SGameWare *w = node->Data();
|
| 5635 |
if ( w->pWare && w->iType == WARETYPE_ADDED )
|
5675 |
if ( w->pWare && w->iType == WARETYPE_ADDED )
|
| 5636 |
writeData.push_back(CyString(" <t id=\"") + (long)start + "\">" + this->ConvertTextString(w->sWareName) + "</t>");
|
5676 |
writeData.push_back(CyString(" <t id=\"") + (long)start + "\">" + this->ConvertTextString(w->sWareName.ToString()) + "</t>");
|
| 5637 |
else
|
5677 |
else
|
| 5638 |
writeData.push_back(CyString(" <t id=\"") + (long)start + "\">-1</t>");
|
5678 |
writeData.push_back(CyString(" <t id=\"") + (long)start + "\">-1</t>");
|
| 5639 |
writeData.push_back(CyString(" <t id=\"") + (long)(start + 1) + "\">" + CyString((char)w->cType) + "</t>");
|
5679 |
writeData.push_back(CyString(" <t id=\"") + (long)(start + 1) + "\">" + CyString((char)w->cType) + "</t>");
|
| 5640 |
writeData.push_back(CyString(" <t id=\"") + (long)(start + 2) + "\">" + (long)w->iPos + "</t>");
|
5680 |
writeData.push_back(CyString(" <t id=\"") + (long)(start + 2) + "\">" + (long)w->iPos + "</t>");
|
| 5641 |
start += 10;
|
5681 |
start += 10;
|
| Line 5693... |
Line 5733... |
| 5693 |
SGameWare *w = node->Data();
|
5733 |
SGameWare *w = node->Data();
|
| 5694 |
if ( !w->pWare || w->iType != WARETYPE_ADDED )
|
5734 |
if ( !w->pWare || w->iType != WARETYPE_ADDED )
|
| 5695 |
continue;
|
5735 |
continue;
|
| 5696 |
|
5736 |
|
| 5697 |
// find the correct text for the language
|
5737 |
// find the correct text for the language
|
| 5698 |
CyString name = CSpkFile::GetWareText(w->pWare, m_iLanguage);
|
5738 |
Utils::String name = CSpkFile::GetWareText(w->pWare, m_iLanguage);
|
| 5699 |
CyString desc = CSpkFile::GetWareDesc(w->pWare, m_iLanguage);
|
5739 |
Utils::String desc = CSpkFile::GetWareDesc(w->pWare, m_iLanguage);
|
| 5700 |
if ( !name.Empty() )
|
5740 |
if ( !name.empty() )
|
| 5701 |
writeData.push_back(CyString(" <t id=\"") + (long)(w->iText + 3) + "\">" + this->ConvertTextString(name) + "</t>");
|
5741 |
writeData.push_back(CyString(" <t id=\"") + (long)(w->iText + 3) + "\">" + this->ConvertTextString(name) + "</t>");
|
| 5702 |
if ( !desc.Empty() )
|
5742 |
if ( !desc.empty() )
|
| 5703 |
writeData.push_back(CyString(" <t id=\"") + (long)(w->iText + 4) + "\">" + this->ConvertTextString(desc) + "</t>");
|
5743 |
writeData.push_back(CyString(" <t id=\"") + (long)(w->iText + 4) + "\">" + this->ConvertTextString(desc) + "</t>");
|
| 5704 |
}
|
5744 |
}
|
| 5705 |
for ( CListNode<SGameShip> *node = m_lGameShips.Front(); node; node = node->next() )
|
5745 |
for ( CListNode<SGameShip> *node = m_lGameShips.Front(); node; node = node->next() )
|
| 5706 |
{
|
5746 |
{
|
| 5707 |
SGameShip *s = node->Data();
|
5747 |
SGameShip *s = node->Data();
|
| 5708 |
if ( !s->pPackage || s->iType != WARETYPE_ADDED )
|
5748 |
if ( !s->pPackage || s->iType != WARETYPE_ADDED )
|
| 5709 |
continue;
|
5749 |
continue;
|
| 5710 |
if ( s->pPackage->GetOriginalDescription() )
|
5750 |
if ( s->pPackage->GetOriginalDescription() )
|
| 5711 |
continue;
|
5751 |
continue;
|
| 5712 |
|
5752 |
|
| 5713 |
CyString name = s->pPackage->GetTextName(m_iLanguage);
|
5753 |
Utils::String name = s->pPackage->GetTextName(m_iLanguage);
|
| 5714 |
CyString desc = s->pPackage->GetTextDescription(m_iLanguage);
|
5754 |
Utils::String desc = s->pPackage->GetTextDescription(m_iLanguage);
|
| 5715 |
if ( !name.Empty() )
|
5755 |
if ( !name.empty() )
|
| 5716 |
writeData.push_back(CyString(" <t id=\"") + (long)s->iText + "\">" + this->ConvertTextString(name) + "</t>");
|
5756 |
writeData.push_back(CyString(" <t id=\"") + (long)s->iText + "\">" + this->ConvertTextString(name) + "</t>");
|
| 5717 |
if ( !desc.Empty() )
|
5757 |
if ( !desc.empty() )
|
| 5718 |
writeData.push_back(CyString(" <t id=\"") + (long)(s->iText + 1) + "\">" + this->ConvertTextString(desc) + "</t>");
|
5758 |
writeData.push_back(CyString(" <t id=\"") + (long)(s->iText + 1) + "\">" + this->ConvertTextString(desc) + "</t>");
|
| 5719 |
}
|
5759 |
}
|
| 5720 |
writeData.push_back(CyString(" </page>"));
|
5760 |
writeData.push_back(CyString(" </page>"));
|
| 5721 |
}
|
5761 |
}
|
| 5722 |
writeData.push_back(CyString("</language>"));
|
5762 |
writeData.push_back(CyString("</language>"));
|