Package me.hackware.api.hud
Interface HudServices
public interface HudServices
Client services the HUD element bases need but cannot see from the API:
the hud.yml settings store, global HUD layout/scale state, the template
scripting engine, and module lookups. The client installs its
implementation once at startup via
install(me.hackware.api.hud.HudServices); the built-in default
is inert (no persistence, templates echo their input), so an
un-bootstrapped environment stays functional but featureless.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classMutable holder (interfaces cannot own mutable statics). -
Method Summary
Modifier and TypeMethodDescriptionvoidadvanceSelections(String owner) voidapplySettingValue(Setting<?> setting, Object value) Deserializevalueintosetting(config wire format).constantCase(String name) floateffectiveTextScale(HUDElement element) evaluateTemplate(String rawTemplate, boolean censor, String owner) static HudServicesget()The installed implementation (inert untilinstall(me.hackware.api.hud.HudServices)is called).intgetHudSetting(String key, Object defaultValue) intintfloathudSettingKeys(String prefix) All stored keys beginning withprefix.static voidinstall(HudServices services) Installed once by the client before any HUD element is constructed.default booleanWhether resolvingexprtwice within one frame is known to return the same value with no side effect.booleanisModuleEnabled(String name, boolean fallback) Whether the module namednameis enabled;fallbackif unknown.voidremoveHudSetting(String key) resolveExpression(String expr) voidserializeSettingValue(Setting<?> setting) Serializesetting's current value into config wire format.voidsetHudSetting(String key, Object value) default intMoves whenever template or condition evaluation reaches a function, a method, or a variable that is not frame-stable.default intMoves whenever the client starts rewriting rendered text differently (NameProtect).
-
Method Details
-
getHudSetting
-
setHudSetting
-
removeHudSetting
-
saveHudSettings
void saveHudSettings() -
hudSettingKeys
All stored keys beginning withprefix. -
applySettingValue
Deserializevalueintosetting(config wire format). -
serializeSettingValue
Serializesetting's current value into config wire format. -
slug
-
constantCase
-
getTextScale
float getTextScale() -
effectiveTextScale
-
getDefaultTextColor
int getDefaultTextColor() -
getSnapDistance
int getSnapDistance() -
getScreenMargin
int getScreenMargin() -
evaluateTemplate
-
resolveExpression
-
isFrameStableExpression
Whether resolvingexprtwice within one frame is known to return the same value with no side effect.falsewhenever that is not known. -
templateVolatileSerial
default int templateVolatileSerial()Moves whenever template or condition evaluation reaches a function, a method, or a variable that is not frame-stable. Equal readings around an evaluation mean repeating it this frame gives the same text and changes nothing. The default moves on every call. -
advanceSelections
-
isModuleEnabled
Whether the module namednameis enabled;fallbackif unknown. -
textRewriteEpoch
default int textRewriteEpoch()Moves whenever the client starts rewriting rendered text differently (NameProtect). Holders of a Component kept across frames drop it when this changes. Render thread only.An implementation that does not track this inherits the default, which moves on every call: nothing is ever reused, which is how text was built before the method existed.
-
get
The installed implementation (inert untilinstall(me.hackware.api.hud.HudServices)is called). -
install
Installed once by the client before any HUD element is constructed.
-