View Full Version : Adding a new Icon.


ClassicThunder
Jun 05, 2007, 06:24 PM
I've created a commerce, edited the gamefonts.tga, and added it to enums.h, but am unable to find out how to get the graphic to show up in text. For example I wan't to be able to add [Icon_New] and have the icon show up.

Does anyone know how to add a new commerce icon?

Impaler[WrG]
Jun 06, 2007, 10:36 AM
You'll also need to create the proper xml entries on CIV4CommerceInfos.xml under GameInfos. The order of these entries on the file must correspond with the order of the new Enums and the graphics or things will get mismatched. This is also ware you can define a button for the Commerce type.

I've make health and Happiness commerce types and rather then editing the graphic files I added this code in CvInfo.cpp to do a little re-direction and recycle the existing chars as new Commerces


int CvCommerceInfo::getChar() const
{
// < More Commerce Types by Impaler[WrG] Start >
if (&GC.getCommerceInfo(COMMERCE_HAPPY) == this)
return gDLL->getSymbolID(HAPPY_CHAR);
if (&GC.getCommerceInfo(COMMERCE_HEALTH) == this)
return gDLL->getSymbolID(HEALTHY_CHAR);
if (&GC.getCommerceInfo(COMMERCE_EXPERIENCE) == this)
return gDLL->getSymbolID(STRENGTH_CHAR);
// < More Commerce Types End >

return m_iChar;
}