mirror of
https://github.com/ihhub/fheroes2.git
synced 2026-10-11 21:59:51 +00:00
@@ -73,7 +73,7 @@ namespace fheroes2
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string highScoreFileName = "fheroes2.hgs";
|
||||
const std::string_view highScoreFileName{ "fheroes2.hgs" };
|
||||
fheroes2::HighScoreDataContainer highScoreDataContainer;
|
||||
const int32_t initialHighScoreEntryOffsetY = 72;
|
||||
const int32_t highScoreEntryStepY = 40;
|
||||
@@ -85,6 +85,8 @@ namespace
|
||||
const int32_t monsterOffsetX = 554;
|
||||
const int32_t monsterOffsetY = 91;
|
||||
|
||||
constexpr size_t maxDisplayedEntries{ 10 };
|
||||
|
||||
// Calculate the mini monster sprites ROI.
|
||||
fheroes2::Rect getAnimationRoi( const fheroes2::Point & position, const bool isCampaign )
|
||||
{
|
||||
@@ -203,7 +205,11 @@ namespace
|
||||
int32_t scoreIndex = 0;
|
||||
int32_t offsetY = position.y;
|
||||
|
||||
for ( const fheroes2::HighscoreData & data : highScores ) {
|
||||
const size_t entryCount{ std::min<size_t>( maxDisplayedEntries, highScores.size() ) };
|
||||
|
||||
for ( size_t i = 0; i < entryCount; ++i ) {
|
||||
const fheroes2::HighscoreData & data = highScores[i];
|
||||
|
||||
const fheroes2::FontType font = ( scoreIndex == selectedScoreIndex ) ? fheroes2::FontType::normalYellow() : fheroes2::FontType::normalWhite();
|
||||
|
||||
// TODO: scenario name can have its own independent language.
|
||||
|
||||
Reference in New Issue
Block a user