|
@@ -621,6 +621,7 @@ void Inventory::inventoryApi(Framework::StreamReader* zRequest, NetworkMessage*
|
|
|
break;
|
|
|
}
|
|
|
case 1: // remove Observer
|
|
|
+ {
|
|
|
char idLen;
|
|
|
zRequest->lese(&idLen, 1);
|
|
|
char* id = new char[idLen + 1];
|
|
@@ -630,6 +631,36 @@ void Inventory::inventoryApi(Framework::StreamReader* zRequest, NetworkMessage*
|
|
|
delete[] id;
|
|
|
break;
|
|
|
}
|
|
|
+ case 2: // request item tooltip
|
|
|
+ {
|
|
|
+ char idLen;
|
|
|
+ zRequest->lese(&idLen, 1);
|
|
|
+ char* id = new char[idLen + 1];
|
|
|
+ zRequest->lese(id, idLen);
|
|
|
+ id[(int)idLen] = 0;
|
|
|
+ zResponse->addressGui(id);
|
|
|
+ delete[] id;
|
|
|
+ int slotId;
|
|
|
+ zRequest->lese((char*)&slotId, 4);
|
|
|
+ Text uiml;
|
|
|
+ for (ItemSlot* slot : *pullSlotsOrder)
|
|
|
+ {
|
|
|
+ if (slot->getId() == slotId)
|
|
|
+ {
|
|
|
+ if (slot->zStack() && slot->zStack()->zItem())
|
|
|
+ uiml = slot->zStack()->zItem()->getTooltipUIML();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ short len = (short)uiml.getLength();
|
|
|
+ char* buffer = new char[uiml.getLength() + 7];
|
|
|
+ buffer[0] = 3;
|
|
|
+ *(int*)(buffer + 1) = slotId;
|
|
|
+ *(short*)(buffer + 5) = len;
|
|
|
+ memcpy(buffer + 7, uiml, len);
|
|
|
+ zResponse->setMessage(buffer, len + 7);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void Inventory::registerAfterPullStackCall(std::function<void(ItemSlot* zSlot, Direction dir, const Item* zItem, int count)> call)
|