Subtitle Panel Yield To Menu Panel
Re: Subtitle Panel Yield To Menu Panel
The Standard Dialogue UI's new Wait For Close checkbox waits for subtitle and menu panels to close. Then it allows the Standard Dialogue UI's Dialogue Panel to close.
-
- Posts: 222
- Joined: Wed Jan 22, 2020 10:48 pm
Re: Subtitle Panel Yield To Menu Panel
Ahh so it is "Wait for Close to Close." Ok great, that's exactly what I need for the Dialogue Panel! Thanks for clarifying that!
Re: Subtitle Panel Yield To Menu Panel
I'll add that to the hover tooltip to make it clear what it does.
Re: Subtitle Panel Yield To Menu Panel
Sorry to jump in hereTony Li wrote: ↑Thu Jan 07, 2021 8:38 am What version of the Dialogue System are you on? The most recent version has additional Wait For Close checkboxes on subtitle panels. And the upcoming version 2.2.15 has a Wait For Close checkbox on the Standard Dialogue UI component itself that waits for all subtitle panels and menu panels to close before closing itself. Would that address your needs?
I am running version 2.2.14 and I don't see any "Wait For Close" checkboxes on my Standard UI Subtitle Panel scripts.
Am I missing something?
Re: Subtitle Panel Yield To Menu Panel
It's tucked away near the bottom of the inspector:
Re: Subtitle Panel Yield To Menu Panel
It wasn't there on my panel.
But I solved the issue now.
It seems Unity has a problem with updating asset packages right now - or at least mine has.
Both my AC and DS assets reported fully updated to latest version, but in reality they weren't.
I just deleted the assets from the cahce folder and re-downloaded and reimported.
Now everything is fine - the panel is updated with the new wait for close setting.
If this is a general Unity problem, I imagine it could be quite a headache for you asset publishers
But I solved the issue now.
It seems Unity has a problem with updating asset packages right now - or at least mine has.
Both my AC and DS assets reported fully updated to latest version, but in reality they weren't.
I just deleted the assets from the cahce folder and re-downloaded and reimported.
Now everything is fine - the panel is updated with the new wait for close setting.
If this is a general Unity problem, I imagine it could be quite a headache for you asset publishers
Re: Subtitle Panel Yield To Menu Panel
It is. Unity's Package Manager window is broken. The Asset Store team says it's their top priority right now. But unfortunately it's been quite a while since it's been broken.
If you're using Unity 2019.4 or earlier, you can use the Asset Store window. Otherwise, if you're using 2020.x, deleting the old version out of the cache, as you did, is the only solution.
If you're using Unity 2019.4 or earlier, you can use the Asset Store window. Otherwise, if you're using 2020.x, deleting the old version out of the cache, as you did, is the only solution.
-
- Posts: 222
- Joined: Wed Jan 22, 2020 10:48 pm
Re: Subtitle Panel Yield To Menu Panel
Sorry to resurrect an old thread (and two bug you twice in one day), but I updated to 2.2.18 today and noticed that "Wait for Close" definitely now exists on StandardDialogueUI, but the problem I was running into actually had to do with the Dialogue Panel, not the Basic Standard Dialogue UI.
The Dialogue Panel has a UIPanel script on it, and you can select to have it Deactivate on Hidden. Because this panel doesn't wait for other panels to close before deactivating, it cuts all the closing panels off before they can finish closing.
I've still got my workaround in place:
But I was wondering if this was something that could be added to UI Panel? Or maybe I'm doing something wrong? Sorry again for bugging you again!
The Dialogue Panel has a UIPanel script on it, and you can select to have it Deactivate on Hidden. Because this panel doesn't wait for other panels to close before deactivating, it cuts all the closing panels off before they can finish closing.
I've still got my workaround in place:
Code: Select all
using System.Collections;
using PixelCrushers.DialogueSystem;
using UnityEngine;
namespace PixelCrushers
{
public class VoodooDetectiveDialoguePanel : UIPanel
{
// Properties
private Coroutine routine;
public override void Open()
{
// Stop trying to close if we got a request to open
if (routine != null) StopCoroutine(routine);
base.Open();
}
public override void Close()
{
// Wait for sub-panels to close before closing
// TODO: wait to see how this resolves: https://www.pixelcrushers.com/phpbb/viewtopic.php?f=3&t=3917&p=21721#p21721
routine = StartCoroutine(CloseRoutine(base.Close));
}
private IEnumerator CloseRoutine(System.Action closeLambda)
{
float safeguardTime = Time.realtimeSinceStartup + 8f;
while (AreAnyPanels(UIPanel.PanelState.Closing) && Time.realtimeSinceStartup < safeguardTime)
{
yield return null;
}
closeLambda?.Invoke();
}
private bool AreAnyPanels(params UIPanel.PanelState[] panelStates)
{
StandardDialogueUI dialogueUI = ((StandardDialogueUI)DialogueManager.instance.dialogueUI);
StandardUIDialogueControls dialogueControls = (StandardUIDialogueControls)dialogueUI.dialogueControls;
foreach (var panel in dialogueControls.subtitlePanels)
{
if (panel != null)
{
foreach (UIPanel.PanelState state in panelStates)
{
if (panel.panelState == state) return true;
}
}
}
foreach (var panel in dialogueControls.menuPanels)
{
foreach (UIPanel.PanelState state in panelStates)
{
if (panel.panelState == state) return true;
}
}
return false;
}
}
}
But I was wondering if this was something that could be added to UI Panel? Or maybe I'm doing something wrong? Sorry again for bugging you again!
Re: Subtitle Panel Yield To Menu Panel
Hi,
The main dialogue UI GameObject itself has a Standard Dialogue UI component. This component has a Conversation UI Elements > Wait For Close checkbox. If you tick that, it should wait for all subtitle panels and menu panels to close before closing the Dialogue Panel.
The main dialogue UI GameObject itself has a Standard Dialogue UI component. This component has a Conversation UI Elements > Wait For Close checkbox. If you tick that, it should wait for all subtitle panels and menu panels to close before closing the Dialogue Panel.
-
- Posts: 222
- Joined: Wed Jan 22, 2020 10:48 pm
Re: Subtitle Panel Yield To Menu Panel
Ah so that's the top level Game Object. I'm referring to the Dialogue Panel. I've attached an image so you can see which Game Object i'm talking about. It has a UIPanel script on in, not the StandardDialogueUI which is on the "Voodoo Detective Dialgoue UI" Game Object.
That Dialogue Panel UIPanel doesn't have "Wait for Close" on it.
That Dialogue Panel UIPanel doesn't have "Wait for Close" on it.
- Attachments
-
- Screen Shot 2021-07-27 at 11.03.33 AM.png (24.61 KiB) Viewed 1963 times