Support "going up" from the working directory in the game browser #3203
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
DriveFilesystem
and a new filetypeFilesystemNode
(which can returns an arbitrary VFS when selected). This filesystem is the parent ofNativeFilesystem
so 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
DriveFilesystem
is flexible enough to also support more drives on other platforms later, implemented is only for Windows as here it is the most useful.