I... Er... Need a Little Help

Voyhkah

Undead
Joined
Apr 25, 2009
Messages
1,444
Location
Earth
I sorta... could use some help... with this really hard thing...

Ok, seriously, I need to make some major changes to the city screen (Using BUG as a base). The city screen needs to look like this.

Spoiler :


The changed part is the bonus screen. The numbers alongside each bonus symbol are the amount of the bonus stockpiled, the ones in parentheses are the income/expenditure rates. I really have no idea where to start with this. Can anyone give me a few hints?
 

Attachments

  • cityscreen.JPG
    cityscreen.JPG
    194.8 KB · Views: 142
Are the both new values exposed to Python?

Not sure how to do it, since I never really dealt with that screen.
But if I search in my CvMainInterface.py (not BUG) for "bonus", I can find in the updateCityScreen function a part which begins with:
PHP:
				for i in range( gc.getNumBonusInfos() ):
					bHandled = False
					if ( pHeadSelectedCity.hasBonus(i) ):

which seems to be the display of the bonuses.
Looking further I see stuff like:

PHP:
szTempBuffer = u"<font=1>%c" %( gc.getBonusInfo(i).getChar() )

which seems to be the symbol itself. -> see, to show the symbol, simple text is used (which gets then replaced by the engine with a symbol, I guess).
The szTempBuffer is used a few times more (to add the symbols for health and happiness).
Theoretically, you just have to get the values for the both new...variables, and add them as text to szTempBuffer.


But that's pure guessing from my side, no guarantee :dunno:.
 
I'm in the process of understanding it. Here's another question: How do you change the color of a section of text (to make it red, green, white, etc.).
 
No real idea how to set the text directly in Python :dunno:.
But you can do it in the text string.
e.g. if you take a look at some random partially coloured text, you'll see this:
[COLOR_UNIT_TEXT]Animals[COLOR_REVERT] hunt unprotected settlers!

The "Animals" is coloured ingame, the rest not.
So just add [COLOR_WHATEVER]*number*[COLOR_REVERT] directly into the text string.

The color values seem to be the ones, which are defined in Interface\CIV4ColorVals.xml.
 
Top Bottom