aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl/gui/controllers/ActionController.java
diff options
context:
space:
mode:
authorisXander <isxander@users.noreply.github.com>2022-09-19 19:11:13 +0100
committerisXander <isxander@users.noreply.github.com>2022-09-19 19:11:13 +0100
commitde1c8a317226b58fe03497027136eaed1adfd808 (patch)
tree5f97d6d91bc37f83d8de8c6f4a335d06a014cee0 /src/main/java/dev/isxander/yacl/gui/controllers/ActionController.java
parent904e4d61b6cf84c807a99e66fc70527b01ae6fcc (diff)
downloadYetAnotherConfigLib-de1c8a317226b58fe03497027136eaed1adfd808.tar.gz
YetAnotherConfigLib-de1c8a317226b58fe03497027136eaed1adfd808.tar.bz2
YetAnotherConfigLib-de1c8a317226b58fe03497027136eaed1adfd808.zip
1.4.0
improved tooltips `ButtonOption` now consumes itself, so you can access it when building.
Diffstat (limited to 'src/main/java/dev/isxander/yacl/gui/controllers/ActionController.java')
-rw-r--r--src/main/java/dev/isxander/yacl/gui/controllers/ActionController.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/dev/isxander/yacl/gui/controllers/ActionController.java b/src/main/java/dev/isxander/yacl/gui/controllers/ActionController.java
index 3550072..673b614 100644
--- a/src/main/java/dev/isxander/yacl/gui/controllers/ActionController.java
+++ b/src/main/java/dev/isxander/yacl/gui/controllers/ActionController.java
@@ -9,13 +9,13 @@ import net.minecraft.text.Text;
import org.jetbrains.annotations.ApiStatus;
import org.lwjgl.glfw.GLFW;
-import java.util.function.Consumer;
+import java.util.function.BiConsumer;
/**
* Simple controller that simply runs the button action on press
* and renders a {@link} Text on the right.
*/
-public class ActionController implements Controller<Consumer<YACLScreen>> {
+public class ActionController implements Controller<BiConsumer<YACLScreen, ButtonOption>> {
public static final Text DEFAULT_TEXT = Text.translatable("yacl.control.action.execute");
private final ButtonOption option;
@@ -75,7 +75,7 @@ public class ActionController implements Controller<Consumer<YACLScreen>> {
public void executeAction() {
playDownSound();
- control.option().action().accept(screen);
+ control.option().action().accept(screen, control.option());
}
@Override