sp00n
Prince
- Joined
- Jan 4, 2007
- Messages
- 371
// Edit
Ok, I've found the answer.
I can either use
The button does look better though with the latter version.
It seems to actually display such a button you need to call
Here's my current version of the Domestic Advisor screen to give a bit more context:
The icons so far are from the GameFont file and are called by the
(For the Archers in this image I tried to just merge a
The relevant code in CvDomesticAdvisor.py looks like this:
Is this possible at all? Or do I need to add the logic to display the button later on, when the column header text is actually being processed?
Ok, I've found the answer.
I can either use
"<img=%s size=%d></img> %s" % (sButton, 18, "XP")
or use setImageButton()
together with setTableColumnHeader()
and some spacebar tabbing to align the "XP" text like it's 1998.The button does look better though with the latter version.

Sorry for bothering you again, but I'm having trouble to merge text with such aI think you want getButton().
getButton()
call.It seems to actually display such a button you need to call
setImageButton()
resp. setImageButtonAt()
, however this appears to need a reference to some sort of screen and X and Y coordinates. What I am trying to achieve is basically "unit icon" + "XP".Here's my current version of the Domestic Advisor screen to give a bit more context:
The icons so far are from the GameFont file and are called by the
unichr()
function. But I couldn't find a representation for all the classes I wanted to display (e.g. Archers or Throwing).(For the Archers in this image I tried to just merge a
getButton()
call with the text, but this way it just displays the path to the art file).The relevant code in CvDomesticAdvisor.py looks like this:
Python:
self.COLUMNS_LIST = COLUMNS_LIST = [
[...]
("TOTAL_EXPERIENCE_MELEE", 50, "int", None, self.getExperienceForUnit, "BRUTE", unichr(8525) + " XP"), # Crossed Swords
("TOTAL_EXPERIENCE_ARCHER", 50, "int", None, self.getExperienceForUnit, "ARCHER", self.getButtonForUnit("ARCHER") + " Archer XP"),
("TOTAL_EXPERIENCE_THROWING", 50, "int", None, self.getExperienceForUnit, "STONE_THROWER", "Throw XP"),
]
Is this possible at all? Or do I need to add the logic to display the button later on, when the column header text is actually being processed?
Last edited: