add default menu content

This commit is contained in:
radius 2016-08-28 23:21:29 -05:00
parent 9cfb6c971f
commit be6ddfa6d0
4 changed files with 12 additions and 17 deletions

View File

@ -930,6 +930,10 @@ static void config_set_defaults(void)
strlcpy(settings->directory.menu_config,
g_defaults.dir.menu_config,
sizeof(settings->directory.menu_config));
if (!string_is_empty(g_defaults.dir.menu_content))
strlcpy(settings->directory.menu_content,
g_defaults.dir.menu_content,
sizeof(settings->directory.menu_content));
#endif
if (!string_is_empty(g_defaults.dir.autoconfig))
strlcpy(settings->directory.autoconfig,

View File

@ -52,6 +52,7 @@ struct defaults
struct
{
char menu_content[PATH_MAX_LENGTH];
char core_assets[PATH_MAX_LENGTH];
char menu_config[PATH_MAX_LENGTH];
char autoconfig[PATH_MAX_LENGTH];

View File

@ -95,22 +95,6 @@ static void frontend_emscripten_get_env(int *argc, char *argv[],
fill_pathname_join(g_defaults.dir.autoconfig, base_path,
"autoconfig", sizeof(g_defaults.dir.autoconfig));
if (path_is_directory("/usr/local/share/retroarch/assets"))
fill_pathname_join(g_defaults.dir.assets, "/usr/local/share/retroarch",
"assets", sizeof(g_defaults.dir.assets));
else if (path_is_directory("/usr/share/retroarch/assets"))
fill_pathname_join(g_defaults.dir.assets, "/usr/share/retroarch",
"assets", sizeof(g_defaults.dir.assets));
else if (path_is_directory("/usr/local/share/games/retroarch/assets"))
fill_pathname_join(g_defaults.dir.assets, "/usr/local/share/games/retroarch",
"assets", sizeof(g_defaults.dir.assets));
else if (path_is_directory("/usr/share/games/retroarch/assets"))
fill_pathname_join(g_defaults.dir.assets, "/usr/share/games/retroarch",
"assets", sizeof(g_defaults.dir.assets));
else
fill_pathname_join(g_defaults.dir.assets, base_path,
"assets", sizeof(g_defaults.dir.assets));
fill_pathname_join(g_defaults.dir.menu_config, base_path,
"config", sizeof(g_defaults.dir.menu_config));
fill_pathname_join(g_defaults.dir.remap, g_defaults.dir.menu_config,
@ -135,6 +119,10 @@ static void frontend_emscripten_get_env(int *argc, char *argv[],
"screenshots", sizeof(g_defaults.dir.screenshot));
fill_pathname_join(g_defaults.dir.thumbnails, base_path,
"thumbnails", sizeof(g_defaults.dir.thumbnails));
fill_pathname_join(g_defaults.dir.thumbnails, "/",
"content", sizeof(g_defaults.dir.thumbnails));
fill_pathname_join(g_defaults.dir.assets, "/",
"assets", sizeof(g_defaults.dir.assets));
snprintf(g_defaults.settings.menu, sizeof(g_defaults.settings.menu), "rgui");
}

View File

@ -120,6 +120,8 @@ function setupFolderStructure()
FS.createPath('/', '/home/web_user', true, true);
FS.createPath('/', '/home/web_user/.config', true, true);
FS.createPath('/', '/home/web_user/.config/retroarch', true, true);
FS.createPath('/', '/assets', true, true);
FS.createPath('/', '/content', true, true);
}
function stat(path)
@ -171,7 +173,7 @@ function uploadData(data,name)
FS.createDataFile('/', name, dataView, true, false);
var data = FS.readFile(name,{ encoding: 'binary' });
FS.writeFile('/home/web_user/content/' + name, data ,{ encoding: 'binary' });
FS.writeFile('/content/' + name, data ,{ encoding: 'binary' });
FS.unlink(name);
}