CArtifactsOfHeroAltar.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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 "../../lib/mapObjects/CGHeroInstance.h"
  15. #include "../../lib/networkPacks/ArtifactLocation.h"
  16. CArtifactsOfHeroAltar::CArtifactsOfHeroAltar(const Point & position)
  17. {
  18. init(position, std::bind(&CArtifactsOfHeroBase::scrollBackpack, this, _1));
  19. setClickPressedArtPlacesCallback(std::bind(&CArtifactsOfHeroBase::clickPressedArtPlace, this, _1, _2));
  20. setShowPopupArtPlacesCallback(std::bind(&CArtifactsOfHeroBase::showPopupArtPlace, this, _1, _2));
  21. enableGesture();
  22. // The backpack is in the altar window above and to the right
  23. for(auto & slot : backpack)
  24. slot->moveBy(Point(2, -1));
  25. leftBackpackRoll->moveBy(Point(2, -1));
  26. rightBackpackRoll->moveBy(Point(2, -1));
  27. };
  28. void CArtifactsOfHeroAltar::deactivate()
  29. {
  30. putBackPickedArtifact();
  31. CArtifactsOfHeroBase::deactivate();
  32. }