diff --git a/Projects/UOContent/Engines/Craft/Core/CraftGump.cs b/Projects/UOContent/Engines/Craft/Core/CraftGump.cs index 2fca292e1..96ff059ac 100644 --- a/Projects/UOContent/Engines/Craft/Core/CraftGump.cs +++ b/Projects/UOContent/Engines/Craft/Core/CraftGump.cs @@ -39,9 +39,6 @@ public class CraftGump : DynamicGump { var context = _craftSystem.GetContext(_from); - _from.CloseGump(); - _from.CloseGump(); - builder.AddPage(); builder.AddBackground(0, 0, 530, 437, 5054); @@ -396,7 +393,7 @@ public class CraftGump : DynamicGump } } - public int CreateGroupList(ref DynamicGumpBuilder builder) + public void CreateGroupList(ref DynamicGumpBuilder builder) { var craftGroupCol = _craftSystem.CraftGroups; @@ -418,8 +415,14 @@ public class CraftGump : DynamicGump builder.AddLabel(50, 80 + i * 20, LabelHue, craftGroup.NameString); } } + } - return craftGroupCol.Count; + public override void SendTo(NetState ns) + { + _from.CloseGump(); + _from.CloseGump(); + + base.SendTo(ns); } public static int GetButtonID(int type, int index) => 1 + type + index * 7; diff --git a/Projects/UOContent/Engines/Help/HelpGump.cs b/Projects/UOContent/Engines/Help/HelpGump.cs index 35a62328f..5d28a4fe6 100644 --- a/Projects/UOContent/Engines/Help/HelpGump.cs +++ b/Projects/UOContent/Engines/Help/HelpGump.cs @@ -56,17 +56,12 @@ public class ContainedMenu : QuestionMenu public sealed class HelpGump : DynamicGump { - private Mobile _from; + private readonly Mobile _from; - public HelpGump(Mobile from) : base(0, 0) - { - _from = from; - } + public HelpGump(Mobile from) : base(0, 0) => _from = from; protected override void BuildLayout(ref DynamicGumpBuilder builder) { - _from.CloseGump(); - var isYoung = IsYoung(_from); var totalHeight = 110 + (isYoung ? 64 : 0) + 4 * 80; @@ -211,6 +206,12 @@ public sealed class HelpGump : DynamicGump builder.AddHtmlLocalized(180, y + 150, 335, 40, 1001015); // NO - I meant to ask for help with another matter. } + public override void SendTo(NetState ns) + { + _from.CloseGump(); + base.SendTo(ns); + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void AddOption( ref DynamicGumpBuilder builder, int y, int buttonId, int localizedName, GumpButtonType type = GumpButtonType.Reply,