Return function not working from main menu (SOLVED)

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
User avatar
Geckos
Veteran
Posts: 471
Joined: Fri Aug 17, 2012 8:33 am
Completed: Brilliant Shadows, Perceptions of the Dead, The Phantom Icecream Truck
Projects: Embers of Magic, Pale Spectrum, Perceptions of the Dead
Organization: Ithaqua Labs
Tumblr: geckosart
Deviantart: sitaart
Contact:

Return function not working from main menu (SOLVED)

#1 Post by Geckos »

Derp. My friend took a look and figured out that action Hide ("preferences") worked over return.

The return function from my Preferences menu works on everything except for the Main Menu screen.
If I start the game, go to Preferences and then click Return I am not brought back to the main menu, I am stuck in the preferences screen.

This is my code for the escape menu/click pull up menu.

Code: Select all

screen navigation:

    # The background of the game menu.
    window:
        style "gm_root"

screen esc_menu:
    modal True
    frame xalign 0.5 yalign 0.2 background None:
        imagemap:
            ground "bg/menu_popup.png"
            idle "bg/menu_popup2.png"
            
            hotspot (744, 39, 392, 137) action Return() 
            hotspot (749, 195, 387, 152) action ShowMenu("save") 
            hotspot (747, 357, 387, 161) action ShowMenu("load") 
            hotspot (749, 542, 384, 174) action ShowMenu("preferences") 
            hotspot (684, 738, 548, 152) action MainMenu()
            hotspot (800, 909, 303, 137) action Quit(confirm=False) #Use action "action Quit(confirm=False)" if you don't want them to confirm to quit. Else use "action ShowMenu("quit")"
        
    
    key "game_menu" action Hide("esc_menu", dissolve)
    frame:
        has vbox
        
        

        



init python:
     config.game_menu_action = [ FileTakeScreenshot(), ShowMenu("esc_menu", transition=dissolve) ]

screen one_button_scr:
    imagebutton:
        align (0.5, 0.98)
        idle "bg/menu_corner.png"
        hover Animation ("bg/menu_corner2.png", .5, "bg/menu_corner3.png", .5)
        action ShowMenu("esc_menu", transition=dissolve) activate_sound "bg/ting2.ogg" hover_sound "bg/ting1.ogg"



init -2:

    # Make all game menu navigation buttons the same size.
    style gm_nav_button:
        size_group "gm_nav"
And this is my preference screen menu code.

Code: Select all

screen preferences:

    imagemap:   
        ground "bg/preferences_2.jpg"
        idle "bg/preferences_3.png"
        hover "bg/preferences_5.png"
        selected_idle "bg/preferences_4.png" 
        selected_hover "bg/preferences_3.png" 
        alpha False
        
        hotspot (113, 278, 199, 49) action Preference("display", "window") activate_sound "bg/ting2.ogg" hover_sound "bg/ting1.ogg"
        hotspot (92, 333, 267, 50) action Preference("display", "fullscreen") activate_sound "bg/ting2.ogg" hover_sound "bg/ting1.ogg"
        hotspot (51, 495, 360, 51) action Preference("skip", "seen") activate_sound "bg/ting2.ogg" hover_sound "bg/ting1.ogg"
        hotspot (48, 542, 365, 61) action Preference("skip", "all") activate_sound "bg/ting2.ogg" hover_sound "bg/ting1.ogg"
        hotspot (705, 275, 129, 54) action Preference("transitions", "all") activate_sound "bg/ting2.ogg" hover_sound "bg/ting1.ogg"
        hotspot (708, 329, 126, 51) action Preference("transitions", "none") activate_sound "bg/ting2.ogg" hover_sound "bg/ting1.ogg"
        hotspot (1310, 552, 331, 50) action Preference("after choices", "stop") activate_sound "bg/ting2.ogg" hover_sound "bg/ting1.ogg"
        hotspot (1311, 495, 332, 57) action Preference("after choices", "skip") activate_sound "bg/ting2.ogg" hover_sound "bg/ting1.ogg"
        hotspot (1515, 942, 365, 135) action Return() activate_sound "bg/ting2.ogg" hover_sound "bg/ting1.ogg"
                                                
        
        bar pos (612, 488) value Preference("text speed") style "pref_slider"
        bar pos (1311, 683) value Preference("sound volume") style "pref_slider"
        bar pos (233, 678) value Preference("music volume") style "pref_slider"
        bar pos (752, 879) value Preference("voice volume") style "pref_slider"
        bar pos (1311, 281) value Preference("auto-forward time") style "pref_slider"

init -2 python:
    style.pref_slider.left_bar = "bg/slider_1.jpg"
    style.pref_slider.right_bar = "bg/slider_2.jpg"

    style.pref_slider.xmaximum = 310
    style.pref_slider.ymaximum = 74

    style.pref_slider.thumb = "bg/slider_thumb.png"
    style.pref_slider.thumb_offset = 4
    style.pref_slider.thumb_shadow = None

Any thoughts on this? I have also attached screenshots of what my menus look like in game.
Attachments
ss_prefs.jpg
ss_popup.jpg
Image ImageImage

Post Reply

Who is online

Users browsing this forum: No registered users