mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
added on_inventory_interact
This commit is contained in:
parent
fc04284b34
commit
2cec6c3f9a
4 changed files with 29 additions and 0 deletions
|
|
@ -431,14 +431,23 @@ void SlotView::clicked(Mousecode button) {
|
|||
ItemStack& grabbed = exchangeSlot->getStack();
|
||||
ItemStack& stack = *bound;
|
||||
|
||||
int action = -1;
|
||||
|
||||
if (button == Mousecode::BUTTON_1) {
|
||||
performLeftClick(stack, grabbed);
|
||||
action = 0;
|
||||
} else if (button == Mousecode::BUTTON_2) {
|
||||
performRightClick(stack, grabbed);
|
||||
action = 1;
|
||||
}
|
||||
|
||||
if (layout.updateFunc) {
|
||||
layout.updateFunc(layout.index, stack);
|
||||
}
|
||||
|
||||
const auto& input = gui.getInput();
|
||||
action = action | (input.pressed(Keycode::LEFT_SHIFT) ? 2 : 0);
|
||||
scripting::on_inventory_interact(inventoryId, layout.index, action);
|
||||
}
|
||||
|
||||
void SlotView::onFocus() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue