Added enter / escape button to minimap flag window

This commit is contained in:
Sam 2013-11-18 20:57:50 +01:00
parent fc54a6e418
commit 4f9f04206d
2 changed files with 11 additions and 4 deletions

View File

@ -273,11 +273,20 @@ function UIMinimap:createFlagWindow(pos)
flagRadioGroup:selectWidget(flagRadioGroup:getFirstWidget())
okButton.onClick = function()
local successFunc = function()
self:addFlag(pos, flagRadioGroup:getSelectedWidget().icon, description:getText())
self:destroyFlagWindow()
end
cancelButton.onClick = function() self:destroyFlagWindow() end
local cancelFunc = function()
self:destroyFlagWindow()
end
okButton.onClick = successFunc
cancelButton.onClick = cancelFunc
self.flagWindow.onEnter = successFunc
self.flagWindow.onEscape = cancelFunc
self.flagWindow.onDestroy = function() flagRadioGroup:destroy() end
end

View File

@ -1356,7 +1356,6 @@ void Game::mount(bool mount)
{
if(!canPerformGameAction())
return;
m_protocolGame->sendMountStatus(mount);
}
@ -1371,7 +1370,6 @@ void Game::answerModalDialog(int dialog, int button, int choice)
{
if(!canPerformGameAction())
return;
m_protocolGame->sendAnswerModalDialog(dialog, button, choice);
}