private void OnNotificationReceived(PlayerNotification obj) { var ui = new NotificationUI(obj, _notifications); _notifications.Add(ui); Branch.Add(ui.Branch); }
private void Notified(PlayerNotification obj) { if (_blocked.Contains(obj.Sender)) { return; } Inbox.Add(obj); NumMessagesReceived++; }
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); }
public void Dismiss(PlayerNotification notification) { Inbox.Remove(notification); }
public void Block(PlayerNotification obj) { Block(obj.Sender); }