mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 12:04:55 +02:00
implement options
This commit is contained in:
@@ -31,6 +31,7 @@ public:
|
||||
bool load(const std::string& file);
|
||||
bool save();
|
||||
|
||||
bool exists(const std::string& key) { return m_confsMap.find(key) != m_confsMap.end(); }
|
||||
void set(const std::string& key, const std::string& value) { m_confsMap[key] = value; }
|
||||
std::string get(const std::string& key) { return m_confsMap[key]; }
|
||||
|
||||
|
@@ -154,6 +154,7 @@ void LuaInterface::registerFunctions()
|
||||
g_lua.registerClass<Configs>();
|
||||
g_lua.bindClassStaticFunction<Configs>("set", std::bind(&Configs::set, &g_configs, _1, _2));
|
||||
g_lua.bindClassStaticFunction<Configs>("get", std::bind(&Configs::get, &g_configs, _1));
|
||||
g_lua.bindClassStaticFunction<Configs>("exists", std::bind(&Configs::exists, &g_configs, _1));
|
||||
|
||||
// Logger
|
||||
g_lua.registerClass<Logger>();
|
||||
@@ -170,5 +171,6 @@ void LuaInterface::registerFunctions()
|
||||
g_lua.bindGlobalFunction("addEvent", std::bind(&EventDispatcher::addEvent, &g_dispatcher, _1, false));
|
||||
g_lua.bindGlobalFunction("scheduleEvent", std::bind(&EventDispatcher::scheduleEvent, &g_dispatcher, _1, _2));
|
||||
g_lua.bindGlobalFunction("getMouseCursorPos", std::bind(&Platform::getMouseCursorPos, &g_platform));
|
||||
g_lua.bindGlobalFunction("setVerticalSync", std::bind(&Platform::setVerticalSync, &g_platform, _1));
|
||||
g_lua.bindGlobalFunction("getScreenSize", std::bind(&Graphics::getScreenSize, &g_graphics));
|
||||
}
|
||||
|
Reference in New Issue
Block a user