mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 23:08:05 -05:00
ZoneCommon: Add GameLanguagePrefix class and save known prefixes for languages in the game object
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
#include "ContentLoaderT6.h"
|
||||
#include "Game/T6/GameAssetPoolT6.h"
|
||||
#include "Game/T6/GameT6.h"
|
||||
#include "Game/GameLanguage.h"
|
||||
|
||||
const std::string ZoneLoaderFactoryT6::MAGIC_SIGNED_TREYARCH = "TAff0100";
|
||||
const std::string ZoneLoaderFactoryT6::MAGIC_SIGNED_ASSET_BUILDER = "ABff0100";
|
||||
@ -85,74 +86,19 @@ const uint8_t ZoneLoaderFactoryT6::RSA_PUBLIC_KEY_TREYARCH[]
|
||||
|
||||
class ZoneLoaderFactoryT6::ZoneLoaderFactoryT6Impl
|
||||
{
|
||||
static ZoneLanguage GetZoneLanguage(std::string& zoneName)
|
||||
static GameLanguage GetZoneLanguage(std::string& zoneName)
|
||||
{
|
||||
if(zoneName.compare(0, 3, "en_") == 0)
|
||||
auto languagePrefixes = g_GameT6.GetLanguagePrefixes();
|
||||
|
||||
for(const auto& languagePrefix : languagePrefixes)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_ENGLISH;
|
||||
}
|
||||
if(zoneName.compare(0, 3, "fr_") == 0)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_FRENCH;
|
||||
}
|
||||
if(zoneName.compare(0, 3, "fc_") == 0)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_FRENCH_CAN;
|
||||
}
|
||||
if(zoneName.compare(0, 3, "ge_") == 0)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_GERMAN;
|
||||
}
|
||||
if(zoneName.compare(0, 3, "as_") == 0)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_AUSTRIAN;
|
||||
}
|
||||
if(zoneName.compare(0, 3, "it_") == 0)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_ITALIAN;
|
||||
}
|
||||
if(zoneName.compare(0, 3, "sp_") == 0)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_SPANISH;
|
||||
}
|
||||
if(zoneName.compare(0, 3, "br_") == 0)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_BRITISH;
|
||||
}
|
||||
if(zoneName.compare(0, 3, "ru_") == 0)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_RUSSIAN;
|
||||
}
|
||||
if(zoneName.compare(0, 3, "po_") == 0)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_POLISH;
|
||||
}
|
||||
if(zoneName.compare(0, 3, "ko_") == 0)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_KOREAN;
|
||||
}
|
||||
if(zoneName.compare(0, 3, "ja_") == 0)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_JAPANESE;
|
||||
}
|
||||
if(zoneName.compare(0, 3, "cz_") == 0)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_CZECH;
|
||||
}
|
||||
if(zoneName.compare(0, 3, "fj_") == 0)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_FULL_JAPANESE;
|
||||
}
|
||||
if(zoneName.compare(0, 3, "bp_") == 0)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_PORTUGUESE;
|
||||
}
|
||||
if(zoneName.compare(0, 3, "ms_") == 0)
|
||||
{
|
||||
return ZoneLanguage::LANGUAGE_MEXICAN_SPANISH;
|
||||
if(zoneName.compare(0, languagePrefix.m_prefix.length(), languagePrefix.m_prefix) == 0)
|
||||
{
|
||||
return languagePrefix.m_language;
|
||||
}
|
||||
}
|
||||
|
||||
return ZoneLanguage::LANGUAGE_NONE;
|
||||
return GameLanguage::LANGUAGE_NONE;
|
||||
}
|
||||
|
||||
static bool CanLoad(ZoneHeader& header, bool* isSecure, bool* isOfficial, bool* isEncrypted)
|
||||
|
Reference in New Issue
Block a user