Enable/disable delete button when selected or not
This commit is contained in:
parent
646c694f80
commit
821ab3a9c3
1 changed files with 13 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue