示例#1
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));
                }
            }
示例#2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

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

            c_Sign = (TownHouseSign)reader.ReadItem();

            if (version <= 2)
            {
                c_Blocks = new ArrayList();
                int count = reader.ReadInt();
                for (int i = 0; i < count; ++i)
                {
                    c_Blocks.Add(TownHouseSetupGump.FixRect(reader.ReadRect2D()));
                }
            }

            InitSectorDefinition();

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

            s_TownHouses.Add(this);
        }
示例#3
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();
            #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();
            #endif
        }
示例#4
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            if (version >= 2 && version < 4)
            {
                reader.ReadItem();
            }

            c_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;
        }
示例#5
0
        public TownHouseSetupGump(Mobile m, TownHouseSign sign)
            : base(m, 50, 50)
        {
            m.CloseGump(typeof(TownHouseSetupGump));

            c_Sign = sign;
        }
        public TownHouseSetupGump( Mobile m, TownHouseSign sign )
            : base(m, 50, 50)
        {
            m.CloseGump( typeof( TownHouseSetupGump ) );

            c_Sign = sign;
        }
示例#7
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
        }
示例#8
0
        public static void UpdateRegion(TownHouseSign sign)
        {
            if (sign.House == null)
            {
                return;
            }

            sign.House.UpdateRegion();

            Rectangle3D rect;

            for (var i = 0; i < sign.House.Region.Area.Length; ++i)
            {
                rect = sign.House.Region.Area[i];

                sign.House.Region.Area[i] =
                    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.Unregister();
            sign.House.Region.Register();
            sign.House.Region.GoLocation = sign.BanLoc;
        }
 public InternalTarget(TownHouseSetupGump gump, TownHouseSign sign, TargetType type, Point3D point) : base(20, true, TargetFlags.None)
 {
     c_Gump     = gump;
     c_Sign     = sign;
     c_Type     = type;
     c_BoundOne = point;
 }
示例#10
0
		public TownHouse( Mobile m, TownHouseSign sign, int locks, int secures ) : base( 0x1DD6 | 0x4000, m, locks, secures )
		{
			c_Sign = sign;

            SetSign( 0, 0, 0 );

			s_TownHouses.Add( this );
		}
示例#11
0
        public TownHouse(Mobile m, TownHouseSign sign, int locks, int secures) : base(0x1DD6 | 0x4000, m, locks, secures)
        {
            c_Sign = sign;

            SetSign(0, 0, 0);

            s_TownHouses.Add(this);
        }
        public TownHouseConfirmGump(Mobile m, TownHouseSign sign) : base(m, 100, 100)
        {
            Override = false;

            c_Sign = sign;

            NewGump();
        }
示例#13
0
        public TownHouse(Mobile m, TownHouseSign sign, ArrayList list, int locks, int secures) : base(0x1DD8 | 0x4000, m, locks, secures)
        {
            c_Sign   = sign;
            c_Blocks = list;

            SetSign(0, 0, 0);

            s_TownHouses.Add(this);
        }
示例#14
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);
        }
示例#15
0
        private void New()
        {
            TownHouseSign sign = new TownHouseSign();

            Owner.AddToBackpack(sign);
            Owner.SendMessage("Une nouvelle enseigne est maintenant dans votre sac à do.s Il se déplace par lui-même lors de l'installation, mais si que vous ne terminez pas l'installation, vous pouvez le supprimer");

            NewGump();

            new TownHouseSetupGump(Owner, sign);
        }
示例#16
0
        public TownHouseSetupGump(Mobile m, TownHouseSign sign) : base(m, 50, 50)
        {
            m.CloseGump(typeof(TownHouseSetupGump));

            c_Sign = sign;

            if (!c_Sign.Owned)
            {
                c_Page = Page.Blocks;
            }

            NewGump();
        }
示例#17
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 (c_Page != 0)
            {
                AddButton(width / 2 - 10, y += 25, 0x25E4, 0x25E5, "Page Down", PageDown);
            }

            ArrayList list = new ArrayList(TownHouseSign.AllSigns);

            list.Sort(new InternalSort());

            TownHouseSign sign = null;

            y += 5;

            for (int i = c_Page * pp; i < (c_Page + 1) * pp && i < list.Count; ++i)
            {
                sign = (TownHouseSign)list[i];

                AddHtml(30, y += 20, width / 2 - 20, "<DIV ALIGN=LEFT>" + sign.Name);
                AddButton(15, y + 3, 0x2716, "TownHouse Menu", 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", HouseMenu, sign.House);
                }
            }

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

            AddHtml(0, y += 35, width, "<CENTER>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);
        }
示例#18
0
            public int Compare(object x, object y)
            {
                if (x == null && y == null)
                {
                    return(0);
                }
                if (x == null || !(x is TownHouseSign))
                {
                    return(-1);
                }
                if (y == null || !(y is TownHouseSign))
                {
                    return(1);
                }

                TownHouseSign a = (TownHouseSign)x;
                TownHouseSign b = (TownHouseSign)y;

                return(Insensitive.Compare(a.Name, b.Name));
            }
