mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
shortcut
This commit is contained in:
parent
da64991fd9
commit
1e298534ae
@ -74,6 +74,7 @@ enum class EShortcut
|
||||
HIGH_SCORES_CAMPAIGNS,
|
||||
HIGH_SCORES_SCENARIOS,
|
||||
HIGH_SCORES_RESET,
|
||||
HIGH_SCORES_STATISTIC,
|
||||
|
||||
// Game lobby / scenario selection
|
||||
LOBBY_BEGIN_STANDARD_GAME, // b
|
||||
|
@ -281,6 +281,7 @@ EShortcut ShortcutHandler::findShortcut(const std::string & identifier ) const
|
||||
{"highScoresCampaigns", EShortcut::HIGH_SCORES_CAMPAIGNS },
|
||||
{"highScoresScenarios", EShortcut::HIGH_SCORES_SCENARIOS },
|
||||
{"highScoresReset", EShortcut::HIGH_SCORES_RESET },
|
||||
{"highScoresStatistic", EShortcut::HIGH_SCORES_STATISTIC },
|
||||
{"lobbyReplayVideo", EShortcut::LOBBY_REPLAY_VIDEO },
|
||||
{"lobbyExtraOptions", EShortcut::LOBBY_EXTRA_OPTIONS },
|
||||
{"lobbyTurnOptions", EShortcut::LOBBY_TURN_OPTIONS },
|
||||
|
@ -207,7 +207,7 @@ CHighScoreInputScreen::CHighScoreInputScreen(bool won, HighScoreCalculation calc
|
||||
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") + ":"));
|
||||
}
|
||||
|
||||
@ -288,6 +288,8 @@ void CHighScoreInputScreen::clickPressed(const Point & cursorPosition)
|
||||
|
||||
void CHighScoreInputScreen::keyPressed(EShortcut key)
|
||||
{
|
||||
if(key == EShortcut::HIGH_SCORES_STATISTIC)
|
||||
return;
|
||||
clickPressed(Point());
|
||||
}
|
||||
|
||||
|
@ -11,12 +11,19 @@
|
||||
#include "StdInc.h"
|
||||
|
||||
#include "CStatisticScreen.h"
|
||||
#include "../CGameInfo.h"
|
||||
|
||||
#include "../gui/CGuiHandler.h"
|
||||
#include "../gui/WindowHandler.h"
|
||||
#include "../gui/Shortcut.h"
|
||||
|
||||
#include "../widgets/Images.h"
|
||||
#include "../widgets/GraphicalPrimitiveCanvas.h"
|
||||
#include "../widgets/TextControls.h"
|
||||
#include "../widgets/Buttons.h"
|
||||
|
||||
#include "../../lib/gameState/GameStatistics.h"
|
||||
#include "../../lib/texts/CGeneralTextHandler.h"
|
||||
|
||||
CStatisticScreen::CStatisticScreen(StatisticDataSet statistic)
|
||||
: CWindowObject(BORDERED)
|
||||
@ -24,11 +31,9 @@ CStatisticScreen::CStatisticScreen(StatisticDataSet statistic)
|
||||
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
|
||||
pos = center(Rect(0, 0, 800, 600));
|
||||
filledBackground = std::make_shared<FilledTexturePlayerColored>(ImagePath::builtin("DiBoxBck"), Rect(0, 0, pos.w, pos.h));
|
||||
filledBackground->setPlayerColor(PlayerColor(1));
|
||||
|
||||
addUsedEvents(LCLICK);
|
||||
}
|
||||
|
||||
void CStatisticScreen::clickPressed(const Point & cursorPosition)
|
||||
{
|
||||
close();
|
||||
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));
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ class FilledTexturePlayerColored;
|
||||
class CStatisticScreen : public CWindowObject
|
||||
{
|
||||
std::shared_ptr<FilledTexturePlayerColored> filledBackground;
|
||||
|
||||
std::vector<std::shared_ptr<CIntObject>> layout;
|
||||
public:
|
||||
CStatisticScreen(StatisticDataSet statistic);
|
||||
|
||||
void clickPressed(const Point & cursorPosition) override;
|
||||
};
|
||||
|
@ -137,6 +137,7 @@
|
||||
"heroToggleTactics": "B",
|
||||
"highScoresCampaigns": "C",
|
||||
"highScoresReset": "R",
|
||||
"highScoresStatistic": ".",
|
||||
"highScoresScenarios": "S",
|
||||
"kingdomHeroesTab": "H",
|
||||
"kingdomTownsTab": "T",
|
||||
|
Loading…
x
Reference in New Issue
Block a user