import Phaser from 'phaser';
import type { EventBus } from '../../core/EventBus';

// Text-only meter readout. LANE-JUICE's MeterHud replaces this at integration.
export class HudStub {
  private readonly text: Phaser.GameObjects.Text;
  private readonly off: () => void;

  constructor(scene: Phaser.Scene, bus: EventBus) {
    this.text = scene.add
      .text(4, 4, 'vibe 50  aggro 0  hype 1.0', { fontFamily: 'monospace', fontSize: '8px', color: '#9fe8a0' })
      .setDepth(1000)
      .setScrollFactor(0);
    this.off = bus.on('meters:changed', ({ vibe, aggro, hype }) => {
      this.text.setText(`vibe ${Math.round(vibe)}  aggro ${Math.round(aggro)}  hype ${hype.toFixed(1)}`);
    });
  }

  destroy(): void {
    this.off();
    this.text.destroy();
  }
}
