bind some functions
This commit is contained in:
parent
4341bf91a6
commit
558872f57d
|
@ -184,3 +184,8 @@ void Game::openOutfitWindow()
|
||||||
{
|
{
|
||||||
m_protocolGame->sendGetOutfit();
|
m_protocolGame->sendGetOutfit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Game::setOutfit(const Outfit& outfit)
|
||||||
|
{
|
||||||
|
m_protocolGame->sendSetOutfit(outfit);
|
||||||
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "declarations.h"
|
#include "declarations.h"
|
||||||
#include <otclient/net/declarations.h>
|
#include <otclient/net/declarations.h>
|
||||||
#include <otclient/core/item.h>
|
#include <otclient/core/item.h>
|
||||||
|
#include <otclient/core/outfit.h>
|
||||||
|
|
||||||
class Game
|
class Game
|
||||||
{
|
{
|
||||||
|
@ -53,6 +54,7 @@ public:
|
||||||
void talkChannel(int channelType, int channelId, const std::string& message);
|
void talkChannel(int channelType, int channelId, const std::string& message);
|
||||||
void talkPrivate(int channelType, const std::string& receiver, const std::string& message);
|
void talkPrivate(int channelType, const std::string& receiver, const std::string& message);
|
||||||
void openOutfitWindow();
|
void openOutfitWindow();
|
||||||
|
void setOutfit(const Outfit& outfit);
|
||||||
|
|
||||||
bool isOnline() { return m_online; }
|
bool isOnline() { return m_online; }
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,11 @@ void OTClient::registerLuaFunctions()
|
||||||
g_lua.registerClass<ProtocolGame, Protocol>();
|
g_lua.registerClass<ProtocolGame, Protocol>();
|
||||||
|
|
||||||
g_lua.registerClass<Thing>();
|
g_lua.registerClass<Thing>();
|
||||||
|
|
||||||
g_lua.registerClass<Creature>();
|
g_lua.registerClass<Creature>();
|
||||||
|
g_lua.bindClassMemberFunction("setOutfit", &Creature::setOutfit);
|
||||||
|
g_lua.bindClassMemberFunction("getOutfit", &Creature::getOutfit);
|
||||||
|
|
||||||
g_lua.registerClass<Player, Creature>();
|
g_lua.registerClass<Player, Creature>();
|
||||||
g_lua.registerClass<LocalPlayer, Player>();
|
g_lua.registerClass<LocalPlayer, Player>();
|
||||||
g_lua.registerClass<Item>();
|
g_lua.registerClass<Item>();
|
||||||
|
@ -70,8 +74,8 @@ void OTClient::registerLuaFunctions()
|
||||||
g_lua.bindClassStaticFunction<Game>("logout", std::bind(&Game::logout, &g_game, _1));
|
g_lua.bindClassStaticFunction<Game>("logout", std::bind(&Game::logout, &g_game, _1));
|
||||||
g_lua.bindClassStaticFunction<Game>("cancelLogin", std::bind(&Game::cancelLogin, &g_game));
|
g_lua.bindClassStaticFunction<Game>("cancelLogin", std::bind(&Game::cancelLogin, &g_game));
|
||||||
g_lua.bindClassStaticFunction<Game>("isOnline", std::bind(&Game::isOnline, &g_game));
|
g_lua.bindClassStaticFunction<Game>("isOnline", std::bind(&Game::isOnline, &g_game));
|
||||||
g_lua.bindClassStaticFunction<Game>("isOnline", std::bind(&Game::isOnline, &g_game));
|
|
||||||
g_lua.bindClassStaticFunction<Game>("openOutfitWindow", std::bind(&Game::openOutfitWindow, &g_game));
|
g_lua.bindClassStaticFunction<Game>("openOutfitWindow", std::bind(&Game::openOutfitWindow, &g_game));
|
||||||
|
g_lua.bindClassStaticFunction<Game>("setOutfit", std::bind(&Game::setOutfit, &g_game, _1));
|
||||||
|
|
||||||
g_lua.registerClass<UIItem, UIWidget>();
|
g_lua.registerClass<UIItem, UIWidget>();
|
||||||
g_lua.bindClassStaticFunction<UIItem>("create", &UIItem::create<UIItem>);
|
g_lua.bindClassStaticFunction<UIItem>("create", &UIItem::create<UIItem>);
|
||||||
|
|
Loading…
Reference in New Issue