mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
draw images
This commit is contained in:
parent
92b0e2b400
commit
909b06f7c1
@ -42,7 +42,7 @@ CHighScoreScreen::CHighScoreScreen()
|
||||
Settings entry1 = persistentStorage.write["highscore"]["campaign"][std::to_string(i)]["campaign"];
|
||||
entry1->String() = "test";
|
||||
Settings entry2 = persistentStorage.write["highscore"]["campaign"][std::to_string(i)]["points"];
|
||||
entry2->Integer() = 100;
|
||||
entry2->Integer() = std::rand() % 400 * 5;
|
||||
|
||||
Settings entry3 = persistentStorage.write["highscore"]["standard"][std::to_string(i)]["player"];
|
||||
entry3->String() = "test";
|
||||
@ -51,7 +51,7 @@ CHighScoreScreen::CHighScoreScreen()
|
||||
Settings entry5 = persistentStorage.write["highscore"]["standard"][std::to_string(i)]["days"];
|
||||
entry5->Integer() = 123;
|
||||
Settings entry6 = persistentStorage.write["highscore"]["standard"][std::to_string(i)]["points"];
|
||||
entry6->Integer() = 100;
|
||||
entry6->Integer() = std::rand() % 400;
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,12 +74,10 @@ void CHighScoreScreen::addHighScores()
|
||||
background = std::make_shared<CPicture>(ImagePath::builtin(highscorepage == HighScorePage::STANDARD ? "HISCORE" : "HISCORE2"));
|
||||
|
||||
texts.clear();
|
||||
images.clear();
|
||||
|
||||
static const JsonNode configCreatures(JsonPath::builtin("CONFIG/highscoreCreatures.json"));
|
||||
auto creatures = configCreatures["creatures"].Vector();
|
||||
for(auto & creature : creatures) {
|
||||
images.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("CPRSMALL"), (*CGI->creh)[CreatureID::decode(creature["creature"].String())]->getIconIndex(), 0, 10, 10));
|
||||
}
|
||||
|
||||
// Header
|
||||
texts.push_back(std::make_shared<CLabel>(115, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->translate("core.genrltxt.433")));
|
||||
@ -118,6 +116,12 @@ void CHighScoreScreen::addHighScores()
|
||||
texts.push_back(std::make_shared<CLabel>(410, y + i * 50, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, curData["campaign"].String()));
|
||||
texts.push_back(std::make_shared<CLabel>(590, y + i * 50, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, std::to_string(curData["points"].Integer())));
|
||||
}
|
||||
|
||||
int divide = (highscorepage == HighScorePage::STANDARD) ? 1 : 5;
|
||||
for(auto & creature : creatures) {
|
||||
if(curData["points"].Integer() / divide <= creature["max"].Integer() && curData["points"].Integer() / divide >= creature["min"].Integer())
|
||||
images.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("CPRSMALL"), (*CGI->creh)[CreatureID::decode(creature["creature"].String())]->getIconIndex(), 0, 670, y - 15 + i * 50));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,28 +10,28 @@
|
||||
{ "min" : 29, "max" : 32, "creature": "core:masterGremlin" },
|
||||
{ "min" : 33, "max" : 36, "creature": "core:hobgoblin" },
|
||||
{ "min" : 37, "max" : 40, "creature": "core:pikeman" },
|
||||
{ "min" : 41, "max" : 44, "creature": "core:infernoTroglodyte" },
|
||||
{ "min" : 41, "max" : 44, "creature": "core:infernalTroglodyte" },
|
||||
{ "min" : 45, "max" : 48, "creature": "core:skeletonWarrior" },
|
||||
{ "min" : 49, "max" : 52, "creature": "core:gnollMarauder" },
|
||||
{ "min" : 53, "max" : 56, "creature": "core:walkingDead" },
|
||||
{ "min" : 57, "max" : 60, "creature": "core:centaur" },
|
||||
{ "min" : 61, "max" : 64, "creature": "core:herberdier" },
|
||||
{ "min" : 61, "max" : 64, "creature": "core:halberdier" },
|
||||
{ "min" : 65, "max" : 68, "creature": "core:archer" },
|
||||
{ "min" : 69, "max" : 72, "creature": "core:lizardman" },
|
||||
{ "min" : 73, "max" : 76, "creature": "core:zombie" },
|
||||
{ "min" : 77, "max" : 80, "creature": "core:wolfRider" },
|
||||
{ "min" : 81, "max" : 84, "creature": "core:centaurCaptian" },
|
||||
{ "min" : 77, "max" : 80, "creature": "core:goblinWolfRider" },
|
||||
{ "min" : 81, "max" : 84, "creature": "core:centaurCaptain" },
|
||||
{ "min" : 85, "max" : 88, "creature": "core:dwarf" },
|
||||
{ "min" : 89, "max" : 92, "creature": "core:harpy" },
|
||||
{ "min" : 93, "max" : 96, "creature": "core:lizardWarrior" },
|
||||
{ "min" : 97, "max" : 100, "creature": "core:gog" },
|
||||
{ "min" : 101, "max" : 104, "creature": "core:stoneGargoyle" },
|
||||
{ "min" : 105, "max" : 108, "creature": "core:masksman" },
|
||||
{ "min" : 105, "max" : 108, "creature": "core:sharpshooter" },
|
||||
{ "min" : 109, "max" : 112, "creature": "core:orc" },
|
||||
{ "min" : 113, "max" : 116, "creature": "core:obsidianGargoyle" },
|
||||
{ "min" : 117, "max" : 120, "creature": "core:wofRaider" },
|
||||
{ "min" : 117, "max" : 120, "creature": "core:hobgoblinWolfRider" },
|
||||
{ "min" : 121, "max" : 124, "creature": "core:battleDwarf" },
|
||||
{ "min" : 125, "max" : 128, "creature": "core:elf" },
|
||||
{ "min" : 125, "max" : 128, "creature": "core:woodElf" },
|
||||
{ "min" : 129, "max" : 132, "creature": "core:harpyHag" },
|
||||
{ "min" : 133, "max" : 136, "creature": "core:magog" },
|
||||
{ "min" : 137, "max" : 140, "creature": "core:orcChieftain" },
|
||||
@ -51,8 +51,8 @@
|
||||
{ "min" : 191, "max" : 193, "creature": "core:evilEye" },
|
||||
{ "min" : 194, "max" : 196, "creature": "core:cerberus" },
|
||||
{ "min" : 197, "max" : 199, "creature": "core:ironGolem" },
|
||||
{ "min" : 200, "max" : 202, "creature": "core:orge" },
|
||||
{ "min" : 203, "max" : 205, "creature": "core:swordman" },
|
||||
{ "min" : 200, "max" : 202, "creature": "core:ogre" },
|
||||
{ "min" : 203, "max" : 205, "creature": "core:swordsman" },
|
||||
{ "min" : 206, "max" : 208, "creature": "core:demon" },
|
||||
{ "min" : 209, "max" : 211, "creature": "core:royalGriffin" },
|
||||
{ "min" : 212, "max" : 214, "creature": "core:hornedDemon" },
|
||||
@ -65,16 +65,16 @@
|
||||
{ "min" : 233, "max" : 235, "creature": "core:vampire" },
|
||||
{ "min" : 236, "max" : 238, "creature": "core:mage" },
|
||||
{ "min" : 239, "max" : 241, "creature": "core:medusaQueen" },
|
||||
{ "min" : 242, "max" : 244, "creature": "core:crusider" },
|
||||
{ "min" : 242, "max" : 244, "creature": "core:crusader" },
|
||||
{ "min" : 245, "max" : 247, "creature": "core:goldGolem" },
|
||||
{ "min" : 248, "max" : 250, "creature": "core:orgeMage" },
|
||||
{ "min" : 248, "max" : 250, "creature": "core:ogreMage" },
|
||||
{ "min" : 251, "max" : 253, "creature": "core:archMage" },
|
||||
{ "min" : 254, "max" : 256, "creature": "core:greaterBasilisk" },
|
||||
{ "min" : 257, "max" : 259, "creature": "core:zealot" },
|
||||
{ "min" : 260, "max" : 262, "creature": "core:pitFiend" },
|
||||
{ "min" : 263, "max" : 265, "creature": "core:diamondGolem" },
|
||||
{ "min" : 266, "max" : 268, "creature": "core:vampireLord" },
|
||||
{ "min" : 269, "max" : 271, "creature": "core:dendroidSolider" },
|
||||
{ "min" : 269, "max" : 271, "creature": "core:dendroidSoldier" },
|
||||
{ "min" : 272, "max" : 274, "creature": "core:minotaur" },
|
||||
{ "min" : 275, "max" : 277, "creature": "core:lich" },
|
||||
{ "min" : 278, "max" : 280, "creature": "core:genie" },
|
||||
@ -86,13 +86,13 @@
|
||||
{ "min" : 296, "max" : 298, "creature": "core:powerLich" },
|
||||
{ "min" : 299, "max" : 301, "creature": "core:thunderbird" },
|
||||
{ "min" : 302, "max" : 304, "creature": "core:pitLord" },
|
||||
{ "min" : 305, "max" : 307, "creature": "core:cyclops" },
|
||||
{ "min" : 305, "max" : 307, "creature": "core:cyclop" },
|
||||
{ "min" : 308, "max" : 310, "creature": "core:wyvern" },
|
||||
{ "min" : 311, "max" : 313, "creature": "core:cyclopsKing" },
|
||||
{ "min" : 311, "max" : 313, "creature": "core:cyclopKing" },
|
||||
{ "min" : 314, "max" : 316, "creature": "core:wyvernMonarch" },
|
||||
{ "min" : 317, "max" : 319, "creature": "core:manticore" },
|
||||
{ "min" : 320, "max" : 322, "creature": "core:scorpicore" },
|
||||
{ "min" : 323, "max" : 325, "creature": "core:efreeti" },
|
||||
{ "min" : 323, "max" : 325, "creature": "core:efreet" },
|
||||
{ "min" : 326, "max" : 328, "creature": "core:unicorn" },
|
||||
{ "min" : 329, "max" : 331, "creature": "core:efreetSultan" },
|
||||
{ "min" : 332, "max" : 334, "creature": "core:cavalier" },
|
||||
@ -109,7 +109,7 @@
|
||||
{ "min" : 365, "max" : 367, "creature": "core:ghostDragon" },
|
||||
{ "min" : 368, "max" : 370, "creature": "core:redDragon" },
|
||||
{ "min" : 371, "max" : 373, "creature": "core:greenDragon" },
|
||||
{ "min" : 374, "max" : 376, "creature": "core:angle" },
|
||||
{ "min" : 374, "max" : 376, "creature": "core:angel" },
|
||||
{ "min" : 377, "max" : 379, "creature": "core:devil" },
|
||||
{ "min" : 380, "max" : 382, "creature": "core:chaosHydra" },
|
||||
{ "min" : 383, "max" : 385, "creature": "core:ancientBehemoth" },
|
||||
@ -117,6 +117,6 @@
|
||||
{ "min" : 389, "max" : 391, "creature": "core:titan" },
|
||||
{ "min" : 392, "max" : 394, "creature": "core:goldDragon" },
|
||||
{ "min" : 395, "max" : 397, "creature": "core:blackDragon" },
|
||||
{ "min" : 398, "max" : 400, "creature": "core:archAngle " }
|
||||
{ "min" : 398, "max" : 400, "creature": "core:archangel" }
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user