Class ExpressionPanelRendering
java.lang.Object
org.cyclops.integrateddynamics.core.logicprogrammer.client.ExpressionPanelRendering
The layout, colors and drawing that the expression panel of an operator and the one without an operator share.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final recordA part of the panel that can be clicked or has a tooltip, relative to the gui. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final Stringstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddrawFitted(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, net.minecraft.client.gui.Font font, String text, int x, int y, int width, int height, int color) Draw text centered in a box, at the largest of a few scales at which it fits, truncating it at the smallest one.static voiddrawOutline(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int x, int y, int width, int height, int color) static intgetContrastingTextColor(int background) static voidrenderFooter(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int guiLeft, int guiTop, net.minecraft.client.gui.Font font, net.minecraft.network.chat.Component text, net.minecraft.network.chat.Component tooltip, List<ExpressionPanelRendering.Region> regions) Draw text centered in the footer, on the dark background of the expression where the colors of types are readable.static voidrenderRegionTooltips(ContainerScreenLogicProgrammerBase<?> gui, net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, List<ExpressionPanelRendering.Region> regions, int mouseX, int mouseY) Draw the tooltip of the region under the mouse.static voidrenderStatus(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int guiLeft, int guiTop, net.minecraft.client.gui.Font font, Expression expression, ExpressionTypeChecker.Result result, List<ExpressionPanelRendering.Region> regions) Draw the type of the expression in the footer, in the colors of its types as in tooltips, or the first error instead, which keeps it from being written.static voidrenderTextBox(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int x, int y, int bottom, int contentBottom, boolean focused) Draw the box of the text: its outline while it is focused, and otherwise the line between it and the footer, which is where the bottom of the outline goes.static voidrenderTextError(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int guiLeft, int guiTop, net.minecraft.client.gui.Font font, ExpressionParseException error, List<ExpressionPanelRendering.Region> regions) Draw the message of an error in the text in the footer, without where it is, as the text marks it.static voidrenderTitle(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int guiLeft, int guiTop, net.minecraft.client.gui.Font font) static List<net.minecraft.network.chat.Component> wrapTooltip(List<net.minecraft.network.chat.Component> lines)
-
Field Details
-
COLOR_TEXT
public static final int COLOR_TEXT -
COLOR_TEXT_LIGHT
public static final int COLOR_TEXT_LIGHT -
COLOR_TEXT_ERROR
public static final int COLOR_TEXT_ERROR -
COLOR_ERROR
public static final int COLOR_ERROR -
COLOR_SELECTED
public static final int COLOR_SELECTED -
COLOR_STRIP
public static final int COLOR_STRIP -
COLOR_STRIP_LINE
public static final int COLOR_STRIP_LINE -
COLOR_STRIP_HOVER
public static final int COLOR_STRIP_HOVER -
COLOR_FOCUS
public static final int COLOR_FOCUS -
COLOR_EMPTY
public static final int COLOR_EMPTY -
COLOR_EDITED
public static final int COLOR_EDITED -
PANEL_X
public static final int PANEL_X- See Also:
-
PANEL_WIDTH
public static final int PANEL_WIDTH- See Also:
-
TITLE_Y
public static final int TITLE_Y- See Also:
-
BUTTONS_Y
public static final int BUTTONS_Y- See Also:
-
PARAMS_Y
public static final int PARAMS_Y- See Also:
-
CHIP_HEIGHT
public static final int CHIP_HEIGHT- See Also:
-
LINE_HEIGHT
public static final int LINE_HEIGHT- See Also:
-
CONTENT_BOTTOM
public static final int CONTENT_BOTTOM- See Also:
-
FOOTER_LINES
public static final int FOOTER_LINES- See Also:
-
FOOTER_HEIGHT
public static final int FOOTER_HEIGHT- See Also:
-
FOOTER_Y
public static final int FOOTER_Y- See Also:
-
TEXT_WIDTH
public static final int TEXT_WIDTH- See Also:
-
ELLIPSIS
- See Also:
-
APPLY_DELAY_MS
public static final int APPLY_DELAY_MS- See Also:
-
-
Method Details
-
drawFitted
public static void drawFitted(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, net.minecraft.client.gui.Font font, String text, int x, int y, int width, int height, int color) Draw text centered in a box, at the largest of a few scales at which it fits, truncating it at the smallest one. -
getContrastingTextColor
public static int getContrastingTextColor(int background) - Parameters:
background- A background color.- Returns:
- Dark or light text, whichever can be read on it.
-
drawOutline
public static void drawOutline(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int x, int y, int width, int height, int color) -
renderTextBox
public static void renderTextBox(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int x, int y, int bottom, int contentBottom, boolean focused) Draw the box of the text: its outline while it is focused, and otherwise the line between it and the footer, which is where the bottom of the outline goes.- Parameters:
x- The left of the box.y- The top of the box.bottom- Where the footer starts.
-
renderTitle
public static void renderTitle(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int guiLeft, int guiTop, net.minecraft.client.gui.Font font) -
renderStatus
public static void renderStatus(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int guiLeft, int guiTop, net.minecraft.client.gui.Font font, Expression expression, ExpressionTypeChecker.Result result, List<ExpressionPanelRendering.Region> regions) Draw the type of the expression in the footer, in the colors of its types as in tooltips, or the first error instead, which keeps it from being written. The check mark next to the operator name already tells when it can be written. -
renderTextError
public static void renderTextError(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int guiLeft, int guiTop, net.minecraft.client.gui.Font font, ExpressionParseException error, List<ExpressionPanelRendering.Region> regions) Draw the message of an error in the text in the footer, without where it is, as the text marks it. -
renderRegionTooltips
public static void renderRegionTooltips(ContainerScreenLogicProgrammerBase<?> gui, net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, List<ExpressionPanelRendering.Region> regions, int mouseX, int mouseY) Draw the tooltip of the region under the mouse. -
wrapTooltip
-