コード例 #1
0
        public static void GenGates()
        {
            RemGates();

            if (m_CategoryList == null)
            {
                m_CategoryList = new List <PGCategory>();
            }

            int count = 0;
            IEnumerator <PGCategory> PGC = m_CategoryList.GetEnumerator();

            while (PGC.MoveNext())
            {
                if (PGC.Current.GetFlag(EntryFlag.Generate))
                {
                    IEnumerator <PGLocation> PGL = PGC.Current.Locations.GetEnumerator();
                    while (PGL.MoveNext())
                    {
                        if (PGL.Current.GetFlag(EntryFlag.Generate))
                        {
                            PublicGate gate = new PublicGate();

                            gate.MoveToWorld(PGL.Current.Location, PGL.Current.Map);
                            gate.Name = "Public Gate: " + PGL.Current.Name;
                            gate.Hue  = PGL.Current.Hue;
                            count++;
                        }
                    }
                }
            }

            World.Broadcast(6, true, "{0} public gates generated.", count);
        }
コード例 #2
0
        public PGAddEditGump(Conditions conditions, int curC, int curL, PublicGate gate) : base(0, 0)
        {
            if (!PGSystem.Running)
            {
                return;
            }

            m_Conditions = conditions;
            m_CurCat     = curC;
            m_CurLoc     = curL;
            m_Gate       = gate;

            if (!GetFlag(Conditions.Category) || (GetFlag(Conditions.Category) && !GetFlag(Conditions.Adding)))
            {
                m_Cat = PGSystem.CategoryList[curC];
            }
            if (m_Cat != null && (!GetFlag(Conditions.Category) && !GetFlag(Conditions.Adding)))
            {
                m_Loc = m_Cat.Locations[curL];
            }


            string Name = "";

            if (!GetFlag(Conditions.Adding))
            {
                if (GetFlag(Conditions.Category))
                {
                    Name = m_Cat.Name;
                }
                else
                {
                    Name = m_Loc.Name;
                }
            }

            Point3D Loc = new Point3D(0, 0, 0);
            Map     Map = Map.Trammel;
            bool    Gen, Staff, Reds, Charge, Young;
            int     Hue, Cost;

            Gen = Staff = Reds = Charge = Young = false;
            Hue = Cost = 0;

            if (GetFlag(Conditions.Category) && !GetFlag(Conditions.Adding))
            {
                Gen    = m_Cat.GetFlag(EntryFlag.Generate);
                Staff  = m_Cat.GetFlag(EntryFlag.StaffOnly);
                Reds   = m_Cat.GetFlag(EntryFlag.Reds);
                Charge = m_Cat.GetFlag(EntryFlag.Charge);
                Young  = m_Cat.GetFlag(EntryFlag.Young);
                Cost   = m_Cat.Cost;
            }

            if (!GetFlag(Conditions.Category) && !GetFlag(Conditions.Adding))
            {
                Loc    = m_Loc.Location;
                Map    = m_Loc.Map;
                Gen    = m_Loc.GetFlag(EntryFlag.Generate);
                Staff  = m_Loc.GetFlag(EntryFlag.StaffOnly);
                Reds   = m_Loc.GetFlag(EntryFlag.Reds);
                Charge = m_Loc.GetFlag(EntryFlag.Charge);
                Young  = m_Loc.GetFlag(EntryFlag.Young);
                Hue    = m_Loc.Hue;
                Cost   = m_Loc.Cost;
            }

            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            AddPage(0);

            AddBackground(530, 100, 230, 410, 2600);
            AddLabel(602, 120, 0, string.Format("{0} {1}", (GetFlag(Conditions.Adding) ? "Add" : "Edit"), (GetFlag(Conditions.Category) ? "Category" : "Location")));

            AddLabel(625, 145, 0, "Name :");
            AddImage(555, 170, 2446);
            AddTextEntry(565, 170, 160, 20, 0, 2, Name);

            AddLabel(715, 235, 0, ": C");
            AddImage(650, 235, 2443);
            AddTextEntry(655, 235, 55, 20, 0, 15, Cost.ToString());

            if (!GetFlag(Conditions.Category))
            {
                AddLabel(560, 210, 0, "X :");
                AddImage(580, 210, 2443);
                AddTextEntry(585, 210, 55, 20, 0, 3, Loc.X.ToString());

                AddLabel(560, 235, 0, "Y :");
                AddImage(580, 235, 2443);
                AddTextEntry(585, 235, 55, 20, 0, 4, Loc.Y.ToString());

                AddLabel(560, 260, 0, "Z :");
                AddImage(580, 260, 2443);
                AddTextEntry(585, 260, 55, 20, 0, 5, Loc.Z.ToString());

                AddLabel(715, 210, 0, ": H");
                AddImage(650, 210, 2443);
                AddTextEntry(655, 210, 55, 20, 0, 14, Hue.ToString());

                AddLabel(585, 315, 0, "Trammel");
                AddRadio(555, 315, 208, 209, (Map == Map.Trammel ? true : false), 6);

                AddLabel(585, 340, 0, "Felucca");
                AddRadio(555, 340, 208, 209, (Map == Map.Felucca ? true : false), 7);

                AddLabel(685, 315, 0, "Malas");
                AddRadio(655, 315, 208, 209, (Map == Map.Malas ? true : false), 8);

                AddLabel(685, 345, 0, "Ilshenar");
                AddRadio(655, 340, 208, 209, (Map == Map.Ilshenar ? true : false), 9);

                AddLabel(585, 365, 0, "Tokuno");
                AddRadio(555, 370, 208, 209, (Map == Map.Tokuno ? true : false), 10);

                AddLabel(685, 365, 0, "TerMur");
                AddRadio(655, 370, 208, 209, (Map == Map.TerMur ? true : false), 20);
            }


            AddLabel(585, 395, 0, "Generate?");
            AddCheck(555, 395, 210, 211, Gen, 11);

            AddLabel(665, 395, 0, "Young?");
            AddCheck(715, 395, 210, 211, Young, 16);

            AddLabel(585, 420, 0, "Reds?");
            AddCheck(555, 420, 210, 211, Reds, 13);

            AddLabel(658, 420, 0, "Charge?");
            AddCheck(715, 420, 210, 211, Charge, 17);

            AddLabel(585, 445, 0, "Staff Only?");
            AddCheck(555, 445, 210, 211, Staff, 12);

            AddButton(700, 450, 1417, 1417, 1, GumpButtonType.Reply, 0);
            AddLabel(728, 481, 69, "Apply");
        }
