CHeroBackpackWindow.cpp 858 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * CHeroBackpackWindow.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 "CHeroBackpackWindow.h"
  12. #include "../gui/CGuiHandler.h"
  13. #include "../gui/Shortcut.h"
  14. #include "../widgets/Buttons.h"
  15. CHeroBackpackWindow::CHeroBackpackWindow(const CGHeroInstance * hero)
  16. : CWindowObject(PLAYER_COLORED)
  17. {
  18. OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
  19. arts = std::make_shared<CArtifactsOfHeroBackpack>(Point(-100, -170));
  20. arts->setHero(hero);
  21. addSet(arts);
  22. addCloseCallback(std::bind(&CHeroBackpackWindow::close, this));
  23. quitButton = std::make_shared<CButton>(Point(242, 200), "hsbtns.def", CButton::tooltip(""), [this]() { close(); }, EShortcut::GLOBAL_RETURN);
  24. }