CCampaignScreen.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * CCampaignScreen.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 JsonNode;
  14. VCMI_LIB_NAMESPACE_END
  15. class CLabel;
  16. class CPicture;
  17. class CButton;
  18. class CCampaignScreen : public CWindowObject
  19. {
  20. public:
  21. enum CampaignStatus {DEFAULT = 0, ENABLED, DISABLED, COMPLETED}; // the status of the campaign
  22. private:
  23. /// A button which plays a video when you move the mouse cursor over it
  24. class CCampaignButton : public CIntObject
  25. {
  26. private:
  27. std::shared_ptr<CLabel> hoverLabel;
  28. std::shared_ptr<CPicture> graphicsImage;
  29. std::shared_ptr<CPicture> graphicsCompleted;
  30. CampaignStatus status;
  31. std::string campFile; // the filename/resourcename of the campaign
  32. std::string video; // the resource name of the video
  33. std::string hoverText;
  34. void clickReleased(const Point & cursorPosition) override;
  35. void hover(bool on) override;
  36. public:
  37. CCampaignButton(const JsonNode & config);
  38. void show(Canvas & to) override;
  39. };
  40. std::vector<std::shared_ptr<CCampaignButton>> campButtons;
  41. std::vector<std::shared_ptr<CPicture>> images;
  42. std::shared_ptr<CButton> buttonBack;
  43. std::shared_ptr<CButton> createExitButton(const JsonNode & button);
  44. public:
  45. enum CampaignSet {ROE, AB, SOD, WOG};
  46. CCampaignScreen(const JsonNode & config);
  47. void activate() override;
  48. };