mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-07-09 19:58:25 +00:00
* Stringtables now support IDs and Strings at the same time. DLCs have a new branch for RMLUI now.
* Removed hardcoded StringTableNameMap for use Strings instead of IDs for RMLUI.
* Strings in RMLUI now uses [] since {} is used for data and it could affect future menus.
* Removed GetStringTable. app.GetString now support WStrings.
38 lines
791 B
C++
38 lines
791 B
C++
#pragma once
|
|
|
|
using namespace std;
|
|
|
|
class StringTable
|
|
{
|
|
private:
|
|
unordered_map<wstring, size_t> m_stringsMap;
|
|
vector<wstring> m_stringsVec;
|
|
|
|
vector<pair<wstring, int>> m_langSizeMap;
|
|
wstring currentLanguage;
|
|
|
|
byteArray src;
|
|
|
|
public:
|
|
StringTable(void);
|
|
StringTable(PBYTE pbData, DWORD dwSize);
|
|
~StringTable(void);
|
|
|
|
void ReloadStringTable();
|
|
void Reset(); // TU30
|
|
|
|
void write(DataOutputStream* dos); // TU30
|
|
|
|
void getData(PBYTE *ppbData, UINT *pdwSize);
|
|
|
|
LPCWSTR getString(const wstring &id);
|
|
LPCWSTR getString(int id);
|
|
|
|
private:
|
|
void ProcessStringTableData(void);
|
|
|
|
// From TU30
|
|
void ReadAllFromStream(DataInputStream* dis);
|
|
bool FindLanguage(wstring& outLangId, int64_t& outBytesToSkip, int& outDataSize);
|
|
void ReadLanguageFromStream(DataInputStream* dis, int dataSize);
|
|
}; |