Fixes formatting (#200)
This commit is contained in:
parent
1f651992d7
commit
86b7b3aed1
209 changed files with 51326 additions and 50397 deletions
|
|
@ -1,291 +1,317 @@
|
|||
/***************************************************************************
|
||||
* Gump.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class Gump
|
||||
{
|
||||
private static uint m_NextSerial = 1;
|
||||
|
||||
private static readonly byte[] m_BeginLayout = StringToBuffer("{ ");
|
||||
private static readonly byte[] m_EndLayout = StringToBuffer(" }");
|
||||
|
||||
private static readonly byte[] m_NoMove = StringToBuffer("{ nomove }");
|
||||
private static readonly byte[] m_NoClose = StringToBuffer("{ noclose }");
|
||||
private static readonly byte[] m_NoDispose = StringToBuffer("{ nodispose }");
|
||||
private static readonly byte[] m_NoResize = StringToBuffer("{ noresize }");
|
||||
|
||||
public List<string> Strings { get; }
|
||||
|
||||
internal int m_TextEntries, m_Switches;
|
||||
|
||||
public Gump(int x, int y)
|
||||
{
|
||||
do
|
||||
{
|
||||
Serial = m_NextSerial++;
|
||||
} while (Serial == 0); // standard client apparently doesn't send a gump response packet if serial == 0
|
||||
|
||||
X = x;
|
||||
Y = y;
|
||||
|
||||
TypeID = GetTypeID(GetType());
|
||||
|
||||
Entries = new List<GumpEntry>();
|
||||
Strings = new List<string>();
|
||||
}
|
||||
|
||||
public int TypeID { get; }
|
||||
|
||||
public List<GumpEntry> Entries { get; }
|
||||
|
||||
public uint Serial { get; set; }
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public bool Disposable { get; set; } = true;
|
||||
|
||||
public bool Resizable { get; set; } = true;
|
||||
|
||||
public bool Draggable { get; set; } = true;
|
||||
|
||||
public bool Closable { get; set; } = true;
|
||||
|
||||
public static int GetTypeID(Type type) => type?.FullName?.GetHashCode() ?? -1;
|
||||
|
||||
public void AddPage(int page)
|
||||
{
|
||||
Add(new GumpPage(page));
|
||||
}
|
||||
|
||||
public void AddAlphaRegion(int x, int y, int width, int height)
|
||||
{
|
||||
Add(new GumpAlphaRegion(x, y, width, height));
|
||||
}
|
||||
|
||||
public void AddBackground(int x, int y, int width, int height, int gumpID)
|
||||
{
|
||||
Add(new GumpBackground(x, y, width, height, gumpID));
|
||||
}
|
||||
|
||||
public void AddButton(int x, int y, int normalID, int pressedID, int buttonID,
|
||||
GumpButtonType type = GumpButtonType.Reply, int param = 0)
|
||||
{
|
||||
Add(new GumpButton(x, y, normalID, pressedID, buttonID, type, param));
|
||||
}
|
||||
|
||||
public void AddCheck(int x, int y, int inactiveID, int activeID, bool initialState, int switchID)
|
||||
{
|
||||
Add(new GumpCheck(x, y, inactiveID, activeID, initialState, switchID));
|
||||
}
|
||||
|
||||
public void AddGroup(int group)
|
||||
{
|
||||
Add(new GumpGroup(group));
|
||||
}
|
||||
|
||||
public void AddTooltip(int number, string args = null)
|
||||
{
|
||||
Add(new GumpTooltip(number, args));
|
||||
}
|
||||
|
||||
public void AddHtml(int x, int y, int width, int height, string text, bool background = false, bool scrollbar = false)
|
||||
{
|
||||
Add(new GumpHtml(x, y, width, height, text, background, scrollbar));
|
||||
}
|
||||
|
||||
public void AddHtmlLocalized(int x, int y, int width, int height, int number, bool background = false,
|
||||
bool scrollbar = false)
|
||||
{
|
||||
Add(new GumpHtmlLocalized(x, y, width, height, number, background, scrollbar));
|
||||
}
|
||||
|
||||
public void AddHtmlLocalized(int x, int y, int width, int height, int number, int color, bool background = false,
|
||||
bool scrollbar = false)
|
||||
{
|
||||
Add(new GumpHtmlLocalized(x, y, width, height, number, color, background, scrollbar));
|
||||
}
|
||||
|
||||
public void AddHtmlLocalized(int x, int y, int width, int height, int number, string args, int color,
|
||||
bool background = false, bool scrollbar = false)
|
||||
{
|
||||
Add(new GumpHtmlLocalized(x, y, width, height, number, args, color, background, scrollbar));
|
||||
}
|
||||
|
||||
public void AddImage(int x, int y, int gumpID, int hue = 0)
|
||||
{
|
||||
Add(new GumpImage(x, y, gumpID, hue));
|
||||
}
|
||||
|
||||
public void AddImageTiled(int x, int y, int width, int height, int gumpID)
|
||||
{
|
||||
Add(new GumpImageTiled(x, y, width, height, gumpID));
|
||||
}
|
||||
|
||||
public void AddImageTiledButton(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)
|
||||
{
|
||||
Add(new GumpImageTileButton(x, y, normalID, pressedID, buttonID, type, param, itemID, hue, width, height,
|
||||
localizedTooltip));
|
||||
}
|
||||
|
||||
public void AddItem(int x, int y, int itemID, int hue = 0)
|
||||
{
|
||||
Add(new GumpItem(x, y, itemID, hue));
|
||||
}
|
||||
|
||||
public void AddLabel(int x, int y, int hue, string text)
|
||||
{
|
||||
Add(new GumpLabel(x, y, hue, text));
|
||||
}
|
||||
|
||||
public void AddLabelCropped(int x, int y, int width, int height, int hue, string text)
|
||||
{
|
||||
Add(new GumpLabelCropped(x, y, width, height, hue, text));
|
||||
}
|
||||
|
||||
public void AddRadio(int x, int y, int inactiveID, int activeID, bool initialState, int switchID)
|
||||
{
|
||||
Add(new GumpRadio(x, y, inactiveID, activeID, initialState, switchID));
|
||||
}
|
||||
|
||||
public void AddTextEntry(int x, int y, int width, int height, int hue, int entryID, string initialText)
|
||||
{
|
||||
Add(new GumpTextEntry(x, y, width, height, hue, entryID, initialText));
|
||||
}
|
||||
|
||||
public void AddTextEntry(int x, int y, int width, int height, int hue, int entryID, string initialText, int size)
|
||||
{
|
||||
Add(new GumpTextEntryLimited(x, y, width, height, hue, entryID, initialText, size));
|
||||
}
|
||||
|
||||
public void AddItemProperty(uint serial)
|
||||
{
|
||||
Add(new GumpItemProperty(serial));
|
||||
}
|
||||
|
||||
public void AddSpriteImage(int x, int y, int gumpID, int width, int height, int sx, int sy)
|
||||
{
|
||||
Add(new GumpSpriteImage(x, y, gumpID, width, height, sx, sy));
|
||||
}
|
||||
|
||||
public void AddECHandleInput()
|
||||
{
|
||||
Add(new GumpECHandleInput());
|
||||
}
|
||||
|
||||
public void AddGumpIDOverride(int gumpID)
|
||||
{
|
||||
Add(new GumpMasterGump(gumpID));
|
||||
}
|
||||
|
||||
public void Add(GumpEntry g)
|
||||
{
|
||||
if (g.Parent != this)
|
||||
g.Parent = this;
|
||||
else if (!Entries.Contains(g))
|
||||
Entries.Add(g);
|
||||
}
|
||||
|
||||
public void Remove(GumpEntry g)
|
||||
{
|
||||
if (g == null || !Entries.Contains(g))
|
||||
return;
|
||||
|
||||
Entries.Remove(g);
|
||||
g.Parent = null;
|
||||
}
|
||||
|
||||
public int Intern(string value)
|
||||
{
|
||||
var indexOf = Strings.IndexOf(value);
|
||||
|
||||
if (indexOf >= 0) return indexOf;
|
||||
|
||||
Strings.Add(value);
|
||||
return Strings.Count - 1;
|
||||
}
|
||||
|
||||
public void SendTo(NetState state)
|
||||
{
|
||||
state.AddGump(this);
|
||||
state.Send(Compile(state));
|
||||
}
|
||||
|
||||
public static byte[] StringToBuffer(string str) => Encoding.ASCII.GetBytes(str);
|
||||
|
||||
public Packet Compile(NetState ns = null)
|
||||
{
|
||||
IGumpWriter disp;
|
||||
|
||||
if (ns?.Unpack == true)
|
||||
disp = new DisplayGumpPacked(this);
|
||||
else
|
||||
disp = new DisplayGumpFast(this);
|
||||
|
||||
if (!Draggable)
|
||||
disp.AppendLayout(m_NoMove);
|
||||
|
||||
if (!Closable)
|
||||
disp.AppendLayout(m_NoClose);
|
||||
|
||||
if (!Disposable)
|
||||
disp.AppendLayout(m_NoDispose);
|
||||
|
||||
if (!Resizable)
|
||||
disp.AppendLayout(m_NoResize);
|
||||
|
||||
var count = Entries.Count;
|
||||
|
||||
for (var i = 0; i < count; ++i)
|
||||
{
|
||||
var e = Entries[i];
|
||||
|
||||
disp.AppendLayout(m_BeginLayout);
|
||||
e.AppendTo(ns, disp);
|
||||
disp.AppendLayout(m_EndLayout);
|
||||
}
|
||||
|
||||
disp.WriteStrings(Strings);
|
||||
|
||||
disp.Flush();
|
||||
|
||||
m_TextEntries = disp.TextEntries;
|
||||
m_Switches = disp.Switches;
|
||||
|
||||
return (Packet)disp;
|
||||
}
|
||||
|
||||
public virtual void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnServerClose(NetState owner)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* Gump.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class Gump
|
||||
{
|
||||
private static uint m_NextSerial = 1;
|
||||
|
||||
private static readonly byte[] m_BeginLayout = StringToBuffer("{ ");
|
||||
private static readonly byte[] m_EndLayout = StringToBuffer(" }");
|
||||
|
||||
private static readonly byte[] m_NoMove = StringToBuffer("{ nomove }");
|
||||
private static readonly byte[] m_NoClose = StringToBuffer("{ noclose }");
|
||||
private static readonly byte[] m_NoDispose = StringToBuffer("{ nodispose }");
|
||||
private static readonly byte[] m_NoResize = StringToBuffer("{ noresize }");
|
||||
|
||||
internal int m_TextEntries, m_Switches;
|
||||
|
||||
public Gump(int x, int y)
|
||||
{
|
||||
do
|
||||
{
|
||||
Serial = m_NextSerial++;
|
||||
} while (Serial == 0); // standard client apparently doesn't send a gump response packet if serial == 0
|
||||
|
||||
X = x;
|
||||
Y = y;
|
||||
|
||||
TypeID = GetTypeID(GetType());
|
||||
|
||||
Entries = new List<GumpEntry>();
|
||||
Strings = new List<string>();
|
||||
}
|
||||
|
||||
public List<string> Strings { get; }
|
||||
|
||||
public int TypeID { get; }
|
||||
|
||||
public List<GumpEntry> Entries { get; }
|
||||
|
||||
public uint Serial { get; set; }
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public bool Disposable { get; set; } = true;
|
||||
|
||||
public bool Resizable { get; set; } = true;
|
||||
|
||||
public bool Draggable { get; set; } = true;
|
||||
|
||||
public bool Closable { get; set; } = true;
|
||||
|
||||
public static int GetTypeID(Type type) => type?.FullName?.GetHashCode() ?? -1;
|
||||
|
||||
public void AddPage(int page)
|
||||
{
|
||||
Add(new GumpPage(page));
|
||||
}
|
||||
|
||||
public void AddAlphaRegion(int x, int y, int width, int height)
|
||||
{
|
||||
Add(new GumpAlphaRegion(x, y, width, height));
|
||||
}
|
||||
|
||||
public void AddBackground(int x, int y, int width, int height, int gumpID)
|
||||
{
|
||||
Add(new GumpBackground(x, y, width, height, gumpID));
|
||||
}
|
||||
|
||||
public void AddButton(
|
||||
int x, int y, int normalID, int pressedID, int buttonID,
|
||||
GumpButtonType type = GumpButtonType.Reply, int param = 0
|
||||
)
|
||||
{
|
||||
Add(new GumpButton(x, y, normalID, pressedID, buttonID, type, param));
|
||||
}
|
||||
|
||||
public void AddCheck(int x, int y, int inactiveID, int activeID, bool initialState, int switchID)
|
||||
{
|
||||
Add(new GumpCheck(x, y, inactiveID, activeID, initialState, switchID));
|
||||
}
|
||||
|
||||
public void AddGroup(int group)
|
||||
{
|
||||
Add(new GumpGroup(group));
|
||||
}
|
||||
|
||||
public void AddTooltip(int number, string args = null)
|
||||
{
|
||||
Add(new GumpTooltip(number, args));
|
||||
}
|
||||
|
||||
public void AddHtml(
|
||||
int x, int y, int width, int height, string text, bool background = false, bool scrollbar = false
|
||||
)
|
||||
{
|
||||
Add(new GumpHtml(x, y, width, height, text, background, scrollbar));
|
||||
}
|
||||
|
||||
public void AddHtmlLocalized(
|
||||
int x, int y, int width, int height, int number, bool background = false,
|
||||
bool scrollbar = false
|
||||
)
|
||||
{
|
||||
Add(new GumpHtmlLocalized(x, y, width, height, number, background, scrollbar));
|
||||
}
|
||||
|
||||
public void AddHtmlLocalized(
|
||||
int x, int y, int width, int height, int number, int color, bool background = false,
|
||||
bool scrollbar = false
|
||||
)
|
||||
{
|
||||
Add(new GumpHtmlLocalized(x, y, width, height, number, color, background, scrollbar));
|
||||
}
|
||||
|
||||
public void AddHtmlLocalized(
|
||||
int x, int y, int width, int height, int number, string args, int color,
|
||||
bool background = false, bool scrollbar = false
|
||||
)
|
||||
{
|
||||
Add(new GumpHtmlLocalized(x, y, width, height, number, args, color, background, scrollbar));
|
||||
}
|
||||
|
||||
public void AddImage(int x, int y, int gumpID, int hue = 0)
|
||||
{
|
||||
Add(new GumpImage(x, y, gumpID, hue));
|
||||
}
|
||||
|
||||
public void AddImageTiled(int x, int y, int width, int height, int gumpID)
|
||||
{
|
||||
Add(new GumpImageTiled(x, y, width, height, gumpID));
|
||||
}
|
||||
|
||||
public void AddImageTiledButton(
|
||||
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
|
||||
)
|
||||
{
|
||||
Add(
|
||||
new GumpImageTileButton(
|
||||
x,
|
||||
y,
|
||||
normalID,
|
||||
pressedID,
|
||||
buttonID,
|
||||
type,
|
||||
param,
|
||||
itemID,
|
||||
hue,
|
||||
width,
|
||||
height,
|
||||
localizedTooltip
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public void AddItem(int x, int y, int itemID, int hue = 0)
|
||||
{
|
||||
Add(new GumpItem(x, y, itemID, hue));
|
||||
}
|
||||
|
||||
public void AddLabel(int x, int y, int hue, string text)
|
||||
{
|
||||
Add(new GumpLabel(x, y, hue, text));
|
||||
}
|
||||
|
||||
public void AddLabelCropped(int x, int y, int width, int height, int hue, string text)
|
||||
{
|
||||
Add(new GumpLabelCropped(x, y, width, height, hue, text));
|
||||
}
|
||||
|
||||
public void AddRadio(int x, int y, int inactiveID, int activeID, bool initialState, int switchID)
|
||||
{
|
||||
Add(new GumpRadio(x, y, inactiveID, activeID, initialState, switchID));
|
||||
}
|
||||
|
||||
public void AddTextEntry(int x, int y, int width, int height, int hue, int entryID, string initialText)
|
||||
{
|
||||
Add(new GumpTextEntry(x, y, width, height, hue, entryID, initialText));
|
||||
}
|
||||
|
||||
public void AddTextEntry(int x, int y, int width, int height, int hue, int entryID, string initialText, int size)
|
||||
{
|
||||
Add(new GumpTextEntryLimited(x, y, width, height, hue, entryID, initialText, size));
|
||||
}
|
||||
|
||||
public void AddItemProperty(uint serial)
|
||||
{
|
||||
Add(new GumpItemProperty(serial));
|
||||
}
|
||||
|
||||
public void AddSpriteImage(int x, int y, int gumpID, int width, int height, int sx, int sy)
|
||||
{
|
||||
Add(new GumpSpriteImage(x, y, gumpID, width, height, sx, sy));
|
||||
}
|
||||
|
||||
public void AddECHandleInput()
|
||||
{
|
||||
Add(new GumpECHandleInput());
|
||||
}
|
||||
|
||||
public void AddGumpIDOverride(int gumpID)
|
||||
{
|
||||
Add(new GumpMasterGump(gumpID));
|
||||
}
|
||||
|
||||
public void Add(GumpEntry g)
|
||||
{
|
||||
if (g.Parent != this)
|
||||
g.Parent = this;
|
||||
else if (!Entries.Contains(g))
|
||||
Entries.Add(g);
|
||||
}
|
||||
|
||||
public void Remove(GumpEntry g)
|
||||
{
|
||||
if (g == null || !Entries.Contains(g))
|
||||
return;
|
||||
|
||||
Entries.Remove(g);
|
||||
g.Parent = null;
|
||||
}
|
||||
|
||||
public int Intern(string value)
|
||||
{
|
||||
var indexOf = Strings.IndexOf(value);
|
||||
|
||||
if (indexOf >= 0) return indexOf;
|
||||
|
||||
Strings.Add(value);
|
||||
return Strings.Count - 1;
|
||||
}
|
||||
|
||||
public void SendTo(NetState state)
|
||||
{
|
||||
state.AddGump(this);
|
||||
state.Send(Compile(state));
|
||||
}
|
||||
|
||||
public static byte[] StringToBuffer(string str) => Encoding.ASCII.GetBytes(str);
|
||||
|
||||
public Packet Compile(NetState ns = null)
|
||||
{
|
||||
IGumpWriter disp;
|
||||
|
||||
if (ns?.Unpack == true)
|
||||
disp = new DisplayGumpPacked(this);
|
||||
else
|
||||
disp = new DisplayGumpFast(this);
|
||||
|
||||
if (!Draggable)
|
||||
disp.AppendLayout(m_NoMove);
|
||||
|
||||
if (!Closable)
|
||||
disp.AppendLayout(m_NoClose);
|
||||
|
||||
if (!Disposable)
|
||||
disp.AppendLayout(m_NoDispose);
|
||||
|
||||
if (!Resizable)
|
||||
disp.AppendLayout(m_NoResize);
|
||||
|
||||
var count = Entries.Count;
|
||||
|
||||
for (var i = 0; i < count; ++i)
|
||||
{
|
||||
var e = Entries[i];
|
||||
|
||||
disp.AppendLayout(m_BeginLayout);
|
||||
e.AppendTo(ns, disp);
|
||||
disp.AppendLayout(m_EndLayout);
|
||||
}
|
||||
|
||||
disp.WriteStrings(Strings);
|
||||
|
||||
disp.Flush();
|
||||
|
||||
m_TextEntries = disp.TextEntries;
|
||||
m_Switches = disp.Switches;
|
||||
|
||||
return (Packet)disp;
|
||||
}
|
||||
|
||||
public virtual void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnServerClose(NetState owner)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,56 +1,56 @@
|
|||
/***************************************************************************
|
||||
* GumpAlphaRegion.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpAlphaRegion : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("checkertrans");
|
||||
|
||||
public GumpAlphaRegion(int x, int y, int width, int height)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ checkertrans {X} {Y} {Width} {Height} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpAlphaRegion.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpAlphaRegion : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("checkertrans");
|
||||
|
||||
public GumpAlphaRegion(int x, int y, int width, int height)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ checkertrans {X} {Y} {Width} {Height} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,60 +1,60 @@
|
|||
/***************************************************************************
|
||||
* GumpBackground.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpBackground : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("resizepic");
|
||||
|
||||
public GumpBackground(int x, int y, int width, int height, int gumpID)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
GumpID = gumpID;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int GumpID { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ resizepic {X} {Y} {GumpID} {Width} {Height} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(GumpID);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpBackground.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpBackground : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("resizepic");
|
||||
|
||||
public GumpBackground(int x, int y, int width, int height, int gumpID)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
GumpID = gumpID;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int GumpID { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ resizepic {X} {Y} {GumpID} {Width} {Height} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(GumpID);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,76 +1,78 @@
|
|||
/***************************************************************************
|
||||
* GumpButton.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public enum GumpButtonType
|
||||
{
|
||||
Page = 0,
|
||||
Reply = 1
|
||||
}
|
||||
|
||||
public class GumpButton : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("button");
|
||||
|
||||
public GumpButton(int x, int y, int normalID, int pressedID, int buttonID,
|
||||
GumpButtonType type = GumpButtonType.Reply, int param = 0)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
NormalID = normalID;
|
||||
PressedID = pressedID;
|
||||
ButtonID = buttonID;
|
||||
Type = type;
|
||||
Param = param;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int NormalID { get; set; }
|
||||
|
||||
public int PressedID { get; set; }
|
||||
|
||||
public int ButtonID { get; set; }
|
||||
|
||||
public GumpButtonType Type { get; set; }
|
||||
|
||||
public int Param { get; set; }
|
||||
|
||||
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(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(NormalID);
|
||||
disp.AppendLayout(PressedID);
|
||||
disp.AppendLayout((int)Type);
|
||||
disp.AppendLayout(Param);
|
||||
disp.AppendLayout(ButtonID);
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpButton.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public enum GumpButtonType
|
||||
{
|
||||
Page = 0,
|
||||
Reply = 1
|
||||
}
|
||||
|
||||
public class GumpButton : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("button");
|
||||
|
||||
public GumpButton(
|
||||
int x, int y, int normalID, int pressedID, int buttonID,
|
||||
GumpButtonType type = GumpButtonType.Reply, int param = 0
|
||||
)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
NormalID = normalID;
|
||||
PressedID = pressedID;
|
||||
ButtonID = buttonID;
|
||||
Type = type;
|
||||
Param = param;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int NormalID { get; set; }
|
||||
|
||||
public int PressedID { get; set; }
|
||||
|
||||
public int ButtonID { get; set; }
|
||||
|
||||
public GumpButtonType Type { get; set; }
|
||||
|
||||
public int Param { get; set; }
|
||||
|
||||
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(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(NormalID);
|
||||
disp.AppendLayout(PressedID);
|
||||
disp.AppendLayout((int)Type);
|
||||
disp.AppendLayout(Param);
|
||||
disp.AppendLayout(ButtonID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,67 +1,67 @@
|
|||
/***************************************************************************
|
||||
* GumpCheck.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpCheck : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("checkbox");
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int InactiveID { get; set; }
|
||||
|
||||
public int ActiveID { get; set; }
|
||||
|
||||
public bool InitialState { get; set; }
|
||||
|
||||
public int SwitchID { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
$"{{ checkbox {X} {Y} {InactiveID} {ActiveID} {(InitialState ? 1 : 0)} {SwitchID} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(InactiveID);
|
||||
disp.AppendLayout(ActiveID);
|
||||
disp.AppendLayout(InitialState);
|
||||
disp.AppendLayout(SwitchID);
|
||||
|
||||
disp.Switches++;
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpCheck.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpCheck : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("checkbox");
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int InactiveID { get; set; }
|
||||
|
||||
public int ActiveID { get; set; }
|
||||
|
||||
public bool InitialState { get; set; }
|
||||
|
||||
public int SwitchID { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
$"{{ checkbox {X} {Y} {InactiveID} {ActiveID} {(InitialState ? 1 : 0)} {SwitchID} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(InactiveID);
|
||||
disp.AppendLayout(ActiveID);
|
||||
disp.AppendLayout(InitialState);
|
||||
disp.AppendLayout(SwitchID);
|
||||
|
||||
disp.Switches++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +1,36 @@
|
|||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright (C) 2020 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: GumpECHandleInput.cs *
|
||||
* Created: 2020/04/24 - Updated: 2020/04/24 *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpECHandleInput : GumpEntry
|
||||
{
|
||||
public override string Compile(NetState ns) => "{ echandleinput }";
|
||||
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("echandleinput");
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright (C) 2020 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: GumpECHandleInput.cs *
|
||||
* Created: 2020/04/24 - Updated: 2020/04/24 *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpECHandleInput : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("echandleinput");
|
||||
public override string Compile(NetState ns) => "{ echandleinput }";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,48 +1,48 @@
|
|||
/***************************************************************************
|
||||
* GumpEntry.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public abstract class GumpEntry
|
||||
{
|
||||
private Gump m_Parent;
|
||||
|
||||
public Gump Parent
|
||||
{
|
||||
get => m_Parent;
|
||||
set
|
||||
{
|
||||
if (m_Parent != value)
|
||||
{
|
||||
m_Parent?.Remove(this);
|
||||
|
||||
m_Parent = value;
|
||||
|
||||
m_Parent?.Add(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public abstract string Compile(NetState ns);
|
||||
public abstract void AppendTo(NetState ns, IGumpWriter disp);
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpEntry.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public abstract class GumpEntry
|
||||
{
|
||||
private Gump m_Parent;
|
||||
|
||||
public Gump Parent
|
||||
{
|
||||
get => m_Parent;
|
||||
set
|
||||
{
|
||||
if (m_Parent != value)
|
||||
{
|
||||
m_Parent?.Remove(this);
|
||||
|
||||
m_Parent = value;
|
||||
|
||||
m_Parent?.Add(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public abstract string Compile(NetState ns);
|
||||
public abstract void AppendTo(NetState ns, IGumpWriter disp);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,41 +1,41 @@
|
|||
/***************************************************************************
|
||||
* GumpGroup.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpGroup : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("group");
|
||||
|
||||
public GumpGroup(int group) => Group = group;
|
||||
|
||||
public int Group { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ group {Group} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(Group);
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpGroup.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpGroup : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("group");
|
||||
|
||||
public GumpGroup(int group) => Group = group;
|
||||
|
||||
public int Group { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ group {Group} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(Group);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,69 +1,69 @@
|
|||
/***************************************************************************
|
||||
* GumpHtml.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpHtml : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("htmlgump");
|
||||
|
||||
public GumpHtml(int x, int y, int width, int height, string text, bool background, bool scrollbar)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Text = text;
|
||||
Background = background;
|
||||
Scrollbar = scrollbar;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public string Text { get; set; }
|
||||
|
||||
public bool Background { get; set; }
|
||||
|
||||
public bool Scrollbar { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
$"{{ htmlgump {X} {Y} {Width} {Height} {Parent.Intern(Text)} {(Background ? 1 : 0)} {(Scrollbar ? 1 : 0)} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(Parent.Intern(Text));
|
||||
disp.AppendLayout(Background);
|
||||
disp.AppendLayout(Scrollbar);
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpHtml.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpHtml : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("htmlgump");
|
||||
|
||||
public GumpHtml(int x, int y, int width, int height, string text, bool background, bool scrollbar)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Text = text;
|
||||
Background = background;
|
||||
Scrollbar = scrollbar;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public string Text { get; set; }
|
||||
|
||||
public bool Background { get; set; }
|
||||
|
||||
public bool Scrollbar { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
$"{{ htmlgump {X} {Y} {Width} {Height} {Parent.Intern(Text)} {(Background ? 1 : 0)} {(Scrollbar ? 1 : 0)} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(Parent.Intern(Text));
|
||||
disp.AppendLayout(Background);
|
||||
disp.AppendLayout(Scrollbar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,172 +1,178 @@
|
|||
/***************************************************************************
|
||||
* GumpHtmlLocalized.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public enum GumpHtmlLocalizedType
|
||||
{
|
||||
Plain,
|
||||
Color,
|
||||
Args
|
||||
}
|
||||
|
||||
public class GumpHtmlLocalized : GumpEntry
|
||||
{
|
||||
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");
|
||||
|
||||
public GumpHtmlLocalized(int x, int y, int width, int height, int number,
|
||||
bool background = false, bool scrollbar = false)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Number = number;
|
||||
Background = background;
|
||||
Scrollbar = scrollbar;
|
||||
|
||||
Type = GumpHtmlLocalizedType.Plain;
|
||||
}
|
||||
|
||||
public GumpHtmlLocalized(int x, int y, int width, int height, int number, int color,
|
||||
bool background = false, bool scrollbar = false)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Number = number;
|
||||
Color = color;
|
||||
Background = background;
|
||||
Scrollbar = scrollbar;
|
||||
|
||||
Type = GumpHtmlLocalizedType.Color;
|
||||
}
|
||||
|
||||
public GumpHtmlLocalized(int x, int y, int width, int height, int number, string args, int color,
|
||||
bool background = false, bool scrollbar = false)
|
||||
{
|
||||
// Are multiple arguments unsupported? And what about non ASCII arguments?
|
||||
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Number = number;
|
||||
Args = args;
|
||||
Color = color;
|
||||
Background = background;
|
||||
Scrollbar = scrollbar;
|
||||
|
||||
Type = GumpHtmlLocalizedType.Args;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int Number { get; set; }
|
||||
|
||||
public string Args { get; set; }
|
||||
|
||||
public int Color { get; set; }
|
||||
|
||||
public bool Background { get; set; }
|
||||
|
||||
public bool Scrollbar { get; set; }
|
||||
|
||||
public GumpHtmlLocalizedType Type { get; set; }
|
||||
|
||||
public override string Compile(NetState ns)
|
||||
{
|
||||
return Type switch
|
||||
{
|
||||
GumpHtmlLocalizedType.Plain =>
|
||||
$"{{ xmfhtmlgump {X} {Y} {Width} {Height} {Number} {(Background ? 1 : 0)} {(Scrollbar ? 1 : 0)} }}",
|
||||
GumpHtmlLocalizedType.Color =>
|
||||
$"{{ xmfhtmlgumpcolor {X} {Y} {Width} {Height} {Number} {(Background ? 1 : 0)} {(Scrollbar ? 1 : 0)} {Color} }}",
|
||||
_ =>
|
||||
$"{{ xmfhtmltok {X} {Y} {Width} {Height} {(Background ? 1 : 0)} {(Scrollbar ? 1 : 0)} {Color} {Number} @{Args}@ }}"
|
||||
};
|
||||
}
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
switch (Type)
|
||||
{
|
||||
case GumpHtmlLocalizedType.Plain:
|
||||
{
|
||||
disp.AppendLayout(m_LayoutNamePlain);
|
||||
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(Number);
|
||||
disp.AppendLayout(Background);
|
||||
disp.AppendLayout(Scrollbar);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case GumpHtmlLocalizedType.Color:
|
||||
{
|
||||
disp.AppendLayout(m_LayoutNameColor);
|
||||
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(Number);
|
||||
disp.AppendLayout(Background);
|
||||
disp.AppendLayout(Scrollbar);
|
||||
disp.AppendLayout(Color);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case GumpHtmlLocalizedType.Args:
|
||||
{
|
||||
disp.AppendLayout(m_LayoutNameArgs);
|
||||
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(Background);
|
||||
disp.AppendLayout(Scrollbar);
|
||||
disp.AppendLayout(Color);
|
||||
disp.AppendLayout(Number);
|
||||
disp.AppendLayout(Args);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpHtmlLocalized.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public enum GumpHtmlLocalizedType
|
||||
{
|
||||
Plain,
|
||||
Color,
|
||||
Args
|
||||
}
|
||||
|
||||
public class GumpHtmlLocalized : GumpEntry
|
||||
{
|
||||
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");
|
||||
|
||||
public GumpHtmlLocalized(
|
||||
int x, int y, int width, int height, int number,
|
||||
bool background = false, bool scrollbar = false
|
||||
)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Number = number;
|
||||
Background = background;
|
||||
Scrollbar = scrollbar;
|
||||
|
||||
Type = GumpHtmlLocalizedType.Plain;
|
||||
}
|
||||
|
||||
public GumpHtmlLocalized(
|
||||
int x, int y, int width, int height, int number, int color,
|
||||
bool background = false, bool scrollbar = false
|
||||
)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Number = number;
|
||||
Color = color;
|
||||
Background = background;
|
||||
Scrollbar = scrollbar;
|
||||
|
||||
Type = GumpHtmlLocalizedType.Color;
|
||||
}
|
||||
|
||||
public GumpHtmlLocalized(
|
||||
int x, int y, int width, int height, int number, string args, int color,
|
||||
bool background = false, bool scrollbar = false
|
||||
)
|
||||
{
|
||||
// Are multiple arguments unsupported? And what about non ASCII arguments?
|
||||
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Number = number;
|
||||
Args = args;
|
||||
Color = color;
|
||||
Background = background;
|
||||
Scrollbar = scrollbar;
|
||||
|
||||
Type = GumpHtmlLocalizedType.Args;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int Number { get; set; }
|
||||
|
||||
public string Args { get; set; }
|
||||
|
||||
public int Color { get; set; }
|
||||
|
||||
public bool Background { get; set; }
|
||||
|
||||
public bool Scrollbar { get; set; }
|
||||
|
||||
public GumpHtmlLocalizedType Type { get; set; }
|
||||
|
||||
public override string Compile(NetState ns)
|
||||
{
|
||||
return Type switch
|
||||
{
|
||||
GumpHtmlLocalizedType.Plain =>
|
||||
$"{{ xmfhtmlgump {X} {Y} {Width} {Height} {Number} {(Background ? 1 : 0)} {(Scrollbar ? 1 : 0)} }}",
|
||||
GumpHtmlLocalizedType.Color =>
|
||||
$"{{ xmfhtmlgumpcolor {X} {Y} {Width} {Height} {Number} {(Background ? 1 : 0)} {(Scrollbar ? 1 : 0)} {Color} }}",
|
||||
_ =>
|
||||
$"{{ xmfhtmltok {X} {Y} {Width} {Height} {(Background ? 1 : 0)} {(Scrollbar ? 1 : 0)} {Color} {Number} @{Args}@ }}"
|
||||
};
|
||||
}
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
switch (Type)
|
||||
{
|
||||
case GumpHtmlLocalizedType.Plain:
|
||||
{
|
||||
disp.AppendLayout(m_LayoutNamePlain);
|
||||
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(Number);
|
||||
disp.AppendLayout(Background);
|
||||
disp.AppendLayout(Scrollbar);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case GumpHtmlLocalizedType.Color:
|
||||
{
|
||||
disp.AppendLayout(m_LayoutNameColor);
|
||||
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(Number);
|
||||
disp.AppendLayout(Background);
|
||||
disp.AppendLayout(Scrollbar);
|
||||
disp.AppendLayout(Color);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case GumpHtmlLocalizedType.Args:
|
||||
{
|
||||
disp.AppendLayout(m_LayoutNameArgs);
|
||||
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(Background);
|
||||
disp.AppendLayout(Scrollbar);
|
||||
disp.AppendLayout(Color);
|
||||
disp.AppendLayout(Number);
|
||||
disp.AppendLayout(Args);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,63 +1,63 @@
|
|||
/***************************************************************************
|
||||
* GumpImage.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpImage : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("gumppic");
|
||||
private static readonly byte[] m_HueEquals = Gump.StringToBuffer(" hue=");
|
||||
|
||||
public GumpImage(int x, int y, int gumpID, int hue = 0)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
GumpID = gumpID;
|
||||
Hue = hue;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int GumpID { get; set; }
|
||||
|
||||
public int Hue { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
Hue == 0 ? $"{{ gumppic {X} {Y} {GumpID} }}" : $"{{ gumppic {X} {Y} {GumpID} hue={Hue} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(GumpID);
|
||||
|
||||
if (Hue != 0)
|
||||
{
|
||||
disp.AppendLayout(m_HueEquals);
|
||||
disp.AppendLayoutNS(Hue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpImage.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpImage : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("gumppic");
|
||||
private static readonly byte[] m_HueEquals = Gump.StringToBuffer(" hue=");
|
||||
|
||||
public GumpImage(int x, int y, int gumpID, int hue = 0)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
GumpID = gumpID;
|
||||
Hue = hue;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int GumpID { get; set; }
|
||||
|
||||
public int Hue { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
Hue == 0 ? $"{{ gumppic {X} {Y} {GumpID} }}" : $"{{ gumppic {X} {Y} {GumpID} hue={Hue} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(GumpID);
|
||||
|
||||
if (Hue != 0)
|
||||
{
|
||||
disp.AppendLayout(m_HueEquals);
|
||||
disp.AppendLayoutNS(Hue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,121 +1,123 @@
|
|||
/***************************************************************************
|
||||
* GumpImageTileButton.cs
|
||||
* -------------------
|
||||
* begin : April 26, 2005
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpImageTileButton : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("buttontileart");
|
||||
private static readonly byte[] m_LayoutTooltip = Gump.StringToBuffer(" }{ tooltip");
|
||||
|
||||
private GumpButtonType m_Type;
|
||||
|
||||
// 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)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
NormalID = normalID;
|
||||
PressedID = pressedID;
|
||||
ButtonID = buttonID;
|
||||
m_Type = type;
|
||||
Param = param;
|
||||
|
||||
ItemID = itemID;
|
||||
Hue = hue;
|
||||
Width = width;
|
||||
Height = height;
|
||||
|
||||
LocalizedTooltip = localizedTooltip;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int NormalID { get; set; }
|
||||
|
||||
public int PressedID { get; set; }
|
||||
|
||||
public int ButtonID { get; set; }
|
||||
|
||||
public GumpButtonType Type
|
||||
{
|
||||
get => m_Type;
|
||||
set
|
||||
{
|
||||
if (m_Type != value)
|
||||
{
|
||||
m_Type = value;
|
||||
|
||||
var parent = Parent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int Param { get; set; }
|
||||
|
||||
public int ItemID { get; set; }
|
||||
|
||||
public int Hue { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int LocalizedTooltip { get; set; }
|
||||
|
||||
public override string Compile(NetState ns)
|
||||
{
|
||||
if (LocalizedTooltip > 0)
|
||||
return
|
||||
$"{{ buttontileart {X} {Y} {NormalID} {PressedID} {(int)m_Type} {Param} {ButtonID} {ItemID} {Hue} {Width} {Height} }}{{ tooltip {LocalizedTooltip} }}";
|
||||
return
|
||||
$"{{ 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(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(NormalID);
|
||||
disp.AppendLayout(PressedID);
|
||||
disp.AppendLayout((int)m_Type);
|
||||
disp.AppendLayout(Param);
|
||||
disp.AppendLayout(ButtonID);
|
||||
|
||||
disp.AppendLayout(ItemID);
|
||||
disp.AppendLayout(Hue);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
|
||||
if (LocalizedTooltip > 0)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutTooltip);
|
||||
disp.AppendLayout(LocalizedTooltip);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpImageTileButton.cs
|
||||
* -------------------
|
||||
* begin : April 26, 2005
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpImageTileButton : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("buttontileart");
|
||||
private static readonly byte[] m_LayoutTooltip = Gump.StringToBuffer(" }{ tooltip");
|
||||
|
||||
private GumpButtonType m_Type;
|
||||
|
||||
// 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
|
||||
)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
NormalID = normalID;
|
||||
PressedID = pressedID;
|
||||
ButtonID = buttonID;
|
||||
m_Type = type;
|
||||
Param = param;
|
||||
|
||||
ItemID = itemID;
|
||||
Hue = hue;
|
||||
Width = width;
|
||||
Height = height;
|
||||
|
||||
LocalizedTooltip = localizedTooltip;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int NormalID { get; set; }
|
||||
|
||||
public int PressedID { get; set; }
|
||||
|
||||
public int ButtonID { get; set; }
|
||||
|
||||
public GumpButtonType Type
|
||||
{
|
||||
get => m_Type;
|
||||
set
|
||||
{
|
||||
if (m_Type != value)
|
||||
{
|
||||
m_Type = value;
|
||||
|
||||
var parent = Parent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int Param { get; set; }
|
||||
|
||||
public int ItemID { get; set; }
|
||||
|
||||
public int Hue { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int LocalizedTooltip { get; set; }
|
||||
|
||||
public override string Compile(NetState ns)
|
||||
{
|
||||
if (LocalizedTooltip > 0)
|
||||
return
|
||||
$"{{ buttontileart {X} {Y} {NormalID} {PressedID} {(int)m_Type} {Param} {ButtonID} {ItemID} {Hue} {Width} {Height} }}{{ tooltip {LocalizedTooltip} }}";
|
||||
return
|
||||
$"{{ 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(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(NormalID);
|
||||
disp.AppendLayout(PressedID);
|
||||
disp.AppendLayout((int)m_Type);
|
||||
disp.AppendLayout(Param);
|
||||
disp.AppendLayout(ButtonID);
|
||||
|
||||
disp.AppendLayout(ItemID);
|
||||
disp.AppendLayout(Hue);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
|
||||
if (LocalizedTooltip > 0)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutTooltip);
|
||||
disp.AppendLayout(LocalizedTooltip);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,60 +1,60 @@
|
|||
/***************************************************************************
|
||||
* GumpImageTiled.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpImageTiled : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("gumppictiled");
|
||||
|
||||
public GumpImageTiled(int x, int y, int width, int height, int gumpID)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
GumpID = gumpID;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int GumpID { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ gumppictiled {X} {Y} {Width} {Height} {GumpID} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(GumpID);
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpImageTiled.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpImageTiled : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("gumppictiled");
|
||||
|
||||
public GumpImageTiled(int x, int y, int width, int height, int gumpID)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
GumpID = gumpID;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int GumpID { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ gumppictiled {X} {Y} {Width} {Height} {GumpID} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(GumpID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,60 +1,60 @@
|
|||
/***************************************************************************
|
||||
* GumpItem.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpItem : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("tilepic");
|
||||
private static readonly byte[] m_LayoutNameHue = Gump.StringToBuffer("tilepichue");
|
||||
|
||||
public GumpItem(int x, int y, int itemID, int hue = 0)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
ItemID = itemID;
|
||||
Hue = hue;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int ItemID { get; set; }
|
||||
|
||||
public int Hue { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
Hue == 0 ? $"{{ tilepic {X} {Y} {ItemID} }}" : $"{{ tilepichue {X} {Y} {ItemID} {Hue} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(Hue == 0 ? m_LayoutName : m_LayoutNameHue);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(ItemID);
|
||||
|
||||
if (Hue != 0)
|
||||
disp.AppendLayout(Hue);
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpItem.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpItem : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("tilepic");
|
||||
private static readonly byte[] m_LayoutNameHue = Gump.StringToBuffer("tilepichue");
|
||||
|
||||
public GumpItem(int x, int y, int itemID, int hue = 0)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
ItemID = itemID;
|
||||
Hue = hue;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int ItemID { get; set; }
|
||||
|
||||
public int Hue { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
Hue == 0 ? $"{{ tilepic {X} {Y} {ItemID} }}" : $"{{ tilepichue {X} {Y} {ItemID} {Hue} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(Hue == 0 ? m_LayoutName : m_LayoutNameHue);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(ItemID);
|
||||
|
||||
if (Hue != 0)
|
||||
disp.AppendLayout(Hue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,41 +1,41 @@
|
|||
/***************************************************************************
|
||||
* GumpItemProperty.cs
|
||||
* -------------------
|
||||
* begin : May 26, 2013
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpItemProperty : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("itemproperty");
|
||||
|
||||
public GumpItemProperty(uint serial) => Serial = serial;
|
||||
|
||||
public uint Serial { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ itemproperty {Serial} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(Serial);
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpItemProperty.cs
|
||||
* -------------------
|
||||
* begin : May 26, 2013
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpItemProperty : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("itemproperty");
|
||||
|
||||
public GumpItemProperty(uint serial) => Serial = serial;
|
||||
|
||||
public uint Serial { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ itemproperty {Serial} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(Serial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,56 +1,56 @@
|
|||
/***************************************************************************
|
||||
* GumpLabel.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpLabel : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("text");
|
||||
|
||||
public GumpLabel(int x, int y, int hue, string text)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Hue = hue;
|
||||
Text = text;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Hue { get; set; }
|
||||
|
||||
public string Text { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ text {X} {Y} {Hue} {Parent.Intern(Text)} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Hue);
|
||||
disp.AppendLayout(Parent.Intern(Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpLabel.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpLabel : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("text");
|
||||
|
||||
public GumpLabel(int x, int y, int hue, string text)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Hue = hue;
|
||||
Text = text;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Hue { get; set; }
|
||||
|
||||
public string Text { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ text {X} {Y} {Hue} {Parent.Intern(Text)} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Hue);
|
||||
disp.AppendLayout(Parent.Intern(Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,65 +1,65 @@
|
|||
/***************************************************************************
|
||||
* GumpLabelCropped.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpLabelCropped : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("croppedtext");
|
||||
|
||||
public GumpLabelCropped(int x, int y, int width, int height, int hue, string text)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Hue = hue;
|
||||
Text = text;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int Hue { get; set; }
|
||||
|
||||
public string Text { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
$"{{ croppedtext {X} {Y} {Width} {Height} {Hue} {Parent.Intern(Text)} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(Hue);
|
||||
disp.AppendLayout(Parent.Intern(Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpLabelCropped.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpLabelCropped : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("croppedtext");
|
||||
|
||||
public GumpLabelCropped(int x, int y, int width, int height, int hue, string text)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Hue = hue;
|
||||
Text = text;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int Hue { get; set; }
|
||||
|
||||
public string Text { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
$"{{ croppedtext {X} {Y} {Width} {Height} {Hue} {Parent.Intern(Text)} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(Hue);
|
||||
disp.AppendLayout(Parent.Intern(Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,42 +1,42 @@
|
|||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright (C) 2020 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: GumpMasterGump.cs *
|
||||
* Created: 2020/04/24 - Updated: 2020/04/24 *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpMasterGump : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("mastergump");
|
||||
|
||||
public GumpMasterGump(int gumpID) => GumpID = gumpID;
|
||||
|
||||
public int GumpID { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ mastergump {GumpID} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(GumpID);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright (C) 2020 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: GumpMasterGump.cs *
|
||||
* Created: 2020/04/24 - Updated: 2020/04/24 *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpMasterGump : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("mastergump");
|
||||
|
||||
public GumpMasterGump(int gumpID) => GumpID = gumpID;
|
||||
|
||||
public int GumpID { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ mastergump {GumpID} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(GumpID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,41 +1,41 @@
|
|||
/***************************************************************************
|
||||
* GumpPage.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpPage : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("page");
|
||||
|
||||
public GumpPage(int page) => Page = page;
|
||||
|
||||
public int Page { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ page {Page} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(Page);
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpPage.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpPage : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("page");
|
||||
|
||||
public GumpPage(int page) => Page = page;
|
||||
|
||||
public int Page { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ page {Page} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(Page);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,67 +1,67 @@
|
|||
/***************************************************************************
|
||||
* GumpRadio.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpRadio : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("radio");
|
||||
|
||||
public GumpRadio(int x, int y, int inactiveID, int activeID, bool initialState, int switchID)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
InactiveID = inactiveID;
|
||||
ActiveID = activeID;
|
||||
InitialState = initialState;
|
||||
SwitchID = switchID;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int InactiveID { get; set; }
|
||||
|
||||
public int ActiveID { get; set; }
|
||||
|
||||
public bool InitialState { get; set; }
|
||||
|
||||
public int SwitchID { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
$"{{ radio {X} {Y} {InactiveID} {ActiveID} {(InitialState ? 1 : 0)} {SwitchID} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(InactiveID);
|
||||
disp.AppendLayout(ActiveID);
|
||||
disp.AppendLayout(InitialState);
|
||||
disp.AppendLayout(SwitchID);
|
||||
|
||||
disp.Switches++;
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpRadio.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpRadio : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("radio");
|
||||
|
||||
public GumpRadio(int x, int y, int inactiveID, int activeID, bool initialState, int switchID)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
InactiveID = inactiveID;
|
||||
ActiveID = activeID;
|
||||
InitialState = initialState;
|
||||
SwitchID = switchID;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int InactiveID { get; set; }
|
||||
|
||||
public int ActiveID { get; set; }
|
||||
|
||||
public bool InitialState { get; set; }
|
||||
|
||||
public int SwitchID { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
$"{{ radio {X} {Y} {InactiveID} {ActiveID} {(InitialState ? 1 : 0)} {SwitchID} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(InactiveID);
|
||||
disp.AppendLayout(ActiveID);
|
||||
disp.AppendLayout(InitialState);
|
||||
disp.AppendLayout(SwitchID);
|
||||
|
||||
disp.Switches++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,48 +1,48 @@
|
|||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpSpriteImage : GumpEntry
|
||||
{
|
||||
public GumpSpriteImage(int x, int y, int gumpID, int width, int height, int sx, int sy)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
GumpID = gumpID;
|
||||
Width = width;
|
||||
Height = height;
|
||||
SX = sx;
|
||||
SY = sy;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int GumpID { get; set; }
|
||||
|
||||
public int SX { get; set; }
|
||||
|
||||
public int SY { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ picinpic {X} {Y} {GumpID} {Width} {Height} {SX} {SY} }}";
|
||||
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("picinpic");
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(GumpID);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(SX);
|
||||
disp.AppendLayout(SY);
|
||||
}
|
||||
}
|
||||
}
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpSpriteImage : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("picinpic");
|
||||
|
||||
public GumpSpriteImage(int x, int y, int gumpID, int width, int height, int sx, int sy)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
GumpID = gumpID;
|
||||
Width = width;
|
||||
Height = height;
|
||||
SX = sx;
|
||||
SY = sy;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int GumpID { get; set; }
|
||||
|
||||
public int SX { get; set; }
|
||||
|
||||
public int SY { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ picinpic {X} {Y} {GumpID} {Width} {Height} {SX} {SY} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(GumpID);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(SX);
|
||||
disp.AppendLayout(SY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,71 +1,71 @@
|
|||
/***************************************************************************
|
||||
* GumpTextEntry.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpTextEntry : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("textentry");
|
||||
|
||||
public GumpTextEntry(int x, int y, int width, int height, int hue, int entryID, string initialText)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Hue = hue;
|
||||
EntryID = entryID;
|
||||
InitialText = initialText;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int Hue { get; set; }
|
||||
|
||||
public int EntryID { get; set; }
|
||||
|
||||
public string InitialText { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
$"{{ textentry {X} {Y} {Width} {Height} {Hue} {EntryID} {Parent.Intern(InitialText)} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(Hue);
|
||||
disp.AppendLayout(EntryID);
|
||||
disp.AppendLayout(Parent.Intern(InitialText));
|
||||
|
||||
disp.TextEntries++;
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpTextEntry.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpTextEntry : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("textentry");
|
||||
|
||||
public GumpTextEntry(int x, int y, int width, int height, int hue, int entryID, string initialText)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Hue = hue;
|
||||
EntryID = entryID;
|
||||
InitialText = initialText;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int Hue { get; set; }
|
||||
|
||||
public int EntryID { get; set; }
|
||||
|
||||
public string InitialText { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
$"{{ textentry {X} {Y} {Width} {Height} {Hue} {EntryID} {Parent.Intern(InitialText)} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(Hue);
|
||||
disp.AppendLayout(EntryID);
|
||||
disp.AppendLayout(Parent.Intern(InitialText));
|
||||
|
||||
disp.TextEntries++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,75 +1,77 @@
|
|||
/***************************************************************************
|
||||
* GumpTextEntryLimited.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpTextEntryLimited : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("textentrylimited");
|
||||
|
||||
public GumpTextEntryLimited(int x, int y, int width, int height, int hue, int entryID, string initialText, int size = 0)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Hue = hue;
|
||||
EntryID = entryID;
|
||||
InitialText = initialText;
|
||||
Size = size;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int Hue { get; set; }
|
||||
|
||||
public int EntryID { get; set; }
|
||||
|
||||
public string InitialText { get; set; }
|
||||
|
||||
public int Size { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
$"{{ textentrylimited {X} {Y} {Width} {Height} {Hue} {EntryID} {Parent.Intern(InitialText)} {Size} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(Hue);
|
||||
disp.AppendLayout(EntryID);
|
||||
disp.AppendLayout(Parent.Intern(InitialText));
|
||||
disp.AppendLayout(Size);
|
||||
|
||||
disp.TextEntries++;
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* GumpTextEntryLimited.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpTextEntryLimited : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("textentrylimited");
|
||||
|
||||
public GumpTextEntryLimited(
|
||||
int x, int y, int width, int height, int hue, int entryID, string initialText, int size = 0
|
||||
)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Hue = hue;
|
||||
EntryID = entryID;
|
||||
InitialText = initialText;
|
||||
Size = size;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
public int Hue { get; set; }
|
||||
|
||||
public int EntryID { get; set; }
|
||||
|
||||
public string InitialText { get; set; }
|
||||
|
||||
public int Size { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) =>
|
||||
$"{{ textentrylimited {X} {Y} {Width} {Height} {Hue} {EntryID} {Parent.Intern(InitialText)} {Size} }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(X);
|
||||
disp.AppendLayout(Y);
|
||||
disp.AppendLayout(Width);
|
||||
disp.AppendLayout(Height);
|
||||
disp.AppendLayout(Hue);
|
||||
disp.AppendLayout(EntryID);
|
||||
disp.AppendLayout(Parent.Intern(InitialText));
|
||||
disp.AppendLayout(Size);
|
||||
|
||||
disp.TextEntries++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,48 +1,48 @@
|
|||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright (C) 2020 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: GumpTooltip.cs - Created: 2020/04/24 - Updated: 2020/04/24 *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpTooltip : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("tooltip");
|
||||
|
||||
public GumpTooltip(int number, string args)
|
||||
{
|
||||
Number = number;
|
||||
Args = args;
|
||||
}
|
||||
|
||||
public int Number { get; set; }
|
||||
|
||||
public string Args { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ tooltip {Number} @{Args}@ }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(Number);
|
||||
disp.AppendLayout(Args);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright (C) 2020 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: GumpTooltip.cs - Created: 2020/04/24 - Updated: 2020/04/24 *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpTooltip : GumpEntry
|
||||
{
|
||||
private static readonly byte[] m_LayoutName = Gump.StringToBuffer("tooltip");
|
||||
|
||||
public GumpTooltip(int number, string args)
|
||||
{
|
||||
Number = number;
|
||||
Args = args;
|
||||
}
|
||||
|
||||
public int Number { get; set; }
|
||||
|
||||
public string Args { get; set; }
|
||||
|
||||
public override string Compile(NetState ns) => $"{{ tooltip {Number} @{Args}@ }}";
|
||||
|
||||
public override void AppendTo(NetState ns, IGumpWriter disp)
|
||||
{
|
||||
disp.AppendLayout(m_LayoutName);
|
||||
disp.AppendLayout(Number);
|
||||
disp.AppendLayout(Args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,69 +1,69 @@
|
|||
/***************************************************************************
|
||||
* RelayInfo.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class TextRelay
|
||||
{
|
||||
public TextRelay(int entryID, string text)
|
||||
{
|
||||
EntryID = entryID;
|
||||
Text = text;
|
||||
}
|
||||
|
||||
public int EntryID { get; }
|
||||
|
||||
public string Text { get; }
|
||||
}
|
||||
|
||||
public class RelayInfo
|
||||
{
|
||||
public RelayInfo(int buttonID, int[] switches, TextRelay[] textEntries)
|
||||
{
|
||||
ButtonID = buttonID;
|
||||
Switches = switches;
|
||||
TextEntries = textEntries;
|
||||
}
|
||||
|
||||
public int ButtonID { get; }
|
||||
|
||||
public int[] Switches { get; }
|
||||
|
||||
public TextRelay[] TextEntries { get; }
|
||||
|
||||
public bool IsSwitched(int switchID)
|
||||
{
|
||||
for (var i = 0; i < Switches.Length; ++i)
|
||||
if (Switches[i] == switchID)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public TextRelay GetTextEntry(int entryID)
|
||||
{
|
||||
for (var i = 0; i < TextEntries.Length; ++i)
|
||||
if (TextEntries[i].EntryID == entryID)
|
||||
return TextEntries[i];
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* RelayInfo.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class TextRelay
|
||||
{
|
||||
public TextRelay(int entryID, string text)
|
||||
{
|
||||
EntryID = entryID;
|
||||
Text = text;
|
||||
}
|
||||
|
||||
public int EntryID { get; }
|
||||
|
||||
public string Text { get; }
|
||||
}
|
||||
|
||||
public class RelayInfo
|
||||
{
|
||||
public RelayInfo(int buttonID, int[] switches, TextRelay[] textEntries)
|
||||
{
|
||||
ButtonID = buttonID;
|
||||
Switches = switches;
|
||||
TextEntries = textEntries;
|
||||
}
|
||||
|
||||
public int ButtonID { get; }
|
||||
|
||||
public int[] Switches { get; }
|
||||
|
||||
public TextRelay[] TextEntries { get; }
|
||||
|
||||
public bool IsSwitched(int switchID)
|
||||
{
|
||||
for (var i = 0; i < Switches.Length; ++i)
|
||||
if (Switches[i] == switchID)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public TextRelay GetTextEntry(int entryID)
|
||||
{
|
||||
for (var i = 0; i < TextEntries.Length; ++i)
|
||||
if (TextEntries[i].EntryID == entryID)
|
||||
return TextEntries[i];
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue