Apply Saving Replay dialog when pressing Enter (closes #424)
This commit is contained in:
@@ -83,10 +83,7 @@ public class GuiSavingReplay {
|
||||
GuiButton applyButton = new GuiButton()
|
||||
.setSize(150, 20)
|
||||
.setI18nLabel("replaymod.gui.done")
|
||||
.onClick(() -> {
|
||||
apply.forEach(Runnable::run);
|
||||
close();
|
||||
});
|
||||
.onClick(this::apply);
|
||||
|
||||
panel.addElements(new VerticalLayout.Data(0.5), applyButton);
|
||||
}
|
||||
@@ -98,6 +95,7 @@ public class GuiSavingReplay {
|
||||
.setText(originalName)
|
||||
.setI18nHint("replaymod.gui.delete")
|
||||
.setTextColorDisabled(Colors.RED)
|
||||
.onEnter(this::apply)
|
||||
.setTooltip(createTooltip(path, metaData));
|
||||
GuiButton clearButton = new GuiButton()
|
||||
.setSize(20, 20)
|
||||
@@ -133,6 +131,11 @@ public class GuiSavingReplay {
|
||||
}).addElements(null, tooltip, entry);
|
||||
}
|
||||
|
||||
private void apply() {
|
||||
apply.forEach(Runnable::run);
|
||||
close();
|
||||
}
|
||||
|
||||
private void applyOutput(Path path, String newName) {
|
||||
if (newName.isEmpty()) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user