CBonusSelection.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. VCMI_LIB_NAMESPACE_BEGIN
  13. class CCampaignState;
  14. struct CampaignRegions;
  15. VCMI_LIB_NAMESPACE_END
  16. class CButton;
  17. class CTextBox;
  18. class CToggleGroup;
  19. class CAnimImage;
  20. class CLabel;
  21. class CFlagBox;
  22. class ISelectionScreenInfo;
  23. /// Campaign screen where you can choose one out of three starting bonuses
  24. class CBonusSelection : public CWindowObject
  25. {
  26. public:
  27. std::shared_ptr<CCampaignState> getCampaign();
  28. CBonusSelection();
  29. class CRegion
  30. : public CIntObject
  31. {
  32. std::shared_ptr<CPicture> graphicsNotSelected;
  33. std::shared_ptr<CPicture> graphicsSelected;
  34. std::shared_ptr<CPicture> graphicsStriped;
  35. int idOfMapAndRegion;
  36. bool accessible; // false if region should be striped
  37. bool selectable; // true if region should be selectable
  38. public:
  39. CRegion(int id, bool accessible, bool selectable, const CampaignRegions & campDsc);
  40. void updateState();
  41. void clickLeft(tribool down, bool previousState) override;
  42. void showPopupWindow() override;
  43. };
  44. void createBonusesIcons();
  45. void updateAfterStateChange();
  46. // Event handlers
  47. void goBack();
  48. void startMap();
  49. void restartMap();
  50. void increaseDifficulty();
  51. void decreaseDifficulty();
  52. std::shared_ptr<CPicture> panelBackground;
  53. std::shared_ptr<CButton> buttonStart;
  54. std::shared_ptr<CButton> buttonRestart;
  55. std::shared_ptr<CButton> buttonBack;
  56. std::shared_ptr<CLabel> campaignName;
  57. std::shared_ptr<CLabel> labelCampaignDescription;
  58. std::shared_ptr<CTextBox> campaignDescription;
  59. std::shared_ptr<CLabel> mapName;
  60. std::shared_ptr<CLabel> labelMapDescription;
  61. std::shared_ptr<CTextBox> mapDescription;
  62. std::vector<std::shared_ptr<CRegion>> regions;
  63. std::shared_ptr<CFlagBox> flagbox;
  64. std::shared_ptr<CLabel> labelChooseBonus;
  65. std::shared_ptr<CToggleGroup> groupBonuses;
  66. std::shared_ptr<CLabel> labelDifficulty;
  67. std::array<std::shared_ptr<CAnimImage>, 5> difficultyIcons;
  68. std::shared_ptr<CButton> buttonDifficultyLeft;
  69. std::shared_ptr<CButton> buttonDifficultyRight;
  70. std::shared_ptr<CAnimImage> iconsMapSizes;
  71. };