Not re-selecting first response button after pause

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
baxta86
Posts: 17
Joined: Wed Jun 30, 2021 7:53 am

Not re-selecting first response button after pause

Post by baxta86 »

Hi Tony,

I have noticed when I un-pause my game while I have a conversation active, the first response button is always re-selected after resuming play from the pause menu. This is so even if the user had say the second or third response button selected when they initially paused.

Is there a fix so that if the user pauses the game while the second response button is currently selected for example, that when they un-pause the game, the second response button is then reselected?

Im pausing by setting the Time.timeScale to 0 and my pause menu takes focus while paused. I assume because the conversation is not in focus during the pause and resumes focus after, it is resetting the button selection to the first response.

Cheers
Tom
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Not re-selecting first response button after pause

Post by Tony Li »

Hi,

Please try this patch:

PixelCrushers_UIPanelPatch_2022-01-06.unitypackage

It adds an improvement where Dialogue System UI panels will re-focus the formerly selected button (and not just the first button) after opening and closing a non-Dialogue System UI.
baxta86
Posts: 17
Joined: Wed Jun 30, 2021 7:53 am

Re: Not re-selecting first response button after pause

Post by baxta86 »

Thanks Tony,

Sorry if this is a silly question, but where should i place the patch in my project? In the actual Project folder? the ProjectSettings folder? Or within the Pixel Crushers folder?

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

Re: Not re-selecting first response button after pause

Post by Tony Li »

Hi,

Download PixelCrushers_UIPanelPatch_2022-01-06.unitypackage. It doesn't matter where.

Then open your project in Unity. Select menu item Assets > Import Package > Custom Package and select the copy of PixelCrushers_UIPanelPatch_2022-01-06.unitypackage that you downloaded. Finally, click Import. This will update the Dialogue System's UIPanel script.
baxta86
Posts: 17
Joined: Wed Jun 30, 2021 7:53 am

Re: Not re-selecting first response button after pause

Post by baxta86 »

Amazing! This works perfectly now :)

I did have to write a little script for On Open() in my UI to make it selected the first button when the conversations starts again (i have an option to close the dialogue and re-open the conversation again), but now when I pause and un-pause, it re-selects whichever response was selected when the pause was activated.

Thanks once again for you help Tony. Honestly the best support for an asset! Wish I could chuck you another 5 start review on the asset store, haha.
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Not re-selecting first response button after pause

Post by Tony Li »

Glad to help! Thank you for the kind words. :-)
h0neyfr0g
Posts: 4
Joined: Wed Feb 23, 2022 1:20 pm

Re: Not re-selecting first response button after pause

Post by h0neyfr0g »

hi Tony!

I added the package as instructed, but Im now getting an error saying

"SetFocus" does not exist and is throwing an error

Thanks for the help!
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Not re-selecting first response button after pause

Post by Tony Li »

Hi,

That patch is for an older version of the Dialogue System. Please try importing the latest version.
Post Reply