CBonusSelection.h 2.5 KB

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