From 3100ef4ce8f5222aed41a82c4b9e48692189311b Mon Sep 17 00:00:00 2001 From: Lenni0451 <20379977+Lenni0451@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:32:23 +0100 Subject: [PATCH] Click buttons without delay --- src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java | 2 +- src/main/java/net/raphimc/viaproxy/ui/impl/RealmsTab.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java b/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java index 65312d0..188a78e 100644 --- a/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java +++ b/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java @@ -197,7 +197,7 @@ public class GeneralTab extends UITab { timer.stop(); if (System.getProperty("viaproxy.gui.autoStart") != null) { - this.stateButton.doClick(); + this.stateButton.doClick(0); } } }); diff --git a/src/main/java/net/raphimc/viaproxy/ui/impl/RealmsTab.java b/src/main/java/net/raphimc/viaproxy/ui/impl/RealmsTab.java index 7ecb94e..5c07719 100644 --- a/src/main/java/net/raphimc/viaproxy/ui/impl/RealmsTab.java +++ b/src/main/java/net/raphimc/viaproxy/ui/impl/RealmsTab.java @@ -237,7 +237,7 @@ public class RealmsTab extends UITab { final int chosen = JOptionPane.showConfirmDialog(this.viaProxyWindow, I18n.get("tab.realms.accept_tos", "https://aka.ms/MinecraftRealmsTerms"), "ViaProxy", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (chosen == JOptionPane.YES_OPTION) { javaRealmsService.acceptTos(); - join.doClick(); + join.doClick(0); } } else { Logger.LOGGER.error("Failed to join realm", cause); @@ -256,12 +256,12 @@ public class RealmsTab extends UITab { final GeneralTab generalTab = this.viaProxyWindow.generalTab; if (generalTab.stateButton.isEnabled()) { if (!generalTab.stateButton.getText().equals(I18n.get("tab.general.state.start"))) { - generalTab.stateButton.doClick(); // Stop the running proxy + generalTab.stateButton.doClick(0); // Stop the running proxy } generalTab.serverAddress.setText(address); generalTab.serverVersion.setSelectedItem(version); generalTab.authMethod.setSelectedIndex(0); - generalTab.stateButton.doClick(); + generalTab.stateButton.doClick(0); this.viaProxyWindow.contentPane.setSelectedIndex(0); } }