Buttons always selected in screen

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
Parkey
Regular
Posts: 69
Joined: Thu Feb 02, 2012 11:52 am
Contact:

Buttons always selected in screen

#1 Post by Parkey »

Hi!!

I have a new problem... again. In the preferences menu I have added new buttons so that the player can change the text size and the buttons text size. But the buttons are always show "selected". I think I know why happens that... I've tried everything, even with the IfSelected function, but I think that I'm not doing something correctly because don't matter how I write the code, always are selected.

Here is the code:

Code: Select all

    grid 3 1:
        style_group "prefs"
        xfill True

        # The left column.
        vbox:
            frame:
                style_group "pref"
                has vbox

                label _("Size")
                textbutton _("Little") action [StylePreference ("size", "little"), ShowMenu ("preferences")]
                textbutton _("Normal") action [StylePreference ("size", "normal"), ShowMenu ("preferences")]
                textbutton _("Big") action [StylePreference ("size", "big"), ShowMenu ("preferences")]

            frame:
                style_group "pref"
                has vbox

                label _("Transitions")
                textbutton _("All") action Preference("transitions", "all")
                textbutton _("None") action Preference("transitions", "none")

[...etc...the rest of code of the preferences menu goes below...]
If I don't add the "ShowMenu ("preferences")" function, it works because the text size and the buttons text size changes and only one button is showed as "selected", but the buttons are not resized until I press the same or another button.

Any idea?

Thanks!!

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: Buttons always selected in screen

#2 Post by apricotorange »

I think you can just replace the 'ShowMenu("preferences")' with 'renpy.restart_interaction'.

Granted, you might want to reconsider having the size preference affect the preferences screen... it's a little bit disorienting for a button to move when you click it.

Post Reply

Who is online

Users browsing this forum: No registered users