" + sign.House.Owner.RawName);
AddButton(width - 30, y + 3, 0x2716, "House Menu", HouseMenu, sign.House);
}
}
else
{
house = (BaseHouse)list[i];
AddHtml(30, y += 20, width / 2 - 20, "
" + house.Name);
AddButton(15, y + 3, 0x2716, "Goto", Goto, house);
if (house.Owner != null)
{
AddHtml(width / 2, y, width / 2 - 40, "
" + house.Owner.RawName);
AddButton(width - 30, y + 3, 0x2716, "House Menu", HouseMenu, house);
}
}
}
if (pp * (c_Page + 1) < list.Count)
{
AddButton(width / 2 - 10, y += 25, 0x25E8, 0x25E9, "Page Up", PageUp);
}
if (c_ListPage == ListPage.Town)
{
AddHtml(0, y += 35, width, "
Add New TownHouse");
AddButton(width / 2 - 80, y + 3, 0x2716, "New", New);
AddButton(width / 2 + 70, y + 3, 0x2716, "New", New);
}
AddBackgroundZero(0, 0, width, y + 40, 0x13BE);
}
private void TownHouseMenu(object obj)
{
if (!(obj is TownHouseSign))
{
return;
}
NewGump();
new TownHouseSetupGump(Owner, (TownHouseSign)obj);
}
private void Page(object obj)
{
c_ListPage = (ListPage)obj;
NewGump();
}
private void Goto(object obj)
{
if (!(obj is BaseHouse))
{
return;
}
Owner.Location = ((BaseHouse)obj).BanLocation;
Owner.Map = ((BaseHouse)obj).Map;
NewGump();
}
private void HouseMenu(object obj)
{
if (!(obj is BaseHouse))
{
return;
}
NewGump();
#if ServUOX
Owner.SendGump(new HouseGump(0, Owner, (BaseHouse)obj));
#else
if (Core.AOS)
{
Owner.SendGump(new HouseGumpAOS(0, Owner, (BaseHouse)obj));
}
else
{
Owner.SendGump(new HouseGump(Owner, (BaseHouse)obj));
}
#endif
}
private void New()
{
var sign = new TownHouseSign();
Owner.AddToBackpack(sign);
Owner.SendMessage("A new sign is now in your backpack. It will move on it's own during setup, but if you don't complete setup you may want to delete it.");
NewGump();
new TownHouseSetupGump(Owner, sign);
}
private void PageUp()
{
c_Page++;
NewGump();
}
private void PageDown()
{
c_Page--;
NewGump();
}
private class InternalSort : IComparer
{
public int Compare(object x, object y)
{
if (x == null && y == null)
{
return 0;
}
if (x is TownHouseSign)
{
var a = (TownHouseSign)x;
var b = (TownHouseSign)y;
return Insensitive.Compare(a.Name, b.Name);
}
else
{
var a = (BaseHouse)x;
var b = (BaseHouse)y;
if (a.Owner == null && b.Owner != null)
{
return -1;
}
if (a.Owner != null && b.Owner == null)
{
return 1;
}
return Insensitive.Compare(a.Owner.RawName, b.Owner.RawName);
}
}
}
}
}