Class ExtensibleTextbox

java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.glasslauncher.mods.api.gcapi.screen.widget.ExtensibleTextbox
All Implemented Interfaces:
HasDrawable, HasToolTip

public class ExtensibleTextbox extends net.minecraft.client.gui.DrawableHelper implements HasDrawable, HasToolTip
Basically a modified Textbox from r1.2.5, but modified for gcapi's use case.
  • Field Details

    • selectedTextColour

      public int selectedTextColour
    • deselectedTextColour

      public int deselectedTextColour
    • errorBorderColour

      public int errorBorderColour
  • Constructor Details

    • ExtensibleTextbox

      public ExtensibleTextbox(net.minecraft.client.render.TextRenderer textRenderer)
  • Method Details

    • isValueValid

      public boolean isValueValid()
    • tick

      public void tick()
      Specified by:
      tick in interface HasDrawable
    • setText

      public void setText(String string)
    • getText

      public String getText()
    • getSelectedText

      public String getSelectedText()
    • addText

      public void addText(String string)
    • method_729

      public void method_729(int i)
    • method_735

      public void method_735(int i)
    • method_739

      public int method_739(int i)
    • method_730

      public int method_730(int i, int j)
    • updateOffsetCursorMax

      public void updateOffsetCursorMax(int cursorMax)
    • updateCursorMax

      public void updateCursorMax(int cursorMax)
    • updateCursorMax

      public void updateCursorMax()
    • onTextChanged

      public void onTextChanged()
    • keyPressed

      public void keyPressed(char c, int i)
      Specified by:
      keyPressed in interface HasDrawable
    • setID

      public void setID(int id)
      Specified by:
      setID in interface HasDrawable
    • mouseClicked

      public void mouseClicked(int mouseX, int mouseY, int button)
      Specified by:
      mouseClicked in interface HasDrawable
    • setXYWH

      public void setXYWH(int x, int y, int width, int height)
      Specified by:
      setXYWH in interface HasDrawable
    • getTooltip

      public List<String> getTooltip()
      Description copied from interface: HasToolTip
      The tooltip to show, can be multiline by adding another element onto the list.
      Specified by:
      getTooltip in interface HasToolTip
      Returns:
      a List of colour-enabled strings to use as a tooltip.
    • getXYWH

      public int[] getXYWH()
      Description copied from interface: HasToolTip
      The position and size of your element. Required.
      Specified by:
      getXYWH in interface HasToolTip
      Returns:
      a 4 length array of ints, the X position, Y position, width and height of your element.
    • draw

      public void draw(int mouseX, int mouseY)
      Specified by:
      draw in interface HasDrawable
    • setMaxLength

      public void setMaxLength(int i)
    • getMaxLength

      public int getMaxLength()
    • getCursorMax

      public int getCursorMax()
    • shouldDrawBackground

      public boolean shouldDrawBackground()
    • setShouldDrawBackground

      public void setShouldDrawBackground(boolean flag)
    • setSelected

      public void setSelected(boolean flag)
    • isSelected

      public boolean isSelected()
    • getCursorMin

      public int getCursorMin()
    • getBackgroundOffset

      public int getBackgroundOffset()
    • updateCursorPosition

      public void updateCursorPosition(int newCursorPos)
    • setEnabled

      public void setEnabled(boolean flag)
    • isEnabled

      public boolean isEnabled()
    • setValidator

      public void setValidator(Function<String,uk.co.benjiweber.expressions.tuple.BiTuple<Boolean,List<String>>> contentsValidator)