Ren'Py Temporarily disable mouse-wheel-rollback for specific screens that use scroll-able vpgird/viewpoint/etc.?

McLOVINu

Active Member
Mar 18, 2018
593
321
Hello,
I ran into a bug/issue with several ren'py vn's, ones that use scroll-able content, like a viewpoint, vpgird, etc.
Both trigger on mouse wheel, and the rollback/forward backs out of the current screen/menu I was currently viewing.

I'm trying to figure out how I can temporarily disable mouse-wheel-rollback on screens that are using a scroll-able viewpoint, vpgrid, etc.

I want rollback, I just don't want mouse wheel to mess with it while there is scroll-able content [like vpgrid, viewpoint, etc.].

I can think of three ways to go about this:
1) temporarily remove keys from: config.keymap = dict(rollback[]) ... NO idea how to even go about this honestly
2) change the viewpoint/vpgrid/etc to cover entire screen but keep the content the same size, basically a big transparent vp/vpgrid/etc. ... too much work getting it to line up with multiple games
3) temporarily disable mouse-wheel-rollback

What I've tried, was adding a "config.rollback_enabled = False/True" to the actions that show/hide said screens.

Example:
Code:
some button:
        action Show("mobile"),SetVariable("config.rollback_enabled", False)

screen mobile:
    modal True
    zorder 1
    add "Mobile/Backgrounds/bg01.png" at phonepos

    imagebutton:
        idle "Mobile/Buttons/middle_button.png"
        hover "Mobile/Buttons/middle_button_hover.png"
        action Hide("mobile"),SetVariable("config.rollback_enabled", True)
However, the mobile screen can be closed via other methods, so the variable isn't always being reset.

I guess for now my solution works, but not perfect.

Maybe a tiny script somewhere to disable mouse-wheel-rollback when any screen is being shown [except the ???say??? screen].

I would be nice if 'modal' itself also disabled rollback/forward, BOOOOO!

Thanks.
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,255
15,039
I ran into a bug/issue with several ren'py vn's, ones that use scroll-able content, like a viewpoint, vpgird, etc.
Both trigger on mouse wheel, and the rollback/forward backs out of the current screen/menu I was currently viewing.
There's two incorrect information here:

Firstly viewport and viewport-like do not necessarily handle the mouse wheel. It's defined by a property of the used statement that is defaulted at False, and most creators do not enable it because they don't even know that the said property exist.

Secondly viewport and viewport-like do not propagate the events they catch, therefore when they handle the mouse wheel, you can not rollback through it, unless you use it outside of the viewport(-like) zone.


Therefore, if you rollback when using the mouse wheel, it's because either the viewport(-like) do not support it, or because you aren't over the rollback zone, and only because of this. So, there's no need to temporarily disable the binding, just to place the mouse cursor on the right place, and not bother to use the mouse wheel if it clearly happen that it's not handled by the viewport(-like) in the game you are currently playing.