mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-25 21:38:59 +02:00
Fix button interaction with hotkey & mouse
This commit is contained in:
parent
d5d0ca96a8
commit
ff1c94541f
@ -173,22 +173,28 @@ void CButton::clickLeft(tribool down, bool previousState)
|
||||
|
||||
if (down)
|
||||
{
|
||||
if (!soundDisabled)
|
||||
CCS->soundh->playSound(soundBase::button);
|
||||
setState(PRESSED);
|
||||
}
|
||||
else if(hoverable && isHovered())
|
||||
setState(HIGHLIGHTED);
|
||||
else
|
||||
setState(NORMAL);
|
||||
if (getState() != PRESSED)
|
||||
{
|
||||
if (!soundDisabled)
|
||||
CCS->soundh->playSound(soundBase::button);
|
||||
setState(PRESSED);
|
||||
|
||||
if (actOnDown && down)
|
||||
{
|
||||
onButtonClicked();
|
||||
if (actOnDown)
|
||||
onButtonClicked();
|
||||
}
|
||||
}
|
||||
else if (!actOnDown && previousState && (down==false))
|
||||
else
|
||||
{
|
||||
onButtonClicked();
|
||||
if (getState() == PRESSED)
|
||||
{
|
||||
if(hoverable && isHovered())
|
||||
setState(HIGHLIGHTED);
|
||||
else
|
||||
setState(NORMAL);
|
||||
|
||||
if (!actOnDown && previousState && (down == false))
|
||||
onButtonClicked();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user