mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 08:05:38 +00:00
If no keyboard input config is found, load a default.
(Previously would only load the keyboard default if *no* input configs were found.)
This commit is contained in:
parent
253ea2b5d3
commit
420dc912e0
|
@ -228,6 +228,7 @@ void InputManager::loadConfig()
|
||||||
|
|
||||||
pugi::xml_node root = doc.child("inputList");
|
pugi::xml_node root = doc.child("inputList");
|
||||||
|
|
||||||
|
bool loadedKeyboard = false;
|
||||||
for(pugi::xml_node node = root.child("inputConfig"); node; node = node.next_sibling("inputConfig"))
|
for(pugi::xml_node node = root.child("inputConfig"); node; node = node.next_sibling("inputConfig"))
|
||||||
{
|
{
|
||||||
std::string type = node.attribute("type").as_string();
|
std::string type = node.attribute("type").as_string();
|
||||||
|
@ -235,6 +236,7 @@ void InputManager::loadConfig()
|
||||||
if(type == "keyboard")
|
if(type == "keyboard")
|
||||||
{
|
{
|
||||||
getInputConfigByDevice(DEVICE_KEYBOARD)->loadFromXML(node, mNumPlayers);
|
getInputConfigByDevice(DEVICE_KEYBOARD)->loadFromXML(node, mNumPlayers);
|
||||||
|
loadedKeyboard = true;
|
||||||
mNumPlayers++;
|
mNumPlayers++;
|
||||||
}else if(type == "joystick")
|
}else if(type == "joystick")
|
||||||
{
|
{
|
||||||
|
@ -265,9 +267,9 @@ void InputManager::loadConfig()
|
||||||
|
|
||||||
delete[] configuredDevice;
|
delete[] configuredDevice;
|
||||||
|
|
||||||
if(mNumPlayers == 0)
|
if(!loadedKeyboard)
|
||||||
{
|
{
|
||||||
LOG(LogInfo) << "No input configs loaded. Loading default keyboard config.";
|
LOG(LogInfo) << "No keyboard input found. Loading default keyboard config.";
|
||||||
loadDefaultConfig();
|
loadDefaultConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue