Disable/enable page buttons in blueprint library
This commit is contained in:
parent
771f42977c
commit
2f7ae5a3f2
2 changed files with 17 additions and 2 deletions
|
@ -51,7 +51,7 @@ public class TileBlueprintLibrary extends TileBuildCraft implements IInventory {
|
|||
public EntityPlayer uploadingPlayer = null;
|
||||
public EntityPlayer downloadingPlayer = null;
|
||||
|
||||
private int pageId = 0;
|
||||
public int pageId = 0;
|
||||
|
||||
public TileBlueprintLibrary() {
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
|
|||
buttonList.add(deleteButton);
|
||||
|
||||
checkDelete();
|
||||
checkPages();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -145,14 +146,28 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
|
|||
}
|
||||
|
||||
checkDelete();
|
||||
checkPages();
|
||||
}
|
||||
|
||||
protected void checkDelete() {
|
||||
if (library.selected != -1) {
|
||||
deleteButton.enabled = true;
|
||||
|
||||
} else {
|
||||
deleteButton.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected void checkPages() {
|
||||
if (library.pageId != 0) {
|
||||
prevPageButton.enabled = true;
|
||||
} else {
|
||||
prevPageButton.enabled = false;
|
||||
}
|
||||
|
||||
if (library.pageId < BuildCraftBuilders.clientDB.getPageNumber() - 1) {
|
||||
nextPageButton.enabled = true;
|
||||
} else {
|
||||
nextPageButton.enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue