From 060c73ee2b7c49dab600825bf59c7300acbd41a2 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Tue, 25 Jun 2024 22:06:16 +0200 Subject: [PATCH] improve PlayerSelector rendering consistency --- .../client/feature/modules/experimental/PlayerSelector.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/experimental/PlayerSelector.java b/Client/src/main/java/de/com/baseband/client/feature/modules/experimental/PlayerSelector.java index 2d27d5b..84dfdaa 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/experimental/PlayerSelector.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/experimental/PlayerSelector.java @@ -73,7 +73,7 @@ public class PlayerSelector extends Feature { public void text(RenderGameOverlayEvent.Text e) { ScaledResolution sr = new ScaledResolution(mc); int x = sr.getScaledWidth() / 5; - int y = sr.getScaledHeight() / 2; + int y = sr.getScaledHeight() / 2 - 5 * mc.fontRenderer.FONT_HEIGHT; if(display.isEmpty()) return; @@ -87,6 +87,7 @@ public class PlayerSelector extends Feature { } private void renderList(int x, int y) { + y += -Math.min(cursor - 5, 0) * mc.fontRenderer.FONT_HEIGHT; for (int i = Math.max(0, cursor - 5); i < Math.min(display.size(), cursor + 6); i++) { NetworkPlayerInfo playerInfo = display.get(i); boolean selected = cursor == i; @@ -103,6 +104,7 @@ public class PlayerSelector extends Feature { mode = Mode.LIST; mc.fontRenderer.drawStringWithShadow(" Select with enter", x, y, 0xffffffff); y += mc.fontRenderer.FONT_HEIGHT; + y += -Math.min(optionCursor - 5, 0) * mc.fontRenderer.FONT_HEIGHT; for (int i = Math.max(0, optionCursor - 5); i < Math.min(options.size(), optionCursor + 6); i++) { PlayerSelectOption option = options.get(i);