1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-02 09:02:03 +02:00
vcmi/client/mainmenu/CHighScoreScreen.h

74 lines
1.8 KiB
C++
Raw Normal View History

2023-09-22 01:39:35 +02:00
/*
* 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 "../windows/CWindowObject.h"
class CButton;
class CLabel;
2023-09-22 20:39:20 +02:00
class CMultiLineLabel;
2023-09-22 01:39:35 +02:00
class CAnimImage;
2023-09-22 20:39:20 +02:00
class CTextInput;
2023-09-22 01:39:35 +02:00
class CHighScoreScreen : public CWindowObject
{
2023-09-22 20:39:20 +02:00
enum HighScorePage { SCENARIO, CAMPAIGN };
2023-09-22 01:39:35 +02:00
void addButtons();
void addHighScores();
void buttonCampaginClick();
void buttonStandardClick();
void buttonResetClick();
void buttonExitClick();
2023-09-22 20:39:20 +02:00
HighScorePage highscorepage = HighScorePage::SCENARIO;
2023-09-22 01:39:35 +02:00
std::shared_ptr<CPicture> background;
std::vector<std::shared_ptr<CButton>> buttons;
std::vector<std::shared_ptr<CLabel>> texts;
std::vector<std::shared_ptr<CAnimImage>> images;
public:
CHighScoreScreen();
};
2023-09-22 20:39:20 +02:00
class CHighScoreInput : public CWindowObject
{
std::shared_ptr<CPicture> background;
std::shared_ptr<CMultiLineLabel> text;
std::shared_ptr<CButton> buttonOk;
std::shared_ptr<CButton> buttonCancel;
std::shared_ptr<CGStatusBar> statusBar;
std::shared_ptr<CTextInput> textInput;
std::function<void(std::string text)> ready;
void okay();
void abort();
public:
CHighScoreInput(std::function<void(std::string text)> readyCB);
};
class CHighScoreInputScreen : public CWindowObject
{
std::vector<std::shared_ptr<CMultiLineLabel>> texts;
std::shared_ptr<CHighScoreInput> input;
2023-09-22 21:45:12 +02:00
std::string video;
bool won;
2023-09-22 20:39:20 +02:00
public:
2023-09-22 21:45:12 +02:00
CHighScoreInputScreen(bool won);
2023-09-22 20:39:20 +02:00
void addEntry(std::string text);
void show(Canvas & to) override;
void activate() override;
void deactivate() override;
void clickPressed(const Point & cursorPosition) override;
};