1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00
This commit is contained in:
Laserlicht 2024-08-12 01:07:58 +02:00
parent da64991fd9
commit 1e298534ae
6 changed files with 19 additions and 9 deletions

View File

@ -74,6 +74,7 @@ enum class EShortcut
HIGH_SCORES_CAMPAIGNS, HIGH_SCORES_CAMPAIGNS,
HIGH_SCORES_SCENARIOS, HIGH_SCORES_SCENARIOS,
HIGH_SCORES_RESET, HIGH_SCORES_RESET,
HIGH_SCORES_STATISTIC,
// Game lobby / scenario selection // Game lobby / scenario selection
LOBBY_BEGIN_STANDARD_GAME, // b LOBBY_BEGIN_STANDARD_GAME, // b

View File

@ -281,6 +281,7 @@ EShortcut ShortcutHandler::findShortcut(const std::string & identifier ) const
{"highScoresCampaigns", EShortcut::HIGH_SCORES_CAMPAIGNS }, {"highScoresCampaigns", EShortcut::HIGH_SCORES_CAMPAIGNS },
{"highScoresScenarios", EShortcut::HIGH_SCORES_SCENARIOS }, {"highScoresScenarios", EShortcut::HIGH_SCORES_SCENARIOS },
{"highScoresReset", EShortcut::HIGH_SCORES_RESET }, {"highScoresReset", EShortcut::HIGH_SCORES_RESET },
{"highScoresStatistic", EShortcut::HIGH_SCORES_STATISTIC },
{"lobbyReplayVideo", EShortcut::LOBBY_REPLAY_VIDEO }, {"lobbyReplayVideo", EShortcut::LOBBY_REPLAY_VIDEO },
{"lobbyExtraOptions", EShortcut::LOBBY_EXTRA_OPTIONS }, {"lobbyExtraOptions", EShortcut::LOBBY_EXTRA_OPTIONS },
{"lobbyTurnOptions", EShortcut::LOBBY_TURN_OPTIONS }, {"lobbyTurnOptions", EShortcut::LOBBY_TURN_OPTIONS },

View File

@ -207,7 +207,7 @@ CHighScoreInputScreen::CHighScoreInputScreen(bool won, HighScoreCalculation calc
CCS->musich->playMusic(AudioPath::builtin("music/UltimateLose"), false, true); CCS->musich->playMusic(AudioPath::builtin("music/UltimateLose"), false, true);
} }
statisticButton = std::make_shared<CButton>(Point(736, 0), AnimationPath::builtin("TPTAV02.DEF"), CButton::tooltip(CGI->generaltexth->translate("vcmi.statisticWindow.statistic")), [this](){ GH.windows().createAndPushWindow<CStatisticScreen>(stat); }); statisticButton = std::make_shared<CButton>(Point(736, 0), AnimationPath::builtin("TPTAV02.DEF"), CButton::tooltip(CGI->generaltexth->translate("vcmi.statisticWindow.statistic")), [this](){ GH.windows().createAndPushWindow<CStatisticScreen>(stat); }, EShortcut::HIGH_SCORES_STATISTIC);
texts.push_back(std::make_shared<CMultiLineLabel>(Rect(0, 0, 726, 32), FONT_HIGH_SCORE, ETextAlignment::CENTERRIGHT, Colors::WHITE, CGI->generaltexth->translate("vcmi.statisticWindow.statistic") + ":")); texts.push_back(std::make_shared<CMultiLineLabel>(Rect(0, 0, 726, 32), FONT_HIGH_SCORE, ETextAlignment::CENTERRIGHT, Colors::WHITE, CGI->generaltexth->translate("vcmi.statisticWindow.statistic") + ":"));
} }
@ -288,6 +288,8 @@ void CHighScoreInputScreen::clickPressed(const Point & cursorPosition)
void CHighScoreInputScreen::keyPressed(EShortcut key) void CHighScoreInputScreen::keyPressed(EShortcut key)
{ {
if(key == EShortcut::HIGH_SCORES_STATISTIC)
return;
clickPressed(Point()); clickPressed(Point());
} }

View File

@ -11,12 +11,19 @@
#include "StdInc.h" #include "StdInc.h"
#include "CStatisticScreen.h" #include "CStatisticScreen.h"
#include "../CGameInfo.h"
#include "../gui/CGuiHandler.h" #include "../gui/CGuiHandler.h"
#include "../gui/WindowHandler.h" #include "../gui/WindowHandler.h"
#include "../gui/Shortcut.h"
#include "../widgets/Images.h" #include "../widgets/Images.h"
#include "../widgets/GraphicalPrimitiveCanvas.h"
#include "../widgets/TextControls.h"
#include "../widgets/Buttons.h"
#include "../../lib/gameState/GameStatistics.h" #include "../../lib/gameState/GameStatistics.h"
#include "../../lib/texts/CGeneralTextHandler.h"
CStatisticScreen::CStatisticScreen(StatisticDataSet statistic) CStatisticScreen::CStatisticScreen(StatisticDataSet statistic)
: CWindowObject(BORDERED) : CWindowObject(BORDERED)
@ -24,11 +31,9 @@ CStatisticScreen::CStatisticScreen(StatisticDataSet statistic)
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE; OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
pos = center(Rect(0, 0, 800, 600)); pos = center(Rect(0, 0, 800, 600));
filledBackground = std::make_shared<FilledTexturePlayerColored>(ImagePath::builtin("DiBoxBck"), Rect(0, 0, pos.w, pos.h)); filledBackground = std::make_shared<FilledTexturePlayerColored>(ImagePath::builtin("DiBoxBck"), Rect(0, 0, pos.w, pos.h));
filledBackground->setPlayerColor(PlayerColor(1));
addUsedEvents(LCLICK); layout.push_back(std::make_shared<CMultiLineLabel>(Rect(0, 0, 800, 30), FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->translate("vcmi.statisticWindow.statistic")));
} layout.push_back(std::make_shared<TransparentFilledRectangle>(Rect(10, 30, 780, 530), ColorRGBA(0, 0, 0, 64), ColorRGBA(64, 80, 128, 255), 1));
layout.push_back(std::make_shared<CButton>(Point(725, 564), AnimationPath::builtin("MUBCHCK"), CButton::tooltip(), [this](){ close(); }, EShortcut::GLOBAL_ACCEPT));
void CStatisticScreen::clickPressed(const Point & cursorPosition)
{
close();
} }

View File

@ -16,8 +16,8 @@ class FilledTexturePlayerColored;
class CStatisticScreen : public CWindowObject class CStatisticScreen : public CWindowObject
{ {
std::shared_ptr<FilledTexturePlayerColored> filledBackground; std::shared_ptr<FilledTexturePlayerColored> filledBackground;
std::vector<std::shared_ptr<CIntObject>> layout;
public: public:
CStatisticScreen(StatisticDataSet statistic); CStatisticScreen(StatisticDataSet statistic);
void clickPressed(const Point & cursorPosition) override;
}; };

View File

@ -137,6 +137,7 @@
"heroToggleTactics": "B", "heroToggleTactics": "B",
"highScoresCampaigns": "C", "highScoresCampaigns": "C",
"highScoresReset": "R", "highScoresReset": "R",
"highScoresStatistic": ".",
"highScoresScenarios": "S", "highScoresScenarios": "S",
"kingdomHeroesTab": "H", "kingdomHeroesTab": "H",
"kingdomTownsTab": "T", "kingdomTownsTab": "T",