Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <vector>
- using LocalizeStringIndex_t = unsigned;
- struct Kit_t
- {
- int id;
- std::string name;
- bool operator < (const Kit_t& other) const { return (name < other.name); }
- };
- class ILocalizeTextQuery
- {
- public:
- virtual int ComputeTextWidth(const wchar_t* pString) = 0;
- };
- using CreateInterfaceFn2 = void* (*)(const char*, int*);
- template <class T>
- T* CaptureInterface2(const char* module, const char* name)
- {
- return reinterpret_cast<T*>(platform::CaptureInterface2(module, name));
- }
- enum InitReturnVal_t
- {
- INIT_FAILED = 0,
- INIT_OK,
- INIT_LAST_VAL,
- };
- enum AppSystemTier_t
- {
- APP_SYSTEM_TIER0 = 0,
- APP_SYSTEM_TIER1,
- APP_SYSTEM_TIER2,
- APP_SYSTEM_TIER3,
- APP_SYSTEM_TIER_OTHER,
- };
- struct AppSystemInfo_t;
- class IAppSystem2
- {
- public:
- virtual bool Connect(CreateInterfaceFn2 factory) = 0;
- virtual void Disconnect() = 0;
- virtual void* QueryInterface(const char* pInterfaceName) = 0;
- virtual InitReturnVal_t Init() = 0;
- virtual void Shutdown() = 0;
- virtual const AppSystemInfo_t* GetDependencies() = 0;
- virtual AppSystemTier_t GetTier() = 0;
- virtual void Reconnect(CreateInterfaceFn2 factory, const char* pInterfaceName) = 0;
- virtual bool IsSingleton() = 0;
- };
- class ILocalize : public IAppSystem2
- {
- public:
- virtual bool AddFile(const char* fileName, const char* pPathID = nullptr, bool bIncludeFallbackSearchPaths = false) = 0;
- virtual void RemoveAll() = 0;
- virtual wchar_t* Find(const char* tokenName) = 0;
- virtual const wchar_t* FindSafe(const char* tokenName) = 0;
- virtual int ConvertANSIToUnicode(const char* ansi, wchar_t* unicode, int unicodeBufferSizeInBytes) = 0;
- virtual int ConvertUnicodeToANSI(const wchar_t* unicode, char* ansi, int ansiBufferSize) = 0;
- virtual LocalizeStringIndex_t FindIndex(const char* tokenName) = 0;
- virtual void ConstructString(wchar_t* unicodeOuput, int unicodeBufferSizeInBytes, const wchar_t* formatString, int numFormatParameters, ...) = 0;
- virtual const char* GetNameByIndex(LocalizeStringIndex_t index) = 0;
- virtual wchar_t* GetValueByIndex(LocalizeStringIndex_t index) = 0;
- };
- #define ILOCALIZE_CLIENT_INTERFACE_VERSION "Localize_001"
- extern ILocalize* g_localize;
- extern std::vector<Kit_t> k_skins;
- extern std::vector<Kit_t> k_gloves;
- extern std::vector<Kit_t> k_stickers;
- extern void InitializeKits();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement