Enable/disable delete button when selected or not

This commit is contained in:
Raul Tambre 2014-05-07 21:35:13 +03:00
parent 646c694f80
commit 821ab3a9c3

View file

@ -59,6 +59,8 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
deleteButton = new GuiButton(2, j + 158, k + 114, 25, 20, StringUtils.localize("gui.del"));
buttonList.add(deleteButton);
checkDelete();
}
@Override
@ -141,5 +143,16 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
}
}
}
checkDelete();
}
protected void checkDelete() {
if (library.selected != -1) {
deleteButton.enabled = true;
}
else {
deleteButton.enabled = false;
}
}
}