davidlallen
Deity
This seems simple, but I can't figure it out. I want to dynamically change the name of a promotion during the game. I have added:
And I can see this is working as demonstrated by:
But, the hover help for the promo in the lower left corner of the screen does not update as shown here:
The blue text "Promote Unit (Combat I)" is using the original name from the xml, not the new name I have set. This is not what I want. I have tried to find how this text is set, but I cannot find it. The text "Promote Unit" is the xml tag TXT_KEY_COMMAND_PROMOTION, and there is a related COMMAND_PROMOTION. This is used in CvDLLWidgetData.cpp, which looks promising:
But, that builds the white text, and not the blue text. If I can find how the blue text is built, I am sure I can see what additional code I should add. I cannot find any other useful looking references to COMMAND_PROMOTION in CvGameCoreDLL/* or python/*/*.
Where is this blue text built?
Code:
void CvPromotionInfo::setText(const TCHAR* szText)
{
m_szTextKey = szText;
}
Code:
pPromo = self.gc.getPromotionInfo(iPromo)
sName = pPromo.getText()
The blue text "Promote Unit (Combat I)" is using the original name from the xml, not the new name I have set. This is not what I want. I have tried to find how this text is set, but I cannot find it. The text "Promote Unit" is the xml tag TXT_KEY_COMMAND_PROMOTION, and there is a related COMMAND_PROMOTION. This is used in CvDLLWidgetData.cpp, which looks promising:
Code:
if (GC.getActionInfo(widgetDataStruct.m_iData1).getCommandType() == COMMAND_PROMOTION)
{
GAMETEXT.parsePromotionHelp(szBuffer, ((PromotionTypes)(GC.getActionInfo(widgetDataStruct.m_iData1).getCommandData())));
}
Where is this blue text built?