Yeah, I don't know what's causing this bug. I have no control over the highlight's placement - the function (setState) simply takes the button widget and true/false as its arguments. Either it's a bug in the underlying graphics interface or I'm combining screen elements I'm not supposed to.
Actually the setState command is turning the highlight on, but the piece responsible for the highlight is (pretty sure on this)
attachCheckBoxGFC.
To fix the highlight location, you want to instead be using
addCheckBoxGFCAt, which allows you to provide an offset parameter to fix precisely this issue.
Your Checkbox:
screen.attachCheckBoxGFC( highscore, highscore + "_TopListButton", "Art/Interface/Buttons/Highscores/"+g_strAlternativeButtons+highscore+".dds", ArtFileMgr.getInterfaceArtInfo("BUTTON_HILITE_SQUARE").getPath(), 64, 64, WidgetTypes.WIDGET_GENERAL, -1, -1, ButtonStyles.BUTTON_STYLE_LABEL )
Sample of a CheckBoxAt:
screen.addCheckBoxGFCAt(szStringPanel,
szString, ArtFileMgr.getInterfaceArtInfo("INTERFACE_BUTTONS_GOVERNOR").getPath(), ArtFileMgr.getInterfaceArtInfo("BUTTON_HILITE_SQUARE").getPath(),
xOffset + 3, 3, 32, 32, WidgetTypes.WIDGET_PLOT_LIST, k, -1, ButtonStyles.BUTTON_STYLE_LABEL,
True )
The new pieces are in green. First one is which other object you are attaching the Checkbox to. Second pair is the X and Y offsets from the location of the button you are attaching yourself onto. Last one I think is the initial state. Not sure on that one. (And if you are wondering why there is a k instead of a -1 near the end, that is because they are using a WidgetType which requires a return value).
In general you want a 3 pixel offset for any button. There was also one other case of you using a checkbox, but I didn't take the time to figure out precisely where it was and if it also needed a minor offset.