Maniac
Apolyton Sage
I needed to make some changes to the F7 religion screen, which didn't really fit into the existing getReligionHelpCity function, so I added a new function myself.
Alas, there is some problem. When I open the F7 screen, I get the python exception message:
'CyGameTextMgr' object has no attribute 'getReligionHelpScreen'
I have no idea what could be causing this. The non-CvGameTextMgr.cpp part of the code for getReligionHelpScreen is pretty much copied-and-pasted from getReligionHelpCity, so I don't understand where the problem could lie. Anyone an idea?
For the record I posted my getReligionHelpScreen and the original getReligionHelpCity code here for comparison:
getReligionHelpScreen:
CvReligionScreen.py
szCityName += CyGameTextMgr().getReligionHelpScreen(iLinkReligion, pLoopCity.GetCy())
CyGameTextMgr.h
std::wstring getReligionHelpScreen(int iReligion, CyCity* pCity);
CyGameTextMgr.cpp
getReligionHelpCity
CvReligionScreen.py
CyGameTextMgr.h
std::wstring getReligionHelpCity(int iReligion, CyCity* pCity, bool bCityScreen, bool bForceReligion, bool bForceState, bool bNoStateReligion);
CyGameTextMgr.cpp
Alas, there is some problem. When I open the F7 screen, I get the python exception message:
'CyGameTextMgr' object has no attribute 'getReligionHelpScreen'
I have no idea what could be causing this. The non-CvGameTextMgr.cpp part of the code for getReligionHelpScreen is pretty much copied-and-pasted from getReligionHelpCity, so I don't understand where the problem could lie. Anyone an idea?
For the record I posted my getReligionHelpScreen and the original getReligionHelpCity code here for comparison:
getReligionHelpScreen:
CvReligionScreen.py
szCityName += CyGameTextMgr().getReligionHelpScreen(iLinkReligion, pLoopCity.GetCy())
CyGameTextMgr.h
std::wstring getReligionHelpScreen(int iReligion, CyCity* pCity);
CyGameTextMgr.cpp
Code:
std::wstring CyGameTextMgr::getReligionHelpScreen(int iReligion, CyCity* pCity)
{
CvWStringBuffer szBuffer;
GAMETEXT.setReligionHelpScreen(szBuffer, (ReligionTypes)iReligion, ((pCity != NULL) ? pCity->getCity() : NULL));
return szBuffer.getCString();
}
getReligionHelpCity
CvReligionScreen.py
Code:
if (iLinkReligion == -1):
bFirst = True
for iI in range(len(lReligions)):
szTempBuffer = CyGameTextMgr().getReligionHelpCity(lReligions[iI], pLoopCity.GetCy(), False, False, False, True)
if (szTempBuffer):
if (not bFirst):
szCityName += u", "
szCityName += szTempBuffer
bFirst = False
else:
szCityName += CyGameTextMgr().getReligionHelpCity(iLinkReligion, pLoopCity.GetCy(), False, False, True, False)
CyGameTextMgr.h
std::wstring getReligionHelpCity(int iReligion, CyCity* pCity, bool bCityScreen, bool bForceReligion, bool bForceState, bool bNoStateReligion);
CyGameTextMgr.cpp
Code:
std::wstring CyGameTextMgr::getReligionHelpCity(int iReligion, CyCity* pCity, bool bCityScreen, bool bForceReligion, bool bForceState, bool bNoStateReligion)
{
CvWStringBuffer szBuffer;
GAMETEXT.setReligionHelpCity(szBuffer, (ReligionTypes)iReligion, ((pCity != NULL) ? pCity->getCity() : NULL), bCityScreen, bForceReligion, bForceState, bNoStateReligion);
return szBuffer.getCString();
}