CBonusSelection.h 2.3 KB

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