v0.0.1-Alpha (#42)
This commit is contained in:
parent
d30f93c454
commit
a36796c2c1
3552 changed files with 2476 additions and 15223 deletions
46
Projects/Scripts/Engines/Factions/Gumps/FactionGump.cs
Normal file
46
Projects/Scripts/Engines/Factions/Gumps/FactionGump.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
using Server.Gumps;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public abstract class FactionGump : Gump
|
||||
{
|
||||
public FactionGump(int x, int y) : base(x, y)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual int ButtonTypes => 10;
|
||||
|
||||
public int ToButtonID(int type, int index)
|
||||
{
|
||||
return 1 + index * ButtonTypes + type;
|
||||
}
|
||||
|
||||
public bool FromButtonID(int buttonID, out int type, out int index)
|
||||
{
|
||||
int offset = buttonID - 1;
|
||||
|
||||
if (offset >= 0)
|
||||
{
|
||||
type = offset % ButtonTypes;
|
||||
index = offset / ButtonTypes;
|
||||
return true;
|
||||
}
|
||||
|
||||
type = index = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool Exists(Mobile mob)
|
||||
{
|
||||
return mob.HasGump<FactionGump>();
|
||||
}
|
||||
|
||||
public void AddHtmlText(int x, int y, int width, int height, TextDefinition text, bool back, bool scroll)
|
||||
{
|
||||
if (text?.Number > 0)
|
||||
AddHtmlLocalized(x, y, width, height, text.Number, back, scroll);
|
||||
else if (text?.String != null)
|
||||
AddHtml(x, y, width, height, text.String, back, scroll);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue