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

assembling art qol

This commit is contained in:
SoundSSGood
2025-08-10 17:19:55 +02:00
parent b90e3857fd
commit 04ed758c41
11 changed files with 37 additions and 16 deletions

View File

@@ -113,17 +113,22 @@ void CWindowWithArtifacts::swapArtifactAndClose(const CArtifactsOfHeroBase & art
close();
}
void CWindowWithArtifacts::showArtifactAssembling(const CArtifactsOfHeroBase & artsInst, CArtPlace & artPlace,
void CWindowWithArtifacts::showArtifactPopup(const CArtifactsOfHeroBase & artsInst, CArtPlace & artPlace,
const Point & cursorPosition) const
{
if(artsInst.getArt(artPlace.slot))
{
if(GAME->interface()->artifactController->askToDisassemble(artsInst.getHero(), artPlace.slot))
return;
if(GAME->interface()->artifactController->askToAssemble(artsInst.getHero(), artPlace.slot))
return;
if(artPlace.text.size())
if(!artPlace.text.empty())
{
artPlace.LRClickableAreaWTextComp::showPopupWindow(cursorPosition);
artPlace.setClosePopupWindowCallback([hero = artsInst.getHero(), artPlacePtr = &artPlace]()
{
GAME->interface()->artifactController->askToAssemble(hero, artPlacePtr->slot);
artPlacePtr->setClosePopupWindowCallback([](){});
});
}
}
}