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
|
|
@ -268,12 +268,13 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
*/
|
||||
public static void CloseOtherGumps(PlayerMobile pm)
|
||||
{
|
||||
pm.CloseGump<InfoNPCGump>();
|
||||
pm.CloseGump<QuestRewardGump>();
|
||||
pm.CloseGump<QuestConversationGump>();
|
||||
pm.CloseGump<QuestReportBackGump>();
|
||||
// pm.CloseGump( typeof( UnknownGump807 ) );
|
||||
pm.CloseGump<QuestCancelConfirmGump>();
|
||||
var gumps = pm.GetGumps();
|
||||
|
||||
gumps.Close<InfoNPCGump>();
|
||||
gumps.Close<QuestRewardGump>();
|
||||
gumps.Close<QuestConversationGump>();
|
||||
gumps.Close<QuestReportBackGump>();
|
||||
gumps.Close<QuestCancelConfirmGump>();
|
||||
}
|
||||
|
||||
private struct ButtonInfo
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
private readonly bool m_CloseGumps;
|
||||
private readonly MLQuestInstance m_Instance;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public QuestLogDetailedGump(MLQuestInstance instance, bool closeGumps = true)
|
||||
: base(1046026) // Quest Log
|
||||
{
|
||||
|
|
@ -20,7 +22,6 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
if (closeGumps)
|
||||
{
|
||||
CloseOtherGumps(pm);
|
||||
pm.CloseGump<QuestLogDetailedGump>();
|
||||
}
|
||||
|
||||
SetTitle(quest.Title);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
private readonly bool m_CloseGumps;
|
||||
private readonly PlayerMobile m_Owner;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public QuestLogGump(PlayerMobile pm, bool closeGumps = true)
|
||||
: base(1046026) // Quest Log
|
||||
{
|
||||
|
|
@ -17,7 +19,6 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
|
||||
if (closeGumps)
|
||||
{
|
||||
pm.CloseGump<QuestLogGump>();
|
||||
pm.CloseGump<QuestLogDetailedGump>();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
private readonly MLQuest m_Quest;
|
||||
private readonly IQuestGiver m_Quester;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public QuestOfferGump(MLQuest quest, IQuestGiver quester, PlayerMobile pm)
|
||||
: base(1049010) // Quest Offer
|
||||
{
|
||||
|
|
@ -16,7 +18,6 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
m_Quester = quester;
|
||||
|
||||
CloseOtherGumps(pm);
|
||||
pm.CloseGump<QuestOfferGump>();
|
||||
|
||||
SetTitle(quest.Title);
|
||||
RegisterButton(ButtonPosition.Left, ButtonGraphic.Accept, 1);
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
private readonly IRaceChanger m_Owner;
|
||||
private readonly Race m_Race;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public RaceChangeConfirmGump(IRaceChanger owner, PlayerMobile from, Race targetRace)
|
||||
: base(50, 50)
|
||||
{
|
||||
from.CloseGump<RaceChangeConfirmGump>();
|
||||
|
||||
m_Owner = owner;
|
||||
m_From = from;
|
||||
m_Race = targetRace;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using Server.Engines.MLQuests.Gumps;
|
|||
using Server.Engines.MLQuests.Objectives;
|
||||
using Server.Engines.MLQuests.Rewards;
|
||||
using Server.Engines.Spawners;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.MLQuests
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using Server.Engines.MLQuests.Gumps;
|
||||
using Server.Engines.MLQuests.Objectives;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.MLQuests
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using ModernUO.Serialization;
|
||||
using Server.Engines.MLQuests.Definitions;
|
||||
using Server.Engines.MLQuests.Gumps;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue