Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltips on quickmenu break keyboard and gamepad focus #4372

Closed
timepatches opened this issue Feb 20, 2023 · 5 comments
Closed

Tooltips on quickmenu break keyboard and gamepad focus #4372

timepatches opened this issue Feb 20, 2023 · 5 comments
Labels
can't reproduce The issue or bug reported here cannot be recreated in a clean install/project/game.

Comments

@timepatches
Copy link

When using the tooltip code from the documentation on a quickmenu, buttons with a tooltip attribute can no longer gain focus from mouse or keyboard, they can only be accessed with a mouse.
Buttons can be focused on the quickmenu while in the choice screen, and work on main menu and game menu buttons.

Code is pretty much unchanged from the documentation but for posterity:
`screen quick_menu():
zorder 100

    use tooltipscreen
    hbox:
        yalign 0.637
        xalign 0.889
        spacing 9
        imagebutton idle "gui/alt_save_idle.png" auto "gui/save_%s.png" action ShowMenu ('save') focus_mask True yalign 1.0 style "main_imagebutton"
        imagebutton idle "gui/alt_load_idle.png" auto "gui/load_%s.png" action ShowMenu ('load') focus_mask True yalign 1.0 style "main_imagebutton"
        imagebutton idle "gui/alt_rollback_idle.png" auto "gui/rollback_%s.png" action Rollback() focus_mask True yalign 1.0 style "main_imagebutton" tooltip "Back one line (Mouse Wheel)"
        imagebutton idle "gui/alt_skip_idle.png" auto "gui/skip_%s.png" action Skip () alternate Skip(fast=True, confirm=True) focus_mask True yalign 1.0 style "main_imagebutton" tooltip "Skip seen text (Ctrl)"
        imagebutton idle "gui/alt_menu_idle.png" auto "gui/menu_%s.png" action ShowMenu('gamemenu_settings') focus_mask True yalign 1.0 style "main_imagebutton"

screen tooltipscreen:

    modal False
    sensitive False
    layer "master"
    roll_forward True
    $ tooltip = GetTooltip()

    if tooltip:
        text tooltip size 20 yalign 0.637 xalign 0.889 yoffset -38 outlines [(2,"#000000",0,0)]`
@renpytom
Copy link
Member

I'm unable to reproduce this, using the following screens:

screen tooltipscreen():
    modal False
    sensitive False
    layer "master"
    roll_forward True
    $ tooltip = GetTooltip()

    if tooltip:
        text tooltip size 20 yalign 0.637 xalign 0.889 yoffset -38 outlines [(2,"#000000",0,0)]

image test idle = Solid("#800", xysize=(25, 25))
image test hover = Solid("#080", xysize=(25, 25))
image test insensitive = Solid("#222", xysize=(25, 25))

screen quick_menu():

    ## Ensure this appears on top of other screens.
    zorder 100

    use tooltipscreen

    if quick_menu:

        hbox:
            style_prefix "quick"

            xalign 0.5
            yalign 1.0

            spacing 10

            imagebutton auto "test %s" focus_mask True action Rollback() tooltip _("Rollback")
            imagebutton auto "test %s" focus_mask True action ShowMenu('history') tooltip _("History")
            imagebutton auto "test %s" focus_mask True action Skip() alternate Skip(fast=True, confirm=True) tooltip _("Skip")
            imagebutton auto "test %s" focus_mask True action Preference("auto-forward", "toggle") tooltip _("Auto-forward")
            imagebutton auto "test %s" focus_mask True action ShowMenu('save') tooltip _("Save")
            imagebutton auto "test %s" focus_mask True action QuickSave() tooltip _("Quick Save")
            imagebutton auto "test %s" focus_mask True action QuickLoad() tooltip _("Quick Load")
            imagebutton auto "test %s" focus_mask True action ShowMenu('preferences') tooltip _("Preferences")

Could you try this in a new project, and see if this works for you?

@renpytom renpytom added the can't reproduce The issue or bug reported here cannot be recreated in a clean install/project/game. label Feb 21, 2023
@m-from-space
Copy link

m-from-space commented Feb 21, 2023

I actually can reproduce this in the following easy way in Renpy 8.0.3:

Just insert a simple "tooltip" keyword on one of the imagebuttons inside a quick_menu screen. Doing this results in not being able to focus that button via a gamepad or keyboard. You don't even have to do anything with that tooltip by the way.

edit: I just created a completely new project with Renpy 8.0.3, inserted <tooltip "Quick Save"> onto the quick save button in the quick_menu screen inside screens.rpy and then I was not able to gain focus on that textbutton via gamepad or keyboard. Other buttons work. And mouse works too.

@timepatches
Copy link
Author

Still can't focus those buttons in a new clean project with that code. I'm running 7.5.3 on Windows, if that helps.

@renpytom
Copy link
Member

Can you try on one of the latest nightlies from https://nightly.renpy.org ? That's what I'm testing against.

@renpytom
Copy link
Member

I've tried on the new and old version. This one is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can't reproduce The issue or bug reported here cannot be recreated in a clean install/project/game.
Projects
None yet
Development

No branches or pull requests

3 participants