Class ExpressionParameterChips

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

public class ExpressionParameterChips extends Object
The parameters of an expression as chips in the expression panel, which are clicked and then a slot, or dragged onto a slot. While one is selected, its name and type can be changed in the row below the slots.
  • Field Details

    • COLOR_PARAM

      public static final int COLOR_PARAM
  • Constructor Details

  • Method Details

    • layout

      public static ParameterChipLayout layout(net.minecraft.client.gui.Font font, List<ExpressionParameter> parameters, int buttonWidth)
      Lay out the chips in rows below the title, followed by the button to add one. The rows are limited, and a chip tells how many parameters do not fit, which can be used in the text.
      Parameters:
      buttonWidth - The width of the button to add a parameter.
      Returns:
      Where the chips and the button go, relative to the gui.
    • render

      public int render(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int guiLeft, int guiTop, net.minecraft.client.gui.Font font, ExpressionEditor editor, int buttonWidth, List<ExpressionPanelRendering.Region> regions)
      Draw the chips, with only their names, as their types are in their tooltips and in the type of the expression.
      Parameters:
      buttonWidth - The width of the button to add a parameter.
      regions - Where the regions to click are added.
      Returns:
      The y position below the chips and the button to add one, relative to the gui.
    • onMousePressed

      public void onMousePressed(double mouseX, double mouseY)
      Forget a press, as a release can get lost, such as outside the window, and remember where this one is.
    • mouseDragged

      public boolean mouseDragged(double mouseX, double mouseY, int button)
      Returns:
      If a chip that was pressed is being dragged.
    • mouseReleased

      public int mouseReleased()
      Returns:
      The parameter that was dragged and is released, or -1 if none was dragged.
    • isDragging

      public boolean isDragging()
    • renderDragged

      public void renderDragged(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int guiLeft, int guiTop, net.minecraft.client.gui.Font font, ExpressionEditor editor, int mouseX, int mouseY)
      Draw the chip of the parameter that is being dragged under the mouse, above the items.