exposed global translation file for core
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40521
This commit is contained in:
parent
9d0e33a71f
commit
b9451b6cc9
@ -22,6 +22,7 @@
|
||||
#include "sourcemod.h"
|
||||
|
||||
CTranslator g_Translator;
|
||||
CPhraseFile *g_pCorePhrases = NULL;
|
||||
|
||||
struct trans_t
|
||||
{
|
||||
@ -574,6 +575,10 @@ const char *CPhraseFile::GetFilename()
|
||||
return m_File.c_str();
|
||||
}
|
||||
|
||||
/**************************
|
||||
** MAIN TRANSLATOR CODE **
|
||||
**************************/
|
||||
|
||||
CTranslator::CTranslator()
|
||||
{
|
||||
m_pStringTab = new BaseStringTable(2048);
|
||||
@ -597,6 +602,12 @@ CTranslator::~CTranslator()
|
||||
delete m_pStringTab;
|
||||
}
|
||||
|
||||
void CTranslator::OnSourceModAllInitialized()
|
||||
{
|
||||
unsigned int id = FindOrAddPhraseFile("core.cfg");
|
||||
g_pCorePhrases = GetFileByIndex(id);
|
||||
}
|
||||
|
||||
bool CTranslator::GetLanguageByCode(const char *code, unsigned int *index)
|
||||
{
|
||||
void *_index;
|
||||
|
@ -90,11 +90,15 @@ private:
|
||||
bool m_FileLogged;
|
||||
};
|
||||
|
||||
class CTranslator : public ITextListener_SMC
|
||||
class CTranslator :
|
||||
public ITextListener_SMC,
|
||||
public SMGlobalClass
|
||||
{
|
||||
public:
|
||||
CTranslator();
|
||||
~CTranslator();
|
||||
public: //SMGlobalClass
|
||||
void OnSourceModAllInitialized();
|
||||
public: //ITextListener_SMC
|
||||
void ReadSMC_ParseStart();
|
||||
SMCParseResult ReadSMC_NewSection(const char *name, bool opt_quotes);
|
||||
@ -117,6 +121,7 @@ private:
|
||||
String m_CustomError;
|
||||
};
|
||||
|
||||
extern CPhraseFile *g_pCorePhrases;
|
||||
extern CTranslator g_Translator;
|
||||
|
||||
#endif //_INCLUDE_SOURCEMOD_TRANSLATOR_H_
|
||||
|
Loading…
Reference in New Issue
Block a user