コード例 #3
0
ファイル: PGGump.cs プロジェクト: alucardxlx/uo-crystal
        public PGGump(Mobile from, int Page, PublicGate gate) : base(0, 0)
        {
            if (!PGSystem.Running)
            {
                return;
            }

            if (PGSystem.CategoryList == null || PGSystem.CategoryList.Count == 0)
            {
                SetFlag(EntryFlag.StaffOnly, true);
                SetFlag(EntryFlag.Generate, false);
                PGSystem.CategoryList = new List <PGCategory>();
                PGSystem.CategoryList.Add(new PGCategory("Empty System", EFlags));
            }

            m_From = from;
            m_Page = Page;
            m_Gate = gate;

            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            AddPage(0);

            #region Categories
            int Cats = CountCats();

            int CStart = (250 - ((Cats / 2) * 25));
            if (CStart < 0)
            {
                CStart = 0;
            }

            AddBackground(0, CStart, 230, 100 + Cats * 25, 2600);
            AddHtml(0, CStart + 15, 230, 20, "<BASEFONT COLOR=#58D3F7 SIZE=8><CENTER>Traveler's Traverse</CENTER></BASEFONT>", false, false);

            int CurC = 0;
            for (int i = 0; i < PGSystem.CategoryList.Count; i++)
            {
                PGCategory PGC = PGSystem.CategoryList[i];
                if (PGC != null)
                {
                    if (from.AccessLevel >= PGSystem.PGAccessLevel)
                    {
                        AddButton(20, CStart + 53 + CurC * 25, (Page == i ? 209 : 208), (Page == i ? 208 : 209), 100 + i, GumpButtonType.Reply, 0);
                        AddLabel(50, CStart + 53 + CurC * 25, (Page == i ? 69 : 0), PGC.Name);
                        CurC++;
                        continue;
                    }

                    if (PGC.GetFlag(EntryFlag.StaffOnly) && from.AccessLevel == AccessLevel.Player)
                    {
                        continue;
                    }
                    if (!PGC.GetFlag(EntryFlag.StaffOnly))
                    {
                        if (PGC.GetFlag(EntryFlag.Young) && !((PlayerMobile)from).Young)
                        {
                            continue;
                        }
                        if (!PGC.GetFlag(EntryFlag.Reds) && from.Kills >= 5)
                        {
                            continue;
                        }
                    }

                    AddButton(20, CStart + 53 + CurC * 25, (Page == i ? 209 : 208), (Page == i ? 208 : 209), 100 + i, GumpButtonType.Reply, 0);
                    AddLabel(50, CStart + 53 + CurC * 25, (Page == i ? 69 : 0), PGC.Name);
                    CurC++;
                }
            }

            if (from.AccessLevel >= PGSystem.PGAccessLevel)
            {
                AddLabel(75, CStart + 65 + Cats * 25, 0, "Add");
                AddButton(50, CStart + 65 + Cats * 25, 208, 209, 2, GumpButtonType.Reply, 0);
                AddLabel(125, CStart + 65 + Cats * 25, 0, "Edit");
                AddButton(160, CStart + 65 + Cats * 25, 208, 209, 3, GumpButtonType.Reply, 0);
            }
            #endregion             //Categories

            #region Locations
            int Locs = CountLocs();
            if (Locs == -1)
            {
                Locs = 0;
            }

            int LStart = (250 - ((Locs / 2) * 25));
            if (LStart < 20)
            {
                LStart = 20;
            }

            AddBackground(230, LStart, 300, 100 + Locs * 25, 2600);

            int        CurL = 0;
            PGCategory PGCL = PGSystem.CategoryList[m_Page];
            if (PGCL != null && PGCL.Locations != null)
            {
                for (int i = 0; i < PGCL.Locations.Count; i++)
                {
                    PGLocation PGL = PGCL.Locations[i];
                    if (PGL != null)
                    {
                        if (from.AccessLevel >= PGSystem.PGAccessLevel)
                        {
                            AddRadio(250, LStart + 53 + CurL * 25, 208, 209, false, 200 + i);
                            AddLabel(280, LStart + 53 + CurL * 25, 0, PGL.Name);
                            CurL++;
                            continue;
                        }

                        if (PGL.GetFlag(EntryFlag.StaffOnly) && from.AccessLevel == AccessLevel.Player)
                        {
                            continue;
                        }
                        if (!PGL.GetFlag(EntryFlag.StaffOnly))
                        {
                            if (PGL.GetFlag(EntryFlag.Young) && !((PlayerMobile)from).Young)
                            {
                                continue;
                            }
                            if (!PGL.GetFlag(EntryFlag.Reds) && from.Kills >= 5)
                            {
                                continue;
                            }
                        }

                        AddRadio(250, LStart + 53 + CurL * 25, 208, 209, false, 200 + i);
                        AddLabel(280, LStart + 53 + CurL * 25, 0, PGL.Name);
                        CurL++;
                    }
                }
            }

            AddButton(465, LStart - 20, 1417, 1417, 1, GumpButtonType.Reply, 0);
            AddHtml(485, LStart + 10, 40, 40, "<BODY><BASEFONT SIZE=7 COLOR=#2E64FE><CENTER><I><B>GO</B></I></CENTER></BASEFONT></BODY>", false, false);

            if (from.AccessLevel >= PGSystem.PGAccessLevel)
            {
                AddLabel(305, LStart + 15, 0, "Add Current Gate");
                AddButton(280, LStart + 15, 208, 209, 6, GumpButtonType.Reply, 0);

                AddLabel(305, LStart + 65 + Locs * 25, 0, "Add");
                AddButton(280, LStart + 65 + Locs * 25, 208, 209, 4, GumpButtonType.Reply, 0);

                AddLabel(430, LStart + 65 + Locs * 25, 0, "Edit");
                AddButton(460, LStart + 65 + Locs * 25, 208, 209, 5, GumpButtonType.Reply, 0);
            }
            #endregion             //Locations
        }
