make playerselector not act up when using chat
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m30s

This commit is contained in:
Daniella / Tove 2024-06-25 22:45:27 +02:00
parent b21e85a998
commit 197c81cc2b
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -92,7 +92,7 @@ public class PlayerSelector extends Feature {
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;
if (selected && Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
if (mc.currentScreen == null && selected && Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
mode = Mode.OPTIONS;
optionCursor = 0;
}
@ -101,7 +101,7 @@ public class PlayerSelector extends Feature {
}
}
private void renderOptions(int x, int y) {
if(Keyboard.isKeyDown(Keyboard.KEY_LEFT))
if(mc.currentScreen != null || Keyboard.isKeyDown(Keyboard.KEY_LEFT))
mode = Mode.LIST;
mc.fontRenderer.drawStringWithShadow(" Select with enter", x, y - mc.fontRenderer.FONT_HEIGHT, 0xffffffff);
y += -Math.min(optionCursor - 5, 0) * mc.fontRenderer.FONT_HEIGHT;