1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-09 01:06:07 +02:00

Switched to images

This commit is contained in:
George King
2025-03-07 17:15:58 +01:00
committed by GitHub
parent ac57e1ee7f
commit 842a0bfbee
2 changed files with 6 additions and 11 deletions

View File

@ -110,15 +110,11 @@ CSelectionBase::CSelectionBase(ESelectionScreen type)
setBackground(ImagePath::fromJson(*RandomGeneratorUtil::nextItem(*bgNames, CRandomGenerator::getDefault()))); setBackground(ImagePath::fromJson(*RandomGeneratorUtil::nextItem(*bgNames, CRandomGenerator::getDefault())));
pos = background->center(); pos = background->center();
// Set logo for (const JsonNode& node : gameSelectConfig["images"].Vector())
const auto& logoConfig = gameSelectConfig["logo"]; {
if (!logoConfig["name"].Vector().empty()) auto image = std::make_shared<CPicture>(ImagePath::fromJson(*RandomGeneratorUtil::nextItem(node["name"].Vector(), CRandomGenerator::getDefault())), Point(node["x"].Integer(), node["y"].Integer()));
logo = std::make_shared<CPicture>(ImagePath::fromJson(*RandomGeneratorUtil::nextItem(logoConfig["name"].Vector(), CRandomGenerator::getDefault())), Point(logoConfig["x"].Integer(), logoConfig["y"].Integer())); images.push_back(image);
}
// Set sublogo
const auto& sublogoConfig = gameSelectConfig["sublogo"];
if (!logoConfig["name"].Vector().empty())
sublogo = std::make_shared<CPicture>(ImagePath::fromJson(*RandomGeneratorUtil::nextItem(sublogoConfig["name"].Vector(), CRandomGenerator::getDefault())), Point(sublogoConfig["x"].Integer(), sublogoConfig["y"].Integer()));
} }
card = std::make_shared<InfoCard>(); card = std::make_shared<InfoCard>();

View File

@ -71,8 +71,7 @@ public:
std::shared_ptr<CButton> buttonBack; std::shared_ptr<CButton> buttonBack;
std::shared_ptr<CButton> buttonSimturns; std::shared_ptr<CButton> buttonSimturns;
std::shared_ptr<CPicture> logo; std::vector<std::shared_ptr<CPicture>> images;
std::shared_ptr<CPicture> sublogo;
std::shared_ptr<SelectionTab> tabSel; std::shared_ptr<SelectionTab> tabSel;
std::shared_ptr<OptionsTab> tabOpt; std::shared_ptr<OptionsTab> tabOpt;