1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-13 11:40:38 +02:00

extended statistic: Window

This commit is contained in:
Laserlicht 2024-08-11 22:44:16 +02:00
parent f42f1de347
commit 299ee35c48
7 changed files with 70 additions and 5 deletions

View File

@ -162,6 +162,8 @@
"vcmi.systemOptions.otherGroup" : "Other Settings", // unused right now
"vcmi.systemOptions.townsGroup" : "Town Screen",
"vcmi.statisticWindow.statistic" : "Statistic",
"vcmi.systemOptions.fullscreenBorderless.hover" : "Fullscreen (borderless)",
"vcmi.systemOptions.fullscreenBorderless.help" : "{Borderless Fullscreen}\n\nIf selected, VCMI will run in borderless fullscreen mode. In this mode, game will always use same resolution as desktop, ignoring selected resolution.",
"vcmi.systemOptions.fullscreenExclusive.hover" : "Fullscreen (exclusive)",

View File

@ -162,6 +162,8 @@
"vcmi.systemOptions.otherGroup" : "Andere Einstellungen", // unused right now
"vcmi.systemOptions.townsGroup" : "Stadt-Bildschirm",
"vcmi.statisticWindow.statistic" : "Statistik",
"vcmi.systemOptions.fullscreenBorderless.hover" : "Vollbild (randlos)",
"vcmi.systemOptions.fullscreenBorderless.help" : "{Randloses Vollbild}\n\nWenn diese Option ausgewählt ist, wird VCMI im randlosen Vollbildmodus ausgeführt. In diesem Modus wird das Spiel immer dieselbe Auflösung wie der Desktop verwenden und die gewählte Auflösung ignorieren.",
"vcmi.systemOptions.fullscreenExclusive.hover" : "Vollbild (exklusiv)",

View File

@ -64,6 +64,7 @@ set(client_SRCS
mainmenu/CPrologEpilogVideo.cpp
mainmenu/CreditsScreen.cpp
mainmenu/CHighScoreScreen.cpp
mainmenu/CStatisticScreen.cpp
mapView/MapRenderer.cpp
mapView/MapRendererContext.cpp
@ -254,6 +255,7 @@ set(client_HEADERS
mainmenu/CPrologEpilogVideo.h
mainmenu/CreditsScreen.h
mainmenu/CHighScoreScreen.h
mainmenu/CStatisticScreen.h
mapView/IMapRendererContext.h
mapView/IMapRendererObserver.h

View File

@ -11,6 +11,7 @@
#include "StdInc.h"
#include "CHighScoreScreen.h"
#include "CStatisticScreen.h"
#include "../gui/CGuiHandler.h"
#include "../gui/WindowHandler.h"
#include "../gui/Shortcut.h"
@ -172,7 +173,7 @@ void CHighScoreScreen::buttonExitClick()
}
CHighScoreInputScreen::CHighScoreInputScreen(bool won, HighScoreCalculation calc, StatisticDataSet statistic)
: CWindowObject(BORDERED), won(won), calc(calc)
: CWindowObject(BORDERED), won(won), calc(calc), stat(statistic)
{
addUsedEvents(LCLICK | KEYBOARD);
@ -206,8 +207,8 @@ 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("bla"), [](){});
texts.push_back(std::make_shared<CMultiLineLabel>(Rect(0, 0, 726, 32), FONT_HIGH_SCORE, ETextAlignment::CENTERRIGHT, Colors::WHITE, "Statistik:"));
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); });
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") + ":"));
}
int CHighScoreInputScreen::addEntry(std::string text) {

View File

@ -10,6 +10,7 @@
#pragma once
#include "../windows/CWindowObject.h"
#include "../../lib/gameState/HighScore.h"
#include "../../lib/gameState/GameStatistics.h"
class CButton;
class CLabel;
@ -21,8 +22,6 @@ class CFilledTexture;
class TransparentFilledRectangle;
class StatisticDataSet;
class CHighScoreScreen : public CWindowObject
{
public:
@ -79,6 +78,7 @@ class CHighScoreInputScreen : public CWindowObject
std::shared_ptr<CFilledTexture> backgroundAroundMenu;
std::shared_ptr<CButton> statisticButton;
StatisticDataSet stat;
bool won;
HighScoreCalculation calc;

View File

@ -0,0 +1,34 @@
/*
* CStatisticScreen.cpp, 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
*
*/
#include "StdInc.h"
#include "CStatisticScreen.h"
#include "../gui/CGuiHandler.h"
#include "../gui/WindowHandler.h"
#include "../widgets/Images.h"
#include "../../lib/gameState/GameStatistics.h"
CStatisticScreen::CStatisticScreen(StatisticDataSet statistic)
: CWindowObject(BORDERED)
{
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));
addUsedEvents(LCLICK);
}
void CStatisticScreen::clickPressed(const Point & cursorPosition)
{
close();
}

View File

@ -0,0 +1,24 @@
/*
* CStatisticScreen.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 FilledTexturePlayerColored;
class StatisticDataSet;
class CStatisticScreen : public CWindowObject
{
std::shared_ptr<FilledTexturePlayerColored> filledBackground;
public:
CStatisticScreen(StatisticDataSet statistic);
void clickPressed(const Point & cursorPosition) override;
};