Exemplo n.º 1
0
        private void OnNotificationReceived(PlayerNotification obj)
        {
            var ui = new NotificationUI(obj, _notifications);

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

            Inbox.Add(obj);
            NumMessagesReceived++;
        }
Exemplo n.º 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);
 }
Exemplo n.º 4
0
 public void Dismiss(PlayerNotification notification)
 {
     Inbox.Remove(notification);
 }
Exemplo n.º 5
0
 public void Block(PlayerNotification obj)
 {
     Block(obj.Sender);
 }