feat: Moves gumps out of the core (#1916)
> [!Important] > **Developer Note** > This code change will **completely move gumps out of the core** ### Summary - Adds `GetGumps()` convenience which exposes methods to Find/Close/Send multiple gumps. This helper is a performance improvement by eliminating the Dictionary<Player, List> lookup for gumps.
This commit is contained in:
parent
40d99f6d1c
commit
8282b00ca2
246 changed files with 1722 additions and 1383 deletions
|
|
@ -74,7 +74,6 @@ namespace Server.Spells.Chivalry
|
|||
else if (resChance > Utility.RandomDouble())
|
||||
{
|
||||
m.FixedParticles(0x375A, 1, 15, 5005, 5, 3, EffectLayer.Head);
|
||||
m.CloseGump<ResurrectGump>();
|
||||
m.SendGump(new ResurrectGump(Caster));
|
||||
sacrifice = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ namespace Server.Spells.Eighth
|
|||
m.PlaySound(0x214);
|
||||
m.FixedEffect(0x376A, 10, 16);
|
||||
|
||||
m.CloseGump<ResurrectGump>();
|
||||
m.SendGump(new ResurrectGump(Caster));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ public class SummonFamiliarSpell : NecromancerSpell
|
|||
{
|
||||
if (CheckSequence())
|
||||
{
|
||||
Caster.CloseGump<SummonFamiliarGump>();
|
||||
Caster.SendGump(new SummonFamiliarGump(Caster, Entries, this));
|
||||
}
|
||||
|
||||
|
|
@ -109,6 +108,8 @@ public class SummonFamiliarGump : Gump
|
|||
|
||||
private readonly SummonFamiliarSpell _spell;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public SummonFamiliarGump(Mobile from, SummonFamiliarEntry[] entries, SummonFamiliarSpell spell) : base(200, 100)
|
||||
{
|
||||
_from = from;
|
||||
|
|
@ -187,14 +188,12 @@ public class SummonFamiliarGump : Gump
|
|||
// That familiar requires ~1_NECROMANCY~ Necromancy and ~2_SPIRIT~ Spirit Speak.
|
||||
_from.SendLocalizedMessage(1061606, $"{entry.ReqNecromancy:F1}\t{entry.ReqSpiritSpeak:F1}");
|
||||
|
||||
_from.CloseGump<SummonFamiliarGump>();
|
||||
_from.SendGump(new SummonFamiliarGump(_from, SummonFamiliarSpell.Entries, _spell));
|
||||
}
|
||||
else if (entry.Type == null)
|
||||
{
|
||||
_from.SendMessage("That familiar has not yet been defined.");
|
||||
|
||||
_from.CloseGump<SummonFamiliarGump>();
|
||||
_from.SendGump(new SummonFamiliarGump(_from, SummonFamiliarSpell.Entries, _spell));
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -143,7 +143,6 @@ public class AnimalForm : NinjaSpell
|
|||
var lastAnimalForm = GetLastAnimalForm(Caster);
|
||||
if (Caster is PlayerMobile && lastAnimalForm == -1 && !_wasMoving && !CasterIsMoving())
|
||||
{
|
||||
Caster.CloseGump<AnimalFormGump>();
|
||||
Caster.SendGump(new AnimalFormGump(Caster, Entries, this));
|
||||
}
|
||||
else if (Morph(Caster, lastAnimalForm) == MorphResult.Fail)
|
||||
|
|
@ -361,6 +360,8 @@ public class AnimalForm : NinjaSpell
|
|||
private readonly AnimalForm _spell;
|
||||
private readonly AnimalFormEntry[] _entries;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public AnimalFormGump(Mobile caster, AnimalFormEntry[] entries, AnimalForm spell) : base(50, 50)
|
||||
{
|
||||
_caster = caster;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,6 @@ namespace Server.Spells.Spellweaving
|
|||
|
||||
if (master?.NetState != null && Utility.InUpdateRange(pet.Location, master.Location))
|
||||
{
|
||||
master.CloseGump<PetResurrectGump>();
|
||||
master.SendGump(new PetResurrectGump(master, pet, hitsScalar));
|
||||
}
|
||||
else
|
||||
|
|
@ -116,7 +115,6 @@ namespace Server.Spells.Spellweaving
|
|||
|
||||
if (friend.NetState != null && Utility.InUpdateRange(pet.Location, friend.Location))
|
||||
{
|
||||
friend.CloseGump<PetResurrectGump>();
|
||||
friend.SendGump(new PetResurrectGump(friend, pet));
|
||||
break;
|
||||
}
|
||||
|
|
@ -125,7 +123,6 @@ namespace Server.Spells.Spellweaving
|
|||
}
|
||||
else
|
||||
{
|
||||
m.CloseGump<ResurrectGump>();
|
||||
m.SendGump(new ResurrectGump(m, hitsScalar));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue