Chat bubbles were quads drawn straight into an overlay with no widget behind them, so `WorldFrame:GetChildren()` never returned them and bubble-skinning addons such as pfUI's found nothing. In the reference, a bubble is an anonymous Frame under WorldFrame from a reused pool: eleven regions (the nine backdrop pieces, the tail, the text in the `NAMEPLATE_FONT` global), the text's bottom on the speaker's projected point, its own fade, and an OnShow on each reuse. It fades out and hides when the speaker is out of range or was not drawn last frame. Bubbles are now built that way, fed by the app and drawn by the frame pass; the overlay path is gone. Item links show their bare names, and a speaker behind the camera fades out. Tests cover the child, its regions, a pfUI-style skin, reuse and the fades. Fixes #884 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
729 B
Rust
20 lines
729 B
Rust
//! The chat bubbles' feed: this frame's live bubbles, gated, faded and seated by
|
|
//! [`crate::chat_bubble`], handed to the widget layer, which keeps them as `WorldFrame` children.
|
|
|
|
use bevy::prelude::*;
|
|
|
|
use crate::chat_bubble::BubbleFeed;
|
|
|
|
/// Every frame, after the bubble drive and before the script paint: write the live set into the
|
|
/// VM's bubble pool, which hides and pools the frames of lines that ended.
|
|
pub(crate) fn feed_bubbles(
|
|
feed: Res<BubbleFeed>,
|
|
// `None` in a run with no UI VM.
|
|
script: Option<NonSendMut<benilla_ui::script::UiScript>>,
|
|
) {
|
|
let (Some(mut script), Some(geometry)) = (script, feed.geometry) else {
|
|
return;
|
|
};
|
|
script.sync_chat_bubbles(geometry, &feed.states);
|
|
}
|