mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
refactoring
This commit is contained in:
@@ -90,20 +90,29 @@ void CArtifactsOfHeroBase::init(
|
||||
|
||||
void CArtifactsOfHeroBase::clickPrassedArtPlace(CArtPlace & artPlace, const Point & cursorPosition)
|
||||
{
|
||||
if(artPlace.isLocked())
|
||||
return;
|
||||
|
||||
if(clickPressedCallback)
|
||||
clickPressedCallback(*this, artPlace, cursorPosition);
|
||||
clickPressedCallback(artPlace, cursorPosition);
|
||||
}
|
||||
|
||||
void CArtifactsOfHeroBase::showPopupArtPlace(CArtPlace & artPlace, const Point & cursorPosition)
|
||||
{
|
||||
if(artPlace.isLocked())
|
||||
return;
|
||||
|
||||
if(showPopupCallback)
|
||||
showPopupCallback(*this, artPlace, cursorPosition);
|
||||
showPopupCallback(artPlace, cursorPosition);
|
||||
}
|
||||
|
||||
void CArtifactsOfHeroBase::gestureArtPlace(CArtPlace & artPlace, const Point & cursorPosition)
|
||||
{
|
||||
if(artPlace.isLocked())
|
||||
return;
|
||||
|
||||
if(gestureCallback)
|
||||
gestureCallback(*this, artPlace, cursorPosition);
|
||||
gestureCallback(artPlace, cursorPosition);
|
||||
}
|
||||
|
||||
void CArtifactsOfHeroBase::setHero(const CGHeroInstance * hero)
|
||||
@@ -226,6 +235,11 @@ void CArtifactsOfHeroBase::addGestureCallback(CArtPlace::ClickFunctor callback)
|
||||
}
|
||||
}
|
||||
|
||||
const CArtifactInstance * CArtifactsOfHeroBase::getArt(const ArtifactPosition & slot)
|
||||
{
|
||||
return curHero ? curHero->getArt(slot) : nullptr;
|
||||
}
|
||||
|
||||
void CArtifactsOfHeroBase::setSlotData(ArtPlacePtr artPlace, const ArtifactPosition & slot)
|
||||
{
|
||||
// Spurious call from artifactMoved in attempt to update hidden backpack slot
|
||||
|
||||
Reference in New Issue
Block a user