tzachshabtay / MonoAGS

AGS (Adventure Game Studio) reimagined in Mono
https://tzachshabtay.github.io/MonoAGS/
Artistic License 2.0
27 stars 8 forks source link

Resources- changing root path #291

Closed tzachshabtay closed 6 years ago

tzachshabtay commented 6 years ago
  1. Added an optional parameter for selecting a root path for file system resource paths. If given it will be used for resolving relative paths when loading resources. Fixes #288.
  2. If a default path was not given, the engine will try to auto-detect and find the “Assets” folder to act as the root folder for relative paths (by drilling down from the executable directory until it finds a folder with the name “Assets”). This is a BREAKING CHANGE -> this was done because the previous assumption, that the assets folder is 2 folders upwards from the working directory was already broken: A. This was true when running from VS but not necessarily when running from somewhere else, and B. After switching to the new project format, the executables are actually compiled 3 folders down (bin/net461/debug) instead of 2 folders down (bin/debug), so running from visual studio would also not work. Also, this makes giving resource paths into the assets folder easier (i.e loader.Load(“Sounds/footstep.ogg”) instead of (“../../Assets/Sounds/footstep.ogg”).
  3. The embedded resource pack was changed to be consistent with the file system resource pack, so the assets folder is also the root for the embedded resources now too. As all resources in the demo game are embedded, changed the paths in all of them and removed the “../../Assets” prefix.