[Python] Checkbox highlighting offset

Dresden

Emperor
Joined
Jul 10, 2008
Messages
1,081
While working on an improved Foreign Advisor info screen, I ran into the following weirdness. (BTS 3.17) Apparently, if you use CyGInterfaceScreen.attachCheckBoxGFC() the highlight texture for the checkbox is offset from the actual button texture. The button gets centered on the panel, but the highlight gets stuck in the upper left. The following images illustrate; all are thumbnails which link to full-size images.

46 pixel "Label" style buttons:


46 pixel "Standard" style buttons which best shows the problem:


And for kicks, 64 pixel "Image" style buttons:


The code used to generate those checkboxes was slight variations of the following:
Code:
			for nCivicOption in range (gc.getNumCivicOptionInfos()):
				nCivic = objLoopPlayer.getCivics (nCivicOption)
				buttonName = self.getNextWidgetName()
				screen.attachCheckBoxGFC(infoPanelName, buttonName, gc.getCivicInfo (nCivic).getButton(), ArtFileMgr.getInterfaceArtInfo("BUTTON_HILITE_SQUARE").getPath(), 46, 46, WidgetTypes.WIDGET_PEDIA_JUMP_TO_CIVIC, nCivic, 1, ButtonStyles.BUTTON_STYLE_LABEL)
				if not bIsActivePlayer and nCivic == objActivePlayer.getCivics(nCivicOption):
					screen.setState(buttonName,True)

Anyone have any ideas on how to fix this? Or perhaps some workaround that produces similar (but actually useful :p) highlighting? I'd prefer to use the 46 pixel size if possible.
 
Top Bottom