CCampaignScreen.h 1.4 KB

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