mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Large refactoring of button classes:
- renamed CAdventureMapButton to more expectable CButton - merged CButtonBase into CButton - created more generic class for clickable elements - created more generic class for selectable elements - renamed CHighlightableButton to CToggleButton - renamed CHighlightableButtonsGrous to CToggleGroup - minimized differences between API of all these classes - removed all but one contructors in buttons, with same parameters across all classes
This commit is contained in:
@ -323,6 +323,19 @@ bool CIntObject::captureThisEvent(const SDL_KeyboardEvent & key)
|
||||
return captureAllKeys;
|
||||
}
|
||||
|
||||
CKeyShortcut::CKeyShortcut()
|
||||
{}
|
||||
|
||||
CKeyShortcut::CKeyShortcut(int key)
|
||||
{
|
||||
if (key != SDLK_UNKNOWN)
|
||||
assignedKeys.insert(key);
|
||||
}
|
||||
|
||||
CKeyShortcut::CKeyShortcut(std::set<int> Keys)
|
||||
:assignedKeys(Keys)
|
||||
{}
|
||||
|
||||
void CKeyShortcut::keyPressed(const SDL_KeyboardEvent & key)
|
||||
{
|
||||
if(vstd::contains(assignedKeys,key.keysym.sym)
|
||||
|
Reference in New Issue
Block a user