Put a scary button when instantiation fails so support can notify devs

This commit is contained in:
Spencer 2018-01-04 19:15:38 -05:00 committed by Alexander Meech
parent fa2362811c
commit e81a36e135
1 changed files with 13 additions and 0 deletions

View File

@ -21,6 +21,17 @@ public class SupportHomePage extends SupportPage
buildPage();
}
private void buildUnavailableButton(int slot)
{
addItem(slot, new ShopItem(Material.BARRIER, "Unavailable", new String[] {
"Sorry, but this button is",
"not currently available.",
"",
"Please contact a developer",
"to get it fixed."
}, 1, true, true));
}
private void buildPageButton(int slot,ShopItem shopItem, Class<? extends SupportPage> clazz)
{
Constructor pageConstructor;
@ -31,6 +42,7 @@ public class SupportHomePage extends SupportPage
{
System.out.println("Could not get page constructor:");
e.printStackTrace();
buildUnavailableButton(slot);
return;
}
@ -42,6 +54,7 @@ public class SupportHomePage extends SupportPage
{
System.out.println("Could not instantiate page:");
e.printStackTrace();
buildUnavailableButton(slot);
}
});
}