2020-09-09 16:48:43 +02:00
|
|
|
package de.ellpeck.actuallyadditions.booklet.page;
|
2016-11-10 21:07:15 +01:00
|
|
|
|
2016-11-10 22:06:58 +01:00
|
|
|
import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase;
|
|
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public class PageTextOnly extends BookletPage {
|
2016-11-10 21:07:15 +01:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public PageTextOnly(int localizationKey, int priority) {
|
2016-11-22 22:54:35 +01:00
|
|
|
super(localizationKey, priority);
|
|
|
|
}
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public PageTextOnly(int localizationKey) {
|
2016-11-10 21:07:15 +01:00
|
|
|
super(localizationKey);
|
|
|
|
}
|
2016-11-10 22:06:58 +01:00
|
|
|
|
2016-11-11 16:37:45 +01:00
|
|
|
@SideOnly(Side.CLIENT)
|
2019-05-02 09:10:29 +02:00
|
|
|
public static void renderTextToPage(GuiBookletBase gui, BookletPage page, int x, int y) {
|
2016-11-11 16:37:45 +01:00
|
|
|
String text = page.getInfoText();
|
2019-05-02 09:10:29 +02:00
|
|
|
if (text != null && !text.isEmpty()) {
|
2016-12-07 15:25:04 +01:00
|
|
|
gui.renderSplitScaledAsciiString(text, x, y, 0, false, gui.getMediumFontSize(), 120);
|
2016-11-10 22:06:58 +01:00
|
|
|
}
|
|
|
|
}
|
2016-11-16 20:31:16 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
2019-05-02 09:10:29 +02:00
|
|
|
public void drawScreenPre(GuiBookletBase gui, int startX, int startY, int mouseX, int mouseY, float partialTicks) {
|
2016-11-16 20:31:16 +01:00
|
|
|
super.drawScreenPre(gui, startX, startY, mouseX, mouseY, partialTicks);
|
2019-05-02 09:10:29 +02:00
|
|
|
renderTextToPage(gui, this, startX + 6, startY + 5);
|
2016-11-16 20:31:16 +01:00
|
|
|
}
|
2016-11-10 21:07:15 +01:00
|
|
|
}
|