CBonusSelection.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 CFilledTexture;
  29. /// Campaign screen where you can choose one out of three starting bonuses
  30. class CBonusSelection : public CWindowObject
  31. {
  32. public:
  33. std::shared_ptr<CampaignState> getCampaign();
  34. CBonusSelection();
  35. class CRegion
  36. : public CIntObject
  37. {
  38. std::shared_ptr<CPicture> graphicsNotSelected;
  39. std::shared_ptr<CPicture> graphicsSelected;
  40. std::shared_ptr<CPicture> graphicsStriped;
  41. CampaignScenarioID idOfMapAndRegion;
  42. bool accessible; // false if region should be striped
  43. bool selectable; // true if region should be selectable
  44. public:
  45. CRegion(CampaignScenarioID id, bool accessible, bool selectable, const CampaignRegions & campDsc);
  46. void updateState();
  47. void clickReleased(const Point & cursorPosition) override;
  48. void showPopupWindow(const Point & cursorPosition) override;
  49. };
  50. void createBonusesIcons();
  51. void updateAfterStateChange();
  52. // Event handlers
  53. void goBack();
  54. void startMap();
  55. void restartMap();
  56. void increaseDifficulty();
  57. void decreaseDifficulty();
  58. std::shared_ptr<CPicture> panelBackground;
  59. std::shared_ptr<CButton> buttonStart;
  60. std::shared_ptr<CButton> buttonRestart;
  61. std::shared_ptr<CButton> buttonBack;
  62. std::shared_ptr<CButton> buttonVideo;
  63. std::shared_ptr<CLabel> campaignName;
  64. std::shared_ptr<CLabel> labelCampaignDescription;
  65. std::shared_ptr<CTextBox> campaignDescription;
  66. std::shared_ptr<CLabel> mapName;
  67. std::shared_ptr<CLabel> labelMapDescription;
  68. std::shared_ptr<CTextBox> mapDescription;
  69. std::vector<std::shared_ptr<CRegion>> regions;
  70. std::shared_ptr<CFlagBox> flagbox;
  71. std::shared_ptr<CLabel> labelChooseBonus;
  72. std::shared_ptr<CToggleGroup> groupBonuses;
  73. std::shared_ptr<CLabel> labelDifficulty;
  74. std::array<std::shared_ptr<CAnimImage>, 5> difficultyIcons;
  75. std::shared_ptr<CButton> buttonDifficultyLeft;
  76. std::shared_ptr<CButton> buttonDifficultyRight;
  77. std::shared_ptr<CAnimImage> iconsMapSizes;
  78. std::shared_ptr<ExtraOptionsTab> tabExtraOptions;
  79. std::shared_ptr<CButton> buttonExtraOptions;
  80. };