From 6c41c03536493894af61fb9fbd1e595f3d9ddc2d Mon Sep 17 00:00:00 2001 From: swkeep <49286776+swkeep@users.noreply.github.com> Date: Tue, 28 May 2024 20:52:42 +0330 Subject: [PATCH 1/4] hide context menu on drag --- html/app.js | 1 + 1 file changed, 1 insertion(+) diff --git a/html/app.js b/html/app.js index e17a42ac8..af723c1c5 100644 --- a/html/app.js +++ b/html/app.js @@ -298,6 +298,7 @@ const InventoryContainer = Vue.createApp({ this.dragStartX = event.clientX; this.dragStartY = event.clientY; this.dragStartInventoryType = inventoryType; + this.showContextMenu = false }, createGhostElement(slotElement) { const ghostElement = slotElement.cloneNode(true); From 0cbcdcc679d724d9555dd34efdbc83de3b5cb508 Mon Sep 17 00:00:00 2001 From: swkeep <49286776+swkeep@users.noreply.github.com> Date: Tue, 28 May 2024 20:55:34 +0330 Subject: [PATCH 2/4] hide context menu by left click --- html/app.js | 5 +++++ html/index.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/html/app.js b/html/app.js index af723c1c5..93e1b20e9 100644 --- a/html/app.js +++ b/html/app.js @@ -210,6 +210,11 @@ const InventoryContainer = Vue.createApp({ getHotbarItemInSlot(slot) { return this.hotbarItems[slot - 1] || null; }, + containerMouseDownAction(event){ + if (event.button === 0 && this.showContextMenu) { + this.showContextMenu = false + } + }, handleMouseDown(event, slot, inventory) { event.preventDefault(); const itemInSlot = this.getItemInSlot(slot, inventory); diff --git a/html/index.html b/html/index.html index 8c4d1c190..7fa01abb1 100644 --- a/html/index.html +++ b/html/index.html @@ -16,7 +16,7 @@