Skip to content

[FEATURE] Port Tree Node Observation Loop into AudioManager #800

Description

@ikostan

name: Feature Request
about: Suggest an idea for this project
title: '[FEATURE] Port Tree Node Observation Loop into AudioManager'
labels: enhancement
assignees: 'ikostan'


Description:
Transfer the active tree observer mechanism (_on_node_added) from globals.gd straight into audio_manager.gd. The audio subsystem will now explicitly bind itself directly to the scene tree's dynamic node addition lifecycle signals upon instantiation.

Why is this useful?:
Centralizes dynamic runtime signal intercept logic. By letting AudioManager process scene additions directly, we completely eliminate cross-singleton method execution churn and allow the audio system to manage focus/click bindings natively.

Proposed Implementation:

  1. Copy the _on_node_added(node: Node) parsing engine entirely out of scripts/core/globals.gd and paste it into scripts/managers/audio_manager.gd.
  2. Inside audio_manager.gd's _ready() routine, initialize the listener connection to the scene tree directly:
    get_tree().node_added.connect(_on_node_added)
  3. Ensure that all targeted node evaluations maintain the identical filtering contracts (get_class() == "Button", metadata exclusion guards, and internal dialog tree checking paths) validated during Task 1.
  4. Modify the internal loop hook to ensure the connection maps directly onto a local AudioManager sound playback callback using CONNECT_DEFERRED.

Additional Context:
This step transfers structural operational behavior out of the global utility file, making the audio singleton completely autonomous.

Metadata

Metadata

Assignees

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions