Adds missing gump components. (#111)

This commit is contained in:
Kamron Batman 2020-04-24 21:31:31 -07:00 committed by GitHub
parent 18b7cee52a
commit c116dff3e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 531 additions and 1045 deletions

View file

@ -31,88 +31,46 @@ namespace Server.Gumps
public class GumpButton : GumpEntry
{
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("button");
private int m_ButtonID;
private int m_ID1, m_ID2;
private int m_Param;
private GumpButtonType m_Type;
private int m_X, m_Y;
public GumpButton(int x, int y, int normalID, int pressedID, int buttonID,
GumpButtonType type = GumpButtonType.Reply, int param = 0)
{
m_X = x;
m_Y = y;
m_ID1 = normalID;
m_ID2 = pressedID;
m_ButtonID = buttonID;
m_Type = type;
m_Param = param;
X = x;
Y = y;
NormalID = normalID;
PressedID = pressedID;
ButtonID = buttonID;
Type = type;
Param = param;
}
public int X
{
get => m_X;
set => Delta(ref m_X, value);
}
public int X { get; set; }
public int Y
{
get => m_Y;
set => Delta(ref m_Y, value);
}
public int Y { get; set; }
public int NormalID
{
get => m_ID1;
set => Delta(ref m_ID1, value);
}
public int NormalID { get; set; }
public int PressedID
{
get => m_ID2;
set => Delta(ref m_ID2, value);
}
public int PressedID { get; set; }
public int ButtonID
{
get => m_ButtonID;
set => Delta(ref m_ButtonID, value);
}
public int ButtonID { get; set; }
public GumpButtonType Type
{
get => m_Type;
set
{
if (m_Type != value)
{
m_Type = value;
public GumpButtonType Type { get; set; }
Gump parent = Parent;
public int Param { get; set; }
parent?.Invalidate();
}
}
}
public int Param
{
get => m_Param;
set => Delta(ref m_Param, value);
}
public override string Compile(NetState ns) => $"{{ button {m_X} {m_Y} {m_ID1} {m_ID2} {(int)m_Type} {m_Param} {m_ButtonID} }}";
public override string Compile(NetState ns) =>
$"{{ button {X} {Y} {NormalID} {PressedID} {(int)Type} {Param} {ButtonID} }}";
public override void AppendTo(NetState ns, IGumpWriter disp)
{
disp.AppendLayout(m_LayoutName);
disp.AppendLayout(m_X);
disp.AppendLayout(m_Y);
disp.AppendLayout(m_ID1);
disp.AppendLayout(m_ID2);
disp.AppendLayout((int)m_Type);
disp.AppendLayout(m_Param);
disp.AppendLayout(m_ButtonID);
disp.AppendLayout(X);
disp.AppendLayout(Y);
disp.AppendLayout(NormalID);
disp.AppendLayout(PressedID);
disp.AppendLayout((int)Type);
disp.AppendLayout(Param);
disp.AppendLayout(ButtonID);
}
}
}