From ccc5b28b140fb1dce500dd833e3906b1432522e4 Mon Sep 17 00:00:00 2001 From: agnor99 <36055315+justliliandev@users.noreply.github.com> Date: Sat, 12 Oct 2024 21:52:22 +0200 Subject: [PATCH] stay in delete mode when holding shift --- .../java/folk/sisby/antique_atlas/gui/AtlasScreen.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/folk/sisby/antique_atlas/gui/AtlasScreen.java b/src/main/java/folk/sisby/antique_atlas/gui/AtlasScreen.java index 30b4266b..e97267de 100644 --- a/src/main/java/folk/sisby/antique_atlas/gui/AtlasScreen.java +++ b/src/main/java/folk/sisby/antique_atlas/gui/AtlasScreen.java @@ -290,7 +290,9 @@ public void updateBookmarkerList() { if (!worldAtlasData.deleteLandmark(player.getEntityWorld(), landmark)) return; updateBookmarkerList(); player.getEntityWorld().playSound(player, player.getBlockPos(), SoundEvents.UI_CARTOGRAPHY_TABLE_TAKE_RESULT, SoundCategory.AMBIENT, 1F, 0.5F); - state.switchTo(NORMAL, this); + if (!hasShiftDown()) { + state.switchTo(NORMAL, this); + } } }); @@ -331,7 +333,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int mouseState) { // If clicked on the map, start dragging if (!state.is(NORMAL) && !state.is(HIDING_MARKERS)) { - if (state.is(PLACING_MARKER) && isMouseOverMap && mouseState == 0 /* left click */) { + if (state.is(PLACING_MARKER) && isMouseOverMap && mouseState == GLFW.GLFW_MOUSE_BUTTON_1) { markerModal.setMarkerData(player.getEntityWorld(), screenXToWorldX(mouseX), screenYToWorldZ(mouseY)); addChild(markerModal); @@ -349,7 +351,9 @@ public boolean mouseClicked(double mouseX, double mouseY, int mouseState) { player.getEntityWorld().playSound(player, player.getBlockPos(), SoundEvents.UI_CARTOGRAPHY_TABLE_TAKE_RESULT, SoundCategory.AMBIENT, 1F, 0.5F); } } - state.switchTo(NORMAL, this); + if (!hasShiftDown() || !state.is(DELETING_MARKER)) { + state.switchTo(NORMAL, this); + } } else if (isMouseOverMap && selectedButton == null) { isDragging = true; return true;