mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 05:21:49 +00:00
fix p.6
This commit is contained in:
parent
1a2f0f4868
commit
cedeaa68ad
2 changed files with 16 additions and 0 deletions
|
|
@ -500,6 +500,19 @@ void SlotView::performRightClick(ItemStack& stack, ItemStack& grabbed) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SlotView::performMiddleClick(ItemStack& stack, ItemStack& grabbed) {
|
||||||
|
auto indices = *content->getIndices();
|
||||||
|
if (!grabbed.isEmpty()) {
|
||||||
|
if (stack.isEmpty()) {
|
||||||
|
stack.set(grabbed);
|
||||||
|
stack.maximizeCount(indices);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
grabbed.set(stack);
|
||||||
|
grabbed.maximizeCount(indices);
|
||||||
|
}
|
||||||
|
|
||||||
void SlotView::clicked(Mousecode button) {
|
void SlotView::clicked(Mousecode button) {
|
||||||
if (bound == nullptr) return;
|
if (bound == nullptr) return;
|
||||||
auto exchangeSlot =
|
auto exchangeSlot =
|
||||||
|
|
@ -514,6 +527,8 @@ void SlotView::clicked(Mousecode button) {
|
||||||
performLeftClick(stack, grabbed);
|
performLeftClick(stack, grabbed);
|
||||||
} else if (button == Mousecode::BUTTON_2) {
|
} else if (button == Mousecode::BUTTON_2) {
|
||||||
performRightClick(stack, grabbed);
|
performRightClick(stack, grabbed);
|
||||||
|
} else if (button == Mousecode::BUTTON_3) {
|
||||||
|
performMiddleClick(stack, grabbed);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (layout.updateFunc) {
|
if (layout.updateFunc) {
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@ namespace gui {
|
||||||
|
|
||||||
void performLeftClick(ItemStack& stack, ItemStack& grabbed);
|
void performLeftClick(ItemStack& stack, ItemStack& grabbed);
|
||||||
void performRightClick(ItemStack& stack, ItemStack& grabbed);
|
void performRightClick(ItemStack& stack, ItemStack& grabbed);
|
||||||
|
void performMiddleClick(ItemStack& stack, ItemStack& grabbed);
|
||||||
|
|
||||||
void drawItemIcon(
|
void drawItemIcon(
|
||||||
Batch2D& batch,
|
Batch2D& batch,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue