mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-29 21:56:54 +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 (down)
|
||||||
{
|
{
|
||||||
if (!soundDisabled)
|
if (getState() != PRESSED)
|
||||||
CCS->soundh->playSound(soundBase::button);
|
{
|
||||||
setState(PRESSED);
|
if (!soundDisabled)
|
||||||
}
|
CCS->soundh->playSound(soundBase::button);
|
||||||
else if(hoverable && isHovered())
|
setState(PRESSED);
|
||||||
setState(HIGHLIGHTED);
|
|
||||||
else
|
|
||||||
setState(NORMAL);
|
|
||||||
|
|
||||||
if (actOnDown && down)
|
if (actOnDown)
|
||||||
{
|
onButtonClicked();
|
||||||
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