Bug Replications

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Message
Author
User avatar
barsunduk
Regular
Posts: 33
Joined: Fri Jul 18, 2014 1:06 pm
Completed: «Crystal City», «Mega City», «Kilmonger», «Neuronaut», «Love, Death & Veggies», «Arrow Tourney», «Big Red Hood: Halloween», «Succubus Throne»
Projects: «Swordsman Tourney», «This Tiny Galaxy»
Organization: 7DOTS
itch: 7dots
Contact:

Re: Bug Replications

#31 Post by barsunduk »

renpy-8.2.0.24012001+nightly-sdk

If the container for the buttons is also a button, then when you hover the cursor over it, Renpy considers that the cursor was hovered over all the buttons inside. They all light up as if I hovered over each one of them.
Was this done on purpose? At the moment this looks like a bug.
I usually use a button container with an empty action so that clicking on the container doesn't trigger the dismiss. I don't need buttons inside another button to become one button.

Code: Select all

init:
    transform hover_at(t=.15):
        on idle:
            ease t zoom 1 alpha .25
        on hover:
            ease t zoom 1.2 alpha 1

screen test:
    # i want to ensure that clicking this button does not activate the dismiss
    button:
        # if you hover over this button
        background gui.accent_color
        align(.5, .5)
        xysize(config.screen_width // 2, config.screen_height // 2)
        action NullAction()

        # all the buttons inside will be highlighted
        for i in [ .25, .5, .75 ]:
            imagebutton:
                idle  Text("●", size=222)
                focus_mask True
                anchor(.5, .5)
                pos(i, .5)
                action Function(renpy.notify, "clicked")
                at hover_at

label start:
    show screen test
    pause
    return
If this is not a bug, then how can I make a container that will not change the state of the buttons inside?
Thank you for your attention.

strayerror
Regular
Posts: 159
Joined: Fri Jan 04, 2019 3:44 pm
Contact:

Re: Bug Replications

#32 Post by strayerror »

It looks like that change was intentional (children of buttons get notified about hover and a few other states). Rather than using a button with NullAction as your container, you probably want a modal frame instead. That would prevent click through and avoid any hover events coming from the container.

Code: Select all

screen test:
    frame:
        modal True
        ... inner buttons ...

User avatar
barsunduk
Regular
Posts: 33
Joined: Fri Jul 18, 2014 1:06 pm
Completed: «Crystal City», «Mega City», «Kilmonger», «Neuronaut», «Love, Death & Veggies», «Arrow Tourney», «Big Red Hood: Halloween», «Succubus Throne»
Projects: «Swordsman Tourney», «This Tiny Galaxy»
Organization: 7DOTS
itch: 7dots
Contact:

Re: Bug Replications

#33 Post by barsunduk »

strayerror wrote: Sun Jan 21, 2024 2:55 pm It looks like that change was intentional (children of buttons get notified about hover and a few other states). Rather than using a button with NullAction as your container, you probably want a modal frame instead. That would prevent click through and avoid any hover events coming from the container.
This is a great solution, thanks for the tip!
But it’s still a pity that I can’t regulate the connection between the container and the buttons inside. Sometimes it is still necessary - to attach one action to a large button, and another to the small buttons inside. For example, a save slot and an x button inside the slot, which is responsible for deleting this slot. These are essentially two different buttons, but the x will be highlighted when you hover over a slot. It would be nice to enable/disable the dependency on the parent container using some property.
Thanks again, you helped me a lot!

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2406
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Bug Replications

#34 Post by Ocelot »

barsunduk wrote: Mon Jan 22, 2024 7:48 am But it’s still a pity that I can’t regulate the connection between the container and the buttons inside. Sometimes it is still necessary - to attach one action to a large button, and another to the small buttons inside. For example, a save slot and an x button inside the slot, which is responsible for deleting this slot. These are essentially two different buttons, but the x will be highlighted when you hover over a slot. It would be nice to enable/disable the dependency on the parent container using some property.
Thanks again, you helped me a lot!
You answered your question yourself. It is not a part of another button, so you should not shove it inside a button. What you describe is implemented by fixed containing a button and then another button drawn over it. fit_first on fixed ensires that it is the same size as your big button, so you can properly position smaller buttons inside.
< < insert Rick Cook quote here > >

User avatar
barsunduk
Regular
Posts: 33
Joined: Fri Jul 18, 2014 1:06 pm
Completed: «Crystal City», «Mega City», «Kilmonger», «Neuronaut», «Love, Death & Veggies», «Arrow Tourney», «Big Red Hood: Halloween», «Succubus Throne»
Projects: «Swordsman Tourney», «This Tiny Galaxy»
Organization: 7DOTS
itch: 7dots
Contact:

Re: Bug Replications

#35 Post by barsunduk »

Code: Select all

$ nvl_hide(Dissolve(1))
This command doesn't work. First there is a pause, and then the nvl-screen instantly appears. In this case, nvl_show(dissolve) works fine.

User avatar
barsunduk
Regular
Posts: 33
Joined: Fri Jul 18, 2014 1:06 pm
Completed: «Crystal City», «Mega City», «Kilmonger», «Neuronaut», «Love, Death & Veggies», «Arrow Tourney», «Big Red Hood: Halloween», «Succubus Throne»
Projects: «Swordsman Tourney», «This Tiny Galaxy»
Organization: 7DOTS
itch: 7dots
Contact:

Re: Bug Replications

#36 Post by barsunduk »

When I use Live2d in Ren'Py 8.2.0, loading from the slots stops working and the game crashes into the main menu.
UPD: Everything works again! It was a strange glitch.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], MisterPinetree