Skip to main content

reload_changed_images

Function reload_changed_images 

Source
pub fn reload_changed_images(
    reloads: MessageReader<'_, '_, AssetReloadRequested>,
    sources: Query<'_, '_, (Entity, &ImageSource)>,
    commands: Commands<'_, '_>,
)
Expand description

Re-enqueues the load for every element showing a file that changed on disk.

Reads AssetReloadRequested and strips the decoded payload, a cached failure, and the Enqueued marker from each entity whose ImageSource names the changed path, so spawn_pending_decodes looks the path up again on the next tick. process_watch_events already dropped the cache entry and moved the entity’s request id on, so that lookup decodes the new bytes and a decode of the old bytes still in flight is discarded.

Not installed by AssetsPlugin: reloading content is part of a hot-reload session, and the runtime adds this system when it starts one, ordered after process_watch_events.