Subversion Repositories spk

Rev

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

Rev 197 Rev 203
Line 310... Line 310...
310
		return CBaseFile::ParseValueLine(sLine);
310
		return CBaseFile::ParseValueLine(sLine);
311
 
311
 
312
	return true;
312
	return true;
313
}
313
}
314
 
314
 
315
Utils::String CXspFile::GetShipName(int lang)
315
Utils::WString CXspFile::shipName(int lang)
316
{
316
{
317
	Utils::String name;
317
	Utils::WString name;
318
	if ( (m_bLanguageText) && (lang) )
318
	if ( (m_bLanguageText) && (lang) )
319
	{
319
	{
320
		for ( SText *text = m_lText.First(); text; text = m_lText.Next() )
320
		for ( SText *text = m_lText.First(); text; text = m_lText.Next() )
321
		{
321
		{
322
			if ( text->iId == lang )
322
			if ( text->iId == lang )
323
			{
323
			{
324
				name = text->sName;
324
				name = text->sName.toWString();
325
				break;
325
				break;
326
			}
326
			}
327
		}
327
		}
328
	}
328
	}
329
 
329
 
Line 1623... Line 1623...
1623
		return german;
1623
		return german;
1624
	// otherwise use any we've found (usually first one)
1624
	// otherwise use any we've found (usually first one)
1625
	return found;
1625
	return found;
1626
}
1626
}
1627
 
1627
 
1628
Utils::String CXspFile::GetTextName(int lang)
1628
Utils::WString CXspFile::getTextName(int lang)
1629
{
1629
{
1630
	SText *t = FindShipText(lang);
1630
	SText *t = FindShipText(lang);
1631
	if ( t )
1631
	if ( t )
1632
	{
1632
	{
1633
		// return the correct language text
1633
		// return the correct language text
Line 1642... Line 1642...
1642
				return t->sName;
1642
				return t->sName;
1643
		}
1643
		}
1644
	}
1644
	}
1645
 
1645
 
1646
	// still not found one, return the ships name
1646
	// still not found one, return the ships name
1647
	return this->GetShipName(lang);
1647
	return this->shipName(lang);
1648
}
1648
}
1649
 
1649
 
1650
Utils::String CXspFile::GetTextDescription(int lang)
1650
Utils::String CXspFile::GetTextDescription(int lang)
1651
{
1651
{
1652
	SText *t = FindShipText(lang);
1652
	SText *t = FindShipText(lang);
Line 1665... Line 1665...
1665
		}
1665
		}
1666
	}
1666
	}
1667
 
1667
 
1668
	// still not found one, return the ships name
1668
	// still not found one, return the ships name
1669
	if ( !this->description().empty() ) return this->description();
1669
	if ( !this->description().empty() ) return this->description();
1670
	return this->GetShipName(lang);
1670
	return this->shipName(lang).toString();
1671
}
1671
}
1672
 
1672
 
1673
bool CXspFile::startExtractShip(CVirtualFileSystem *pVfs, const Utils::String &sId, CProgressInfo *pProgress)
1673
bool CXspFile::startExtractShip(CVirtualFileSystem *pVfs, const Utils::String &sId, CProgressInfo *pProgress)
1674
{
1674
{
1675
	m_sID = sId.remove('\r');
1675
	m_sID = sId.remove('\r');