public class HUDClickGUI extends ClickGUI implements Toggleable
ClickGUI.LoopFunction
Modifier and Type | Field and Description |
---|---|
protected java.util.List<FixedComponent> |
allComponents
List of all components.
|
protected boolean |
guiOpen
Whether the GUI components are shown or not.
|
protected java.util.List<FixedComponent> |
hudComponents
List of HUD components.
|
components, descriptionRenderer, inter, permanentComponents
Constructor and Description |
---|
HUDClickGUI(Interface inter,
DescriptionRenderer descriptionRenderer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addComponent(FixedComponent component)
Add component to
allComponents instead of the ClickGUI list. |
void |
addHUDComponent(FixedComponent component)
Add component to
allComponents and hudComponents . |
void |
enter()
Handle the GUI being opened.
|
void |
exit()
Handle the GUI being closed.
|
Toggleable |
getComponentToggleable(FixedComponent component)
Get toggleable indicating whether a component is shown or not.
|
void |
hideComponent(FixedComponent component)
Hide a component.
|
boolean |
isOn()
Returns whether GUI is open.
|
void |
showComponent(FixedComponent component)
Add a component to be visible.
|
void |
toggle()
Toggles GUI open state and chooses right components to render.
|
doComponentLoop, getComponents, getContext, handleButton, handleKey, handleScroll, loadConfig, render, saveConfig
protected java.util.List<FixedComponent> allComponents
protected java.util.List<FixedComponent> hudComponents
protected boolean guiOpen
public HUDClickGUI(Interface inter, DescriptionRenderer descriptionRenderer)
inter
- the interface for the ClickGUIdescriptionRenderer
- the DescriptionRenderer
used by the GUIpublic void addComponent(FixedComponent component)
allComponents
instead of the ClickGUI
list.addComponent
in class ClickGUI
component
- component to be addedpublic void showComponent(FixedComponent component)
PanelManager
showComponent
in interface PanelManager
showComponent
in class ClickGUI
component
- the component to be added.public void hideComponent(FixedComponent component)
PanelManager
hideComponent
in interface PanelManager
hideComponent
in class ClickGUI
component
- the component to be removed.public void addHUDComponent(FixedComponent component)
allComponents
and hudComponents
.component
- the new HUD componentpublic void toggle()
toggle
in interface Toggleable
public boolean isOn()
isOn
in interface Toggleable
public Toggleable getComponentToggleable(FixedComponent component)
PanelManager
getComponentToggleable
in interface PanelManager
getComponentToggleable
in class ClickGUI
component
- the component in question