Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -1,77 +1,78 @@
|
|||
using System.Collections;
|
||||
using Server.Network;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class ReclaimVendorGump : Gump
|
||||
{
|
||||
private BaseHouse m_House;
|
||||
private ArrayList m_Vendors;
|
||||
public class ReclaimVendorGump : Gump
|
||||
{
|
||||
private BaseHouse m_House;
|
||||
private ArrayList m_Vendors;
|
||||
|
||||
public ReclaimVendorGump( BaseHouse house ) : base( 50, 50 )
|
||||
{
|
||||
m_House = house;
|
||||
m_Vendors = new ArrayList( house.InternalizedVendors );
|
||||
public ReclaimVendorGump(BaseHouse house) : base(50, 50)
|
||||
{
|
||||
m_House = house;
|
||||
m_Vendors = new ArrayList(house.InternalizedVendors);
|
||||
|
||||
AddBackground( 0, 0, 170, 50 + m_Vendors.Count * 20, 0x13BE );
|
||||
AddBackground(0, 0, 170, 50 + m_Vendors.Count * 20, 0x13BE);
|
||||
|
||||
AddImageTiled( 10, 10, 150, 20, 0xA40 );
|
||||
AddHtmlLocalized( 10, 10, 150, 20, 1061827, 0x7FFF, false, false ); // <CENTER>Reclaim Vendor</CENTER>
|
||||
AddImageTiled(10, 10, 150, 20, 0xA40);
|
||||
AddHtmlLocalized(10, 10, 150, 20, 1061827, 0x7FFF, false, false); // <CENTER>Reclaim Vendor</CENTER>
|
||||
|
||||
AddImageTiled( 10, 40, 150, m_Vendors.Count * 20, 0xA40 );
|
||||
AddImageTiled(10, 40, 150, m_Vendors.Count * 20, 0xA40);
|
||||
|
||||
for ( int i = 0; i < m_Vendors.Count; i++ )
|
||||
{
|
||||
Mobile m = (Mobile) m_Vendors[i];
|
||||
for (int i = 0; i < m_Vendors.Count; i++)
|
||||
{
|
||||
Mobile m = (Mobile)m_Vendors[i];
|
||||
|
||||
int y = 40 + i * 20;
|
||||
int y = 40 + i * 20;
|
||||
|
||||
AddButton( 10, y, 0xFA5, 0xFA7, i + 1, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 45, y, 0x481, m.Name );
|
||||
}
|
||||
}
|
||||
AddButton(10, y, 0xFA5, 0xFA7, i + 1, GumpButtonType.Reply, 0);
|
||||
AddLabel(45, y, 0x481, m.Name);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if ( info.ButtonID == 0 || !m_House.IsActive || !m_House.IsInside( from ) || !m_House.IsOwner( from ) || !from.CheckAlive() )
|
||||
return;
|
||||
if (info.ButtonID == 0 || !m_House.IsActive || !m_House.IsInside(from) || !m_House.IsOwner(from) ||
|
||||
!from.CheckAlive())
|
||||
return;
|
||||
|
||||
int index = info.ButtonID - 1;
|
||||
int index = info.ButtonID - 1;
|
||||
|
||||
if ( index < 0 || index >= m_Vendors.Count )
|
||||
return;
|
||||
if (index < 0 || index >= m_Vendors.Count)
|
||||
return;
|
||||
|
||||
Mobile mob = (Mobile) m_Vendors[index];
|
||||
Mobile mob = (Mobile)m_Vendors[index];
|
||||
|
||||
if ( !m_House.InternalizedVendors.Contains( mob ) )
|
||||
return;
|
||||
if (!m_House.InternalizedVendors.Contains(mob))
|
||||
return;
|
||||
|
||||
if ( mob.Deleted )
|
||||
{
|
||||
m_House.InternalizedVendors.Remove( mob );
|
||||
}
|
||||
else
|
||||
{
|
||||
bool vendor, contract;
|
||||
BaseHouse.IsThereVendor( from.Location, from.Map, out vendor, out contract );
|
||||
if (mob.Deleted)
|
||||
{
|
||||
m_House.InternalizedVendors.Remove(mob);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool vendor, contract;
|
||||
BaseHouse.IsThereVendor(from.Location, from.Map, out vendor, out contract);
|
||||
|
||||
if ( vendor )
|
||||
{
|
||||
from.SendLocalizedMessage( 1062677 ); // You cannot place a vendor or barkeep at this location.
|
||||
}
|
||||
else if ( contract )
|
||||
{
|
||||
from.SendLocalizedMessage( 1062678 ); // You cannot place a vendor or barkeep on top of a rental contract!
|
||||
}
|
||||
else
|
||||
{
|
||||
m_House.InternalizedVendors.Remove( mob );
|
||||
mob.MoveToWorld( from.Location, from.Map );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (vendor)
|
||||
{
|
||||
from.SendLocalizedMessage(1062677); // You cannot place a vendor or barkeep at this location.
|
||||
}
|
||||
else if (contract)
|
||||
{
|
||||
from.SendLocalizedMessage(1062678); // You cannot place a vendor or barkeep on top of a rental contract!
|
||||
}
|
||||
else
|
||||
{
|
||||
m_House.InternalizedVendors.Remove(mob);
|
||||
mob.MoveToWorld(from.Location, from.Map);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue