/* * CHighScoreScreen.h, part of VCMI engine * * Authors: listed in file AUTHORS in main folder * * License: GNU General Public License v2.0 or later * Full text of license available in license.txt file, in main folder * */ #pragma once #include "../widgets/IVideoHolder.h" #include "../windows/CWindowObject.h" #include "../../lib/gameState/HighScore.h" #include "../../lib/gameState/GameStatistics.h" class CButton; class CLabel; class CMultiLineLabel; class CAnimImage; class CTextInput; class VideoWidgetBase; class CFilledTexture; class TransparentFilledRectangle; class CHighScoreScreen : public CWindowObject { public: enum HighScorePage { SCENARIO, CAMPAIGN }; private: void addButtons(); void addHighScores(); void buttonCampaignClick(); void buttonScenarioClick(); void buttonResetClick(); void buttonExitClick(); void showPopupWindow(const Point & cursorPosition) override; HighScorePage highscorepage; std::shared_ptr background; std::shared_ptr backgroundAroundMenu; std::vector> buttons; std::vector> texts; std::vector> images; const int screenRows = 11; int highlighted; public: CHighScoreScreen(HighScorePage highscorepage, int highlighted = -1); }; class CHighScoreInput : public CWindowObject { std::shared_ptr text; std::shared_ptr buttonOk; std::shared_ptr buttonCancel; std::shared_ptr statusBar; std::shared_ptr textInput; std::function ready; void okay(); void abort(); public: CHighScoreInput(std::string playerName, std::function readyCB); }; class CHighScoreInputScreen : public CWindowObject, public IVideoHolder { std::vector> texts; std::shared_ptr input; std::shared_ptr background; std::shared_ptr videoPlayer; std::shared_ptr backgroundAroundMenu; std::shared_ptr statisticButton; bool won; HighScoreCalculation calc; StatisticDataSet stat; void onVideoPlaybackFinished() override; public: CHighScoreInputScreen(bool won, HighScoreCalculation calc, const StatisticDataSet & statistic); int addEntry(std::string text); void clickPressed(const Point & cursorPosition) override; void keyPressed(EShortcut key) override; void show(Canvas & to) override; };