Afforess
The White Wizard
I just finished added a boolean function in CvBuildingInfos that checks to see if the city is on a peak or not (Useful for Ski Resort Buildings, and such...). It works fine. (I can code things by myself. )
However, I added this section to CvGameTextMgr to alert players that the building needs to be on a peak. The problem is that it gives a python exception and the worldbuilder UI is broken. I tested it again without the CvGameTextMgr code, and the problems went away...
Here's my code:
It compiles fine. I want to show red text when the requirement is not met, regular grey text when it is.
However, I added this section to CvGameTextMgr to alert players that the building needs to be on a peak. The problem is that it gives a python exception and the worldbuilder UI is broken. I tested it again without the CvGameTextMgr code, and the problems went away...
Here's my code:
Code:
if (kBuilding.isBuildOnlyOnPeaks())
{
if (!(pPlot->isPeak()) || pPlot == NULL)
{
szBuffer.append(NEWLINE);
szBuffer.append(gDLL->getText("TXT_KEY_BUILDING_REQUIRES_MOUNTAIN_RED"));
}
else // else is here to catch errors, or rare cases...
{
szBuffer.append(NEWLINE);
szBuffer.append(gDLL->getText("TXT_KEY_BUILDING_REQUIRES_MOUNTAIN"));
}
}
It compiles fine. I want to show red text when the requirement is not met, regular grey text when it is.