aboutsummaryrefslogtreecommitdiff
path: root/src/testmod/java/dev
diff options
context:
space:
mode:
authorxander <xander@isxander.dev>2022-09-30 17:28:31 +0100
committerxander <xander@isxander.dev>2022-09-30 17:28:31 +0100
commit2eb6fa164da23c547ceccf8d2773a1e12eedb4f3 (patch)
tree2be18d83076c408088773eee086e3d461b3dffb8 /src/testmod/java/dev
parent575faeaf25256e02cbca39501c3ec97655959cea (diff)
downloadYetAnotherConfigLib-2eb6fa164da23c547ceccf8d2773a1e12eedb4f3.tar.gz
YetAnotherConfigLib-2eb6fa164da23c547ceccf8d2773a1e12eedb4f3.tar.bz2
YetAnotherConfigLib-2eb6fa164da23c547ceccf8d2773a1e12eedb4f3.zip
labels now support style events
Diffstat (limited to 'src/testmod/java/dev')
-rw-r--r--src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java b/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java
index aca966b..80db142 100644
--- a/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java
+++ b/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java
@@ -15,6 +15,8 @@ import net.minecraft.client.gui.screen.MessageScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.option.GraphicsMode;
import net.minecraft.client.toast.SystemToast;
+import net.minecraft.text.ClickEvent;
+import net.minecraft.text.HoverEvent;
import net.minecraft.text.Text;
import java.awt.*;
@@ -176,7 +178,13 @@ public class ModMenuIntegration implements ModMenuApi {
.controller(ActionController::new)
.build())
.option(Option.createBuilder(Text.class)
- .binding(Binding.immutable(Text.of("Labels that are very large get wrapped around onto a new line! I hope this is a good demonstration!")))
+ .binding(Binding.immutable(Text.empty()
+ .append(Text.literal("a").styled(style -> style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.of("a")))))
+ .append(Text.literal("b").styled(style -> style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.of("b")))))
+ .append(Text.literal("c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c").styled(style -> style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.of("c")))))
+ .append(Text.literal("e").styled(style -> style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.of("e")))))
+ .styled(style -> style.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://isxander.dev")))
+ ))
.controller(LabelController::new)
.build())
.build())