diff --git a/common/src/main/java/dev/ftb/mods/ftbfiltersystem/client/gui/FilterScreen.java b/common/src/main/java/dev/ftb/mods/ftbfiltersystem/client/gui/FilterScreen.java index 9071e8a..63880e8 100644 --- a/common/src/main/java/dev/ftb/mods/ftbfiltersystem/client/gui/FilterScreen.java +++ b/common/src/main/java/dev/ftb/mods/ftbfiltersystem/client/gui/FilterScreen.java @@ -264,10 +264,10 @@ public boolean keyPressed(int keyCode, int scanCode, int modifier) { if (keyCode == InputConstants.KEY_ESCAPE) { titleEditBox.setValue(newTitle == null ? title.getString() : newTitle.getString()); showingTitleEdit = false; - return true; } else { - return titleEditBox.keyPressed(keyCode, scanCode, modifier); + titleEditBox.keyPressed(keyCode, scanCode, modifier); } + return true; } else { closeWithConfirmation(); return true; @@ -441,7 +441,7 @@ public boolean mouseDragged(double pMouseX, double pMouseY, int pButton, double protected void renderDecorations(GuiGraphics guiGraphics, int pMouseX, int pMouseY) { if (dragging != null) { FilterEntry entry = getEntryAtPosition(pMouseX, pMouseY); - if (entry != null && entry.dumpedFilter.filter() != dragging) { + if (entry != null && entry.dumpedFilter.filter() != dragging.dumpedFilter.filter()) { int w = font.width(dragging.dumpedFilter.filter().getDisplayName()); guiGraphics.fill(pMouseX, pMouseY - ELEMENT_HEIGHT / 2 + 1, pMouseX + w + 10, pMouseY + ELEMENT_HEIGHT / 2, 0xC0E1F1FD); guiGraphics.renderOutline(pMouseX, pMouseY - ELEMENT_HEIGHT / 2 + 1, w + 10, ELEMENT_HEIGHT, 0xC0404040); @@ -477,7 +477,7 @@ public FilterEntry(DumpedFilter dumpedFilter) { public void render(GuiGraphics guiGraphics, int index, int top, int left, int width, int height, int mouseX, int mouseY, boolean isMouseOver, float partialTick) { int labelLeft = left + dumpedFilter.indent() * 10; int yBase = top + height / 2; - if (dumpedFilter.filter() == dragTarget && dragging != dragTarget) { + if (dumpedFilter.filter() == dragTarget && dragging.dumpedFilter.filter() != dragTarget) { guiGraphics.fill(labelLeft - 2, top - 3, labelLeft + font.width(getLabel()) + 2, top + font.lineHeight, 0xFFCAE9BE); guiGraphics.renderOutline(labelLeft - 2, top - 3, font.width(getLabel()) + 4, font.lineHeight + 4, 0xFF306844); } diff --git a/common/src/main/java/dev/ftb/mods/ftbfiltersystem/registry/item/SmartFilterItem.java b/common/src/main/java/dev/ftb/mods/ftbfiltersystem/registry/item/SmartFilterItem.java index 84742cb..235386c 100644 --- a/common/src/main/java/dev/ftb/mods/ftbfiltersystem/registry/item/SmartFilterItem.java +++ b/common/src/main/java/dev/ftb/mods/ftbfiltersystem/registry/item/SmartFilterItem.java @@ -61,6 +61,7 @@ public InteractionResultHolder use(Level level, Player player, Intera @Override public void appendHoverText(ItemStack itemStack, @Nullable Level level, List list, TooltipFlag tooltipFlag) { - list.add(Component.translatable("item.ftbfiltersystem.smart_filter.tooltip").withStyle(ChatFormatting.GRAY)); + list.add(Component.translatable("item.ftbfiltersystem.smart_filter.tooltip.1").withStyle(ChatFormatting.GRAY)); + list.add(Component.translatable("item.ftbfiltersystem.smart_filter.tooltip.2").withStyle(ChatFormatting.GRAY)); } } diff --git a/common/src/main/resources/assets/ftbfiltersystem/lang/en_us.json b/common/src/main/resources/assets/ftbfiltersystem/lang/en_us.json index 4f1b679..4d0dc93 100644 --- a/common/src/main/resources/assets/ftbfiltersystem/lang/en_us.json +++ b/common/src/main/resources/assets/ftbfiltersystem/lang/en_us.json @@ -1,7 +1,8 @@ { "ftbfiltersystem": "FTB Filter System", "item.ftbfiltersystem.smart_filter": "Smart Filter", - "item.ftbfiltersystem.smart_filter.tooltip": "Right-click: configure filter\nSneak + Right-click: Test filter with item in off hand", + "item.ftbfiltersystem.smart_filter.tooltip.1": "Right-click: configure filter", + "item.ftbfiltersystem.smart_filter.tooltip.2": "Sneak + Right-click: Test filter with item in off hand", "ftbfiltersystem.message.parse_failed": "Filter parse failure: %s", "ftbfiltersystem.message.not_a_filter": "You must hold a Smart Filter in your main hand", "ftbfiltersystem.message.no_offhand_item": "Hold an item to be tested in your off hand", @@ -28,7 +29,7 @@ "filter.ftbfiltersystem.or.name": "Any Of", "filter.ftbfiltersystem.or.tooltip": "Compound filter: this filter matches if ANY of its child filters match.", "filter.ftbfiltersystem.not.name": "Not", - "filter.ftbfiltersystem.not.tooltip": "Compound filter: this filter matches if its child filter does NOT match. At most child can be added.", + "filter.ftbfiltersystem.not.tooltip": "Compound filter: this filter matches if its child filter does NOT match. At most one child can be added.", "filter.ftbfiltersystem.only_one.name": "Only One Of", "filter.ftbfiltersystem.only_one.tooltip": "Compound filter: this filter matches if exactly ONE of its child filters matches.", "filter.ftbfiltersystem.block.name": "Is Block", diff --git a/gradlew b/gradlew old mode 100644 new mode 100755