mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Fix crash on miniHillFort popup window
This commit is contained in:
@@ -1337,7 +1337,7 @@ std::string HillFort::getPopupText(PlayerColor player) const
|
|||||||
{
|
{
|
||||||
MetaString message = MetaString::createFromRawString("{%s}\r\n\r\n%s");
|
MetaString message = MetaString::createFromRawString("{%s}\r\n\r\n%s");
|
||||||
|
|
||||||
message.replaceName(ID);
|
message.replaceName(ID, subID);
|
||||||
message.replaceTextID(getDescriptionToolTip());
|
message.replaceTextID(getDescriptionToolTip());
|
||||||
|
|
||||||
return message.toString();
|
return message.toString();
|
||||||
|
|||||||
@@ -393,11 +393,16 @@ void MetaString::replaceName(const FactionID & id)
|
|||||||
replaceTextID(id.toEntity(VLC)->getNameTextID());
|
replaceTextID(id.toEntity(VLC)->getNameTextID());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MetaString::replaceName(const MapObjectID& id)
|
void MetaString::replaceName(const MapObjectID & id)
|
||||||
{
|
{
|
||||||
replaceTextID(VLC->objtypeh->getObjectName(id, 0));
|
replaceTextID(VLC->objtypeh->getObjectName(id, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MetaString::replaceName(const MapObjectID & id, const MapObjectSubID & subId)
|
||||||
|
{
|
||||||
|
replaceTextID(VLC->objtypeh->getObjectName(id, subId));
|
||||||
|
}
|
||||||
|
|
||||||
void MetaString::replaceName(const PlayerColor & id)
|
void MetaString::replaceName(const PlayerColor & id)
|
||||||
{
|
{
|
||||||
replaceTextID(TextIdentifier("vcmi.capitalColors", id.getNum()).get());
|
replaceTextID(TextIdentifier("vcmi.capitalColors", id.getNum()).get());
|
||||||
|
|||||||
@@ -99,7 +99,8 @@ public:
|
|||||||
|
|
||||||
void replaceName(const ArtifactID & id);
|
void replaceName(const ArtifactID & id);
|
||||||
void replaceName(const FactionID& id);
|
void replaceName(const FactionID& id);
|
||||||
void replaceName(const MapObjectID& id);
|
void replaceName(const MapObjectID & id);
|
||||||
|
void replaceName(const MapObjectID & id, const MapObjectSubID & subId);
|
||||||
void replaceName(const PlayerColor& id);
|
void replaceName(const PlayerColor& id);
|
||||||
void replaceName(const SecondarySkill& id);
|
void replaceName(const SecondarySkill& id);
|
||||||
void replaceName(const SpellID& id);
|
void replaceName(const SpellID& id);
|
||||||
|
|||||||
Reference in New Issue
Block a user