Added enter / escape button to minimap flag window
This commit is contained in:
parent
fc54a6e418
commit
4f9f04206d
|
@ -273,11 +273,20 @@ function UIMinimap:createFlagWindow(pos)
|
||||||
|
|
||||||
flagRadioGroup:selectWidget(flagRadioGroup:getFirstWidget())
|
flagRadioGroup:selectWidget(flagRadioGroup:getFirstWidget())
|
||||||
|
|
||||||
okButton.onClick = function()
|
local successFunc = function()
|
||||||
self:addFlag(pos, flagRadioGroup:getSelectedWidget().icon, description:getText())
|
self:addFlag(pos, flagRadioGroup:getSelectedWidget().icon, description:getText())
|
||||||
self:destroyFlagWindow()
|
self:destroyFlagWindow()
|
||||||
end
|
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
|
self.flagWindow.onDestroy = function() flagRadioGroup:destroy() end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1356,7 +1356,6 @@ void Game::mount(bool mount)
|
||||||
{
|
{
|
||||||
if(!canPerformGameAction())
|
if(!canPerformGameAction())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_protocolGame->sendMountStatus(mount);
|
m_protocolGame->sendMountStatus(mount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1371,7 +1370,6 @@ void Game::answerModalDialog(int dialog, int button, int choice)
|
||||||
{
|
{
|
||||||
if(!canPerformGameAction())
|
if(!canPerformGameAction())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_protocolGame->sendAnswerModalDialog(dialog, button, choice);
|
m_protocolGame->sendAnswerModalDialog(dialog, button, choice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue