Skip to content

Commit

Permalink
Merge pull request #269 from autobleem/feature/merge_PS1_selects
Browse files Browse the repository at this point in the history
Feature/merge ps1 selects
  • Loading branch information
ChocoNutDancer committed Dec 13, 2019
2 parents b06f47f + 7aa7b3e commit 59456a3
Show file tree
Hide file tree
Showing 10 changed files with 295 additions and 270 deletions.
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

0 comments on commit 59456a3

Please sign in to comment.