示例#19
0
        private void RecreateSign()
        {
            c_Sign          = new TownHouseSign();
            c_Sign.Map      = Map;
            c_Sign.Location = Sign.Location;
            c_Sign.Z        = Sign.Z - 5;
            c_Sign.Price    = Price;
            c_Sign.Blocks   = new ArrayList(c_Blocks);
            c_Sign.House    = this;
            c_Sign.MinZ     = Region.MinZ;
            c_Sign.MaxZ     = Region.MaxZ;
            c_Sign.Locks    = MaxLockDowns;
            c_Sign.Secures  = MaxSecures;
            c_Sign.BanLoc   = Region.GoLocation;
            c_Sign.SignLoc  = Sign.Location;

            if (Owner != null)
            {
                Errors.Report(String.Format("A Town House Setup sign has been generated for {0}'s TownHouse.  This is not normal, as the sign should never had been deleted.  Some properties of their home may not be the same intended.", Owner.Name));
            }
        }
示例#20
0
        public static void UpdateRegion(TownHouseSign sign)
        {
            if (sign.House == null)
            {
                return;
            }

            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;
        }
 public InternalTarget(TownHouseSetupGump gump, TownHouseSign sign, TargetType type) : this(gump, sign, type, Point3D.Zero)
 {
 }
 public static void SendTo(Mobile m, TownHouseSign sign)
 {
     new TownHouseConfirmGump(m, sign);
 }
示例#23
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 (c_Page != 0)
            {
                AddButton(width / 2 - 10, y += 25, 0x25E4, 0x25E5, "Page Down", new GumpCallback(PageDown));
            }

            ArrayList list = new ArrayList();

            if (c_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>" + (c_ListPage == ListPage.Town ? "TownHouses" : "Houses") + " Count: " + list.Count);
            AddHtml(0, y += 25, width, "<CENTER>TownHouses / Houses");
            AddButton(width / 2 - 100, y + 3, c_ListPage == ListPage.Town ? 0x939 : 0x2716, "Page", new GumpStateCallback(Page), ListPage.Town);
            AddButton(width / 2 + 90, y + 3, c_ListPage == ListPage.House ? 0x939 : 0x2716, "Page", new GumpStateCallback(Page), ListPage.House);

            TownHouseSign sign  = null;
            BaseHouse     house = null;

            y += 5;

            for (int i = c_Page * pp; i < (c_Page + 1) * pp && i < list.Count; ++i)
            {
                if (c_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 * (c_Page + 1) < list.Count)
            {
                AddButton(width / 2 - 10, y += 25, 0x25E8, 0x25E9, "Page Up", new GumpCallback(PageUp));
            }

            if (c_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);
        }
示例#24
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            if ( version >= 2 )
                c_Hanger = reader.ReadItem();

            c_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;
        }
示例#25
0
 public TownHouseConfirmGump(Mobile m, TownHouseSign sign) : base(m, 100, 100)
 {
     c_Sign = sign;
 }
示例#26
0
        protected override void BuildGump()
        {
            var width = 400;
            var 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);

            var pp = 10;

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

            var list = new ArrayList();

            if (c_ListPage == ListPage.Town)
            {
                list.AddRange(TownHouseSign.AllSigns);
            }
            else
            {
                list.AddRange(BaseHouse.AllHouses);
            }

            list.Sort(new InternalSort());

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

            TownHouseSign sign  = null;
            BaseHouse     house = null;

            y += 5;

            for (var i = c_Page * pp; i < (c_Page + 1) * pp && i < list.Count; ++i)
            {
                if (c_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", 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", 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", 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", 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, "<CENTER>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);
        }
示例#27
0
        private void New()
        {
            TownHouseSign sign = new TownHouseSign();
            Owner.AddToBackpack(sign);
            Owner.SendMessage("Une nouvelle enseigne est maintenant dans votre sac à do.s Il se déplace par lui-même lors de l'installation, mais si que vous ne terminez pas l'installation, vous pouvez le supprimer");

            NewGump();

            new TownHouseSetupGump(Owner, sign);
        }
示例#28
0
			public InternalTarget( TownHouseSetupGump gump, TownHouseSign sign, TargetType type, Point3D point ) : base( 20, true, TargetFlags.None )
			{
				c_Gump = gump;
				c_Sign = sign;
				c_Type = type;
				c_BoundOne = point;
			}
示例#29
0
			public InternalTarget( TownHouseSetupGump gump, TownHouseSign sign, TargetType type ) : this( gump, sign, type, Point3D.Zero ){}
        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);
        }
示例#31
0
		public TownHouseConfirmGump( Mobile m, TownHouseSign sign ) : base( m, 100, 100 )
		{
			c_Sign = sign;
		}