浏览代码

Switched to images

George King 9 月之前
父节点
当前提交
842a0bfbee
共有 2 个文件被更改,包括 6 次插入11 次删除
  1. 5 9
      client/lobby/CSelectionBase.cpp
  2. 1 2
      client/lobby/CSelectionBase.h

+ 5 - 9
client/lobby/CSelectionBase.cpp

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

+ 1 - 2
client/lobby/CSelectionBase.h

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