mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
code review; higher prio for custom image
This commit is contained in:
@@ -506,16 +506,7 @@ void CKingdomInterface::generateObjectsList(const std::vector<const CGObjectInst
|
|||||||
for(const CGObjectInstance * object : ownedObjects)
|
for(const CGObjectInstance * object : ownedObjects)
|
||||||
{
|
{
|
||||||
//Dwellings
|
//Dwellings
|
||||||
if(object->ID == Obj::CREATURE_GENERATOR1)
|
if(auto * dwelling = dynamic_cast<const CGDwelling *>(object))
|
||||||
{
|
|
||||||
OwnedObjectInfo & info = visibleObjects[object->subID];
|
|
||||||
if(info.count++ == 0)
|
|
||||||
{
|
|
||||||
info.hoverText = object->getObjectName();
|
|
||||||
info.imageID = object->subID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(auto * dwelling = dynamic_cast<const CGDwelling *>(object))
|
|
||||||
{
|
{
|
||||||
auto kingdomOverviewImage = dwelling->getKingdomOverviewImage();
|
auto kingdomOverviewImage = dwelling->getKingdomOverviewImage();
|
||||||
|
|
||||||
@@ -529,6 +520,15 @@ void CKingdomInterface::generateObjectsList(const std::vector<const CGObjectInst
|
|||||||
info.imageID = 0;
|
info.imageID = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(object->ID == Obj::CREATURE_GENERATOR1)
|
||||||
|
{
|
||||||
|
OwnedObjectInfo & info = visibleObjects[object->subID];
|
||||||
|
if(info.count++ == 0)
|
||||||
|
{
|
||||||
|
info.hoverText = object->getObjectName();
|
||||||
|
info.imageID = object->subID;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Special objects from idToImage map that should be displayed in objects list
|
//Special objects from idToImage map that should be displayed in objects list
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
{ "amount" : 12, "type" : "earthElemental" }
|
{ "amount" : 12, "type" : "earthElemental" }
|
||||||
],
|
],
|
||||||
|
|
||||||
/// Optional image showed on kingdom overview (animation; only frame 0 displayed)
|
/// Image showed on kingdom overview (animation; only frame 0 displayed)
|
||||||
"kingdomOverviewImage" : "image.def"
|
"kingdomOverviewImage" : "image.def"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user