This reverts commit 179cb50557.
This commit is contained in:
parent
179cb50557
commit
c2ecc76457
588 changed files with 16260 additions and 10926 deletions
|
|
@ -18,58 +18,77 @@
|
|||
*
|
||||
***************************************************************************/
|
||||
|
||||
using System.Buffers;
|
||||
using Server.Buffers;
|
||||
using Server.Collections;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpCheck : GumpEntry
|
||||
{
|
||||
private static byte[] m_LayoutName = Gump.StringToBuffer("checkbox");
|
||||
private int m_ID1, m_ID2;
|
||||
private bool m_InitialState;
|
||||
private int m_SwitchID;
|
||||
private int m_X, m_Y;
|
||||
|
||||
public GumpCheck(int x, int y, int inactiveID, int activeID, bool initialState, int switchID)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
InactiveID = inactiveID;
|
||||
ActiveID = activeID;
|
||||
InitialState = initialState;
|
||||
SwitchID = switchID;
|
||||
m_X = x;
|
||||
m_Y = y;
|
||||
m_ID1 = inactiveID;
|
||||
m_ID2 = activeID;
|
||||
m_InitialState = initialState;
|
||||
m_SwitchID = switchID;
|
||||
}
|
||||
|
||||
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 InactiveID { get; set; }
|
||||
public int InactiveID
|
||||
{
|
||||
get => m_ID1;
|
||||
set => Delta(ref m_ID1, value);
|
||||
}
|
||||
|
||||
public int ActiveID { get; set; }
|
||||
public int ActiveID
|
||||
{
|
||||
get => m_ID2;
|
||||
set => Delta(ref m_ID2, value);
|
||||
}
|
||||
|
||||
public bool InitialState { get; set; }
|
||||
public bool InitialState
|
||||
{
|
||||
get => m_InitialState;
|
||||
set => Delta(ref m_InitialState, value);
|
||||
}
|
||||
|
||||
public int SwitchID { get; set; }
|
||||
public int SwitchID
|
||||
{
|
||||
get => m_SwitchID;
|
||||
set => Delta(ref m_SwitchID, value);
|
||||
}
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ checkbox {m_X} {m_Y} {m_ID1} {m_ID2} {(m_InitialState ? 1 : 0)} {m_SwitchID} }}";
|
||||
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("{ checkbox ");
|
||||
|
||||
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(69));
|
||||
writer.Write(m_LayoutName);
|
||||
writer.WriteAscii(X.ToString());
|
||||
writer.Write((byte)0x20); // ' '
|
||||
writer.WriteAscii(Y.ToString());
|
||||
writer.Write((byte)0x20); // ' '
|
||||
writer.WriteAscii(InactiveID.ToString());
|
||||
writer.Write((byte)0x20); // ' '
|
||||
writer.WriteAscii(ActiveID.ToString());
|
||||
writer.Write((byte)0x20); // ' '
|
||||
writer.WriteAscii(InitialState ? "1" : "0");
|
||||
writer.Write((byte)0x20); // ' '
|
||||
writer.WriteAscii(SwitchID.ToString());
|
||||
writer.Write((byte)0x20); // ' '
|
||||
writer.Write((byte)0x7D); // '}'
|
||||
buffer.Advance(writer.WrittenCount);
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(m_X);
|
||||
disp.AppendLayout(m_Y);
|
||||
disp.AppendLayout(m_ID1);
|
||||
disp.AppendLayout(m_ID2);
|
||||
disp.AppendLayout(m_InitialState);
|
||||
disp.AppendLayout(m_SwitchID);
|
||||
|
||||
disp.Switches++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue