Package me.hackware.api.hud
Class TextListHUDElement
java.lang.Object
me.hackware.api.hud.HUDElement
me.hackware.api.hud.TextHUDElement
me.hackware.api.hud.TextListHUDElement
- All Implemented Interfaces:
SettingContainer
Base class for list-style HUD elements (potion timers, entity radar, item radar, visual range).
Provides shared settings, config persistence helpers, editor state management, and utilities.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumNested classes/interfaces inherited from class me.hackware.api.hud.HUDElement
HUDElement.Anchor, HUDElement.ConditionType, HUDElement.ExpandAnchorX, HUDElement.ExpandAnchorY, HUDElement.VisibilityCondition, HUDElement.VisibilityKeyMode -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal NumberSetting<Integer> final NumberSetting<Integer> protected booleanfinal NumberSetting<Integer> final NumberSetting<Integer> final SettingGroupfinal StringSettingFields inherited from class me.hackware.api.hud.TextHUDElement
PAD_H, PAD_V -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTextListHUDElement(String id, int defaultX, int defaultY) -
Method Summary
Modifier and TypeMethodDescriptionprotected static intapplyAlpha(int color, float alpha) protected StringThe text string to display.protected intReturns the effective item indent (0 when centered).protected intEffective gap used for rendering (user value + 2).protected intgetColor()The ARGB color for the text.protected booleanprotected Stringprotected static ObjectlegacyIdList(Object raw) Legacy selected-ids value (real yml list or comma-joined string) → a real string list.protected voidmigrateIconKeys(String basePath, boolean defaultShown) Legacy icon keys (iconMode / showIcons+iconPosition / size / spacing) →basePath.protected voidLegacy shared list keys → the standard slug paths.protected voidregisterListGroup(Setting<?> animate, Setting<?> filter, Setting<?> maxEntries, Setting<?> sortBy) Registers the standardListgroup (Alignment, [Animate], [Filter], Gap, Indent, [Max Entries], Sorting{Order, [Sort By]}, Title).voidrender(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font, float textScale) voidrenderEditor(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font, float textScale) protected TextListHUDElement.Alignmentprotected TextListHUDElement.AlignmentLegacy screen-third alignment fallback retained for list implementations that need it.protected abstract Stringprotected net.minecraft.network.chat.ComponentvoidsetInEditor(boolean inEditor) protected booleanWhether the active sort order reverses the comparator.voidupdateEditorSize(net.minecraft.client.gui.Font font) Update width/height as the editor would see them (with placeholder content).Methods inherited from class me.hackware.api.hud.TextHUDElement
buildDisplayText, buildSizingText, renderContent, textX, updateSizeMethods inherited from class me.hackware.api.hud.HUDElement
addCondition, addSettings, addSettings, areConditionsMet, canResetToDefault, clamp, clearExpandOverrides, clearSavedPosition, contains, defaultTextColor, effHeight, effRenderScale, effWidth, getConditions, getEditorAlpha, getExpandAnchorX, getExpandAnchorY, getHeight, getId, getReservedHeight, getReservedWidth, getScale, getSettings, getVisibilityKey, getVisibilityKeyMode, getWidth, getX, getY, graphicalScale, hudScale, isDraggable, isEditorHidden, isVisibilityHoldShows, loadElementSettings, migrateArgbColorKey, migrateColorSettingKey, migrateEnumSettingKey, migrateOpacityIntoColorAlpha, migrateOverrideColorKey, migrateSettingKey, migrateSettingKey, removeCondition, render, renderEditor, resetClampSides, resetToDefault, resolve, resolvedExpandX, resolvedExpandY, resolveEditor, saveConditions, saveContainerSettings, savePosition, saveVisibilityKey, scalesWithTextScale, setClampSides, setEditorAlpha, setExpandAnchorX, setExpandAnchorY, setExpandOverrides, setPosition, setScale, setVisibilityHoldShows, setVisibilityKey, setVisibilityKeyMode, snapshotAnchor, usesBaseScaleSlider, wrapperScale
-
Field Details
-
alignment
-
lineGap
-
itemIndent
-
sortOrder
-
title
-
titleTemplate
-
iconMode
-
iconSize
-
iconSpacing
-
inEditor
protected boolean inEditor
-
-
Constructor Details
-
TextListHUDElement
-
-
Method Details
-
registerListGroup
protected void registerListGroup(Setting<?> animate, Setting<?> filter, Setting<?> maxEntries, Setting<?> sortBy) Registers the standardListgroup (Alignment, [Animate], [Filter], Gap, Indent, [Max Entries], Sorting{Order, [Sort By]}, Title). Null slots are omitted. Call from the element constructor AFTER its other groups so List lands last in the window. -
migrateListKeys
protected void migrateListKeys()Legacy shared list keys → the standard slug paths. -
legacyIdList
Legacy selected-ids value (real yml list or comma-joined string) → a real string list. -
migrateIconKeys
Legacy icon keys (iconMode / showIcons+iconPosition / size / spacing) →basePath. -
buildText
Description copied from class:TextHUDElementThe text string to display. Called every frame.- Specified by:
buildTextin classTextHUDElement
-
getColor
protected int getColor()Description copied from class:TextHUDElementThe ARGB color for the text. Called every frame.- Specified by:
getColorin classTextHUDElement
-
key
-
effectiveLineGap
protected int effectiveLineGap()Effective gap used for rendering (user value + 2). -
sortDescending
protected boolean sortDescending()Whether the active sort order reverses the comparator. Lists that always grow downward read AUTO as ascending; direction-aware lists override. -
effectiveItemIndent
protected int effectiveItemIndent()Returns the effective item indent (0 when centered). -
iconsShown
protected boolean iconsShown() -
setInEditor
public void setInEditor(boolean inEditor) -
renderEditor
public void renderEditor(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font, float textScale) - Overrides:
renderEditorin classHUDElement
-
render
public void render(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font, float textScale) - Overrides:
renderin classHUDElement
-
updateEditorSize
public void updateEditorSize(net.minecraft.client.gui.Font font) Description copied from class:HUDElementUpdate width/height as the editor would see them (with placeholder content). Subclasses that report 0 size outside the editor should override this.- Overrides:
updateEditorSizein classHUDElement
-
resolveTitle
-
resolveTitleComponent
protected net.minecraft.network.chat.Component resolveTitleComponent() -
resolveAlignment
-
resolveAlignmentByScreenThirds
Legacy screen-third alignment fallback retained for list implementations that need it. -
applyAlpha
protected static int applyAlpha(int color, float alpha)
-