Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open res:// file from directory in exported project through FileDialog #56737

Open
timvisee opened this issue Jan 13, 2022 · 3 comments
Open

Comments

@timvisee
Copy link

timvisee commented Jan 13, 2022

Godot version

v3.4.2.stable.official [45eaa2d]

System information

Ubuntu 21.10, Linux 5.15, GLES3, NVIDIA 495.46, GTX 2070,

Issue description

The FileDialog cannot open files from res:// when the file is in a sub directory, when the project is exported. Files are opened fine when they are in the root of res://.

Not being able to open them means that a file in a sub directory cannot be 'confirmed'. The 'Open' button or double clicking simply does nothing.

This only happens when the project is exported. Running from the editor works fine. I'm assuming this has to do with reading from the .pck file.

Steps to reproduce

See the attached project. Export with *.txt as non-resource, to include it in the export.

Run the project from the editor:

  • Opening res://text.txt and res://sub/text.txt works fine.

Run the exported project:

  • Opening res://text.txt works fine
  • Opening res://sub/text.txt fails and does nothing

Minimal reproduction project

godot-res-error.zip

@timvisee
Copy link
Author

timvisee commented Jan 13, 2022

This appears to have been fixed on master.

It is still broken in 3.4 however. I'd love to have this backported to 3.4. I'm unsure where the fix is implemented though.

In the meanwhile I've implemented a fix myself on the 3.4 branch. With extensive testing this seems to work fine. Though I'm not 100% sure this is the correct approach:
https://github.com/timvisee/godot/commits/3.4-fix-absolute-res

Updated project for 4.0, which again, works fine: godot-res-error-4.0.zip

@akien-mga akien-mga added this to the 3.5 milestone Jan 13, 2022
@akien-mga
Copy link
Member

Duplicate of #37646

@akien-mga
Copy link
Member

Well maybe not strictly speaking a duplicate as this one is about FileAccess and not DirAccess, though it's probably the same underlying bug (which I tried to address or might have introduced myself in #31440). CC @RandomShaper

@akien-mga akien-mga reopened this Jan 13, 2022
@timvisee timvisee changed the title Cannot open res:// file from directory in exported project Cannot open res:// file from directory in exported project through FileDialog Jan 13, 2022
@KoBeWi KoBeWi modified the milestones: 3.5, 3.x Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants