Fixes code according to modern code style. Fixes a few expression bugs.

This commit is contained in:
Kamron Batman 2018-09-15 09:58:51 -07:00
parent 89eea25e5f
commit 970fd563b2
3324 changed files with 441118 additions and 433755 deletions

View file

@ -18,157 +18,161 @@
*
***************************************************************************/
using System;
using Server.Network;
namespace Server.Gumps
{
public class GumpImageTileButton : GumpEntry
{
//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;
private int m_ID1, m_ID2;
private int m_ButtonID;
private GumpButtonType m_Type;
private int m_Param;
public class GumpImageTileButton : GumpEntry
{
private static byte[] m_LayoutName = Gump.StringToBuffer("buttontileart");
private static 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_Hue;
private int m_Width;
private int m_Height;
private int m_ItemID;
private int m_Param;
private GumpButtonType m_Type;
public GumpImageTileButton( int x, int y, int normalID, int pressedID, int buttonID, GumpButtonType type, int param, int itemID, int hue, int width, int height ) : this(x, y, normalID, pressedID, buttonID, type, param, itemID, hue, width, height, -1 )
{
}
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 )
{
m_X = x;
m_Y = y;
m_ID1 = normalID;
m_ID2 = pressedID;
m_ButtonID = buttonID;
m_Type = type;
m_Param = param;
private int m_Width;
m_ItemID = itemID;
m_Hue = hue;
m_Width = width;
m_Height = height;
//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;
LocalizedTooltip = localizedTooltip;
}
public GumpImageTileButton(int x, int y, int normalID, int pressedID, int buttonID, GumpButtonType type, int param,
int itemID, int hue, int width, int height) : this(x, y, normalID, pressedID, buttonID, type, param, itemID, hue,
width, height, -1)
{
}
public int X
{
get => m_X;
set => Delta( ref m_X, value );
}
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)
{
m_X = x;
m_Y = y;
m_ID1 = normalID;
m_ID2 = pressedID;
m_ButtonID = buttonID;
m_Type = type;
m_Param = param;
public int Y
{
get => m_Y;
set => Delta( ref m_Y, value );
}
m_ItemID = itemID;
m_Hue = hue;
m_Width = width;
m_Height = height;
public int NormalID
{
get => m_ID1;
set => Delta( ref m_ID1, value );
}
LocalizedTooltip = localizedTooltip;
}
public int PressedID
{
get => m_ID2;
set => Delta( ref m_ID2, value );
}
public int X
{
get => m_X;
set => Delta(ref m_X, value);
}
public int ButtonID
{
get => m_ButtonID;
set => Delta( ref m_ButtonID, value );
}
public int Y
{
get => m_Y;
set => Delta(ref m_Y, value);
}
public GumpButtonType Type
{
get => m_Type;
set
{
if ( m_Type != value )
{
m_Type = value;
public int NormalID
{
get => m_ID1;
set => Delta(ref m_ID1, value);
}
Gump parent = Parent;
public int PressedID
{
get => m_ID2;
set => Delta(ref m_ID2, value);
}
parent?.Invalidate();
}
}
}
public int ButtonID
{
get => m_ButtonID;
set => Delta(ref m_ButtonID, value);
}
public int Param
{
get => m_Param;
set => Delta( ref m_Param, value );
}
public GumpButtonType Type
{
get => m_Type;
set
{
if (m_Type != value)
{
m_Type = value;
public int ItemID
{
get => m_ItemID;
set => Delta( ref m_ItemID, value );
}
Gump parent = Parent;
public int Hue
{
get => m_Hue;
set => Delta( ref m_Hue, value );
}
parent?.Invalidate();
}
}
}
public int Width
{
get => m_Width;
set => Delta( ref m_Width, value );
}
public int Param
{
get => m_Param;
set => Delta(ref m_Param, value);
}
public int Height
{
get => m_Height;
set => Delta( ref m_Height, value );
}
public int ItemID
{
get => m_ItemID;
set => Delta(ref m_ItemID, value);
}
public int LocalizedTooltip { get; set; }
public int Hue
{
get => m_Hue;
set => Delta(ref m_Hue, value);
}
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} }}";
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} }}";
}
public int Width
{
get => m_Width;
set => Delta(ref m_Width, value);
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "buttontileart" );
private static byte[] m_LayoutTooltip = Gump.StringToBuffer( " }{ tooltip" );
public int Height
{
get => m_Height;
set => Delta(ref m_Height, value);
}
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 );
public int LocalizedTooltip{ get; set; }
disp.AppendLayout( m_ItemID );
disp.AppendLayout( m_Hue );
disp.AppendLayout( m_Width );
disp.AppendLayout( m_Height );
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} }}";
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} }}";
}
if ( LocalizedTooltip > 0 )
{
disp.AppendLayout( m_LayoutTooltip );
disp.AppendLayout( LocalizedTooltip );
}
}
}
}
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(m_ItemID);
disp.AppendLayout(m_Hue);
disp.AppendLayout(m_Width);
disp.AppendLayout(m_Height);
if (LocalizedTooltip > 0)
{
disp.AppendLayout(m_LayoutTooltip);
disp.AppendLayout(LocalizedTooltip);
}
}
}
}