diff options
| author | Anthony Hilyard <anthony.hilyard@gmail.com> | 2021-09-29 13:27:28 -0700 |
|---|---|---|
| committer | Anthony Hilyard <anthony.hilyard@gmail.com> | 2021-09-29 13:27:28 -0700 |
| commit | 8c02a2a7e0d2e2951cdc6a4382a6aa8f235ec63b (patch) | |
| tree | 6afeb1c55253dbcbce3510fb7d64b55dda647dcd /src/main/java/com/anthonyhilyard/iceberg/events | |
| parent | 211793ac73a3aaa98835c9ac25fa4583a72bb03a (diff) | |
| download | Iceberg-8c02a2a7e0d2e2951cdc6a4382a6aa8f235ec63b.tar.gz Iceberg-8c02a2a7e0d2e2951cdc6a4382a6aa8f235ec63b.tar.bz2 Iceberg-8c02a2a7e0d2e2951cdc6a4382a6aa8f235ec63b.zip | |
Added extended tooltip rendering events to facilitate customization.
Diffstat (limited to 'src/main/java/com/anthonyhilyard/iceberg/events')
| -rw-r--r-- | src/main/java/com/anthonyhilyard/iceberg/events/RenderTooltipExtEvent.java | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/main/java/com/anthonyhilyard/iceberg/events/RenderTooltipExtEvent.java b/src/main/java/com/anthonyhilyard/iceberg/events/RenderTooltipExtEvent.java new file mode 100644 index 0000000..dfb1364 --- /dev/null +++ b/src/main/java/com/anthonyhilyard/iceberg/events/RenderTooltipExtEvent.java @@ -0,0 +1,57 @@ +package com.anthonyhilyard.iceberg.events; + +import java.util.List; + +import com.mojang.blaze3d.matrix.MatrixStack; + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.text.ITextProperties; +import net.minecraftforge.client.event.RenderTooltipEvent; + +public class RenderTooltipExtEvent +{ + public static class Pre extends RenderTooltipEvent.Pre + { + private boolean comparisonTooltip = false; + public Pre(ItemStack stack, List<? extends ITextProperties> lines, MatrixStack matrixStack, int x, int y, int screenWidth, int screenHeight, int maxWidth, FontRenderer font, boolean comparison) + { + super(stack, lines, matrixStack, x, y, screenWidth, screenHeight, maxWidth, font); + comparisonTooltip = comparison; + } + public boolean isComparison() { return comparisonTooltip; } + } + + public static class PostBackground extends RenderTooltipEvent.PostBackground + { + private boolean comparisonTooltip = false; + public PostBackground(ItemStack stack, List<? extends ITextProperties> textLines, MatrixStack matrixStack, int x, int y, FontRenderer font, int width, int height, boolean comparison) + { + super(stack, textLines, matrixStack, x, y, font, width, height); + comparisonTooltip = comparison; + } + public boolean isComparison() { return comparisonTooltip; } + } + + public static class PostText extends RenderTooltipEvent.PostText + { + private boolean comparisonTooltip = false; + public PostText(ItemStack stack, List<? extends ITextProperties> textLines, MatrixStack matrixStack, int x, int y, FontRenderer font, int width, int height, boolean comparison) + { + super(stack, textLines, matrixStack, x, y, font, width, height); + comparisonTooltip = comparison; + } + public boolean isComparison() { return comparisonTooltip; } + } + + public static class Color extends RenderTooltipEvent.Color + { + private boolean comparisonTooltip = false; + public Color(ItemStack stack, List<? extends ITextProperties> textLines, MatrixStack matrixStack, int x, int y, FontRenderer font, int background, int borderStart, int borderEnd, boolean comparison) + { + super(stack, textLines, matrixStack, x, y, font, background, borderStart, borderEnd); + comparisonTooltip = comparison; + } + public boolean isComparison() { return comparisonTooltip; } + } +} |
