Support "going up" from the working directory in the game browser#3203
Draft
Ghabry wants to merge 5 commits into
Draft
Support "going up" from the working directory in the game browser#3203Ghabry wants to merge 5 commits into
Ghabry wants to merge 5 commits into
Conversation
Is a virtual filesystem that lists drive letters on e.g. Windows. The filesystem is deactivated on all other platforms right now. Invented a new filetype "Filesystem" for delegation of the drive FS to the native FS. This is kinda a hack but I couldn't think of a better way to add this...
Member
Author
|
I have to patch this out but it is currently possible to traverse the fake filesystem of emscripten: https://easyrpg.org/play/pr3203/?game=ageag :D |
…ndering of ".." on error screen.
ghost
approved these changes
May 11, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently when starting the Player and the game browser launches you cannot go up from the working directory.
This is now working for the following cases (first commit):
No there is no special code for these 3 cases, the implementation just only works correctly for 1 and 2.
A bit more involved (second commit): When you can go fully up you will reach the drive letters on Windows.
I implemented this using a new virtual filesystem class
DriveFilesystemand a new filetypeFilesystemNode(which can returns an arbitrary VFS when selected). This filesystem is the parent ofNativeFilesystemso you reach it when selecting..at the highest location (c:/).It is not attached as a parent when no drives are specified (= disabled under !Windows)
In theory this could be also hardcoded in
NativeFilesystem(when going up fromC:\or/return a drive list) but we make some assumptions about how the root has to look (e.g. on the 3DSromfs:is not a valid directory butromfs:/is. Therefore I decided to add an additional layer here just to not break any of our existing code.This
DriveFilesystemis flexible enough to also support more drives on other platforms later, implemented is only for Windows as here it is the most useful.