Hello, I'm screwing around with modifying some files and I'm working with the religious adviser screen from Eusebius' World Religion Mod.
There's a sequence that looks like this:
Now the bit that says -- if (gc.getPlayer(self.iActivePlayer).canDoReligion(i)): -- right at the top seems to limit the religions displayed to those that the player can switch too.
I'd like to change this line so that it only displays the religions that have been founded, regardless of if the player can switch to them, so if only Hinduisim and Buddhism have been founded, those are all that will show up on the religion screen.
Can any of you python wizards tell me how this might work, or what I can change to make it display the way I want?
There's a sequence that looks like this:
Code:
# Religion buttons at the top
xLoop = self.X_RELIGION_START
for i in range(gc.getNumReligionInfos()):
if (gc.getPlayer(self.iActivePlayer).canDoReligion(i)): #EWR: Only list ones player can convert to
szButtonName = self.getReligionButtonName(i)
if gc.getGame().getReligionGameTurnFounded(i) >= 0:
screen.addCheckBoxGFC(szButtonName, gc.getReligionInfo(i).getButton(), ArtFileMgr.getInterfaceArtInfo("BUTTON_HILITE_SQUARE").getPath(), self.X_RELIGION_AREA + xLoop - self.BUTTON_SIZE/2, self.Y_RELIGION_AREA + self.Y_RELIGION - self.BUTTON_SIZE/2, self.BUTTON_SIZE, self.BUTTON_SIZE, WidgetTypes.WIDGET_GENERAL, -1, -1, ButtonStyles.BUTTON_STYLE_LABEL)
else:
screen.setImageButton(szButtonName, gc.getReligionInfo(i).getButtonDisabled(), self.X_RELIGION_AREA + xLoop - self.BUTTON_SIZE/2, self.Y_RELIGION_AREA + self.Y_RELIGION - self.BUTTON_SIZE/2, self.BUTTON_SIZE, self.BUTTON_SIZE, WidgetTypes.WIDGET_GENERAL, -1, -1)
szName = self.getReligionTextName(i)
szLabel = gc.getReligionInfo(i).getDescription()
# if (self.iReligionSelected == i):
# szLabel = localText.changeTextColor(szLabel, gc.getInfoTypeForString("COLOR_YELLOW"))
screen.setText(szName, szArea, szLabel, CvUtil.FONT_CENTER_JUSTIFY, xLoop + self.X_RELIGION_AREA, self.Y_RELIGION_AREA + self.Y_RELIGION_NAME, 2*self.DZ, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
xLoop += self.DX_RELIGION
Now the bit that says -- if (gc.getPlayer(self.iActivePlayer).canDoReligion(i)): -- right at the top seems to limit the religions displayed to those that the player can switch too.
I'd like to change this line so that it only displays the religions that have been founded, regardless of if the player can switch to them, so if only Hinduisim and Buddhism have been founded, those are all that will show up on the religion screen.
Can any of you python wizards tell me how this might work, or what I can change to make it display the way I want?