1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Fix keyboard shortcuts on selection dialogs

This commit is contained in:
Ivan Savenko 2023-07-22 22:29:05 +03:00
parent a619193e3c
commit 01d588ab54

View File

@ -90,6 +90,15 @@ CSelWindow::CSelWindow(const std::string &Text, PlayerColor player, int charperl
//buttons.back()->addCallback(std::bind(&CCallback::selectionMade, LOCPLINT->cb.get(), 0, askID));
}
if(buttons.size() == 1)
buttons.front()->assignedKey = EShortcut::GLOBAL_RETURN;
if(buttons.size() == 2)
{
buttons.front()->assignedKey = EShortcut::GLOBAL_ACCEPT;
buttons.back()->assignedKey = EShortcut::GLOBAL_CANCEL;
}
for(int i=0;i<comps.size();i++)
{
comps[i]->recActions = 255-DISPOSE;