Opera
Deity
- Joined
- Sep 21, 2008
- Messages
- 4,643
Hi there
I took my code from Legends of Revolution; it's used to allow a player with a certain trait to still get the commerces from non-state religions in her empire. It actually works but it doesn't show up in the religion screen, even though there's this modification (between the comments) in CvGameTextMgr::setReligionHelpCity :
I don't really get why it's not working. FYI, a similar check is run in CvCity to allow the commerces to be added and it works, but here, it doesn't.
Edit: Nevermind, I think I found what was wrong. I guess it's because when you have a state religion, it is automatically selected when you enter the screen, so the python only draws the commerces for this religion. But it's annoying as it seems like the trait isn't working...
I guess I would have to tweak this part of CvReligionScreen.py:
So that it still loops over all religions... Any idea about how to write this bit?
I took my code from Legends of Revolution; it's used to allow a player with a certain trait to still get the commerces from non-state religions in her empire. It actually works but it doesn't show up in the religion screen, even though there's this modification (between the comments) in CvGameTextMgr::setReligionHelpCity :
Code:
if (eStateReligion == eReligion || eStateReligion == NO_RELIGION
/*************************************************************************************************/
/** NonStateReligionCommerce Opera (from Legends of Revolution) 21.09.09 **/
/*************************************************************************************************/
|| (GET_PLAYER(pCity->getOwnerINLINE()).isNonStateReligionCommerce())
/*************************************************************************************************/
/** NonStateReligionCommerce END **/
/*************************************************************************************************/
|| bForceState)
{
for (i = 0; i < NUM_COMMERCE_TYPES; i++)
{
iCommerce = GC.getReligionInfo(eReligion).getStateReligionCommerce((CommerceTypes)i);
if (pCity->isHolyCity(eReligion))
{
iCommerce += GC.getReligionInfo(eReligion).getHolyCityCommerce((CommerceTypes)i);
}
if (iCommerce != 0)
{
if (bHandled)
{
szBuffer.append(L", ");
}
szTempBuffer.Format(L"%s%d%c", iCommerce > 0 ? "+" : "", iCommerce, GC.getCommerceInfo((CommerceTypes)i).getChar());
szBuffer.append(szTempBuffer);
bHandled = true;
}
}
}
Edit: Nevermind, I think I found what was wrong. I guess it's because when you have a state religion, it is automatically selected when you enter the screen, so the python only draws the commerces for this religion. But it's annoying as it seems like the trait isn't working...
I guess I would have to tweak this part of 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)