mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-03-24 05:58:13 +05:00
December 2014 files
This commit is contained in:
@@ -11,6 +11,20 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize)
|
||||
{
|
||||
src = byteArray(pbData, dwSize);
|
||||
|
||||
ProcessStringTableData();
|
||||
}
|
||||
|
||||
|
||||
void StringTable::ReloadStringTable()
|
||||
{
|
||||
m_stringsMap.clear();
|
||||
m_stringsVec.clear();
|
||||
|
||||
ProcessStringTableData();
|
||||
}
|
||||
|
||||
void StringTable::ProcessStringTableData(void)
|
||||
{
|
||||
ByteArrayInputStream bais(src);
|
||||
DataInputStream dis(&bais);
|
||||
|
||||
@@ -35,8 +49,8 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize)
|
||||
|
||||
//
|
||||
for( AUTO_VAR(it_locales, locales.begin());
|
||||
it_locales!=locales.end() && (!foundLang);
|
||||
it_locales++
|
||||
it_locales!=locales.end() && (!foundLang);
|
||||
it_locales++
|
||||
)
|
||||
{
|
||||
bytesToSkip = 0;
|
||||
@@ -72,7 +86,7 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize)
|
||||
|
||||
// Read the language file for the selected language
|
||||
int langVersion = dis2.readInt();
|
||||
|
||||
|
||||
isStatic = false; // 4J-JEV: Versions 1 and up could use
|
||||
if (langVersion > 0) // integers rather than wstrings as keys.
|
||||
isStatic = dis2.readBoolean();
|
||||
@@ -80,6 +94,8 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize)
|
||||
wstring langId = dis2.readUTF();
|
||||
int totalStrings = dis2.readInt();
|
||||
|
||||
app.DebugPrintf("IsStatic=%d totalStrings = %d\n",isStatic?1:0,totalStrings);
|
||||
|
||||
if (!isStatic)
|
||||
{
|
||||
for(int i = 0; i < totalStrings; ++i)
|
||||
@@ -109,11 +125,12 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize)
|
||||
|
||||
isStatic = false;
|
||||
}
|
||||
|
||||
|
||||
// We can't delete this data in the dtor, so clear the reference
|
||||
bais.reset();
|
||||
}
|
||||
|
||||
|
||||
StringTable::~StringTable(void)
|
||||
{
|
||||
// delete src.data; TODO 4J-JEV: ?
|
||||
|
||||
Reference in New Issue
Block a user