diff options
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/infopanes/InfoPane.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/infopanes/InfoPane.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/infopanes/InfoPane.java b/src/main/java/io/github/moulberry/notenoughupdates/infopanes/InfoPane.java index 945b1bbf..3ceb0425 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/infopanes/InfoPane.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/infopanes/InfoPane.java @@ -8,6 +8,7 @@ import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; import java.awt.*; +import java.util.concurrent.CompletableFuture; public abstract class InfoPane extends Gui { @@ -48,4 +49,21 @@ public abstract class InfoPane extends Gui { height - overlay.getBoxPadding() + 5, bg.getRGB()); } + public static CompletableFuture<? extends InfoPane> create(NEUOverlay overlay, NEUManager manager, String infoType, + String name, String internalName, String infoText) { + switch (infoType.intern()) { + case "WIKI_URL": + return HTMLInfoPane.createFromWikiUrl(overlay, manager, name, infoText); + case "WIKI": + return CompletableFuture.completedFuture( + HTMLInfoPane.createFromWikiText(overlay, manager, name, internalName, infoText)); + case "HTML": + return CompletableFuture.completedFuture( + new HTMLInfoPane(overlay, manager, name, internalName, infoText)); + default: + return CompletableFuture.completedFuture( + new TextInfoPane(overlay, manager, name, infoText)); + } + } + } |
