From c051b0ba3b55459cba707a4cb9a4d7c989912fd1 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Fri, 28 Jun 2019 17:38:55 +0200 Subject: [PATCH] Fix crash when quickly double-clicking the "Load"-replay button This has previously been fixed for quadruple-clicking on the replay itself but for some reason has not been fixed for simply double-clicking the "Load" button. --- .../com/replaymod/replay/gui/screen/GuiReplayViewer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/replaymod/replay/gui/screen/GuiReplayViewer.java b/src/main/java/com/replaymod/replay/gui/screen/GuiReplayViewer.java index 4b76a03c..03e8c97e 100755 --- a/src/main/java/com/replaymod/replay/gui/screen/GuiReplayViewer.java +++ b/src/main/java/com/replaymod/replay/gui/screen/GuiReplayViewer.java @@ -76,8 +76,6 @@ public class GuiReplayViewer extends GuiScreen { }).onSelectionDoubleClicked(() -> { if (this.loadButton.isEnabled()) { this.loadButton.onClick(); - // Disable load button to prevent the player from opening the replay twice at the same time - this.loadButton.setDisabled(); } }); @@ -88,6 +86,9 @@ public class GuiReplayViewer extends GuiScreen { mod.startReplay(list.getSelected().file); } catch (IOException e) { e.printStackTrace(); + } finally { + // Disable load button to prevent the player from opening the replay twice at the same time + loadButton.setDisabled(); } } }).setSize(150, 20).setI18nLabel("replaymod.gui.load").setDisabled();