Closed SarthakSingh31 closed 3 years ago
shouldn't the path be relative to the world file and completely unrelated to the working directory?
while #52 fixes this when the project is run from its root, it is still broken when the project is e.g. a workspace member.
That’s a good point, I didn’t check that case when I tested it. #52 was a distinct improvement from what was there, so I merged, but I’d love to see a more complete solution if there is one.
On Apr 18, 2021, at 7:42 AM, František Hanzlík @.***> wrote:
shouldn't the path be relative to the world file and completely unrelated to the working directory?
while #52 fixes this when the project is run from its root, it is still broken when the project is e.g. a workspace member.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.
I am currently short on time so I can't submit a PR anytime soon, but if this is still broken when I have free time again I'll take a look at it
For a project with the above file structure and where
tiles_world.tsx
is an external tileset used byworld.tmx
when we try to run
asset_server.load("working_map.tmx")
https://github.com/StarArawn/bevy_tiled/blob/2af6208d6ccd7c9b8da5aed27c46a2e24cf6cce2/src/loader.rs#L25-L32
load_context.path()
returns the path relative to the assets folder (i.e."world.tmx"
)https://github.com/StarArawn/bevy_tiled/blob/2af6208d6ccd7c9b8da5aed27c46a2e24cf6cce2/src/map.rs#L53-L54
this
asset_path
is then used intiled::parse_with_path
to resolve external tilesets which panics withbecause it will try to look for
"<execution path>/tiles_world.tsx"
instead of"<execution path>/assets/tiles_world.tsx"