Multiple Alerts

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Ronia
Posts: 5
Joined: Thu Mar 04, 2021 7:17 am

Multiple Alerts

Post by Ronia »

Hi!

I'm trying to display multiple alerts at the same time. I have seen that there is a post on the forum about this same thing, but it does not cover my case.

I'm using the SMS Dialogue UI, which has templates for the NPC and PC Subtitles and every time it wants to show a new message, it copies them and enters the corresponding text, allowing you to have several messages at the same time. This is what I would like to be able to do with the alerts, have a template and clone it to be able to show several alert UIs at the same time.

Thank you so much!
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multiple Alerts

Post by Tony Li »

Hi,

The Dialogue System's standard dialogue UI system doesn't do that by default. You can queue alerts so that the next one in the queue will appear as soon as the current one disappears. But to show multiple at the same time you'll need to do a little scripting. Make a subclass of StandardDialogueUI that overrides the ShowAlert() method to show multiple alerts at the same time. If you don't want to do too much scripting and don't mind a small purchase, you could just redirect your overridden ShowAlert() method to Animmal's Ultimate Notification System. (Page 12 of the Ultimate Notification System's manual also has additional tips for using it with the Dialogue System.) The subclass might look something like:

Code: Select all

using UnityEngine;
using PixelCrushers.DialogueSystem;
using Animmal.NotificationSystem;

public class MyCustomDialogueUI : StandardDialogueUI
{
    public override ShowAlert(string message, float duration)
    {
        var notificationData = new NotificationData();
        notificationData.Texts.Add(message);
        NotificationManager.Instance.ShowNotification(“Alert”, notificationData);
    }
}
Post Reply