protected override void OnMouseClick(MouseEventArgs e) { if (e.Button == MouseButtons.Left) { Control control = table.GetChildAtPoint(e.Location); string text = null, title = null; if (control is ArtBox) { BuffInfo buff = BuffIcons.GetBuffByGump(((ArtBox)control).ArtID); if (buff != null) { title = buff.Title; text = buff.Info; } } else if (control is LabelEx) { text = control.Tag as string; } if (text != null) { toolTip.ToolTipTitle = title; toolTip.Show(text, this, e.Location, 5000); } } base.OnMouseClick(e); }
private void BuffIcons_Added(BuffIcon buffID, BuffInfo buff) { ArtBox gump = new ArtBox(BuffIcons.GetGumpID(buffID), isGump: true, vertical: table.RowCount == 0); if (buff.Duration != 0) { BuffTimer timer = new BuffTimer(gump, buff); gump.Tag = timer; timer.Start(); } table.Controls.Add(gump); }
private void BuffIcons_Removed(BuffIcon buffID) { ArtBox gump = table.Controls.OfType <ArtBox>().FirstOrDefault(g => g.ArtID == BuffIcons.GetGumpID(buffID)); if (gump != null) { BuffTimer timer = gump.Tag as BuffTimer; if (timer != null) { timer.Stop(); } table.Controls.Remove(gump); } }