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 uploadingPlayer = null;
|
||||||
public EntityPlayer downloadingPlayer = null;
|
public EntityPlayer downloadingPlayer = null;
|
||||||
|
|
||||||
private int pageId = 0;
|
public int pageId = 0;
|
||||||
|
|
||||||
public TileBlueprintLibrary() {
|
public TileBlueprintLibrary() {
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,7 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
|
||||||
buttonList.add(deleteButton);
|
buttonList.add(deleteButton);
|
||||||
|
|
||||||
checkDelete();
|
checkDelete();
|
||||||
|
checkPages();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -145,14 +146,28 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
|
||||||
}
|
}
|
||||||
|
|
||||||
checkDelete();
|
checkDelete();
|
||||||
|
checkPages();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void checkDelete() {
|
protected void checkDelete() {
|
||||||
if (library.selected != -1) {
|
if (library.selected != -1) {
|
||||||
deleteButton.enabled = true;
|
deleteButton.enabled = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
deleteButton.enabled = false;
|
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