mirror of
https://github.com/edubart/otclient.git
synced 2025-12-21 07:57:12 +01:00
Some work on container pagination
Bind lua functions for containers Update onAddItem now it have the pagination slot Note: getSize as i see is equal to getItemsCount, but not sure thats why I've added !
This commit is contained in:
@@ -620,11 +620,16 @@ void ProtocolGame::parseOpenContainer(const InputMessagePtr& msg)
|
||||
int capacity = msg->getU8();
|
||||
bool hasParent = (msg->getU8() != 0);
|
||||
|
||||
bool isUnlocked;
|
||||
bool hasPages;
|
||||
int containerSize;
|
||||
int firstIndex;
|
||||
|
||||
if(g_game.getFeature(Otc::GameContainerPagination)) {
|
||||
msg->getU8(); // drag and drop
|
||||
msg->getU8(); // pagination
|
||||
msg->getU16(); // container size
|
||||
msg->getU16(); // first index
|
||||
isUnlocked = (msg->getU8() != 0); // drag and drop
|
||||
hasPages = (msg->getU8() != 0); // pagination
|
||||
containerSize = msg->getU16(); // container size
|
||||
firstIndex = msg->getU16(); // first index
|
||||
}
|
||||
|
||||
int itemCount = msg->getU8();
|
||||
@@ -633,7 +638,7 @@ void ProtocolGame::parseOpenContainer(const InputMessagePtr& msg)
|
||||
for(int i = 0; i < itemCount; i++)
|
||||
items[i] = getItem(msg);
|
||||
|
||||
g_game.processOpenContainer(containerId, containerItem, name, capacity, hasParent, items);
|
||||
g_game.processOpenContainer(containerId, containerItem, name, capacity, hasParent, items, isUnlocked, hasPages, containerSize, firstIndex);
|
||||
}
|
||||
|
||||
void ProtocolGame::parseCloseContainer(const InputMessagePtr& msg)
|
||||
@@ -645,11 +650,12 @@ void ProtocolGame::parseCloseContainer(const InputMessagePtr& msg)
|
||||
void ProtocolGame::parseContainerAddItem(const InputMessagePtr& msg)
|
||||
{
|
||||
int containerId = msg->getU8();
|
||||
int slot = 0;
|
||||
if(g_game.getFeature(Otc::GameContainerPagination)) {
|
||||
msg->getU16(); // slot
|
||||
slot = msg->getU16(); // slot
|
||||
}
|
||||
ItemPtr item = getItem(msg);
|
||||
g_game.processContainerAddItem(containerId, item);
|
||||
g_game.processContainerAddItem(containerId, item, slot);
|
||||
}
|
||||
|
||||
void ProtocolGame::parseContainerUpdateItem(const InputMessagePtr& msg)
|
||||
|
||||
Reference in New Issue
Block a user