mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
add clean adventure options
This commit is contained in:
parent
c2b181dc0c
commit
82480e3552
@ -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))
|
||||
|
@ -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();
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user