コード例 #4
0
ファイル: PGGump.cs プロジェクト: FreeReign/realmofdarkness
		public PGGump( Mobile from, int Page, PublicGate gate ) : base( 0, 0 )
		{
			if( !PGSystem.Running )
				return;

			if( PGSystem.CategoryList == null || PGSystem.CategoryList.Count == 0 )
			{
				SetFlag( EntryFlag.StaffOnly, true );
				SetFlag( EntryFlag.Generate, false );
				PGSystem.CategoryList = new List<PGCategory>();
				PGSystem.CategoryList.Add( new PGCategory( "Empty System", EFlags ) );
			}

			m_From = from;
			m_Page = Page;
			m_Gate = gate;

			Closable = true;
			Disposable = true;
			Dragable = true;
			Resizable = false;

			AddPage(0);

			#region Categories
			int Cats = CountCats();

			int CStart = (250 - ((Cats / 2) * 25));
			if( CStart < 0 )
				CStart = 0;

			AddBackground( 0, CStart, 230, 100+Cats*25, 2600 );
			AddHtml( 0, CStart+15, 230, 20, "<BASEFONT SIZE=7><CENTER>Public Moongate</CENTER></BASEFONT>", false, false );

			int CurC = 0;
			for( int i = 0; i < PGSystem.CategoryList.Count; i++ )
			{
				PGCategory PGC = PGSystem.CategoryList[i];
				if( PGC != null )
				{
					if( from.AccessLevel >= PGSystem.PGAccessLevel )
					{
						AddButton( 20, CStart+53+CurC*25, (Page == i ? 209 : 208), (Page == i ? 208 : 209), 100+i, GumpButtonType.Reply, 0);
						AddLabel( 50, CStart+53+CurC*25, (Page == i ? 69 : 0), PGC.Name );
						CurC++;
						continue;
					}

					if( PGC.GetFlag( EntryFlag.StaffOnly ) && from.AccessLevel == AccessLevel.Player )
						continue;
					if( !PGC.GetFlag( EntryFlag.StaffOnly ) )
					{
						if( PGC.GetFlag( EntryFlag.Young ) && !((PlayerMobile)from).Young )
							continue;
						if( !PGC.GetFlag( EntryFlag.Reds ) && from.Kills >= 5 )
							continue;
					}

					AddButton( 20, CStart+53+CurC*25, (Page == i ? 209 : 208), (Page == i ? 208 : 209), 100+i, GumpButtonType.Reply, 0);
					AddLabel( 50, CStart+53+CurC*25, (Page == i ? 69 : 0), PGC.Name );
					CurC++;
				}
			}

			if( from.AccessLevel >= PGSystem.PGAccessLevel )
			{
				AddLabel(   75, CStart+65+Cats*25, 0, "Add" );
				AddButton(  50, CStart+65+Cats*25, 208, 209, 2, GumpButtonType.Reply, 0 );
				AddLabel(  125, CStart+65+Cats*25, 0, "Edit" );
				AddButton( 160, CStart+65+Cats*25, 208, 209, 3, GumpButtonType.Reply, 0 );
			}
			#endregion //Categories

			#region Locations
			int Locs = CountLocs();
			if( Locs == -1 )
				Locs = 0;

			int LStart = (250 - ((Locs / 2) * 25));
			if( LStart < 20 )
				LStart = 20;

			AddBackground( 230, LStart, 300, 100+Locs*25, 2600 );

			int CurL = 0;
			PGCategory PGCL = PGSystem.CategoryList[m_Page];
			if( PGCL != null && PGCL.Locations != null )
			{
				for( int i = 0; i < PGCL.Locations.Count; i++ )
				{
					PGLocation PGL = PGCL.Locations[i];
					if( PGL != null )
					{
						if( from.AccessLevel >= PGSystem.PGAccessLevel )
						{
							AddRadio( 250, LStart+53+CurL*25, 208, 209, false, 200+i );
							AddLabel( 280, LStart+53+CurL*25, 0, PGL.Name );
							CurL++;
							continue;
						}

						if( PGL.GetFlag( EntryFlag.StaffOnly ) && from.AccessLevel == AccessLevel.Player )
							continue;
						if( !PGL.GetFlag( EntryFlag.StaffOnly ) )
						{
							if( PGL.GetFlag( EntryFlag.Young ) && !((PlayerMobile)from).Young )
								continue;
							if( !PGL.GetFlag( EntryFlag.Reds ) && from.Kills >= 5 )
								continue;
						}

						AddRadio( 250, LStart+53+CurL*25, 208, 209, false, 200+i );
						AddLabel( 280, LStart+53+CurL*25, 0, PGL.Name );
						CurL++;
					}
				}
			}

			AddButton( 465, LStart-20, 1417, 1417, 1, GumpButtonType.Reply, 0);
			AddHtml( 485, LStart+10, 40, 40, "<BODY><BASEFONT SIZE=7 COLOR=#33AA33><CENTER><I><B>GO</B></I></CENTER></BASEFONT></BODY>", false, false);

			if( from.AccessLevel >= PGSystem.PGAccessLevel )
			{
				AddLabel( 305, LStart+15, 0, "Add Current Gate" );
				AddButton( 280, LStart+15, 208, 209, 6, GumpButtonType.Reply, 0 );

				AddLabel( 305, LStart+65+Locs*25, 0, "Add" );
				AddButton( 280, LStart+65+Locs*25, 208, 209, 4, GumpButtonType.Reply, 0 );

				AddLabel( 430, LStart+65+Locs*25, 0, "Edit" );
				AddButton( 460, LStart+65+Locs*25, 208, 209, 5, GumpButtonType.Reply, 0);
			}
			#endregion //Locations
		}
