[Bug] hyperlink_focus fails in draggable viewports etc
Posted: Mon Sep 20, 2021 12:54 pm
When custom style.hyperlink_functions[2] is set, it's supposed to run on hyperlinks hover. It doesn't happen if the hyperlink is inside a button or a draggable viewport.
In such cases only unhovering works (hyperlink_focus(None) runs), but it doesn't run on hovering.
Test code:
Funny thing that hyperlink_focus runs on a link in a draggable viewport if the mouse is moved there from above, but doesn't work if moving in from other three directions.
Tested on desktop. Why do I want it to work? To change the mouse cursor hovering hyperlinks. Yes, I use complex layouts like hypertext on text buttons and in draggable viewports.
In such cases only unhovering works (hyperlink_focus(None) runs), but it doesn't run on hovering.
Test code:
Code: Select all
init python:
test_mess = ""
def my_hyperlink_sensitive(target=None):
global test_mess
if target:
test_mess += "Focusing in " + target + ". "
else:
test_mess += " Unfocusing. "
renpy.restart_interaction()
style.default.hyperlink_functions = (
hyperlink_styler,
hyperlink_function,
my_hyperlink_sensitive)
screen test_link():
frame background None:
vbox spacing 36:
viewport id "vp":
ysize 48
text "A {a=viewport}link{/a} in viewport (works well)."
viewport id "vp2":
ysize 48
draggable True
text "A {a=draggable viewport}link{/a} in draggable viewport (only from above)."
textbutton "A {a=textbutton}link{/a} in textbutton (doesn't work).":
action Return()
text test_mess
label main_menu:
return
label start:
call screen test_link
"End"
Tested on desktop. Why do I want it to work? To change the mouse cursor hovering hyperlinks. Yes, I use complex layouts like hypertext on text buttons and in draggable viewports.