Skip to content

Commit

Permalink
Merge pull request #233 from justliliandev/feature/195
Browse files Browse the repository at this point in the history
stay in delete mode when holding shift
  • Loading branch information
sisby-folk authored Oct 12, 2024
2 parents 2e856e7 + ccc5b28 commit 494931d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/folk/sisby/antique_atlas/gui/AtlasScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
});

Expand Down Expand Up @@ -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);

Expand All @@ -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;
Expand Down

0 comments on commit 494931d

Please sign in to comment.