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):
Project path is empty (working directory is used)
Project Path is an absolute path.
When Project path is not absolute the going up will end when the relative path ends. (fixing this edge-case is annoying, so I just gave up for now 🤷 )
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 filetype FilesystemNode (which can returns an arbitrary VFS when selected). This filesystem is the parent of NativeFilesystem 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 from C:\ or / return a drive list) but we make some assumptions about how the root has to look (e.g. on the 3DS romfs: is not a valid directory but romfs:/ 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.
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.