Cleanup/Housekeeping (#242)
This commit is contained in:
parent
90ede0659f
commit
741e8d8300
228 changed files with 6292 additions and 2690 deletions
|
|
@ -1,23 +1,3 @@
|
|||
/***************************************************************************
|
||||
* 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;
|
||||
|
|
@ -232,15 +212,21 @@ namespace Server.Gumps
|
|||
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;
|
||||
|
|
@ -250,7 +236,10 @@ namespace Server.Gumps
|
|||
{
|
||||
var indexOf = Strings.IndexOf(value);
|
||||
|
||||
if (indexOf >= 0) return indexOf;
|
||||
if (indexOf >= 0)
|
||||
{
|
||||
return indexOf;
|
||||
}
|
||||
|
||||
Strings.Add(value);
|
||||
return Strings.Count - 1;
|
||||
|
|
@ -269,21 +258,33 @@ namespace Server.Gumps
|
|||
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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue