Player icon indicating copy to clipboard operation
Player copied to clipboard

Persistent storage for global configuration

Open Ghabry opened this issue 10 years ago • 2 comments

This one superseds #53

The game browser would make a bit more sense when you could browse (or auto scan as planned for Android) your hard disk and add game directories. The game directories must be remembered.

This needs changes to the FileFinder:

  • [x] CreateDirectory function
  • [ ] GetConfigDirectory function
  • [ ] GetConfigFile function

CreateDirectory: As the name says

GetConfigDirectory: Create path to config directory if non existant and return a DirectoryTree handle to it. SDL2 has a function for this (can't remember the name). The code could be used as a reference because I don't want a SDL2 dependency.

GetConfigFile: Return path to config file in config directory. Format to be decided, probably INI or JSON (picojson header)

Could probably also store other things in this file like button mappings (joystick), but that's not subject of this issue

[GameDirectories]
LastDirectory=
Folder1=
Folder2=
...
Folder9=
{
   "last_directory": "",
   "game_directories" : ["folder1", "folder2"]
}

Ghabry avatar Dec 07 '15 11:12 Ghabry

https://github.com/Malvineous/cfgpath could be used in parts too.

carstene1ns avatar Mar 19 '16 01:03 carstene1ns

Once the VFS-stuff is in I will take a look at this. Will be also useful for savegame redirection (save in APPDATA when the game dir is not writable). Also a requested feature for libretro

Ghabry avatar May 01 '21 14:05 Ghabry