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

@ -26,68 +26,39 @@ namespace Server.Gumps
{
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("buttontileart");
private static readonly byte[] m_LayoutTooltip = Gump.StringToBuffer(" }{ tooltip");
private int m_ButtonID;
private int m_Height;
private int m_Hue;
private int m_ID1, m_ID2;
private int m_ItemID;
private int m_Param;
private GumpButtonType m_Type;
private int m_Width;
//Note, on OSI, The tooltip supports ONLY clilocs as far as I can figure out, and the tooltip ONLY works after the buttonTileArt (as far as I can tell from testing)
private int m_X, m_Y;
// Note, on OSI, The tooltip supports ONLY clilocs as far as I can figure out, and the tooltip ONLY works after the buttonTileArt (as far as I can tell from testing)
public GumpImageTileButton(int x, int y, int normalID, int pressedID, int buttonID, GumpButtonType type, int param,
int itemID, int hue, int width, int height, int localizedTooltip = -1)
{
m_X = x;
m_Y = y;
m_ID1 = normalID;
m_ID2 = pressedID;
m_ButtonID = buttonID;
X = x;
Y = y;
NormalID = normalID;
PressedID = pressedID;
ButtonID = buttonID;
m_Type = type;
m_Param = param;
Param = param;
m_ItemID = itemID;
m_Hue = hue;
m_Width = width;
m_Height = height;
ItemID = itemID;
Hue = hue;
Width = width;
Height = height;
LocalizedTooltip = localizedTooltip;
}
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
{
@ -98,69 +69,47 @@ namespace Server.Gumps
{
m_Type = value;
Gump parent = Parent;
parent?.Invalidate();
var parent = Parent;
}
}
}
public int Param
{
get => m_Param;
set => Delta(ref m_Param, value);
}
public int Param { get; set; }
public int ItemID
{
get => m_ItemID;
set => Delta(ref m_ItemID, value);
}
public int ItemID { get; set; }
public int Hue
{
get => m_Hue;
set => Delta(ref m_Hue, value);
}
public int Hue { get; set; }
public int Width
{
get => m_Width;
set => Delta(ref m_Width, value);
}
public int Width { get; set; }
public int Height
{
get => m_Height;
set => Delta(ref m_Height, value);
}
public int Height { get; set; }
public int LocalizedTooltip{ get; set; }
public int LocalizedTooltip { get; set; }
public override string Compile(NetState ns)
{
if (LocalizedTooltip > 0)
return
$"{{ buttontileart {m_X} {m_Y} {m_ID1} {m_ID2} {(int)m_Type} {m_Param} {m_ButtonID} {m_ItemID} {m_Hue} {m_Width} {m_Height} }}{{ tooltip {LocalizedTooltip} }}";
$"{{ buttontileart {X} {Y} {NormalID} {PressedID} {(int)m_Type} {Param} {ButtonID} {ItemID} {Hue} {Width} {Height} }}{{ tooltip {LocalizedTooltip} }}";
return
$"{{ buttontileart {m_X} {m_Y} {m_ID1} {m_ID2} {(int)m_Type} {m_Param} {m_ButtonID} {m_ItemID} {m_Hue} {m_Width} {m_Height} }}";
$"{{ buttontileart {X} {Y} {NormalID} {PressedID} {(int)m_Type} {Param} {ButtonID} {ItemID} {Hue} {Width} {Height} }}";
}
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(X);
disp.AppendLayout(Y);
disp.AppendLayout(NormalID);
disp.AppendLayout(PressedID);
disp.AppendLayout((int)m_Type);
disp.AppendLayout(m_Param);
disp.AppendLayout(m_ButtonID);
disp.AppendLayout(Param);
disp.AppendLayout(ButtonID);
disp.AppendLayout(m_ItemID);
disp.AppendLayout(m_Hue);
disp.AppendLayout(m_Width);
disp.AppendLayout(m_Height);
disp.AppendLayout(ItemID);
disp.AppendLayout(Hue);
disp.AppendLayout(Width);
disp.AppendLayout(Height);
if (LocalizedTooltip > 0)
{