mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
slot onrightclick event
This commit is contained in:
parent
d8cc810441
commit
8409e0d82e
4 changed files with 23 additions and 12 deletions
|
|
@ -26,8 +26,7 @@ namespace scripting {
|
|||
class Environment;
|
||||
}
|
||||
|
||||
using itemsharefunc = std::function<void(uint, ItemStack&)>;
|
||||
using slotcallback = std::function<void(ItemStack&, ItemStack&)>;
|
||||
using slotcallback = std::function<void(uint, ItemStack&)>;
|
||||
|
||||
class InventoryInteraction {
|
||||
ItemStack grabbedItem;
|
||||
|
|
@ -44,7 +43,7 @@ struct SlotLayout {
|
|||
glm::vec2 position;
|
||||
bool background;
|
||||
bool itemSource;
|
||||
itemsharefunc shareFunc;
|
||||
slotcallback shareFunc;
|
||||
slotcallback rightClick;
|
||||
int padding = 0;
|
||||
|
||||
|
|
@ -52,7 +51,7 @@ struct SlotLayout {
|
|||
glm::vec2 position,
|
||||
bool background,
|
||||
bool itemSource,
|
||||
itemsharefunc shareFunc,
|
||||
slotcallback shareFunc,
|
||||
slotcallback rightClick);
|
||||
};
|
||||
|
||||
|
|
@ -63,6 +62,7 @@ class SlotView : public gui::UINode {
|
|||
SlotLayout layout;
|
||||
bool highlighted = false;
|
||||
|
||||
int64_t inventoryid = 0;
|
||||
ItemStack* bound = nullptr;
|
||||
public:
|
||||
SlotView(SlotLayout layout);
|
||||
|
|
@ -76,6 +76,7 @@ public:
|
|||
virtual void focus(gui::GUI*) override;
|
||||
|
||||
void bind(
|
||||
int64_t inventoryid,
|
||||
ItemStack& stack,
|
||||
LevelFrontend* frontend,
|
||||
InventoryInteraction* interaction
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue