return button doesn't return to the screen I want [solved]

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
Meg'
Regular
Posts: 185
Joined: Tue Sep 27, 2011 10:37 am
Projects: Anges Démoniaques, Gang (Alex & Hugo), Le passé dans les veines
Location: France
Contact:

return button doesn't return to the screen I want [solved]

#1 Post by Meg' »

Hi!

After a lot of thoughts and failed attempts, I'm asking for help. My return button won't return to the CG_Galery screen but instead get me back to the game directly. Here is my code:

Code: Select all

screen CG_Galery:
    
    tag menu
    
    add "gui/bonus.jpg"
    
    hbox:
        xpos 246 
        ypos 610 

        if not persistent.illu1Purchased:
            $cond = persistent.EnergyAvailable - 20 < 0
            imagebutton:
                yoffset -40
                idle "gui/change_apparence_locked.png"
                if not cond:
                    action [ShowMenu("purchase_illu1")]

        else:

            imagebutton auto "gui/change_apparence_%s.png":
                action [Show("illu1")]
    
    add "gui/forme1.png" xpos 1003 ypos 0.73 at main_eff8
    imagebutton auto "gui/config_%s.png" xalign 0.95 ypos 0.85 action Return() at main_eff7

screen purchase_illu1:
    tag menu
    add "gui/debloquer_illu.png"
    add "gui/debloquer_custom.png"
    use yesno_proxy([Function(PurchaseItem,"illu1Purchased",20),Show("illu1")],ShowMenu("CG_Galery"))
    
screen illu1:
    
    add DynamicDisplayable(draw_illu1)
    
    add "gui/forme1.png" xpos 1003 ypos 0.73 at main_eff8
    imagebutton auto "gui/config_%s.png" xalign 0.95 ypos 0.85 action Return() at main_eff7
I tried to change the Return() into Return("CG_Galery"), Show("CG_Galery") and ShowMenu("CG_Galery"), it doesn't work. The only thing that works is the Return() but it gets me back to the game instead of returning to the CG_Galery screen.

I don't understand why. Can someone help?

Thanks,

Meg'
Last edited by Meg' on Fri Jul 14, 2017 11:40 am, edited 1 time in total.

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: return button doesn't return to the screen I want

#2 Post by Milkymalk »

You only "show" illu1. Return only undoes the last "call" statement, to put it simply. Just "hide" the screen instead and you should be where you started.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
Meg'
Regular
Posts: 185
Joined: Tue Sep 27, 2011 10:37 am
Projects: Anges Démoniaques, Gang (Alex & Hugo), Le passé dans les veines
Location: France
Contact:

Re: return button doesn't return to the screen I want

#3 Post by Meg' »

That worked like a charm. Thank you so much! :D

Post Reply

Who is online

Users browsing this forum: No registered users