Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions workspace/all/common/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ void CFG_defaults(NextUISettings *cfg)
.showMenuTransitions = CFG_DEFAULT_SHOWMENUTRANSITIONS,
.showRecents = CFG_DEFAULT_SHOWRECENTS,
.showTools = CFG_DEFAULT_SHOWTOOLS,
.showCollections = CFG_DEFAULT_SHOWCOLLECTIONS,
.showGameArt = CFG_DEFAULT_SHOWGAMEART,
.gameSwitcherScaling = CFG_DEFAULT_GAMESWITCHERSCALING,
.defaultView = CFG_DEFAULT_VIEW,
Expand Down Expand Up @@ -199,6 +200,11 @@ void CFG_init(FontLoad_callback_t cb, ColorSet_callback_t ccb)
CFG_setShowTools((bool)temp_value);
continue;
}
if (sscanf(line, "collections=%i", &temp_value) == 1)
{
CFG_setShowCollections((bool)temp_value);
continue;
}
if (sscanf(line, "gameart=%i", &temp_value) == 1)
{
CFG_setShowGameArt((bool)temp_value);
Expand Down Expand Up @@ -621,6 +627,17 @@ void CFG_setShowTools(bool show)
CFG_sync();
}

bool CFG_getShowCollections(void)
{
return settings.showCollections;
}

void CFG_setShowCollections(bool show)
{
settings.showCollections = show;
CFG_sync();
}

bool CFG_getShowGameArt(void)
{
return settings.showGameArt;
Expand Down Expand Up @@ -1064,6 +1081,10 @@ void CFG_get(const char *key, char *value)
else if (strcmp(key, "tools") == 0)
{
sprintf(value, "%i", CFG_getShowTools());
}
else if (strcmp(key, "collections") == 0)
{
sprintf(value, "%i", CFG_getShowCollections());
}
else if (strcmp(key, "gameart") == 0)
{
Expand Down Expand Up @@ -1199,6 +1220,7 @@ void CFG_sync(void)
fprintf(file, "menutransitions=%i\n", settings.showMenuTransitions);
fprintf(file, "recents=%i\n", settings.showRecents);
fprintf(file, "tools=%i\n", settings.showTools);
fprintf(file, "collections=%i\n", settings.showCollections);
fprintf(file, "gameart=%i\n", settings.showGameArt);
fprintf(file, "showfoldernamesatroot=%i\n", settings.showFolderNamesAtRoot);
fprintf(file, "screentimeout=%i\n", settings.screenTimeoutSecs);
Expand Down Expand Up @@ -1259,6 +1281,7 @@ void CFG_print(void)
printf("\t\"menutransitions\": %i,\n", settings.showMenuTransitions);
printf("\t\"recents\": %i,\n", settings.showRecents);
printf("\t\"tools\": %i,\n", settings.showTools);
printf("\t\"collections\": %i,\n", settings.showCollections);
printf("\t\"gameart\": %i,\n", settings.showGameArt);
printf("\t\"showfoldernamesatroot\": %i,\n", settings.showFolderNamesAtRoot);
printf("\t\"screentimeout\": %i,\n", settings.screenTimeoutSecs);
Expand Down
5 changes: 5 additions & 0 deletions workspace/all/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ typedef struct
bool showMenuTransitions;
bool showRecents;
bool showTools;
bool showCollections;
bool showGameArt;
bool showFolderNamesAtRoot;
bool romsUseFolderBackground;
Expand Down Expand Up @@ -167,6 +168,7 @@ typedef struct
#define CFG_DEFAULT_SHOWMENUANIMATIONS true
#define CFG_DEFAULT_SHOWMENUTRANSITIONS true
#define CFG_DEFAULT_SHOWRECENTS true
#define CFG_DEFAULT_SHOWCOLLECTIONS true
#define CFG_DEFAULT_SHOWGAMEART true
#define CFG_DEFAULT_SHOWFOLDERNAMESATROOT true
#define CFG_DEFAULT_GAMESWITCHERSCALING GFX_SCALE_FULLSCREEN
Expand Down Expand Up @@ -259,6 +261,9 @@ void CFG_setShowRecents(bool show);
// Show/hide tools folder in the main menu.
bool CFG_getShowTools(void);
void CFG_setShowTools(bool show);
// Show/hide collections in the main menu.
bool CFG_getShowCollections(void);
void CFG_setShowCollections(bool show);
// Show/hide game art in the main menu.
bool CFG_getShowGameArt(void);
void CFG_setShowGameArt(bool show);
Expand Down
2 changes: 1 addition & 1 deletion workspace/all/nextui/nextui.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ static Array* getRoot(void) {
Array *entries = getRoms();

// Handle collections
if (hasCollections()) {
if (hasCollections() && CFG_getShowCollections()) {
if (entries->count) {
Array_push(root, Entry_new(COLLECTIONS_PATH, ENTRY_DIR));
} else { // No visible systems, promote collections to root
Expand Down
4 changes: 4 additions & 0 deletions workspace/all/settings/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ int main(int argc, char *argv[])
[]() -> std::any { return CFG_getShowTools(); },
[](const std::any &value) { CFG_setShowTools(std::any_cast<bool>(value)); },
[]() { CFG_setShowTools(CFG_DEFAULT_SHOWTOOLS);}},
new MenuItem{ListItemType::Generic, "Show Collections", "Show \"Collections\" menu entry in game list.", {false, true}, on_off,
[]() -> std::any { return CFG_getShowCollections(); },
[](const std::any &value) { CFG_setShowCollections(std::any_cast<bool>(value)); },
[]() { CFG_setShowCollections(CFG_DEFAULT_SHOWCOLLECTIONS);}},
new MenuItem{ListItemType::Generic, "Show game art", "Show game artwork in the main menu", {false, true}, on_off, []() -> std::any
{ return CFG_getShowGameArt(); },
[](const std::any &value)
Expand Down
Loading