CaptainMidnight
Warlord
- Joined
- Apr 16, 2006
- Messages
- 141
I've run a ground yet again with GamesTextManager.cpp, I really don't understand what's going on here and can't find any manuals or guides to help me out. Anyway, I extracted a 'Civic building class Commerce change' tag from Afforress's A New Dawn. It works great and so far the AI works too. But I can't get the game text to display properly and I rather not use the user unfriendly :
GameTextManager.cpp (Compiles fine and looks ok):
The XML is like this:
But I just get a funny read out (see the attach screenie). It should display "+1 Gold, +1 Culture, +1 Beaker from Granary". I have tried different XML structures but to no avail. Am I missing something obvious?
GameTextManager.cpp (Compiles fine and looks ok):
Code:
/*************************************************************************************************/
/** CMEDIT: Building Class Commerce Change (Original Code by Afforess) **/
/** DATE: 27/04/2012 **/
/*************************************************************************************************/
iLast = 0;
int iCount = 0;
for (iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
{
for (iJ = 0; iJ < NUM_COMMERCE_TYPES; iJ++)
{
BuildingTypes eBuilding;
if (bPlayerContext && NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
eBuilding = (BuildingTypes)GC.getCivilizationInfo(GC.getGameINLINE().getActiveCivilizationType()).getCivilizationBuildings(iI);
}
else
{
eBuilding = (BuildingTypes)GC.getBuildingClassInfo((BuildingClassTypes)iI).getDefaultBuildingIndex();
}
if (eBuilding != NO_BUILDING && GC.getCivicInfo(eCivic).getBuildingClassCommerceChange(iI, iJ) != 0)
{
szFirstBuffer.Format(L"%s%s", NEWLINE, gDLL->getText("TXT_KEY_CIVIC_BUILDING_COMMERCE_CHANGE", GC.getCivicInfo(eCivic).getBuildingClassCommerceChange(iI, iJ), GC.getCommerceInfo((CommerceTypes)iJ).getChar()).c_str());
CvWString szBuilding;
szBuilding.Format(L"<link=literal>%s</link>", GC.getBuildingInfo(eBuilding).getDescription());
setListHelp(szHelpText, szFirstBuffer, szBuilding, L", ", (GC.getCivicInfo(eCivic).getBuildingClassCommerceChange(iI, iJ) != iLast));
if (iLast == GC.getCivicInfo(eCivic).getBuildingClassCommerceChange(iI, iJ)) iCount++;
iLast = GC.getCivicInfo(eCivic).getBuildingClassCommerceChange(iI, iJ);
if (iCount > 3) iCount = iLast = 0;
}
}
}
/*************************************************************************************************/
/** COMMENT: **/
/** CMEDIT: End **/
/*************************************************************************************************/
The XML is like this:
Code:
<TEXT>
<Tag>TXT_KEY_CIVIC_BUILDING_COMMERCE_CHANGE</Tag>
<English>[ICON_BULLET]%D1_Change %F2 from[SPACE]</English>
<French>[ICON_BULLET]%D1_Change %F2 :[SPACE]</French>
<German>[ICON_BULLET]%D1_Change %F2 durch die Modernisierung[SPACE]</German>
<Italian>[ICON_BULLET]%D1_Change %F2 da[SPACE]</Italian>
<Spanish>[ICON_BULLET]%D1_Change %F2 por[SPACE]</Spanish>
</TEXT>
But I just get a funny read out (see the attach screenie). It should display "+1 Gold, +1 Culture, +1 Beaker from Granary". I have tried different XML structures but to no avail. Am I missing something obvious?