Beispiel #1
0
        public static void UpdateRegion(TownHouseSign sign)
        {
            if (sign.House == null)
            {
                return;
            }

            #if (RunUO_1_Final)
            sign.House.Region.Coords = new ArrayList(sign.Blocks);
            sign.House.Region.MinZ   = sign.MinZ;
            sign.House.Region.MaxZ   = sign.MaxZ;
            sign.House.Region.Unregister();
            sign.House.Region.Register();
            sign.House.Region.GoLocation = sign.BanLoc;
            #elif (RunUO_2_RC1)
            sign.House.UpdateRegion();

            Rectangle3D rect = new Rectangle3D(Point3D.Zero, Point3D.Zero);

            for (int i = 0; i < sign.House.Region.Area.Length; ++i)
            {
                rect = sign.House.Region.Area[i];
                rect = new Rectangle3D(new Point3D(rect.Start.X - sign.House.X, rect.Start.Y - sign.House.Y, sign.MinZ), new Point3D(rect.End.X - sign.House.X, rect.End.Y - sign.House.Y, sign.MaxZ));
                sign.House.Region.Area[i] = rect;
            }

            sign.House.Region.Unregister();
            sign.House.Region.Register();
            sign.House.Region.GoLocation = sign.BanLoc;
            #endif
        }
Beispiel #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            if (version >= 2)
            {
                m_Hanger = reader.ReadItem();
            }

            m_Sign = (TownHouseSign)reader.ReadItem();

            if (version <= 2)
            {
                int count = reader.ReadInt();
                for (int i = 0; i < count; ++i)
                {
                    reader.ReadRect2D();
                }
            }

            if (Price == 0)
            {
                Price = 1;
            }

            ItemID = 0x1DD6 | 0x4000;
        }
Beispiel #3
0
            public int Compare(object x, object y)
            {
                if (x == null && y == null)
                {
                    return(0);
                }

                if (x is TownHouseSign)
                {
                    TownHouseSign a = (TownHouseSign)x;
                    TownHouseSign b = (TownHouseSign)y;

                    return(Insensitive.Compare(a.Name, b.Name));
                }
                else
                {
                    BaseHouse a = (BaseHouse)x;
                    BaseHouse 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));
                }
            }
 public InternalTarget(TownHouseSetupGump gump, TownHouseSign sign, TargetType type, Point3D point) : base(20, true, TargetFlags.None)
 {
     m_Gump     = gump;
     m_Sign     = sign;
     m_Type     = type;
     m_BoundOne = point;
 }
Beispiel #5
0
        public TownHouse(Mobile m, TownHouseSign sign, int locks, int secures) : base(0x1DD6 | 0x4000, m, locks, secures)
        {
            m_Sign = sign;

            SetSign(0, 0, 0);

            s_TownHouses.Add(this);
        }
Beispiel #6
0
        private void New()
        {
            TownHouseSign 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);
        }
 public TownHouseConfirmGump(Mobile m, TownHouseSign sign) : base(m, 100, 100)
 {
     c_Sign = sign;
 }
Beispiel #8
0
        protected override void BuildGump()
        {
            int width = 400;
            int y     = 0;

            AddHtml(0, y += 10, width, "<CENTER>TownHouses Main Menu");
            AddImage(width / 2 - 120, y + 2, 0x39);
            AddImage(width / 2 + 90, y + 2, 0x3B);

            int pp = 10;

            if (m_Page != 0)
            {
                AddButton(width / 2 - 10, y += 25, 0x25E4, 0x25E5, "Page Down", new GumpCallback(PageDown));
            }

            ArrayList list = new ArrayList();

            if (m_ListPage == ListPage.Town)
            {
                list = new ArrayList(TownHouseSign.AllSigns);
            }
            else
            {
                foreach (Item item in World.Items.Values)
                {
                    if (item is BaseHouse)
                    {
                        list.Add(item);
                    }
                }
            }

            list.Sort(new InternalSort());

            AddHtml(0, y += 20, width, "<CENTER>" + (m_ListPage == ListPage.Town ? "TownHouses" : "Houses") + " Count: " + list.Count);
            AddHtml(0, y += 25, width, "<CENTER>TownHouses / Houses");
            AddButton(width / 2 - 100, y + 3, m_ListPage == ListPage.Town ? 0x939 : 0x2716, "Page", new GumpStateCallback(Page), ListPage.Town);
            AddButton(width / 2 + 90, y + 3, m_ListPage == ListPage.House ? 0x939 : 0x2716, "Page", new GumpStateCallback(Page), ListPage.House);

            TownHouseSign sign  = null;
            BaseHouse     house = null;

            y += 5;

            for (int i = m_Page * pp; i < (m_Page + 1) * pp && i < list.Count; ++i)
            {
                if (m_ListPage == ListPage.Town)
                {
                    sign = (TownHouseSign)list[i];

                    AddHtml(30, y += 20, width / 2 - 20, "<DIV ALIGN=LEFT>" + sign.Name);
                    AddButton(15, y + 3, 0x2716, "TownHouse Menu", new GumpStateCallback(TownHouseMenu), sign);

                    if (sign.House != null && sign.House.Owner != null)
                    {
                        AddHtml(width / 2, y, width / 2 - 40, "<DIV ALIGN=RIGHT>" + sign.House.Owner.RawName);
                        AddButton(width - 30, y + 3, 0x2716, "House Menu", new GumpStateCallback(HouseMenu), sign.House);
                    }
                }
                else
                {
                    house = (BaseHouse)list[i];

                    AddHtml(30, y += 20, width / 2 - 20, "<DIV ALIGN=LEFT>" + house.Name);
                    AddButton(15, y + 3, 0x2716, "Goto", new GumpStateCallback(Goto), house);

                    if (house.Owner != null)
                    {
                        AddHtml(width / 2, y, width / 2 - 40, "<DIV ALIGN=RIGHT>" + house.Owner.RawName);
                        AddButton(width - 30, y + 3, 0x2716, "House Menu", new GumpStateCallback(HouseMenu), house);
                    }
                }
            }

            if (pp * (m_Page + 1) < list.Count)
            {
                AddButton(width / 2 - 10, y += 25, 0x25E8, 0x25E9, "Page Up", new GumpCallback(PageUp));
            }

            if (m_ListPage == ListPage.Town)
            {
                AddHtml(0, y += 35, width, "<CENTER>Add New TownHouse");
                AddButton(width / 2 - 80, y + 3, 0x2716, "New", new GumpCallback(New));
                AddButton(width / 2 + 70, y + 3, 0x2716, "New", new GumpCallback(New));
            }

            AddBackgroundZero(0, 0, width, y + 40, 0x13BE);
        }
        public TownHouseSetupGump(Mobile m, TownHouseSign sign) : base(m, 50, 50)
        {
            m.CloseGump(typeof(TownHouseSetupGump));

            m_Sign = sign;
        }
 public InternalTarget(TownHouseSetupGump gump, TownHouseSign sign, TargetType type) : this(gump, sign, type, Point3D.Zero)
 {
 }