Ejemplo n.º 1
0
    private Notification_IGDC CreateNotification(Message_IGDC message)
    {
        Notification_IGDC not = Instantiate(not_prefab, nots_parent);

        not.SetupNotification(message, delegate { ShowNotificationsStackTrace(not); });
        nots_alive.Add(not);

        return(not);
    }
Ejemplo n.º 2
0
    public void ChangeStackingMode()
    {
        for (int i = 0; i < nots_alive.Count; i++)
        {
            Destroy(nots_alive[i].gameObject);
        }

        nots_alive.Clear();

        Notification_IGDC curr_not = null;

        switch (stackingMode)
        {
        case STACKING_MODE.CONSECUTIVE_MESSAGES:
            for (int i = 0; i < messages.Count; i++)
            {
                if (i > 0 &&
                    messages[i].condition == messages[i - 1].condition &&
                    messages[i].stackTrace == messages[i - 1].stackTrace)
                {
                    curr_not.InStack++;
                }
                else
                {
                    curr_not = CreateNotification(messages[i]);
                    tray_ctrl.NewUnreadMessage();
                }
            }
            break;

        case STACKING_MODE.EVERY_MESSAGE:
            bool found;

            for (int m = 0; m < messages.Count; m++)
            {
                found = false;

                for (int n = 0; n < nots_alive.Count; n++)
                {
                    if (messages[m].stackTrace == nots_alive[n].message.stackTrace &&
                        messages[m].condition == nots_alive[n].message.condition)
                    {
                        found = true;
                        nots_alive[n].InStack++;
                    }
                }

                if (!found)
                {
                    curr_not = CreateNotification(messages[m]);
                    tray_ctrl.NewUnreadMessage();
                }
            }
            break;

        case STACKING_MODE.NONE:
            foreach (Message_IGDC message in messages)
            {
                curr_not = CreateNotification(message);
                tray_ctrl.NewUnreadMessage();
            }
            break;
        }

        MoveNotifications();
    }
Ejemplo n.º 3
0
 public void ShowNotificationsStackTrace(Notification_IGDC not)
 {
     stackTraceShower.Show(not.message.stackTrace);
 }