1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Correctly update drag-and-drop cursor if our window gets deactivated

This commit is contained in:
Ivan Savenko
2022-12-18 14:34:38 +02:00
parent 526a6e4fe7
commit 57dba9433c
3 changed files with 21 additions and 0 deletions

View File

@@ -254,6 +254,22 @@ void CHeroArtPlace::clickRight(tribool down, bool previousState)
}
}
void CArtifactsOfHero::activate()
{
if (commonInfo->src.AOH == this && commonInfo->src.art)
CCS->curh->dragAndDropCursor(make_unique<CAnimImage>("artifact", commonInfo->src.art->artType->getIconIndex()));
CIntObject::activate();
}
void CArtifactsOfHero::deactivate()
{
if (commonInfo->src.AOH == this && commonInfo->src.art)
CCS->curh->dragAndDropCursor(nullptr);
CIntObject::deactivate();
}
/**
* Selects artifact slot so that the containing artifact looks like it's picked up.
*/