CBonusSelection.h 2.6 KB

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