mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-30 03:55:40 +00:00
Always reload input config after running onfinish script
This commit is contained in:
parent
23d96b6a56
commit
ab8409da41
|
@ -348,6 +348,10 @@ void InputManager::writeDeviceConfig(InputConfig* config)
|
|||
|
||||
config->writeToXML(root);
|
||||
doc.save_file(path.c_str());
|
||||
|
||||
// execute any onFinish commands and re-load the config for changes
|
||||
doOnFinish();
|
||||
loadInputConfig(config);
|
||||
}
|
||||
|
||||
void InputManager::doOnFinish()
|
||||
|
|
|
@ -107,7 +107,6 @@ void GuiDetectDevice::update(int deltaTime)
|
|||
// If ES starts and if a known device is connected after startup skip controller configuration
|
||||
if(mFirstRun && fs::exists(InputManager::getConfigPath()) && InputManager::getInstance()->getNumConfiguredDevices() > 0)
|
||||
{
|
||||
InputManager::getInstance()->doOnFinish(); // execute possible onFinish commands
|
||||
if(mDoneCallback)
|
||||
mDoneCallback();
|
||||
delete this; // delete GUI element
|
||||
|
|
|
@ -259,7 +259,6 @@ GuiInputConfig::GuiInputConfig(Window* window, InputConfig* target, bool reconfi
|
|||
std::vector< std::shared_ptr<ButtonComponent> > buttons;
|
||||
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "OK", "ok", [this, okCallback] {
|
||||
InputManager::getInstance()->writeDeviceConfig(mTargetConfig); // save
|
||||
InputManager::getInstance()->doOnFinish(); // execute possible onFinish commands
|
||||
if(okCallback)
|
||||
okCallback();
|
||||
delete this;
|
||||
|
@ -388,4 +387,4 @@ bool GuiInputConfig::assign(Input input, int inputId)
|
|||
void GuiInputConfig::clearAssignment(int inputId)
|
||||
{
|
||||
mTargetConfig->unmapInput(inputName[inputId]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue