1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

Reworked and fixed gendered hero sprites on adventure map

This commit is contained in:
Ivan Savenko
2024-11-03 18:50:47 +00:00
parent 8cd19f639f
commit 697d63d2b8
8 changed files with 93 additions and 34 deletions

View File

@ -72,17 +72,21 @@ public:
class CHeroInstanceConstructor : public CDefaultObjectTypeHandler<CGHeroInstance>
{
JsonNode filtersJson;
protected:
bool objectFilter(const CGObjectInstance * obj, std::shared_ptr<const ObjectTemplate> tmpl) const override;
struct HeroFilter
{
HeroTypeID fixedHero;
bool allowMale;
bool allowFemale;
};
std::map<std::string, HeroFilter> filters;
const CHeroClass * heroClass = nullptr;
std::shared_ptr<const ObjectTemplate> getOverride(TerrainId terrainType, const CGObjectInstance * object) const override;
void initTypeData(const JsonNode & input) override;
public:
const CHeroClass * heroClass = nullptr;
std::map<std::string, LogicalExpression<HeroTypeID>> filters;
void randomizeObject(CGHeroInstance * object, vstd::RNG & rng) const override;
void afterLoadFinalization() override;
bool hasNameTextID() const override;
std::string getNameTextID() const override;