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.
This commit is contained in:
@@ -76,8 +76,6 @@ public class GuiReplayViewer extends GuiScreen {
|
|||||||
}).onSelectionDoubleClicked(() -> {
|
}).onSelectionDoubleClicked(() -> {
|
||||||
if (this.loadButton.isEnabled()) {
|
if (this.loadButton.isEnabled()) {
|
||||||
this.loadButton.onClick();
|
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);
|
mod.startReplay(list.getSelected().file);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
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();
|
}).setSize(150, 20).setI18nLabel("replaymod.gui.load").setDisabled();
|
||||||
|
|||||||
Reference in New Issue
Block a user