tibia-client/src/otclient/otclientluafunctions.cpp

23 lines
952 B
C++
Raw Normal View History

2011-08-15 16:11:24 +02:00
#include "otclient.h"
#include <framework/luascript/luainterface.h>
2011-08-15 21:15:49 +02:00
#include <otclient/core/datmanager.h>
#include <otclient/core/spritemanager.h>
2011-08-15 16:11:24 +02:00
#include <otclient/net/protocollogin.h>
#include <otclient/net/protocolgame.h>
void OTClient::registerLuaFunctions()
{
g_lua.bindGlobalFunction("exit", std::bind(&OTClient::exit, &g_client));
g_lua.bindGlobalFunction("setOnClose", std::bind(&OTClient::setOnClose, &g_client, _1));
2011-08-15 21:15:49 +02:00
g_lua.bindGlobalFunction("importDat", std::bind(&DatManager::load, &g_dat, _1));
g_lua.bindGlobalFunction("importSpr", std::bind(&SpriteManager::load, &g_sprites, _1));
2011-08-15 16:11:24 +02:00
g_lua.registerClass<ProtocolLogin, Protocol>();
g_lua.bindClassStaticFunction<ProtocolLogin>("create", &ProtocolLogin::create);
g_lua.bindClassMemberFunction("login", &ProtocolLogin::login);
2011-08-16 05:27:46 +02:00
g_lua.bindClassMemberFunction("cancelLogin", &ProtocolLogin::cancelLogin);
2011-08-15 16:11:24 +02:00
g_lua.registerClass<ProtocolGame, Protocol>();
}