fix(core): Adds Gump component functionality (#377)
- [X] Adds gump close packet - [X] Fixes gump tooltip - [X] Adds new compile/append functions for the new gump packets
This commit is contained in:
parent
cc91fe2b10
commit
3b413371dc
40 changed files with 1696 additions and 137 deletions
|
|
@ -1,3 +1,5 @@
|
|||
using System.Buffers;
|
||||
using Server.Collections;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
|
|
@ -34,6 +36,9 @@ namespace Server.Gumps
|
|||
public override string Compile(NetState ns) =>
|
||||
$"{{ textentry {X} {Y} {Width} {Height} {Hue} {EntryID} {Parent.Intern(InitialText)} }}";
|
||||
|
||||
public override string Compile(OrderedHashSet<string> strings) =>
|
||||
$"{{ textentry {X} {Y} {Width} {Height} {Hue} {EntryID} {strings.GetOrAdd(InitialText)} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
|
|
@ -47,5 +52,27 @@ namespace Server.Gumps
|
|||
|
||||
disp.TextEntries++;
|
||||
}
|
||||
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
{
|
||||
writer.Write((ushort)0x7B20); // "{ "
|
||||
writer.Write(m_LayoutName);
|
||||
writer.WriteAscii(X.ToString());
|
||||
writer.Write((byte)0x20); // ' '
|
||||
writer.WriteAscii(Y.ToString());
|
||||
writer.Write((byte)0x20); // ' '
|
||||
writer.WriteAscii(Width.ToString());
|
||||
writer.Write((byte)0x20); // ' '
|
||||
writer.WriteAscii(Height.ToString());
|
||||
writer.Write((byte)0x20); // ' '
|
||||
writer.WriteAscii(Hue.ToString());
|
||||
writer.Write((byte)0x20); // ' '
|
||||
writer.WriteAscii(EntryID.ToString());
|
||||
writer.Write((byte)0x20); // ' '
|
||||
writer.WriteAscii(strings.GetOrAdd(InitialText).ToString());
|
||||
writer.Write((ushort)0x207D); // " }"
|
||||
|
||||
entries++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue