Class ClickGuiTab

java.lang.Object
me.hackware.api.gui.ClickGuiTab

public abstract class ClickGuiTab extends Object
A single ClickGUI tab — the sub-screen shown when its tab is selected in the top tab bar.

Every tab has a stable, namespaced id (e.g. "hackware:clickgui:modules"), a human-readable name shown on the bar, and an order that sorts it left-to-right. Tabs are registered at runtime, so the built-in Modules / HUD Editor tabs and any future plugin tabs go through the same path: a plugin can add a brand-new tab, or register a tab under an existing id to replace that surface's rendering wholesale.

The active TabHost is passed to every hook rather than captured, so a single tab instance is shared across screen re-creations. All input hooks default to "not consumed"; override only what the tab needs.

  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ClickGuiTab(String id, String name, int order)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    barShouldYield(TabHost screen, int leftPx, int topPx, int rightPx, int bottomPx)
    For hideBarWhenActive() tabs only: whether the bar should currently yield (hide) given its on-screen pixel rectangle.
    boolean
    charTyped(TabHost screen, int codepoint)
     
    boolean
    When true, the tab bar auto-hides while this tab is active (revealing on hover) and is drawn on top of this tab's content instead of above it.
    final String
    id()
    Stable, namespaced identifier (e.g.
    void
    init(TabHost screen)
    Called once when the host screen (re)builds its tab list.
    boolean
    Whether this tab is a Studio surface (Macros / Profiles / Relations / Statistics).
    boolean
    keyPressed(TabHost screen, net.minecraft.client.input.KeyEvent event)
     
    boolean
    mouseClicked(TabHost screen, double mouseX, double mouseY, int button)
     
    boolean
    mouseDragged(TabHost screen, double mouseX, double mouseY)
     
    void
    mouseReleased(TabHost screen, double mouseX, double mouseY, int button)
     
    boolean
    mouseScrolled(TabHost screen, double mouseX, double mouseY, double amount)
     
    final String
    Display label shown on the tab bar.
    void
    Called when this tab becomes the active tab.
    void
    Called when this tab stops being the active tab, so it can persist state.
    final int
    Sort key for the tab bar (ascending, left to right).
    abstract void
    render(TabHost screen, net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY)
    Draw this tab's content.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ClickGuiTab

      protected ClickGuiTab(String id, String name, int order)
  • Method Details

    • id

      public final String id()
      Stable, namespaced identifier (e.g. "hackware:clickgui:modules").
    • name

      public final String name()
      Display label shown on the tab bar.
    • order

      public final int order()
      Sort key for the tab bar (ascending, left to right).
    • hideBarWhenActive

      public boolean hideBarWhenActive()
      When true, the tab bar auto-hides while this tab is active (revealing on hover) and is drawn on top of this tab's content instead of above it. Used by the HUD editor so its elements can sit under the bar.
    • isStudioSurface

      public boolean isStudioSurface()
      Whether this tab is a Studio surface (Macros / Profiles / Relations / Statistics). Studio tabs get the clipped frosted-glass backdrop blur behind their panel and the tab bar (see StudioBlurShader); other tabs manage their own background.
    • barShouldYield

      public boolean barShouldYield(TabHost screen, int leftPx, int topPx, int rightPx, int bottomPx)
      For hideBarWhenActive() tabs only: whether the bar should currently yield (hide) given its on-screen pixel rectangle. Default always yields; the HUD editor overrides this to keep the bar shown unless an element actually sits beneath it.
    • init

      public void init(TabHost screen)
      Called once when the host screen (re)builds its tab list.
    • onActivate

      public void onActivate(TabHost screen)
      Called when this tab becomes the active tab.
    • onDeactivate

      public void onDeactivate(TabHost screen)
      Called when this tab stops being the active tab, so it can persist state.
    • render

      public abstract void render(TabHost screen, net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY)
      Draw this tab's content. mouseX/mouseY are in screen space.
    • mouseClicked

      public boolean mouseClicked(TabHost screen, double mouseX, double mouseY, int button)
    • mouseDragged

      public boolean mouseDragged(TabHost screen, double mouseX, double mouseY)
    • mouseReleased

      public void mouseReleased(TabHost screen, double mouseX, double mouseY, int button)
    • mouseScrolled

      public boolean mouseScrolled(TabHost screen, double mouseX, double mouseY, double amount)
    • keyPressed

      public boolean keyPressed(TabHost screen, net.minecraft.client.input.KeyEvent event)
    • charTyped

      public boolean charTyped(TabHost screen, int codepoint)