This reverts commit 179cb50557.
This commit is contained in:
parent
179cb50557
commit
c2ecc76457
588 changed files with 16260 additions and 10926 deletions
|
|
@ -18,66 +18,86 @@
|
|||
*
|
||||
***************************************************************************/
|
||||
|
||||
using System.Buffers;
|
||||
using Server.Buffers;
|
||||
using Server.Collections;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpTextEntry : GumpEntry
|
||||
{
|
||||
private static byte[] m_LayoutName = Gump.StringToBuffer("textentry");
|
||||
private int m_EntryID;
|
||||
private int m_Hue;
|
||||
private string m_InitialText;
|
||||
private int m_Width, m_Height;
|
||||
private int m_X, m_Y;
|
||||
|
||||
public GumpTextEntry(int x, int y, int width, int height, int hue, int entryID, string initialText)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Hue = hue;
|
||||
EntryID = entryID;
|
||||
InitialText = initialText;
|
||||
m_X = x;
|
||||
m_Y = y;
|
||||
m_Width = width;
|
||||
m_Height = height;
|
||||
m_Hue = hue;
|
||||
m_EntryID = entryID;
|
||||
m_InitialText = initialText;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
public int X
|
||||
{
|
||||
get => m_X;
|
||||
set => Delta(ref m_X, value);
|
||||
}
|
||||
|
||||
public int Y { get; set; }
|
||||
public int Y
|
||||
{
|
||||
get => m_Y;
|
||||
set => Delta(ref m_Y, value);
|
||||
}
|
||||
|
||||
public int Width { get; set; }
|
||||
public int Width
|
||||
{
|
||||
get => m_Width;
|
||||
set => Delta(ref m_Width, value);
|
||||
}
|
||||
|
||||
public int Height { get; set; }
|
||||
public int Height
|
||||
{
|
||||
get => m_Height;
|
||||
set => Delta(ref m_Height, value);
|
||||
}
|
||||
|
||||
public int Hue { get; set; }
|
||||
public int Hue
|
||||
{
|
||||
get => m_Hue;
|
||||
set => Delta(ref m_Hue, value);
|
||||
}
|
||||
|
||||
public int EntryID { get; set; }
|
||||
public int EntryID
|
||||
{
|
||||
get => m_EntryID;
|
||||
set => Delta(ref m_EntryID, value);
|
||||
}
|
||||
|
||||
public string InitialText { get; set; }
|
||||
public string InitialText
|
||||
{
|
||||
get => m_InitialText;
|
||||
set => Delta(ref m_InitialText, value);
|
||||
}
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ textentry {m_X} {m_Y} {m_Width} {m_Height} {m_Hue} {m_EntryID} {Parent.Intern(m_InitialText)} }}";
|
||||
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer(" { textentry ");
|
||||
|
||||
public override void AppendTo(ArrayBufferWriter<byte> buffer, ArraySet<string> strings, ref int entries, ref int switches)
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
SpanWriter writer = new SpanWriter(buffer.GetSpan(90));
|
||||
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.Add(InitialText).ToString());
|
||||
writer.Write((byte)0x20); // ' '
|
||||
writer.Write((byte)0x7D); // '}'
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(m_X);
|
||||
disp.AppendLayout(m_Y);
|
||||
disp.AppendLayout(m_Width);
|
||||
disp.AppendLayout(m_Height);
|
||||
disp.AppendLayout(m_Hue);
|
||||
disp.AppendLayout(m_EntryID);
|
||||
disp.AppendLayout(Parent.Intern(m_InitialText));
|
||||
|
||||
buffer.Advance(writer.WrittenCount);
|
||||
|
||||
entries++;
|
||||
disp.TextEntries++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue