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); } }