Afforess
The White Wizard
I'm busy convert the Dynamic City Development Mod into a gameoption, and I've hit a snag in the python. I created a new python definition is CvUtil.py to check whether or not my new option is enabled. (Code Here:
), and then referenced the code several times in CvMainInterface, so that the new icons only show if the game option is not enabled. However, this second code, doesn't seem to work. I get python exceptions. Also, I should note, I am using BUG 4.0 as my python base.
Here's an example of my troubled python code (And despite what it seems like, my code is tabbed, not spaced. However my computer refuses to copy-paste it correctly.):
The python exception is for this piece of code (the red text is line 2379), and many others I would assume...
Spoiler :
Code:
#Afforess Investment Start
def isNoInvestment(self):
if gc.getGame().isOption(GameOptionTypes.GAMEOPTION_NO_INVESTMENT):
Self.No_investment = True
else:
Self.No_Investment = False
#Afforess Investment End
Here's an example of my troubled python code (And despite what it seems like, my code is tabbed, not spaced. However my computer refuses to copy-paste it correctly.):
Code:
#Lord Olleus DCD / 2nd May 09
[COLOR=Red] if CvUtil.isNoInvestment():[/COLOR]
if Self.No_investment == True:
screen.addPanel( "CityScreenAdjustPanel", u"", u"", True, False, 10, 44, 238, 105, PanelStyles.PANEL_STYLE_STANDARD )
else:
screen.addPanel( "CityScreenAdjustPanel", u"", u"", True, False, 10, 44, 238, 130, PanelStyles.PANEL_STYLE_STANDARD )
#Lord Olleus / End
And idea what the correct code for this is?Traceback (most recent call last):
File "CvAppInterface", line 81, in preGameStart
File "CvScreensInterface", line 71, in showMainInterface
File "CvMainInterface", line 2379, in interfaceScreen