Skip to content

RevFramework — Status Effects • UI

Optional, lightweight UI components for visualising active status effects
(buffs, debuffs, CC) at runtime.

This folder is presentation-only.
The Status Effects system does not depend on it.


Table of Contents


Overview

The UI folder provides optional, decoupled components for displaying the current state of a StatusEffectController.

Component Description
StatusBuffBar Listens to a controller and spawns / removes status icons.
StatusIconView Displays a single status icon with radial timer and stack count.
StatusIconLibrary ScriptableObject mapping statusId → icon / tint / display name.

These components: - Subscribe to events only - Never mutate status state - Never affect gameplay, authority, or timing

If you delete this entire folder, Status Effects continues to work normally.


Mental Model

UI is a read-only mirror of the Status system.

  • The controller owns truth
  • UI listens and reflects
  • UI never drives behaviour

Think of this folder as a reference implementation: use it, customise it, or replace it entirely.


Quick Start

  1. Create a StatusIconLibrary and configure icons/tints per status ID
  2. Create a prefab with StatusIconView (or rely on the auto-generated fallback)
  3. Add StatusBuffBar to your HUD canvas
  4. Assign the controller, library, and icon prefab
buffBar.controller   = target.GetComponent<StatusEffectController>();
buffBar.iconLibrary = myLibrary;
buffBar.iconPrefab  = myIconPrefab;

At runtime, the buff bar listens to controller events and updates automatically:

  • StatusApplied
  • StatusRefreshed
  • StatusRemoved
  • StatusExpired

No polling, no coupling.


Components

StatusBuffBar

  • Subscribes to StatusEffectController events
  • Instantiates StatusIconView children under a parent transform
  • Tracks and displays stack counts
  • Coalesces Replace / Refresh jitter using a destroy-grace period
  • Destroy-grace uses unscaled time
  • Radial fill reflects the controller’s active time mode
  • Provides a fully functional buff bar out of the box

This component is safe to remove or replace with a custom UI.


StatusIconView

  • Displays:
  • Foreground icon sprite
  • Radial fill (remaining / duration)
  • Optional stack label (UGUI or TMP)

Key methods:

  • Bind(effect, icon, tint, stackCount, displayName)
  • SetStack(int)

The view updates itself each frame based on the bound effect.


StatusIconLibrary

A ScriptableObject mapping status IDs to visual data:

  • Icon sprite
  • Tint / theme colour
  • Optional display name
if (library.TryGet("poison", out var entry))
{
    icon.sprite = entry.icon;
    icon.color  = entry.color;
}

If no entry exists, the UI falls back to ID-based labels and default styling.


Gotchas

  • Icons are destroyed after a grace delay to avoid flicker during rapid refreshes
  • Destroy-grace uses unscaled time; radial fill follows controller time mode
  • Never reuse a single icon instance — always Instantiate
  • High-frequency stacking (e.g. rapid DOT stacks) requires resilient layouts
  • UI does not handle authority or replication — it reflects whatever the controller reports

Extending

You are encouraged to customise or replace this UI:

  • Grid, row, radial, or circular layouts
  • Buff-only / debuff-only filtering
  • Tag-based grouping
  • Animations and transitions
  • UI Toolkit or TMP-based variants
  • Debug overlays or dev HUDs

The only contract you need is controller events.


See Also

  • Core — controller events and lifecycle
  • Effects — effects that drive UI state
  • Teaching — runtime teaching panels