CHighScoreScreen.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * CHighScoreScreen.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 CButton;
  13. class CLabel;
  14. class CMultiLineLabel;
  15. class CAnimImage;
  16. class CTextInput;
  17. class CHighScoreScreen : public CWindowObject
  18. {
  19. enum HighScorePage { SCENARIO, CAMPAIGN };
  20. void addButtons();
  21. void addHighScores();
  22. void buttonCampaginClick();
  23. void buttonStandardClick();
  24. void buttonResetClick();
  25. void buttonExitClick();
  26. HighScorePage highscorepage = HighScorePage::SCENARIO;
  27. std::shared_ptr<CPicture> background;
  28. std::vector<std::shared_ptr<CButton>> buttons;
  29. std::vector<std::shared_ptr<CLabel>> texts;
  30. std::vector<std::shared_ptr<CAnimImage>> images;
  31. public:
  32. CHighScoreScreen();
  33. };
  34. class CHighScoreInput : public CWindowObject
  35. {
  36. std::shared_ptr<CPicture> background;
  37. std::shared_ptr<CMultiLineLabel> text;
  38. std::shared_ptr<CButton> buttonOk;
  39. std::shared_ptr<CButton> buttonCancel;
  40. std::shared_ptr<CGStatusBar> statusBar;
  41. std::shared_ptr<CTextInput> textInput;
  42. std::function<void(std::string text)> ready;
  43. void okay();
  44. void abort();
  45. public:
  46. CHighScoreInput(std::function<void(std::string text)> readyCB);
  47. };
  48. class CHighScoreInputScreen : public CWindowObject
  49. {
  50. std::vector<std::shared_ptr<CMultiLineLabel>> texts;
  51. std::shared_ptr<CHighScoreInput> input;
  52. public:
  53. CHighScoreInputScreen();
  54. void addEntry(std::string text);
  55. void show(Canvas & to) override;
  56. void activate() override;
  57. void deactivate() override;
  58. void clickPressed(const Point & cursorPosition) override;
  59. };