CBonusSelection.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * CBonusSelection.h, 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. #pragma once
  11. #include "../windows/CWindowObject.h"
  12. #include "../lib/campaign/CampaignConstants.h"
  13. #include "../lib/filesystem/ResourcePath.h"
  14. VCMI_LIB_NAMESPACE_BEGIN
  15. class CampaignState;
  16. class CampaignRegions;
  17. VCMI_LIB_NAMESPACE_END
  18. class CButton;
  19. class CTextBox;
  20. class CToggleGroup;
  21. class CAnimImage;
  22. class CLabel;
  23. class CFlagBox;
  24. class ISelectionScreenInfo;
  25. class ExtraOptionsTab;
  26. class VideoWidgetOnce;
  27. class CBonusSelection;
  28. class CampaignIntroVideo : public CWindowObject
  29. {
  30. std::shared_ptr<VideoWidgetOnce> videoPlayer;
  31. std::shared_ptr<CBonusSelection> bonusSel;
  32. void exit();
  33. public:
  34. CampaignIntroVideo(VideoPath video, ImagePath rim, std::shared_ptr<CBonusSelection> bonusSel);
  35. void clickPressed(const Point & cursorPosition) override;
  36. void keyPressed(EShortcut key) override;
  37. };
  38. /// Campaign screen where you can choose one out of three starting bonuses
  39. class CBonusSelection : public CWindowObject
  40. {
  41. public:
  42. std::shared_ptr<CampaignState> getCampaign();
  43. CBonusSelection();
  44. class CRegion
  45. : public CIntObject
  46. {
  47. std::shared_ptr<CPicture> graphicsNotSelected;
  48. std::shared_ptr<CPicture> graphicsSelected;
  49. std::shared_ptr<CPicture> graphicsStriped;
  50. CampaignScenarioID idOfMapAndRegion;
  51. bool accessible; // false if region should be striped
  52. bool selectable; // true if region should be selectable
  53. public:
  54. CRegion(CampaignScenarioID id, bool accessible, bool selectable, const CampaignRegions & campDsc);
  55. void updateState();
  56. void clickReleased(const Point & cursorPosition) override;
  57. void showPopupWindow(const Point & cursorPosition) override;
  58. };
  59. void createBonusesIcons();
  60. void updateAfterStateChange();
  61. // Event handlers
  62. void goBack();
  63. void startMap();
  64. void restartMap();
  65. void increaseDifficulty();
  66. void decreaseDifficulty();
  67. std::shared_ptr<CPicture> panelBackground;
  68. std::shared_ptr<CButton> buttonStart;
  69. std::shared_ptr<CButton> buttonRestart;
  70. std::shared_ptr<CButton> buttonBack;
  71. std::shared_ptr<CButton> buttonVideo;
  72. std::shared_ptr<CLabel> campaignName;
  73. std::shared_ptr<CLabel> labelCampaignDescription;
  74. std::shared_ptr<CTextBox> campaignDescription;
  75. std::shared_ptr<CLabel> mapName;
  76. std::shared_ptr<CLabel> labelMapDescription;
  77. std::shared_ptr<CTextBox> mapDescription;
  78. std::vector<std::shared_ptr<CRegion>> regions;
  79. std::shared_ptr<CFlagBox> flagbox;
  80. std::shared_ptr<CLabel> labelChooseBonus;
  81. std::shared_ptr<CToggleGroup> groupBonuses;
  82. std::shared_ptr<CLabel> labelDifficulty;
  83. std::array<std::shared_ptr<CAnimImage>, 5> difficultyIcons;
  84. std::shared_ptr<CButton> buttonDifficultyLeft;
  85. std::shared_ptr<CButton> buttonDifficultyRight;
  86. std::shared_ptr<CAnimImage> iconsMapSizes;
  87. std::shared_ptr<ExtraOptionsTab> tabExtraOptions;
  88. std::shared_ptr<CButton> buttonExtraOptions;
  89. };