Beispiel #1
0
        private void OnNotificationReceived(PlayerNotification obj)
        {
            var ui = new NotificationUI(obj, _notifications);

            _notifications.Add(ui);
            Branch.Add(ui.Branch);
        }
Beispiel #2
0
        private void Notified(PlayerNotification obj)
        {
            if (_blocked.Contains(obj.Sender))
            {
                return;
            }

            Inbox.Add(obj);
            NumMessagesReceived++;
        }
Beispiel #3
0
 public NotificationUI(PlayerNotification notification, List <NotificationUI> items)
 {
     Branch = new ClickUIBranch("Notification", (int)ClickUIPriorities.Pad);
     _label = new Label
     {
         BackgroundColor = Color.Transparent,
         TextColor       = Color.White,
         Transform       = new Transform2(new Vector2(Sizes.Margin, 0), new Size2(Sizes.Notification.Width - Sizes.Button.Width - Sizes.Margin * 2, 90)),
         Text            = $"{notification.Time} - {notification.Sender} - {notification.Message}",
     };
     _button = ImageTextButtonFactory.Create("Dismiss", new Vector2(Sizes.Notification.Width - Sizes.Margin - Sizes.Button.Width, Sizes.SmallMargin), () => items.Remove(this));
     Branch.Add(_button);
 }
Beispiel #4
0
 public void Dismiss(PlayerNotification notification)
 {
     Inbox.Remove(notification);
 }
Beispiel #5
0
 public void Block(PlayerNotification obj)
 {
     Block(obj.Sender);
 }