Move translator from logic to core (bug 4406 part 6, r=ds).
--HG-- rename : core/PhraseCollection.cpp => core/logic/PhraseCollection.cpp rename : core/PhraseCollection.h => core/logic/PhraseCollection.h rename : core/Translator.cpp => core/logic/Translator.cpp rename : core/Translator.h => core/logic/Translator.h rename : core/sm_memtable.h => core/logic/sm_memtable.h rename : core/smn_lang.cpp => core/logic/smn_lang.cpp
This commit is contained in:
+10
-1
@@ -42,7 +42,7 @@
|
||||
#include <sp_vm_api.h>
|
||||
|
||||
#define SMINTERFACE_PLUGINSYSTEM_NAME "IPluginManager"
|
||||
#define SMINTERFACE_PLUGINSYSTEM_VERSION 3
|
||||
#define SMINTERFACE_PLUGINSYSTEM_VERSION 4
|
||||
|
||||
/** Context user slot 3 is used Core for holding an IPluginContext pointer. */
|
||||
#define SM_CONTEXTVAR_USER 3
|
||||
@@ -93,6 +93,8 @@ namespace SourceMod
|
||||
PluginType_Global, /**< Plugin will never be unloaded or updated */
|
||||
};
|
||||
|
||||
class IPhraseCollection;
|
||||
|
||||
/**
|
||||
* @brief Encapsulates a run-time plugin as maintained by SourceMod.
|
||||
*/
|
||||
@@ -197,6 +199,13 @@ namespace SourceMod
|
||||
* @return IPluginRuntime pointer, or NULL if not loaded.
|
||||
*/
|
||||
virtual SourcePawn::IPluginRuntime *GetRuntime() =0;
|
||||
|
||||
/**
|
||||
* @brief Returns the plugin's phrase collection.
|
||||
*
|
||||
* @return Plugin's phrase collection.
|
||||
*/
|
||||
virtual IPhraseCollection *GetPhrases() =0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
+20
-1
@@ -35,7 +35,10 @@
|
||||
#include <IShareSys.h>
|
||||
|
||||
#define SMINTERFACE_TRANSLATOR_NAME "ITranslator"
|
||||
#define SMINTERFACE_TRANSLATOR_VERSION 1
|
||||
#define SMINTERFACE_TRANSLATOR_VERSION 2
|
||||
|
||||
#define MAX_TRANSLATE_PARAMS 32
|
||||
#define CORELANG_ENGLISH 0
|
||||
|
||||
/**
|
||||
* @file ITranslator.h
|
||||
@@ -322,6 +325,22 @@ namespace SourceMod
|
||||
unsigned int numparams,
|
||||
size_t *pOutLength,
|
||||
const char **pFailPhrase) =0;
|
||||
|
||||
/**
|
||||
* @brief Get number of languages.
|
||||
*
|
||||
* @return Number of languages.
|
||||
*/
|
||||
virtual unsigned int GetLanguageCount() =0;
|
||||
|
||||
/**
|
||||
* @brief Find a language number by name.
|
||||
*
|
||||
* @param name Language name.
|
||||
* @param index Optional pointer to store language index.
|
||||
* @return True if found, false otherwise.
|
||||
*/
|
||||
virtual bool GetLanguageByName(const char *name, unsigned int *index) =0;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user