CArtifactsOfHeroAltar.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * CArtifactsOfHeroAltar.cpp, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #include "StdInc.h"
  11. #include "CArtifactsOfHeroAltar.h"
  12. #include "Buttons.h"
  13. #include "../CPlayerInterface.h"
  14. #include "../../CCallback.h"
  15. #include "../../lib/ArtifactUtils.h"
  16. #include "../../lib/mapObjects/CGHeroInstance.h"
  17. #include "../../lib/networkPacks/ArtifactLocation.h"
  18. CArtifactsOfHeroAltar::CArtifactsOfHeroAltar(const Point & position)
  19. {
  20. init(position, std::bind(&CArtifactsOfHeroBase::scrollBackpack, this, _1));
  21. setClickPrassedArtPlacesCallback(std::bind(&CArtifactsOfHeroBase::clickPrassedArtPlace, this, _1, _2));
  22. setShowPopupArtPlacesCallback(std::bind(&CArtifactsOfHeroBase::showPopupArtPlace, this, _1, _2));
  23. enableGesture();
  24. // The backpack is in the altar window above and to the right
  25. for(auto & slot : backpack)
  26. slot->moveBy(Point(2, -1));
  27. leftBackpackRoll->moveBy(Point(2, -1));
  28. rightBackpackRoll->moveBy(Point(2, -1));
  29. };
  30. void CArtifactsOfHeroAltar::deactivate()
  31. {
  32. putBackPickedArtifact();
  33. CArtifactsOfHeroBase::deactivate();
  34. }