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
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue