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 @@
-
+
From e3bf7eaadb96784c46b009124d83976fdcabda3a Mon Sep 17 00:00:00 2001 From: swkeep <49286776+swkeep@users.noreply.github.com> Date: Tue, 28 May 2024 20:59:01 +0330 Subject: [PATCH 3/4] fix scrollable inventory container --- html/main.css | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/html/main.css b/html/main.css index 6c10a79ac..a3ccc2c75 100644 --- a/html/main.css +++ b/html/main.css @@ -1,5 +1,9 @@ @import url("https://fonts.googleapis.com/css2?family=Open+Sans&display=swap"); +body { + margin: 0; +} + div { font-family: "Open Sans", sans-serif; } @@ -9,8 +13,8 @@ div { } #app { - height: 99vh; - width: 99vw; + height: 100vh; + width: 100vw; background: transparent; } @@ -195,7 +199,7 @@ div { white-space: nowrap; bottom: 0; height: 1vh; - width: 99%; + width: 100%; background-color: #cccccc; display: flex; justify-content: center; From 24f8e4ee62eee2ecccdcb954a72e7c7b8fa68f8b Mon Sep 17 00:00:00 2001 From: swkeep <49286776+swkeep@users.noreply.github.com> Date: Wed, 29 May 2024 00:38:02 +0330 Subject: [PATCH 4/4] fix scroll issue with middle mouse button --- html/app.js | 1 + 1 file changed, 1 insertion(+) diff --git a/html/app.js b/html/app.js index 93e1b20e9..f2dc13905 100644 --- a/html/app.js +++ b/html/app.js @@ -216,6 +216,7 @@ const InventoryContainer = Vue.createApp({ } }, handleMouseDown(event, slot, inventory) { + if (event.button === 1) return; // skip middle mouse event.preventDefault(); const itemInSlot = this.getItemInSlot(slot, inventory); if (event.button === 0) {