mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
fix dragqueen and containers
This commit is contained in:
@@ -198,6 +198,7 @@ void OTClient::registerLuaFunctions()
|
||||
g_lua.bindClassStaticFunction<Game>("open", std::bind(&Game::open, &g_game, _1, _2));
|
||||
g_lua.bindClassStaticFunction<Game>("use", std::bind(&Game::use, &g_game, _1));
|
||||
g_lua.bindClassStaticFunction<Game>("useWith", std::bind(&Game::useWith, &g_game, _1, _2));
|
||||
g_lua.bindClassStaticFunction<Game>("move", std::bind(&Game::move, &g_game, _1, _2, _3));
|
||||
g_lua.bindClassStaticFunction<Game>("useInventoryItem", std::bind(&Game::useInventoryItem, &g_game, _1, _2));
|
||||
g_lua.bindClassStaticFunction<Game>("walk", std::bind(&Game::walk, &g_game, _1));
|
||||
g_lua.bindClassStaticFunction<Game>("forceWalk", std::bind(&Game::forceWalk, &g_game, _1));
|
||||
|
@@ -435,12 +435,14 @@ void ProtocolGame::parseOpenContainer(InputMessage& msg)
|
||||
bool hasParent = (msg.getU8() != 0);
|
||||
int itemCount = msg.getU8();
|
||||
|
||||
g_lua.callGlobalField("Game", "onContainerOpen", containerId, itemId, name, capacity, hasParent);
|
||||
|
||||
std::vector<ItemPtr> items;
|
||||
items.reserve(itemCount);
|
||||
for(int i = 0; i < itemCount; i++) {
|
||||
ItemPtr item = internalGetItem(msg);
|
||||
g_game.processContainerAddItem(containerId, item);
|
||||
items.push_back(item);
|
||||
}
|
||||
|
||||
g_lua.callGlobalField("Game", "onContainerOpen", containerId, itemId, name, capacity, hasParent, items);
|
||||
}
|
||||
|
||||
void ProtocolGame::parseCloseContainer(InputMessage& msg)
|
||||
|
@@ -27,6 +27,11 @@
|
||||
#include <framework/graphics/graphics.h>
|
||||
#include <otclient/core/localplayer.h>
|
||||
|
||||
UIMap::UIMap()
|
||||
{
|
||||
m_dragable = true;
|
||||
}
|
||||
|
||||
void UIMap::draw()
|
||||
{
|
||||
drawSelf();
|
||||
|
@@ -30,6 +30,7 @@
|
||||
class UIMap : public UIWidget
|
||||
{
|
||||
public:
|
||||
UIMap();
|
||||
void draw();
|
||||
|
||||
Position getPosition(const Point& mousePos);
|
||||
|
Reference in New Issue
Block a user