CScenarioInfoScreen.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * CScenarioInfoScreen.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 "CScenarioInfoScreen.h"
  12. #include "OptionsTab.h"
  13. #include "../CGameInfo.h"
  14. #include "../CPlayerInterface.h"
  15. #include "../gui/CGuiHandler.h"
  16. #include "../widgets/Buttons.h"
  17. #include "../../CCallback.h"
  18. #include "../../lib/CGeneralTextHandler.h"
  19. #include "../../lib/StartInfo.h"
  20. #include "../../lib/mapping/CMapInfo.h"
  21. CScenarioInfoScreen::CScenarioInfoScreen()
  22. {
  23. OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
  24. localSi = new StartInfo(*LOCPLINT->cb->getStartInfo());
  25. localMi = new CMapInfo();
  26. localMi->mapHeader = std::unique_ptr<CMapHeader>(new CMapHeader(*LOCPLINT->cb->getMapHeader()));
  27. screenType = ESelectionScreen::scenarioInfo;
  28. card = std::make_shared<InfoCard>();
  29. opt = std::make_shared<OptionsTab>();
  30. opt->recActions = UPDATE | SHOWALL;
  31. opt->recreate();
  32. card->changeSelection();
  33. card->iconDifficulty->setSelected(getCurrentDifficulty());
  34. buttonBack = std::make_shared<CButton>(Point(584, 535), "SCNRBACK.DEF", CGI->generaltexth->zelp[105], std::bind(&CGuiHandler::popIntTotally, &GH, this), SDLK_ESCAPE);
  35. }
  36. CScenarioInfoScreen::~CScenarioInfoScreen()
  37. {
  38. vstd::clear_pointer(localSi);
  39. vstd::clear_pointer(localMi);
  40. }
  41. const CMapInfo * CScenarioInfoScreen::getMapInfo()
  42. {
  43. return localMi;
  44. }
  45. const StartInfo * CScenarioInfoScreen::getStartInfo()
  46. {
  47. return localSi;
  48. }