Adds missing gump components. (#111)
This commit is contained in:
parent
18b7cee52a
commit
c116dff3e8
25 changed files with 531 additions and 1045 deletions
|
|
@ -34,12 +34,7 @@ namespace Server.Gumps
|
|||
private static readonly byte[] m_LayoutNamePlain = Gump.StringToBuffer("xmfhtmlgump");
|
||||
private static readonly byte[] m_LayoutNameColor = Gump.StringToBuffer("xmfhtmlgumpcolor");
|
||||
private static readonly byte[] m_LayoutNameArgs = Gump.StringToBuffer("xmfhtmltok");
|
||||
private string m_Args;
|
||||
private bool m_Background, m_Scrollbar;
|
||||
private int m_Color;
|
||||
private int m_Number;
|
||||
|
||||
private GumpHtmlLocalizedType m_Type;
|
||||
private int m_Width, m_Height;
|
||||
private int m_X, m_Y;
|
||||
|
||||
|
|
@ -50,11 +45,11 @@ namespace Server.Gumps
|
|||
m_Y = y;
|
||||
m_Width = width;
|
||||
m_Height = height;
|
||||
m_Number = number;
|
||||
m_Background = background;
|
||||
m_Scrollbar = scrollbar;
|
||||
Number = number;
|
||||
Background = background;
|
||||
Scrollbar = scrollbar;
|
||||
|
||||
m_Type = GumpHtmlLocalizedType.Plain;
|
||||
Type = GumpHtmlLocalizedType.Plain;
|
||||
}
|
||||
|
||||
public GumpHtmlLocalized(int x, int y, int width, int height, int number, int color,
|
||||
|
|
@ -64,12 +59,12 @@ namespace Server.Gumps
|
|||
m_Y = y;
|
||||
m_Width = width;
|
||||
m_Height = height;
|
||||
m_Number = number;
|
||||
m_Color = color;
|
||||
m_Background = background;
|
||||
m_Scrollbar = scrollbar;
|
||||
Number = number;
|
||||
Color = color;
|
||||
Background = background;
|
||||
Scrollbar = scrollbar;
|
||||
|
||||
m_Type = GumpHtmlLocalizedType.Color;
|
||||
Type = GumpHtmlLocalizedType.Color;
|
||||
}
|
||||
|
||||
public GumpHtmlLocalized(int x, int y, int width, int height, int number, string args, int color,
|
||||
|
|
@ -81,147 +76,99 @@ namespace Server.Gumps
|
|||
m_Y = y;
|
||||
m_Width = width;
|
||||
m_Height = height;
|
||||
m_Number = number;
|
||||
m_Args = args;
|
||||
m_Color = color;
|
||||
m_Background = background;
|
||||
m_Scrollbar = scrollbar;
|
||||
Number = number;
|
||||
Args = args;
|
||||
Color = color;
|
||||
Background = background;
|
||||
Scrollbar = scrollbar;
|
||||
|
||||
m_Type = GumpHtmlLocalizedType.Args;
|
||||
Type = GumpHtmlLocalizedType.Args;
|
||||
}
|
||||
|
||||
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 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 Number
|
||||
{
|
||||
get => m_Number;
|
||||
set => Delta(ref m_Number, value);
|
||||
}
|
||||
public int Number { get; set; }
|
||||
|
||||
public string Args
|
||||
{
|
||||
get => m_Args;
|
||||
set => Delta(ref m_Args, value);
|
||||
}
|
||||
public string Args { get; set; }
|
||||
|
||||
public int Color
|
||||
{
|
||||
get => m_Color;
|
||||
set => Delta(ref m_Color, value);
|
||||
}
|
||||
public int Color { get; set; }
|
||||
|
||||
public bool Background
|
||||
{
|
||||
get => m_Background;
|
||||
set => Delta(ref m_Background, value);
|
||||
}
|
||||
public bool Background { get; set; }
|
||||
|
||||
public bool Scrollbar
|
||||
{
|
||||
get => m_Scrollbar;
|
||||
set => Delta(ref m_Scrollbar, value);
|
||||
}
|
||||
public bool Scrollbar { get; set; }
|
||||
|
||||
public GumpHtmlLocalizedType Type
|
||||
{
|
||||
get => m_Type;
|
||||
set
|
||||
{
|
||||
if (m_Type != value)
|
||||
{
|
||||
m_Type = value;
|
||||
|
||||
Parent?.Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
public GumpHtmlLocalizedType Type { get; set; }
|
||||
|
||||
public override string Compile(NetState ns)
|
||||
{
|
||||
return m_Type switch
|
||||
return Type switch
|
||||
{
|
||||
GumpHtmlLocalizedType.Plain =>
|
||||
$"{{ xmfhtmlgump {m_X} {m_Y} {m_Width} {m_Height} {m_Number} {(m_Background ? 1 : 0)} {(m_Scrollbar ? 1 : 0)} }}",
|
||||
$"{{ xmfhtmlgump {X} {Y} {Width} {Height} {Number} {(Background ? 1 : 0)} {(Scrollbar ? 1 : 0)} }}",
|
||||
GumpHtmlLocalizedType.Color =>
|
||||
$"{{ xmfhtmlgumpcolor {m_X} {m_Y} {m_Width} {m_Height} {m_Number} {(m_Background ? 1 : 0)} {(m_Scrollbar ? 1 : 0)} {m_Color} }}",
|
||||
$"{{ xmfhtmlgumpcolor {X} {Y} {Width} {Height} {Number} {(Background ? 1 : 0)} {(Scrollbar ? 1 : 0)} {Color} }}",
|
||||
_ =>
|
||||
$"{{ xmfhtmltok {m_X} {m_Y} {m_Width} {m_Height} {(m_Background ? 1 : 0)} {(m_Scrollbar ? 1 : 0)} {m_Color} {m_Number} @{m_Args}@ }}"
|
||||
$"{{ xmfhtmltok {X} {Y} {Width} {Height} {(Background ? 1 : 0)} {(Scrollbar ? 1 : 0)} {Color} {Number} @{Args}@ }}"
|
||||
};
|
||||
}
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
switch (m_Type)
|
||||
switch (Type)
|
||||
{
|
||||
case GumpHtmlLocalizedType.Plain:
|
||||
{
|
||||
disp.AppendLayout(m_LayoutNamePlain);
|
||||
{
|
||||
disp.AppendLayout(m_LayoutNamePlain);
|
||||
|
||||
disp.AppendLayout(m_X);
|
||||
disp.AppendLayout(m_Y);
|
||||
disp.AppendLayout(m_Width);
|
||||
disp.AppendLayout(m_Height);
|
||||
disp.AppendLayout(m_Number);
|
||||
disp.AppendLayout(m_Background);
|
||||
disp.AppendLayout(m_Scrollbar);
|
||||
disp.AppendLayout(m_X);
|
||||
disp.AppendLayout(m_Y);
|
||||
disp.AppendLayout(m_Width);
|
||||
disp.AppendLayout(m_Height);
|
||||
disp.AppendLayout(Number);
|
||||
disp.AppendLayout(Background);
|
||||
disp.AppendLayout(Scrollbar);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case GumpHtmlLocalizedType.Color:
|
||||
{
|
||||
disp.AppendLayout(m_LayoutNameColor);
|
||||
{
|
||||
disp.AppendLayout(m_LayoutNameColor);
|
||||
|
||||
disp.AppendLayout(m_X);
|
||||
disp.AppendLayout(m_Y);
|
||||
disp.AppendLayout(m_Width);
|
||||
disp.AppendLayout(m_Height);
|
||||
disp.AppendLayout(m_Number);
|
||||
disp.AppendLayout(m_Background);
|
||||
disp.AppendLayout(m_Scrollbar);
|
||||
disp.AppendLayout(m_Color);
|
||||
disp.AppendLayout(m_X);
|
||||
disp.AppendLayout(m_Y);
|
||||
disp.AppendLayout(m_Width);
|
||||
disp.AppendLayout(m_Height);
|
||||
disp.AppendLayout(Number);
|
||||
disp.AppendLayout(Background);
|
||||
disp.AppendLayout(Scrollbar);
|
||||
disp.AppendLayout(Color);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case GumpHtmlLocalizedType.Args:
|
||||
{
|
||||
disp.AppendLayout(m_LayoutNameArgs);
|
||||
{
|
||||
disp.AppendLayout(m_LayoutNameArgs);
|
||||
|
||||
disp.AppendLayout(m_X);
|
||||
disp.AppendLayout(m_Y);
|
||||
disp.AppendLayout(m_Width);
|
||||
disp.AppendLayout(m_Height);
|
||||
disp.AppendLayout(m_Background);
|
||||
disp.AppendLayout(m_Scrollbar);
|
||||
disp.AppendLayout(m_Color);
|
||||
disp.AppendLayout(m_Number);
|
||||
disp.AppendLayout(m_Args);
|
||||
disp.AppendLayout(m_X);
|
||||
disp.AppendLayout(m_Y);
|
||||
disp.AppendLayout(m_Width);
|
||||
disp.AppendLayout(m_Height);
|
||||
disp.AppendLayout(Background);
|
||||
disp.AppendLayout(Scrollbar);
|
||||
disp.AppendLayout(Color);
|
||||
disp.AppendLayout(Number);
|
||||
disp.AppendLayout(Args);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue