1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-05 00:49:09 +02:00

class CArtifactsOfHeroMain : public CKeyShortcut

This commit is contained in:
SoundSSGood
2024-04-27 02:08:47 +03:00
parent ce9d2d8ab8
commit ce68b3f45d
13 changed files with 67 additions and 39 deletions

View File

@ -314,20 +314,12 @@ CKeyShortcut::CKeyShortcut(EShortcut key)
{
}
CKeyShortcut::CKeyShortcut(const EShortcut & key, const KeyPressedFunctor & keyPressedCallback)
: CKeyShortcut(key)
{
this->keyPressedCallback = keyPressedCallback;
}
void CKeyShortcut::keyPressed(EShortcut key)
{
if( assignedKey == key && assignedKey != EShortcut::NONE && !shortcutPressed)
{
shortcutPressed = true;
clickPressed(GH.getCursorPosition());
if(keyPressedCallback)
keyPressedCallback();
}
}