Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
While trying this awesome plugin and trying it out for the first time, I've noticed that whenever I change something in tiled, it does not hot-reload it in my game, even though I get this in my logs:
But nothing actually happens. Turns out that the query for the changed map, never return anything, or basically it does not match on anything.
After applying this fix, it now works and when I change something it tiled, it hot reloads it in my game.
Changes
This pull request includes changes to the
src/lib.rs
file to update the handling of map events and improve code readability. The most important changes involve modifying the type used for map handles and updating the corresponding method calls.Changes to map handle type:
src/lib.rs
: Updated themap_query
parameter infn handle_map_events
to useTiledMapHandle
instead ofHandle<TiledMap>
.src/lib.rs
: Updated themap_query
parameter infn remove_map_by_asset_id
to useTiledMapHandle
instead ofHandle<TiledMap>
.Method call updates:
src/lib.rs
: Modified the method call frommap_handle.id()
tomap_handle.0.id()
infn handle_map_events
.src/lib.rs
: Modified the method call frommap_handle.id()
tomap_handle.0.id()
infn remove_map_by_asset_id
.