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
|
|
@ -55,7 +55,6 @@ public partial class Impresario : BaseQuester
|
|||
|
||||
if (obj.IsInRightTheater())
|
||||
{
|
||||
player.CloseGump<SheetMusicOfferGump>();
|
||||
player.SendGump(new SheetMusicOfferGump());
|
||||
}
|
||||
else
|
||||
|
|
@ -68,6 +67,8 @@ public partial class Impresario : BaseQuester
|
|||
|
||||
public class SheetMusicOfferGump : BaseQuestGump
|
||||
{
|
||||
public override bool Singleton => true;
|
||||
|
||||
public SheetMusicOfferGump() : base(75, 25)
|
||||
{
|
||||
Closable = false;
|
||||
|
|
|
|||
|
|
@ -130,6 +130,8 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
private readonly QuestSystem m_System;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public QuestLogUpdatedGump(QuestSystem system) : base(3, 30)
|
||||
{
|
||||
m_System = system;
|
||||
|
|
|
|||
|
|
@ -264,7 +264,6 @@ namespace Server.Engines.Quests
|
|||
|
||||
public virtual void ShowQuestLogUpdated()
|
||||
{
|
||||
From.CloseGump<QuestLogUpdatedGump>();
|
||||
From.SendGump(new QuestLogUpdatedGump(this));
|
||||
}
|
||||
|
||||
|
|
@ -272,18 +271,19 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
if (Objectives.Count > 0)
|
||||
{
|
||||
From.CloseGump<QuestItemInfoGump>();
|
||||
From.CloseGump<QuestLogUpdatedGump>();
|
||||
From.CloseGump<QuestObjectivesGump>();
|
||||
From.CloseGump<QuestConversationsGump>();
|
||||
var gumps = From.GetGumps();
|
||||
gumps.Close<QuestItemInfoGump>();
|
||||
gumps.Close<QuestLogUpdatedGump>();
|
||||
gumps.Close<QuestConversationsGump>();
|
||||
gumps.Close<QuestObjectivesGump>();
|
||||
|
||||
From.SendGump(new QuestObjectivesGump(Objectives));
|
||||
gumps.Send(new QuestObjectivesGump(Objectives));
|
||||
|
||||
var last = Objectives[^1];
|
||||
|
||||
if (last.Info != null)
|
||||
{
|
||||
From.SendGump(new QuestItemInfoGump(last.Info));
|
||||
gumps.Send(new QuestItemInfoGump(last.Info));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -292,11 +292,13 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
if (Conversations.Count > 0)
|
||||
{
|
||||
From.CloseGump<QuestItemInfoGump>();
|
||||
From.CloseGump<QuestObjectivesGump>();
|
||||
From.CloseGump<QuestConversationsGump>();
|
||||
var gumps = From.GetGumps();
|
||||
|
||||
From.SendGump(new QuestConversationsGump(Conversations));
|
||||
gumps.Close<QuestItemInfoGump>();
|
||||
gumps.Close<QuestObjectivesGump>();
|
||||
gumps.Close<QuestConversationsGump>();
|
||||
|
||||
gumps.Send(new QuestConversationsGump(Conversations));
|
||||
|
||||
var last = Conversations[^1];
|
||||
|
||||
|
|
@ -389,10 +391,10 @@ namespace Server.Engines.Quests
|
|||
Conversations.Add(conv);
|
||||
}
|
||||
|
||||
From.CloseGump<QuestItemInfoGump>();
|
||||
From.CloseGump<QuestObjectivesGump>();
|
||||
From.CloseGump<QuestConversationsGump>();
|
||||
From.SendGump(conv.Logged ? new QuestConversationsGump(Conversations) : new QuestConversationsGump(conv));
|
||||
var gumps = From.GetGumps();
|
||||
gumps.Close<QuestItemInfoGump>();
|
||||
gumps.Close<QuestObjectivesGump>();
|
||||
gumps.Send(conv.Logged ? new QuestConversationsGump(Conversations) : new QuestConversationsGump(conv));
|
||||
|
||||
if (conv.Info != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -186,7 +186,6 @@ public partial class Mardoth : BaseQuester
|
|||
m.PlaySound(0x214);
|
||||
m.FixedEffect(0x376A, 10, 16);
|
||||
|
||||
m.CloseGump<ResurrectGump>();
|
||||
m.SendGump(new ResurrectGump(m, ResurrectMessage.Healer));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,7 +203,6 @@ public partial class Emino : BaseQuester
|
|||
m.PlaySound(0x214);
|
||||
m.FixedEffect(0x376A, 10, 16);
|
||||
|
||||
m.CloseGump<ResurrectGump>();
|
||||
m.SendGump(new ResurrectGump(m, ResurrectMessage.Healer));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,6 @@ public partial class Zoel : BaseQuester
|
|||
m.PlaySound(0x214);
|
||||
m.FixedEffect(0x376A, 10, 16);
|
||||
|
||||
m.CloseGump<ResurrectGump>();
|
||||
m.SendGump(new ResurrectGump(m, ResurrectMessage.Healer));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Regions;
|
||||
using Server.Mobiles;
|
||||
|
||||
|
|
|
|||
|
|
@ -220,7 +220,6 @@ public partial class Chyloth : BaseQuester
|
|||
AngryAt = null;
|
||||
}
|
||||
|
||||
member.CloseGump<ChylothPartyGump>();
|
||||
member.SendGump(new ChylothPartyGump(from, member));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,6 @@ public partial class Schmendrick : BaseQuester
|
|||
m.PlaySound(0x214);
|
||||
m.FixedEffect(0x376A, 10, 16);
|
||||
|
||||
m.CloseGump<ResurrectGump>();
|
||||
m.SendGump(new ResurrectGump(m, ResurrectMessage.Healer));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -391,7 +391,6 @@ public partial class Uzeraan : BaseQuester
|
|||
m.PlaySound(0x214);
|
||||
m.FixedEffect(0x376A, 10, 16);
|
||||
|
||||
m.CloseGump<ResurrectGump>();
|
||||
m.SendGump(new ResurrectGump(m, ResurrectMessage.Healer));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue