Menu framework

Announcements, support questions, and discussion for the Dialogue System.
hrohibil
Posts: 368
Joined: Thu Nov 04, 2021 12:50 pm

Menu framework

Post by hrohibil »

Hello

Simple question.

Where is the pause menu related to the menu framework? How do I call it.
User avatar
Tony Li
Posts: 21975
Joined: Thu Jul 18, 2013 1:27 pm

Re: Menu framework

Post by Tony Li »

Hi,

In desktop/console games, you would normally press the input defined in the Menu System's Pause component. By default, it's set to "Cancel", which is usually mapped to the Escape key.

However, in mobile games you can't normally press keyboard keys or joystick buttons. Instead, do this:

1. Save a prefab variant of your Menu System. Add a UI button to it. Let's call it "PauseMenuButton". Configure the UI button's OnClick() to call PausePanel.Open.

2. Configure the TitleMenuPanel's OnOpen() event to deactivate PauseMenuButton. Configure its OnClose() event to activate PauseMenuButton.

3. Configure the PauseMenu's OnOpen() event to deactivate PauseMenuButton. Configure its OnClose() event to activate PauseMenuButton.
hrohibil
Posts: 368
Joined: Thu Nov 04, 2021 12:50 pm

Re: Menu framework

Post by hrohibil »

Ok Tony

I followed the steps.
In title menu it works, but when i clik start and go to level1, i dont have the pausebutton UI?
Do i add the Menu prefab variant to the scene? I tried added it but then the menubuttons are visible ?
User avatar
Tony Li
Posts: 21975
Joined: Thu Jul 18, 2013 1:27 pm

Re: Menu framework

Post by Tony Li »

Your Menu System prefab variant should be in the MainMenu scene. In this instance, set the PauseMenuButton inactive.

You can also put an instance in your gameplay scene if you want. If you put it in your gameplay scene, set the instance's TitleMenu inactive and PauseMenuButton active.

Make sure PauseMenuButton is inside the Menu System prefab variant's hierarchy.
hrohibil
Posts: 368
Joined: Thu Nov 04, 2021 12:50 pm

Re: Menu framework

Post by hrohibil »

Hi Tony


This is what my prefab variant looks like.
It is indeed in the main scene.

I dont understand what you mean with " In this instance, set the PauseMenuButton inactive" Are you saying that on the PauseMenuButton it self I should change the pausepanel Onclik to Deactivate?

EDIT:
2 issues when i drag a menu variant to the gameplay.

1:
Even if deactivate all gameobjects except the pausemenu button, when pressing start, the main menu START button is still visible

2:
It seems like i am fighting over canvas sorting? Either i can click on the UI buttton, but then i dont have mobile UI controls or the other way around??

User avatar
Tony Li
Posts: 21975
Joined: Thu Jul 18, 2013 1:27 pm

Re: Menu framework

Post by Tony Li »

Do not make the PauseMenuButton a child of TitleMenu. Make it a direct child of the Menu System.
hrohibil
Posts: 368
Joined: Thu Nov 04, 2021 12:50 pm

Re: Menu framework

Post by hrohibil »

Thanks.
I did that.

And now it works when I launch game from main menu :-)
Thanks Tony.


Now its only from level1 if i play i am not sure how to put it correctly
hrohibil
Posts: 368
Joined: Thu Nov 04, 2021 12:50 pm

Re: Menu framework

Post by hrohibil »

Fixed it...
You are the KING!!!!
Thank you

EDIT:

Do you have a tutorial on how to setup the whole save / load system with invector..
User avatar
Tony Li
Posts: 21975
Joined: Thu Jul 18, 2013 1:27 pm

Re: Menu framework

Post by Tony Li »

Set up the save system here.

Then add the scripting define symbol USE_INVECTOR_INVENTORY as indicated here. Add InvectorStatsSaver and InvectorInventorySaver components to your player, and assign unique keys (e.g., "playerStats" and "playerInventory").
hrohibil
Posts: 368
Joined: Thu Nov 04, 2021 12:50 pm

Re: Menu framework

Post by hrohibil »

Ok i set it up.

In gameplay I made two saves and they show up in the panel, but when i press on any of them, the scenes reload back to initial start NOT the saved game.

Yes i also did add the ReloadWhenDead script..
Post Reply