mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +00:00
Fixed a long-standing bug with detailed GuiGameList detection after mapping input.
This commit is contained in:
parent
aea93748d5
commit
62336ab2fb
|
@ -1,6 +1,7 @@
|
|||
October 5
|
||||
-GuiFastSelect is working, but ugly.
|
||||
-Began work on GuiBox for theming the fast select dialog.
|
||||
-Finally fixed detailed GuiGameList detection after input mapping.
|
||||
|
||||
September 30
|
||||
-Began implementing GuiFastSelect, currently invoked by holding F2. Unfortunately, it doesn't do anything yet.
|
||||
|
|
|
@ -251,3 +251,24 @@ void GuiGameList::onInit()
|
|||
{
|
||||
mTheme->init();
|
||||
}
|
||||
|
||||
|
||||
extern bool IGNOREGAMELIST; //defined in main.cpp (as a command line argument)
|
||||
GuiGameList* GuiGameList::create()
|
||||
{
|
||||
bool detailed = false;
|
||||
|
||||
if(!IGNOREGAMELIST)
|
||||
{
|
||||
for(unsigned int i = 0; i < SystemData::sSystemVector.size(); i++)
|
||||
{
|
||||
if(SystemData::sSystemVector.at(i)->hasGamelist())
|
||||
{
|
||||
detailed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new GuiGameList(detailed);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,8 @@ public:
|
|||
void onInit();
|
||||
void onDeinit();
|
||||
|
||||
static GuiGameList* create();
|
||||
|
||||
static const float sInfoWidth;
|
||||
private:
|
||||
void updateList();
|
||||
|
|
|
@ -66,7 +66,7 @@ void GuiInputConfig::onInput(InputManager::InputButton button, bool keyDown)
|
|||
|
||||
InputManager::loadConfig();
|
||||
delete this;
|
||||
new GuiGameList();
|
||||
GuiGameList::create();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
20
src/main.cpp
20
src/main.cpp
|
@ -109,34 +109,18 @@ int main(int argc, char* argv[])
|
|||
std::cerr << "Does at least one system have a game presesnt?\n";
|
||||
running = false;
|
||||
}else{
|
||||
|
||||
bool useDetail = false;
|
||||
|
||||
//see if any systems had gamelists present, if so we'll use the detailed GuiGameList
|
||||
if(!IGNOREGAMELIST)
|
||||
{
|
||||
for(unsigned int i = 0; i < SystemData::sSystemVector.size(); i++)
|
||||
{
|
||||
if(SystemData::sSystemVector.at(i)->hasGamelist())
|
||||
{
|
||||
useDetail = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//choose which GUI to open depending on Input configuration
|
||||
if(fs::exists(InputManager::getConfigPath()))
|
||||
{
|
||||
//an input config already exists - load it and proceed to the gamelist as usual.
|
||||
InputManager::loadConfig();
|
||||
new GuiGameList(useDetail);
|
||||
GuiGameList::create();
|
||||
}else{
|
||||
//if no input.cfg is present, but a joystick is connected, launch the input config GUI
|
||||
if(SDL_NumJoysticks() > 0)
|
||||
new GuiInputConfig();
|
||||
else
|
||||
new GuiGameList(useDetail);
|
||||
GuiGameList::create();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue