Page 1 of 2

Hide Panel While Preserving Continue

Posted: Tue May 02, 2023 8:44 pm
by BWLGeorge
Howdy, quick question! Been messing around with hiding panels for cutscene purposes and I was using a Conversation to allow the player to sit for a while before getting back up. I wanted to hide the dialogue panel while they sit using HidePanel, and then press the continue button to get back up, but of course hiding the dialogue panel disables the continue button.

Is there any way to hide the dialogue panel but still have the continue button function as normal?

Re: Hide Panel While Preserving Continue

Posted: Tue May 02, 2023 10:24 pm
by Tony Li
Hi,

No, but you could configure a completely different UI button to continue the conversation:

1. Add a UI Button outside of the Dialogue Panel, and give it a unique name such as "ExternalContinueButton". Configure its OnClick() event to call the dialogue UI's OnContinue() method. Deactivate the UI Button.

2. Set the node's Sequence to something like:

Code: Select all

SetDialoguePanel(false);
SetActive(ExternalContinueButton);
required SetDialoguePanel(true)@Message(Continued);
required SetActive(ExternalContinueButton, false)@Message(Continued)

Re: Hide Panel While Preserving Continue

Posted: Tue May 02, 2023 11:15 pm
by BWLGeorge
That did the trick! Thanks so much!

Re: Hide Panel While Preserving Continue

Posted: Wed May 03, 2023 8:34 am
by Tony Li
Glad to help!

Re: Hide Panel While Preserving Continue

Posted: Wed May 03, 2023 9:46 pm
by BWLGeorge
Having a strange issue with this where it's working totally fine in-engine, but pushing a build somehow messes with something. The button doesn't show up in the build, and then when I go back and look in Unity the button has been made active in the scene despite being inactive on the prefab, and then making it inactive in the scene makes it active on the prefab. Then in-engine, the button doesn't become active when the dialogue node is triggered. The problem persists until I move the button (make it the child of something else in the dialogue ui) and switch scenes in Unity (at which point it works fine in multiple scenes until I build, when it breaks again)

Any ideas on where the root cause of this might be?

Re: Hide Panel While Preserving Continue

Posted: Wed May 03, 2023 10:06 pm
by Tony Li
Hi,

I don't know, but it probably has to do with one of these two possibilities:
  • In the scene, you've overridden some setting that was on the prefab -- for example, button is inactive in prefab but active in scene. If you can, make the scene instance exactly match the prefab. When you inspect the scene instance, the Inspector view will show a blue vertical bar next to any settings that differ from the prefab. Right-click on those and select Revert to revert them to the same value as the prefab.
  • Or it has to do with scene changes in one of two ways:
    • Playtest in the editor from the first scene in build settings. This most closely reflects how the game will play in a build. You might be able to recreate the problem.
    • Otherwise maybe it has to do with Don't Destroy On Load objects. The Dialogue Manager is one of these. Related info in this post.

Re: Hide Panel While Preserving Continue

Posted: Wed May 03, 2023 10:29 pm
by BWLGeorge
Hmm, well I'd made sure the prefab was already reverted to its default settings and I'd played through the game in the editor from the start a few times now.

If I understand the conflict with Don't Destroy objects, would I hypothetically be able to add an External Continue Button to the player object or somewhere in the scene and rely on that as opposed to having it attached to the Dialogue Manager's prefab?

Re: Hide Panel While Preserving Continue

Posted: Wed May 03, 2023 10:39 pm
by Tony Li
Keep your External Continue Button within the Dialogue Manager > dialogue UI's hierarchy. But try this patch:

PixelCrushers_GameObjectUtilityPatch_2023-05-03.unitypackage

It might be related to a bug that was fixed recently that wasn't able to find inactive objects in the Don't Destroy On Load section.

Re: Hide Panel While Preserving Continue

Posted: Wed May 03, 2023 10:58 pm
by BWLGeorge
Still isn't working. I'm pretty at a loss for this one. From what I can tell, the actual process of building the game is changing things in the scene editor

Re: Hide Panel While Preserving Continue

Posted: Wed May 03, 2023 11:13 pm
by Tony Li
That sounds unusual. Maybe you have a custom editor script (or from some other asset) that's changing things? Feel free to send a reproduction project to tony (at) pixelcrushers.com if you'd like me to take a look.