Page 1 of 1

Tooltip Being Overwritten?

Posted: Mon Jun 15, 2020 5:39 pm
by vitriolic_crux
Having some more troubles with tooltips. The code below generates imagebuttons based on the contents of the list in halls. However, it seems like the tooltip for each button is being overwritten by the last imagebutton to be created. So if I have four items in halls, then four buttons are created, the tooltips for each button are all set to the tooltip being generated for the fourth item.

Code: Select all

screen master_overlay():
        $ halls = Amerigo.getConnections()
        $ toolTip = GetTooltip()

        zorder 50
        modal False
        frame: # Information Display Panel, LHS
            background "hud_leftbar.png"
            xsize 120
            ysize 1080
            viewport:
                xoffset 5
                yoffset 120
                vbox:
                    yalign 0.5
                    spacing 40
                    if menu_access:
                        for hall in halls:
                            python:
                                caption = ""
                                connection = hall[0]
                                caption = Amerigo.getDisplayName(name=connection)
                            fixed:
                                xalign 0.5
                                xsize 100
                                ysize 100
                                imagebutton:
                                    focus_mask True
                                    action [Function(Amerigo.moveTo, roomName=hall[0]), Jump('overworld')]
                                    tooltip "move [hall[0]], [hall[1]]"
                                    idle "panel_action_button.png"
                                    hover "panel_action_button_hovered.png"
                                text caption:
                                    xalign 0.5
                                    yalign 0.5
                                    style "movement_button_text"

        if toolTip:
            textbutton toolTip:
                text_style "interaction_text"
                xalign 0.5
                yalign 0.25
I'm attempting to parse the tooltip for each button so that each tip can have a different effect, but I'm unable to do this as each button's tooltip is being set to the same unicode string. So I need to know how to make every tooltip unique to each button. Strangely enough, the actions of the buttons are all working as intended.

As a side question, can anyone tell me why I'm unable to convert a slice of the tooltip to an int? The slice comes back as type 'unicode', and even after turning that into a string, using int() still gives me a typeerror.