Temporarily disable polling while configuring inputs.

Polling is disabled once the first device is chosen, and resumed once the
last device is configured.
This commit is contained in:
Aloshi 2013-06-29 20:43:13 -05:00
parent 1dfb45e133
commit f4e2a14685
2 changed files with 5 additions and 0 deletions

View file

@ -44,6 +44,10 @@ bool GuiDetectDevice::input(InputConfig* config, Input input)
if(!input.value)
return false;
//don't allow device list to change once the first player has registered
if(mCurrentPlayer == 0)
mWindow->getInputManager()->stopPolling();
config->setPlayerNum(mCurrentPlayer);
mWindow->getInputManager()->setNumPlayers(mWindow->getInputManager()->getNumPlayers() + 1); //inc total number of players
mCurrentPlayer++;

View file

@ -38,6 +38,7 @@ bool GuiInputConfig::input(InputConfig* config, Input input)
mWindow->pushGui(new GuiInputConfig(mWindow, mWindow->getInputManager()->getInputConfigByPlayer(mTargetConfig->getPlayerNum() + 1)));
}else{
mWindow->getInputManager()->writeConfig();
mWindow->getInputManager()->startPolling(); //enable polling again since we're done
GuiGameList::create(mWindow);
}
delete this;