From be474aa5794b3f6298a4abf660a800c10d80bbfb Mon Sep 17 00:00:00 2001 From: Sollace Date: Mon, 24 Jul 2023 20:53:38 +0100 Subject: [PATCH] Fixed trigger pixels legend --- .../client/hdskins/LegendOverlayWidget.java | 11 ++++++++--- .../client/hdskins/PonifiedDualCarouselWidget.java | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/minelittlepony/client/hdskins/LegendOverlayWidget.java b/src/main/java/com/minelittlepony/client/hdskins/LegendOverlayWidget.java index 0a9545bb..ed6f8a6a 100644 --- a/src/main/java/com/minelittlepony/client/hdskins/LegendOverlayWidget.java +++ b/src/main/java/com/minelittlepony/client/hdskins/LegendOverlayWidget.java @@ -16,6 +16,12 @@ import java.util.stream.Collectors; class LegendOverlayWidget implements Carousel.Element, ITextContext { private static final Bounds LEGEND_BLOCK_BOUNDS = new Bounds(0, 0, 10, 10); + private final Bounds frame; + + public LegendOverlayWidget(Bounds frame) { + this.frame = frame; + } + @Override public void render(DummyPlayer player, DrawContext context, int mouseX, int mouseY) { IPonyData data = IPony.getManager().getPony(player).metadata(); @@ -23,13 +29,12 @@ class LegendOverlayWidget implements Carousel.Element, ITextContext { data.getTriggerPixels().forEach((key, value) -> { context.getMatrices().push(); int i = index[0]++; - int x = 0;//frame.left; - int y = 0/*frame.top*/ + (i * 10 + 20); + int x = frame.left; + int y = frame.top + (i * 10 + 20); context.getMatrices().translate(x, y, 1); drawLegendBlock(context, 0, 0, 0, mouseX - x, mouseY - y, key, value); context.getMatrices().pop(); }); - MinecraftClient.getInstance().getBufferBuilders().getEntityVertexConsumers().draw(); } private void drawLegendBlock(DrawContext context, int index, int x, int y, int mouseX, int mouseY, String key, TriggerPixelType value) { diff --git a/src/main/java/com/minelittlepony/client/hdskins/PonifiedDualCarouselWidget.java b/src/main/java/com/minelittlepony/client/hdskins/PonifiedDualCarouselWidget.java index ea3b794d..cb463b99 100644 --- a/src/main/java/com/minelittlepony/client/hdskins/PonifiedDualCarouselWidget.java +++ b/src/main/java/com/minelittlepony/client/hdskins/PonifiedDualCarouselWidget.java @@ -17,8 +17,8 @@ class PonifiedDualCarouselWidget extends DualCarouselWidget { public PonifiedDualCarouselWidget(GuiSkins screen) { super(screen); - local.addElement(new LegendOverlayWidget()); - remote.addElement(new LegendOverlayWidget()); + local.addElement(new LegendOverlayWidget(local.bounds)); + remote.addElement(new LegendOverlayWidget(remote.bounds)); } @Override