Put a scary button when instantiation fails so support can notify devs
This commit is contained in:
parent
fa2362811c
commit
e81a36e135
|
@ -21,6 +21,17 @@ public class SupportHomePage extends SupportPage
|
||||||
buildPage();
|
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)
|
private void buildPageButton(int slot,ShopItem shopItem, Class<? extends SupportPage> clazz)
|
||||||
{
|
{
|
||||||
Constructor pageConstructor;
|
Constructor pageConstructor;
|
||||||
|
@ -31,6 +42,7 @@ public class SupportHomePage extends SupportPage
|
||||||
{
|
{
|
||||||
System.out.println("Could not get page constructor:");
|
System.out.println("Could not get page constructor:");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
buildUnavailableButton(slot);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +54,7 @@ public class SupportHomePage extends SupportPage
|
||||||
{
|
{
|
||||||
System.out.println("Could not instantiate page:");
|
System.out.println("Could not instantiate page:");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
buildUnavailableButton(slot);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue