Page 1 of 1

[Solved] Gamemenu return button not working

Posted: Thu Oct 15, 2020 3:25 pm
by chesarty
I'm working on a custom main menu using imagebuttons and everything else is working as intended except for one thing. When I go from main menu to settings and then try to use the return button, it starts the game instead of going back to the main menu. This is odd since I didn't change anything about the game menu, only main menu.

Main menu code:

Code: Select all

screen main_menu():
    
    imagemap:
        ground "animated mainmenu"
        idle "gui/mainmenuidle.png"
        hover "gui/mainmenuhover.png"
        
        hotspot (0, 454, 525, 110) action Start():
            hover_sound "audio/hoversound.mp3"
            activate_sound "audio/choicesound.mp3"
        hotspot (0, 575, 525, 110) action ShowMenu("load"):
            hover_sound "audio/hoversound.mp3"
            activate_sound "audio/choicesound.mp3"
        hotspot (0, 691, 525, 110) action ShowMenu("preferences"):
            hover_sound "audio/hoversound.mp3"
            activate_sound "audio/choicesound.mp3"
        hotspot (0, 815, 525, 110) action ShowMenu("help"):
            hover_sound "audio/hoversound.mp3"
            activate_sound "audio/choicesound.mp3"
        hotspot (0, 938, 525, 110) action Quit(confirm=not main_menu):
            hover_sound "audio/hoversound.mp3"
            activate_sound "audio/choicesound.mp3"
        
Game menu return label code:

Code: Select all

    textbutton _("Return"):
        style "return_button"

        action Return("main_menu")
        
Any help? :0

Re: Gamemenu return button not working

Posted: Thu Oct 15, 2020 5:02 pm
by Imperf3kt
You need to add tag menu to the screen.

Re: Gamemenu return button not working

Posted: Fri Oct 16, 2020 1:00 am
by chesarty
Imperf3kt wrote:
Thu Oct 15, 2020 5:02 pm
You need to add tag menu to the screen.
Thanks. Added it, but it still doesn't go back to the main menu.

Re: Gamemenu return button not working

Posted: Fri Oct 16, 2020 1:52 am
by nananame
The return code for the game menu should not pass anything:

Code: Select all

    textbutton _("Return"):
        style "return_button"

        action Return()##delete the "main_menu"