1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

GUIInventoryList: Keep item size while moving (#12896)

This commit is contained in:
Jean-Patrick Guerrero 2022-10-24 13:58:56 +02:00 committed by GitHub
parent 02c293ec63
commit 16266397ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View file

@ -34,10 +34,12 @@ public:
ItemSpec(const InventoryLocation &a_inventoryloc,
const std::string &a_listname,
s32 a_i) :
s32 a_i,
const v2s32 slotsize) :
inventoryloc(a_inventoryloc),
listname(a_listname),
i(a_i)
i(a_i),
slotsize(slotsize)
{
}
@ -46,6 +48,7 @@ public:
InventoryLocation inventoryloc;
std::string listname;
s32 i = -1;
v2s32 slotsize;
};
// options for inventorylists that are setable with the lua api
@ -99,6 +102,11 @@ public:
m_options.slotbordercolor = slotbordercolor;
}
const v2s32 getSlotSize() const noexcept
{
return m_slot_size;
}
// returns -1 if not item is at pos p
s32 getItemIndexAtPos(v2s32 p) const;