fifengine / fifengine-editor-old

Other
4 stars 3 forks source link

Editor file dialog uses botched relative paths #7

Open stubb opened 8 years ago

stubb commented 8 years ago

From @prock-fife on December 1, 2011 21:32

This issue was reported by Fabian Streitel fife@rottenrei.be

When opening/saving a file in the editor, it does two things that are surprising/broken:

  1. it mixes a bunch of directories together (all that are registered with VFS as root directories), which is weird if you register more than one (which we do at UH)
  2. it assumes all of these paths are relative to ./.., which is obviously not the case for directories that are relative to, e.g. the UH root directory.

I modified the code to always use absolute paths, which was a) easy to do and b) fixes both of these problems. See the attached patch, which is relative to the trunk.

Copied from original issue: fifengine/fifengine#616

stubb commented 8 years ago

From @prock-fife on December 1, 2011 21:33

This comment was posted by Fabian Streitel fife@rottenrei.be

Patch that fixes weird filebrowser behaviour

stubb commented 8 years ago

From @vtchill on December 1, 2011 22:4

I can see this being a good change. I essentially do the same thing in the c++ loaders by making the map directory absolute and then using that to load any referenced object/animation/atlas files.

stubb commented 8 years ago

From @prock-fife on June 20, 2013 16:55

I just had a bit of a brainstorm on this issue. Why not create an additional file (or some additional map properties) that would store several paths (e.g. project working directory, resource directory, etc etc). These would be taken into account when loading/saving a map with the editor. It would also allow the clients to specify root directory of their project so all objects do not have to be loaded from the map file relative to the map files location.

I believe map files can already include additional object import directories (relative to the map file itself). We could add another map property that would add additional VFS virtual directories so those object imports can happen relative to an arbitrary path.

stubb commented 8 years ago

From @Beliaar on February 5, 2014 16:52

Hmm, I did not see this issue before, but I think 7ba165a6562940534810f604362e5965bd37e256 fixes the main problem of this isse.