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); } }
private SpellIcon(Spell spell) { this.spell = spell; table.Controls.Add(gump = new ArtBox((ushort)GetID(), 0, ConfigEx.GetElement(false, "SmallSpellIcon") ? 35 : -1, true)); Location = new Point(ConfigEx.GetAttribute(Location.X, "locX", "Spells", "Spell_" + spell.GetID()), ConfigEx.GetAttribute(Location.Y, "locY", "Spells", "Spell_" + spell.GetID())); if (IsUsable) { WeaponMoves.Changed += SetGump; Event.LocalizedMessage += Event_LocalizedMessage; if (IsPrimaryAbility || IsSecondaryAbility) { WeaponAbilities.WeaponSwitched += SetGump; } } if (spell.GetID() == 403)//evasion { Event.LocalizedMessage += OnEvasion; } }
public BuffTimer(ArtBox gump, BuffInfo info) : base(TimeSpan.Zero, TimeSpan.FromSeconds(1)) { this.gump = gump; this.info = info; }