Pārlūkot izejas kodu

add clean adventure options

Laserlicht 1 gadu atpakaļ
vecāks
revīzija
82480e3552

+ 24 - 0
client/render/AssetGenerator.cpp

@@ -23,8 +23,32 @@ VCMI_LIB_NAMESPACE_BEGIN
 void AssetGenerator::generate()
 {
 	createBigSpellBook("data/SpelBk2.bmp");
+    createAdventureOptionsCleanBackground("data/ADVOPTBC.bmp");
 }
 
+void AssetGenerator::createAdventureOptionsCleanBackground(std::string filename)
+{
+	if(!CResourceHandler::get("local")->createResource(filename))
+		return;
+
+	auto res = ImagePath::builtin("ADVOPTBK");
+	res.setOriginalResource(true);
+
+	std::shared_ptr<IImage> img = GH.renderHandler().loadImage(res, EImageBlitMode::OPAQUE);
+
+	Canvas canvas = Canvas(Point(575, 585));
+	canvas.draw(img, Point(0, 0), Rect(0, 0, 575, 585));
+	canvas.draw(img, Point(54, 121), Rect(54, 123, 335, 1));
+	canvas.draw(img, Point(158, 84), Rect(156, 84, 2, 37));
+	canvas.draw(img, Point(234, 84), Rect(232, 84, 2, 37));
+	canvas.draw(img, Point(310, 84), Rect(308, 84, 2, 37));
+	canvas.draw(img, Point(53, 389), Rect(53, 342, 338, 181));
+
+	std::shared_ptr<IImage> image = GH.renderHandler().createImage(canvas.getInternalSurface());
+
+	ResourcePath savePath(filename, EResType::IMAGE);
+	image->exportBitmap(*CResourceHandler::get("local")->getResourceName(savePath));
+}
 void AssetGenerator::createBigSpellBook(std::string filename)
 {
 	if(!CResourceHandler::get("local")->createResource(filename))

+ 1 - 0
client/render/AssetGenerator.h

@@ -15,6 +15,7 @@ VCMI_LIB_NAMESPACE_BEGIN
 class DLL_LINKAGE AssetGenerator
 {
     static void createBigSpellBook(std::string filename);
+    static void createAdventureOptionsCleanBackground(std::string filename);
 
 public:
     static void generate();

+ 1 - 26
config/widgets/extraOptionsTab.json

@@ -6,7 +6,7 @@
 		{
 			"name": "background",
 			"type": "picture",
-			"image": "ADVOPTBK",
+			"image": "ADVOPTBC",
 			"position": {"x": 0, "y": 6}
 		},
 		{
@@ -35,31 +35,6 @@
 			"rect": {"x": 60, "y": 48, "w": 320, "h": 0},
 			"adoptHeight": true
 		},
-		{
-			"type": "transparentFilledRectangle",
-			"rect": {"x": 54, "y": 127, "w": 335, "h": 2},
-			"color": [24, 41, 90, 255]
-		},
-		{
-			"type": "transparentFilledRectangle",
-			"rect": {"x": 159, "y": 90, "w": 2, "h": 38},
-			"color": [24, 41, 90, 255]
-		},
-		{
-			"type": "transparentFilledRectangle",
-			"rect": {"x": 235, "y": 90, "w": 2, "h": 38},
-			"color": [24, 41, 90, 255]
-		},
-		{
-			"type": "transparentFilledRectangle",
-			"rect": {"x": 311, "y": 90, "w": 2, "h": 38},
-			"color": [24, 41, 90, 255]
-		},
-		{
-			"type": "transparentFilledRectangle",
-			"rect": {"x": 55, "y": 556, "w": 335, "h": 19},
-			"color": [24, 41, 90, 255]
-		},
 		{
 			"name": "ExtraOptionsButtons",
 			"type" : "verticalLayout",