CCampaignScreen.h 1.4 KB

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