fix: Fixes craft/help gump not appearing (#1845)

This commit is contained in:
Kamron Batman 2024-06-23 09:54:04 -07:00 • committed by GitHub
parent b8ad5c671d
commit 3b84c8052c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 12 deletions

View file

@ -39,9 +39,6 @@ public class CraftGump : DynamicGump
{
var context = _craftSystem.GetContext(_from);
_from.CloseGump<CraftGump>();
_from.CloseGump<CraftGumpItem>();
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<CraftGump>();
_from.CloseGump<CraftGumpItem>();
base.SendTo(ns);
}
public static int GetButtonID(int type, int index) => 1 + type + index * 7;

View file

@ -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<HelpGump>();
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<HelpGump>();
base.SendTo(ns);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static void AddOption(
ref DynamicGumpBuilder builder, int y, int buttonId, int localizedName, GumpButtonType type = GumpButtonType.Reply,