The skip button of the quick menu (image button) is not switched to the selected_idle state.

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.
Post Reply
Message
Author
yoyuchi
Regular
Posts: 58
Joined: Sat Jul 09, 2022 1:39 pm
Contact:

The skip button of the quick menu (image button) is not switched to the selected_idle state.

#1 Post by yoyuchi » Sun Jul 10, 2022 5:24 am

Hello, everyone.
I changed the quick menu to "image button" and added selected_idle, selected_hover for "skip" and "auto".
"Auto" changes to selected_idle image normally when clicked.
However, the "skip" remains in the hover image state and then changes to selected_idle image when jumping to the next script.
How can I change it to selected_idle image when "clicked"?
Any advice would be helpful. Please teach me how.

Here is the script for my image button.
"Auto" is normal, but the "skip" button is trouble.

Code: Select all

default show_quick_menu = True
default persistent.replay = False
screen quick_menu():

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

    if show_quick_menu:

        hbox:
            style_prefix "quick"

            xalign 0.5
            yalign 1.0

            imagebutton:
                idle "grp/parts/Msave_idle.png"
                hover "grp/parts/Msave_hover.png"
                insensitive "grp/parts/Msave_selX.png"   
                selected_idle "grp/parts/Msave_selected.png"
                action ShowMenu('save')

            imagebutton:
                idle "grp/parts/Mload_idle.png"
                hover "grp/parts/Mload_hover.png"
                insensitive "grp/parts/Mload_selX.png"
                selected_idle "grp/parts/Mload_selected.png"
                action ShowMenu('load')

            imagebutton:
                idle "grp/parts/Moption_idle.png"
                hover "grp/parts/Moption_hover.png"
                selected_idle "grp/parts/Moption_selected.png"
                action ShowMenu('preferences')

            imagebutton:
                idle "grp/parts/Mskip_idle.png"
                hover "grp/parts/Mskip_hover.png"
                selected_idle "grp/parts/Mskip_selected.png"
                selected_hover "grp/parts/Mskip_hover2.png"
            #    focus_mask None
                action Skip() alternate Skip(fast=True, confirm=True)

            imagebutton:
                idle "grp/parts/Mauto_idle.png"
                hover "grp/parts/Mauto_hover.png"
                selected_idle "grp/parts/Mauto_selected.png"
                selected_hover "grp/parts/Mauto_hover2.png"
           #     focus_mask None
                action Preference("auto-forward", "toggle")
               
            imagebutton:
                idle "grp/parts/Mlog_idle.png"
                hover "grp/parts/Mlog_hover.png"
                action [SetVariable("yvalue", 1.0), ShowMenu("text_history")]
        
            imagebutton:
                idle "grp/parts/Mquit_idle.png"
                hover "grp/parts/Mquit_hover.png"
                selected_idle "grp/parts/Mquit_selected.png"
                action MainMenu()             
            spacing 5
    
        imagebutton idle "grp/parts/x_idle.png" hover "grp/parts/x_hover.png" xpos 1522 ypos 610 action HideInterface()
   

$ show_quick_menu = False
$ show_quick_menu = True

## This code ensures that the quick_menu screen is displayed in-game, whenever
## the player has not explicitly hidden the interface.
init python:
    config.overlay_screens.append("quick_menu")

default quick_menu = True

style quick_button is default
style quick_button_text is button_text

style quick_button:
    properties gui.button_properties("quick_button")

style quick_button_text:
    properties gui.button_text_properties("quick_button")

Post Reply

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot]