Always reload input config after running onfinish script

This commit is contained in:
Ken Taylor 2016-07-01 22:14:41 -07:00
parent 23d96b6a56
commit ab8409da41
3 changed files with 5 additions and 3 deletions

View file

@ -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()

View file

@ -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

View file

@ -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]);
}
}