コード例 #5
0
ファイル: PGGump.cs プロジェクト: tbewley10310/Land-of-Archon
        public PGGump(Mobile from, int Page, PublicGate gate) : base(0, 0)
        {
            if (!PGSystem.Running)
            {
                return;
            }

            if (PGSystem.CategoryList == null || PGSystem.CategoryList.Count == 0)
            {
                SetFlag(EntryFlag.StaffOnly, true);
                SetFlag(EntryFlag.Generate, false);
                PGSystem.CategoryList = new List <PGCategory>();
                PGSystem.CategoryList.Add(new PGCategory("Empty System", EFlags));
            }

            m_From = from;
            m_Page = Page;
            m_Gate = gate;

            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            AddPage(0);

            int Locs     = CountLocs();
            int Cats     = CountCats();
            int BHeightT = Locs;
            int BWidth   = 430;

            if (Locs < Cats)
            {
                BHeightT = Cats;
            }

            int BHeight = 280 > (100 + (BHeightT * 25)) ? 280 : (100 + (BHeightT * 25));


            AddBackground(0, 0, BWidth, BHeight, 9270);
            AddLabel(20, 10, 1153, "The Grove");
            AddLabel(215, 10, 1153, "Where ya headed?:");

            AddButton(15, BHeight - 70, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddLabel(50, BHeight - 70, 1153, "OKAY");

            AddButton(15, BHeight - 45, 4005, 4007, 0, GumpButtonType.Reply, 0);
            AddLabel(50, BHeight - 45, 1153, "CANCEL");

            #region Categories
            int CStart = 35;

            int CurC = 0;
            for (int i = 0; i < PGSystem.CategoryList.Count; i++)
            {
                PGCategory PGC = PGSystem.CategoryList[i];
                if (PGC != null)
                {
                    if (from.AccessLevel >= PGSystem.PGAccessLevel)
                    {
                        AddButton(15, CStart + (CurC * 25), (Page == i ? 2118 : 2117), (Page == i ? 2117 : 2118), 100 + i, GumpButtonType.Reply, 0);
                        AddLabel(35, CStart + (CurC * 25), (Page == i ? 53 : PGC.Hue == 0 ? 1153 : PGC.Hue), (Page == i ? (PGC.Name + " <--") : PGC.Name));
                        CurC++;
                        continue;
                    }

                    if (PGC.GetFlag(EntryFlag.StaffOnly) && from.AccessLevel == AccessLevel.Player)
                    {
                        continue;
                    }
                    if (!PGC.GetFlag(EntryFlag.StaffOnly))
                    {
                        if (PGC.GetFlag(EntryFlag.Young) && !((PlayerMobile)from).Young)
                        {
                            continue;
                        }
                        if (!PGC.GetFlag(EntryFlag.Reds) && from.Kills >= 5)
                        {
                            continue;
                        }
                    }

                    AddButton(15, CStart + (CurC * 25), (Page == i ? 2118 : 2117), (Page == i ? 2117 : 2118), 100 + i, GumpButtonType.Reply, 0);
                    AddLabel(35, CStart + (CurC * 25), (Page == i ? 53 : PGC.Hue == 0 ? 1153 : PGC.Hue), (Page == i ? (PGC.Name + " <--") : PGC.Name));
                    CurC++;
                }
            }

            if (from.AccessLevel >= PGSystem.PGAccessLevel)
            {
                AddLabel(160, BHeight - 70, 1153, "ADD");
                AddButton(125, BHeight - 70, 4005, 4007, 2, GumpButtonType.Reply, 0);
                AddLabel(160, BHeight - 45, 1153, "EDIT");
                AddButton(125, BHeight - 45, 4005, 4007, 3, GumpButtonType.Reply, 0);
            }
            #endregion             //Categories

            #region Locations
            if (Locs == -1)
            {
                Locs = 0;
            }

            int LStart = 35;


            int        CurL = 0;
            PGCategory PGCL = PGSystem.CategoryList[m_Page];
            if (PGCL != null && PGCL.Locations != null)
            {
                for (int i = 0; i < PGCL.Locations.Count; i++)
                {
                    PGLocation PGL = PGCL.Locations[i];
                    if (PGL != null)
                    {
                        if (from.AccessLevel >= PGSystem.PGAccessLevel)
                        {
                            AddRadio(215, LStart + (CurL * 25), 210, 211, false, 200 + i);
                            AddLabel(235, LStart + (CurL * 25), PGL.Hue == 0 ? 1153 : PGL.Hue, PGL.Name);
                            CurL++;
                            continue;
                        }

                        if (PGL.GetFlag(EntryFlag.StaffOnly) && from.AccessLevel == AccessLevel.Player)
                        {
                            continue;
                        }
                        if (!PGL.GetFlag(EntryFlag.StaffOnly))
                        {
                            if (PGL.GetFlag(EntryFlag.Young) && !((PlayerMobile)from).Young)
                            {
                                continue;
                            }
                            if (!PGL.GetFlag(EntryFlag.Reds) && from.Kills >= 5)
                            {
                                continue;
                            }
                        }

                        AddRadio(215, LStart + (CurL * 25), 210, 211, false, 200 + i);
                        AddLabel(235, LStart + (CurL * 25), PGL.Hue == 0 ? 1153 : PGL.Hue, PGL.Name);
                        CurL++;
                    }
                }
            }


            if (from.AccessLevel >= PGSystem.PGAccessLevel)
            {
                AddButton(215, BHeight - 45, 4005, 4007, 6, GumpButtonType.Reply, 0);
                AddLabel(250, BHeight - 45, 1153, "Add Current");

                AddLabel(370, BHeight - 70, 1153, "ADD");
                AddButton(335, BHeight - 70, 4005, 4007, 4, GumpButtonType.Reply, 0);

                AddLabel(370, BHeight - 45, 1153, "EDIT");
                AddButton(335, BHeight - 45, 4005, 4007, 5, GumpButtonType.Reply, 0);
            }
            #endregion             //Locations
        }
コード例 #6
0
		public PGAddEditGump( Conditions conditions, int curC, int curL, PublicGate gate ) : base( 0, 0 )
		{
			if( !PGSystem.Running )
				return;

			m_Conditions = conditions;
			m_CurCat     = curC;
			m_CurLoc     = curL;
			m_Gate       = gate;

			if( !GetFlag( Conditions.Category ) || (GetFlag( Conditions.Category ) && !GetFlag( Conditions.Adding )) )
				m_Cat = PGSystem.CategoryList[curC];
			if( m_Cat != null && (!GetFlag( Conditions.Category ) && !GetFlag( Conditions.Adding )) )
				m_Loc = m_Cat.Locations[curL];


			string Name = "";
			if( !GetFlag( Conditions.Adding ) )
			{
				if( GetFlag( Conditions.Category ) )
					Name = m_Cat.Name;
				else
					Name = m_Loc.Name;
			}

			Point3D Loc = new Point3D( 0, 0, 0 );
			Map Map = Map.Trammel;
			bool Gen, Staff, Reds, Charge, Young;
			int Hue, Cost;
			Gen = Staff = Reds = Charge = Young = false;
			Hue = Cost = 0;

			if( GetFlag( Conditions.Category ) && !GetFlag( Conditions.Adding ) )
			{
				Gen    = m_Cat.GetFlag( EntryFlag.Generate );
				Staff  = m_Cat.GetFlag( EntryFlag.StaffOnly );
				Reds   = m_Cat.GetFlag( EntryFlag.Reds );
				Charge = m_Cat.GetFlag( EntryFlag.Charge );
				Young  = m_Cat.GetFlag( EntryFlag.Young );
				Cost   = m_Cat.Cost;
			}

			if( !GetFlag( Conditions.Category ) && !GetFlag( Conditions.Adding ) )
			{
				Loc    = m_Loc.Location;
				Map    = m_Loc.Map;
				Gen    = m_Loc.GetFlag( EntryFlag.Generate );
				Staff  = m_Loc.GetFlag( EntryFlag.StaffOnly );
				Reds   = m_Loc.GetFlag( EntryFlag.Reds );
				Charge = m_Loc.GetFlag( EntryFlag.Charge );
				Young  = m_Loc.GetFlag( EntryFlag.Young );
				Hue    = m_Loc.Hue;
				Cost   = m_Loc.Cost;
			}

			Closable   = true;
			Disposable = true;
			Dragable   = true;
			Resizable  = false;

			AddPage(0);

			AddBackground( 530, 100, 230, 410, 2600 );
			AddLabel( 602, 120, 0, string.Format("{0} {1}", (GetFlag(Conditions.Adding) ? "Add" : "Edit"), (GetFlag(Conditions.Category) ? "Category" : "Location")) );

			AddLabel( 625, 145, 0, "Name :" );
			AddImage( 555, 170, 2446 );
			AddTextEntry( 565, 170, 160, 20, 0, 2, Name );

			AddLabel( 715, 235, 0, ": C" );
			AddImage( 650, 235, 2443 );
			AddTextEntry( 655, 235, 55, 20, 0, 15, Cost.ToString() );

			if( !GetFlag(Conditions.Category) )
			{

				AddLabel( 560, 210, 0, "X :" );
				AddImage( 580, 210, 2443 );
				AddTextEntry( 585, 210, 55, 20, 0, 3, Loc.X.ToString() );

				AddLabel( 560, 235, 0, "Y :" );
				AddImage( 580, 235, 2443 );
				AddTextEntry( 585, 235, 55, 20, 0, 4, Loc.Y.ToString() );

				AddLabel( 560, 260, 0, "Z :" );
				AddImage( 580, 260, 2443 );
				AddTextEntry( 585, 260, 55, 20, 0, 5, Loc.Z.ToString() );

				AddLabel( 715, 210, 0, ": H" );
				AddImage( 650, 210, 2443 );
				AddTextEntry( 655, 210, 55, 20, 0, 14, Hue.ToString() );

				AddLabel( 585, 315, 0, "Trammel" );
				AddRadio( 555, 315, 208, 209, (Map == Map.Trammel ? true : false), 6 );

				AddLabel( 585, 340, 0, "Felucca" );
				AddRadio( 555, 340, 208, 209, (Map == Map.Felucca ? true : false), 7 );

				AddLabel( 685, 315, 0, "Malas" );
				AddRadio( 655, 315, 208, 209, (Map == Map.Malas ? true : false), 8 );

				AddLabel( 685, 345, 0, "Ilshenar" );
				AddRadio( 655, 340, 208, 209, (Map == Map.Ilshenar ? true : false), 9 );

				AddLabel( 585, 365, 0, "Tokuno" );
				AddRadio( 555, 370, 208, 209, (Map == Map.Tokuno ? true : false), 10 );
			}


			AddLabel( 585, 395, 0, "Generate?" );
			AddCheck( 555, 395, 210, 211, Gen, 11 );

			AddLabel( 665, 395, 0, "Young?" );
			AddCheck( 715, 395, 210, 211, Young, 16 );

			AddLabel( 585, 420, 0, "Reds?" );
			AddCheck( 555, 420, 210, 211, Reds, 13 );

			AddLabel( 658, 420, 0, "Charge?" );
			AddCheck( 715, 420, 210, 211, Charge, 17 );

			AddLabel( 585, 445, 0, "Staff Only?" );
			AddCheck( 555, 445, 210, 211, Staff, 12 );

			AddButton( 700, 450, 1417, 1417, 1, GumpButtonType.Reply, 0 );
			AddLabel( 728, 481, 69, "Apply" );
		}
コード例 #7
0
ファイル: PGSystem.cs プロジェクト: FreeReign/realmofdarkness
        public static void GenGates()
        {
            RemGates();

            if (m_CategoryList == null)
                m_CategoryList = new List<PGCategory>();

            int count = 0;
            IEnumerator<PGCategory> PGC = m_CategoryList.GetEnumerator();
            while (PGC.MoveNext())
            {
                if (PGC.Current.GetFlag(EntryFlag.Generate))
                {
                    IEnumerator<PGLocation> PGL = PGC.Current.Locations.GetEnumerator();
                    while (PGL.MoveNext())
                    {
                        if (PGL.Current.GetFlag(EntryFlag.Generate))
                        {
                            PublicGate gate = new PublicGate();

                            gate.MoveToWorld(PGL.Current.Location, PGL.Current.Map);
                            gate.Name = "Public Gate: " + PGL.Current.Name;
                            gate.Hue = PGL.Current.Hue;
                            count++;
                        }
                    }
                }
            }

            World.Broadcast(6, true, "{0} public gates generated.", count);
        }