From a0c1dc1a29f960b5fe97ec96411e86fff9df0fd2 Mon Sep 17 00:00:00 2001 From: BuggyAl <64368488+BuggyAl@users.noreply.github.com> Date: Mon, 27 Feb 2023 22:06:44 -0600 Subject: cancel invalid clicks in terminal (#351) * cancel invalid clicks in terminal Signed-off-by: BuggyAl <64368488+BuggyAl@users.noreply.github.com> * - An option for blocking click Signed-off-by: syeyoung --------- Signed-off-by: BuggyAl <64368488+BuggyAl@users.noreply.github.com> Signed-off-by: syeyoung Co-authored-by: syeyoung --- .../features/impl/boss/terminal/FeatureTerminalSolvers.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mod/src/main/java') diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/FeatureTerminalSolvers.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/FeatureTerminalSolvers.java index 800b75d1..8b6b2f22 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/FeatureTerminalSolvers.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/FeatureTerminalSolvers.java @@ -20,8 +20,10 @@ package kr.syeyoung.dungeonsguide.mod.features.impl.boss.terminal; +import kr.syeyoung.dungeonsguide.mod.config.types.TCBoolean; import kr.syeyoung.dungeonsguide.mod.events.annotations.DGEventHandler; import kr.syeyoung.dungeonsguide.mod.events.impl.DGTickEvent; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; @@ -40,8 +42,12 @@ import java.util.List; public class FeatureTerminalSolvers extends SimpleFeature { public FeatureTerminalSolvers() { super("Bossfight.Floor 7","F7 GUI Terminal Solver", "Solve f7 gui terminals. (color, starts with, order, navigate, correct panes)", "bossfight.terminals"); + + addParameter("cancelwrongclick", new FeatureParameter<>("cancelwrongclick", "Block invalid clicks", "", true, TCBoolean.INSTANCE, nval -> block = nval)); } + private boolean block = true; + public static final List solutionProviders = new ArrayList(); static { @@ -142,7 +148,9 @@ public class FeatureTerminalSolvers extends SimpleFeature { Slot s = ((GuiChest) Minecraft.getMinecraft().currentScreen).getSlotUnderMouse(); if (solution.getCurrSlots().contains(s)) { clicked.add(s); - return; + } else { + if (block) + mouseInputEvent.setCanceled(true); } } -- cgit