Hi All --
I am working on adding an updated unit upgrade screen to the Sevopedia. I already have the screen mostly constructed. I have added a text field showing the amount of research required to upgrade to a unit from the current position the player is in for each unit on the upgrade tree.
Now, I would like to display the list of technologies still required to obtain the unit when the player moves the mouse pointer over the text box displaying the
My problem at this point is that I can't figure out what function to call to get a rollover text box to appear.
This is my current code to generate the text box:
I have tried various combinations of the below to get a simple text field to appear when I rollover the text box above, but nothing works (I've tried both .setText and .attachTextGFC independantly but not both at the same time, just adding both here for completeness):
Any suggestions? Any general guidance on exactly how to use .setText and .attachTextGFC would be helpful, the calls to add various GUI widgets in BTS are pretty confusing.
I am working on adding an updated unit upgrade screen to the Sevopedia. I already have the screen mostly constructed. I have added a text field showing the amount of research required to upgrade to a unit from the current position the player is in for each unit on the upgrade tree.
Now, I would like to display the list of technologies still required to obtain the unit when the player moves the mouse pointer over the text box displaying the
My problem at this point is that I can't figure out what function to call to get a rollover text box to appear.
This is my current code to generate the text box:
Code:
if iCost > 0:
szCostText = str(iCost)
szCostText += u"%c" % gc.getCommerceInfo(CommerceTypes.COMMERCE_RESEARCH).getChar()
szCostText = u"<font=5>" + szCostText.upper() + u"</font>"
researchAmount = self.pediaScreen.getNextWidgetName()
screen.setTextAt(researchAmount, iUnitPanel, szCostText, CvUtil.FONT_LEFT_JUSTIFY,
int(self.buttonSize / 2), int(self.buttonSize * 1.5 * iUnitSize), 0, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
I have tried various combinations of the below to get a simple text field to appear when I rollover the text box above, but nothing works (I've tried both .setText and .attachTextGFC independantly but not both at the same time, just adding both here for completeness):
Code:
infoPanelName = self.pediaScreen.getNextWidgetName()
screen.attachPanel(researchAmount, infoPanelName, "", "", False, False, PanelStyles.PANEL_STYLE_EMPTY)
screen.setText(self.pediaScreen.getNextWidgetName(), infoPanelName, "Testing", CvUtil.FONT_LEFT_JUSTIFY, 0, 0, 0, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
screen.attachTextGFC(infoPanelName, "", CyTranslator().getText("TXT_KEY_PEDIA_FAV_CIVIC", ()) + ":", FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
Any suggestions? Any general guidance on exactly how to use .setText and .attachTextGFC would be helpful, the calls to add various GUI widgets in BTS are pretty confusing.