Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/merge ps1 selects #269

Merged
merged 3 commits into from
Dec 13, 2019
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
5 changes: 5 additions & 0 deletions src/code/engine/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ Config::Config()
inifile.values["showingtimeout"]=DefaultShowingTimeoutText;
aDefaultWasSet = true;
}
if (inifile.values["ps1select"]=="")
{
inifile.values["ps1select"]="All Games";
aDefaultWasSet = true;
}

inifile.values["pcsx"]="bleemsync";

Expand Down
20 changes: 19 additions & 1 deletion src/code/gui/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,24 @@ string GuiBase::getCurrentThemeFontPath() {
#endif
}

//*******************************
// GuiBase::getPS1SelectSubState
// if the set is SET_PS1, the config.ini contains the sub category of the PS1 game display
//*******************************
int GuiBase::getPS1SelectSubState() {
string ps1_SelectSubStateString = cfg.inifile.values["ps1select"];
if (ps1_SelectSubStateString == "All Games")
return CFG_PS1_All_Games;
if (ps1_SelectSubStateString == "Internal Only")
return CFG_PS1_Internal_Only;
if (ps1_SelectSubStateString == "Games Subdir")
return CFG_PS1_Games_Subdir;
if (ps1_SelectSubStateString == "Favorites")
return CFG_PS1_Favorites;
else
return CFG_PS1_All_Games; // unknown config.ini value, return default
}

//*******************************
// Gui
//*******************************
Expand Down Expand Up @@ -729,7 +747,7 @@ void Gui::menuSelection() {
menuVisible = false;
} else {
if (lastSet < 0) {
lastSet = SET_ALL;
lastSet = SET_PS1;
lastSelIndex=0;
resumingGui = false;
}
Expand Down
19 changes: 10 additions & 9 deletions src/code/gui/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ enum MenuOption { MENU_OPTION_SCAN = 1, MENU_OPTION_RUN, MENU_OPTION_SONY, MENU_
#define POS_RIGHT 2

// if you add a new set also update setNames in gui_launcher.cpp
#define SET_ALL 0
#define SET_INTERNAL 1
#define SET_EXTERNAL 2
#define SET_FAVORITE 3
#define SET_RETROARCH 4
#define SET_APPS 5
#define SET_LAST 5

#define SET_PS1 0
#define SET_RETROARCH 1
#define SET_APPS 2
#define SET_LAST 2

// CFG_PS1GAMES_SELECT select states
// in config.ini: "ps1select" = "All Games", "Internal Only", "Games Subdir", "Favorites"
enum { CFG_PS1_All_Games=0, CFG_PS1_Internal_Only, CFG_PS1_Games_Subdir, CFG_PS1_Favorites };

//********************
// GuiBase
Expand All @@ -69,6 +68,8 @@ class GuiBase {
std::string getCurrentThemeFontPath();
std::string getCurrentThemeSoundPath();

int getPS1SelectSubState(); // if the set is SET_PS1, the config.ini contains the sub category of the PS1 game display

GuiBase();
~GuiBase();
};
Expand Down Expand Up @@ -169,7 +170,7 @@ class Gui : public GuiBase {
MenuOption menuOption = MENU_OPTION_SCAN;

// these are saved in gui so the next time Start brings up the carousel it can restore to last state
int lastSet = SET_ALL; // all games, internal, usb game dir, favorites, RA playlist
int lastSet = SET_PS1; // all games, internal, usb game dir, favorites, RA playlist
int lastSelIndex = 0; // index into carouselGames
int lastUSBGameDirIndex = 0; // top row in menu = /Games
int lastRAPlaylistIndex = 0; // top row in menu = first playlist name
Expand Down
Loading