CArtifactsOfHeroAltar.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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(
  21. std::bind(&CArtifactsOfHeroBase::clickPrassedArtPlace, this, _1, _2),
  22. std::bind(&CArtifactsOfHeroBase::showPopupArtPlace, this, _1, _2),
  23. position,
  24. std::bind(&CArtifactsOfHeroBase::scrollBackpack, this, _1));
  25. // The backpack is in the altar window above and to the right
  26. for(auto & slot : backpack)
  27. slot->moveBy(Point(2, -1));
  28. leftBackpackRoll->moveBy(Point(2, -1));
  29. rightBackpackRoll->moveBy(Point(2, -1));
  30. };
  31. void CArtifactsOfHeroAltar::deactivate()
  32. {
  33. putBackPickedArtifact();
  34. CArtifactsOfHeroBase::deactivate();
  35. }