Class ExpressionPanelRendering

java.lang.Object
org.cyclops.integrateddynamics.core.logicprogrammer.client.ExpressionPanelRendering

public final class ExpressionPanelRendering extends Object
The layout, colors and drawing that the expression panel of an operator and the one without an operator share.
  • 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:
    • TEXT_WIDTH

      public static final int TEXT_WIDTH
      See Also:
    • ELLIPSIS

      public static final String 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.
    • renderFooter

      public static void renderFooter(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int guiLeft, int guiTop, net.minecraft.client.gui.Font font, net.minecraft.network.chat.Component text, @Nullable 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. Text that does not fit ends in an ellipsis.
      Parameters:
      tooltip - Shown when hovering the footer, defaults to the text if it does not fit.
      regions - Where the region for the tooltip is added.
    • 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

      public static List<net.minecraft.network.chat.Component> wrapTooltip(List<net.minecraft.network.chat.Component> lines)