Class PrivBotOverlays

java.lang.Object
privbot.ui.overlay.PrivBotOverlays

public final class PrivBotOverlays extends Object
Entry point of the overlay kit: describe a HUD panel or a scene overlay, then install the set.

 private final Snapshot<HudState> hud = Snapshot.empty();     // published on the game tick

 Overlay panel = PrivBotOverlays.panel("Scurrius")
         .visibleWhen(this::isEnabled)
         .rows(hud, (r, s) -> {
             r.status("State", s.segment, s.inCombat ? OverlayTheme.GOOD : OverlayTheme.MUTED);
             r.fraction("HP", s.hp, s.maxHp, ColorRamp.percentBelow(config.eatHpThreshold()));
             r.runtime("Runtime", s.startedAt);
         });

 Overlay tiles = PrivBotOverlays.scene(client)
         .draw(hazards, (c, s) -> s.forEach(h -> c.countdown(h.tile, h.ticksLeft, ColorRamp.ticks(1, 2))));

 overlays = PrivBotOverlays.install(overlayManager, panel, tiles);   // startUp
 overlays.close();                                                    // shutDown
 

Composers run on the render thread and receive the published state and nothing else; that is what keeps them safe on Impact, where a client hook from the render thread times out.