public void ClientUpdateNotifications(string notificationKey, AdminChatWindow targetWindow,
                                              int amt, bool clearAll)
        {
            switch (targetWindow)
            {
            case AdminChatWindow.AdminPlayerChat:
                if (clearAll)
                {
                    playerNotification.RemoveNotification(notificationKey);
                    if (amt == 0)
                    {
                        return;
                    }
                }
                //No need to update notification if the player is already selected in admin chat
                if (adminChatWindows.SelectedWindow == AdminChatWindow.AdminPlayerChat)
                {
                    if (adminChatWindows.adminPlayerChat.SelectedPlayer != null &&
                        adminChatWindows.adminPlayerChat.SelectedPlayer.uid == notificationKey)
                    {
                        break;
                    }
                }
                playerNotification.AddNotification(notificationKey, amt);
                break;

            case AdminChatWindow.AdminToAdminChat:
                if (clearAll)
                {
                    adminNotification.RemoveNotification(notificationKey);
                    if (amt == 0)
                    {
                        return;
                    }
                }

                if (adminChatWindows.adminToAdminChat.gameObject.activeInHierarchy)
                {
                    return;
                }

                adminNotification.AddNotification(notificationKey, amt);
                break;

            case AdminChatWindow.PrayerWindow:
                if (clearAll)
                {
                    prayerNotification.AddNotification(notificationKey, amt);
                }
                prayerNotification.AddNotification(notificationKey, amt);
                break;
            }
        }
Exemplo n.º 2
0
        public void RefreshNotification()
        {
            if (parentNotification == null)
            {
                return;
            }

            if (parentNotification.notifications.ContainsKey(PlayerData.uid))
            {
                pendingMsgNotification.ClearAll();
                pendingMsgNotification.AddNotification(PlayerData.uid,
                                                       parentNotification.notifications[PlayerData.uid]);
            }
            else
            {
                pendingMsgNotification.ClearAll();
            }
        }
Exemplo n.º 3
0
 public void UpdateNotifications(int amt)
 {
     notifications.AddNotification(NotificationKey, amt);
 }