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

@ -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,