mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
correctly register them
This commit is contained in:
@@ -160,6 +160,7 @@ std::shared_ptr<CIntObject> AdventureMapWidget::buildMapButton(const JsonNode &
|
|||||||
auto assetGenerator = ENGINE->renderHandler().getAssetGenerator();
|
auto assetGenerator = ENGINE->renderHandler().getAssetGenerator();
|
||||||
auto layout = assetGenerator->createAdventureMapButton(ImagePath::fromJson(input["generateFromBaseImage"]), small);
|
auto layout = assetGenerator->createAdventureMapButton(ImagePath::fromJson(input["generateFromBaseImage"]), small);
|
||||||
assetGenerator->addAnimationFile(AnimationPath::builtin("SPRITES/" + input["image"].String()), layout);
|
assetGenerator->addAnimationFile(AnimationPath::builtin("SPRITES/" + input["image"].String()), layout);
|
||||||
|
ENGINE->renderHandler().updateGeneratedAssets();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto button = std::make_shared<CButton>(position.topLeft(), image, help, 0, EShortcut::NONE, playerColored);
|
auto button = std::make_shared<CButton>(position.topLeft(), image, help, 0, EShortcut::NONE, playerColored);
|
||||||
|
|||||||
@@ -55,4 +55,6 @@ public:
|
|||||||
virtual void exportGeneratedAssets() = 0;
|
virtual void exportGeneratedAssets() = 0;
|
||||||
|
|
||||||
virtual std::shared_ptr<AssetGenerator> getAssetGenerator() = 0;
|
virtual std::shared_ptr<AssetGenerator> getAssetGenerator() = 0;
|
||||||
|
|
||||||
|
virtual void updateGeneratedAssets() = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -486,7 +486,7 @@ void RenderHandler::onLibraryLoadingFinished(const Services * services)
|
|||||||
{
|
{
|
||||||
assert(animationLayouts.empty());
|
assert(animationLayouts.empty());
|
||||||
assetGenerator->initialize();
|
assetGenerator->initialize();
|
||||||
animationLayouts = assetGenerator->generateAllAnimations();
|
updateGeneratedAssets();
|
||||||
|
|
||||||
addImageListEntries(services->creatures());
|
addImageListEntries(services->creatures());
|
||||||
addImageListEntries(services->heroTypes());
|
addImageListEntries(services->heroTypes());
|
||||||
@@ -545,3 +545,8 @@ std::shared_ptr<AssetGenerator> RenderHandler::getAssetGenerator()
|
|||||||
{
|
{
|
||||||
return assetGenerator;
|
return assetGenerator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RenderHandler::updateGeneratedAssets()
|
||||||
|
{
|
||||||
|
animationLayouts = assetGenerator->generateAllAnimations();
|
||||||
|
}
|
||||||
|
|||||||
@@ -69,4 +69,5 @@ public:
|
|||||||
void exportGeneratedAssets() override;
|
void exportGeneratedAssets() override;
|
||||||
|
|
||||||
std::shared_ptr<AssetGenerator> getAssetGenerator() override;
|
std::shared_ptr<AssetGenerator> getAssetGenerator() override;
|
||||||
|
void updateGeneratedAssets() override;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user