AddBackground() public méthode

public AddBackground ( int x, int y, int width, int height, int gumpID ) : void
x int
y int
width int
height int
gumpID int
Résultat void
        void IHTMLBookGump.DrawToSurface(Gump gump, int x, int y, string page1Text, string page2Text, int page)
        {
            /*gump.AddImage(x, y, m_Book.GumpID);

            gump.AddHtml( 29 + x + m_Book.HTMLOffset.X, 23 + y + m_Book.HTMLOffset.Y, 147, 167, page1Text, (bool)false, (bool)false);
            gump.AddHtml( 186 + x + m_Book.HTMLOffset.X, 23 + y + m_Book.HTMLOffset.Y, 147, 167, page2Text, (bool)false, (bool)false);*/
            gump.AddBackground(x-22+22, y+4, 646, 362, 5120);
            gump.AddBackground(x+22, y+13, 606, 343, 9300);
            if ( page + 2 < m_Book.HTMLContent.CachedHTMLContent.Length )
                gump.AddButton(x+576, y+0, 2469, 2471, (int)Buttons.NextPage, GumpButtonType.Reply, 0);
            if ( page - 2 >= 0 )
                gump.AddButton(x+492, y+0, 2466, 2468, (int)Buttons.PreviousPage, GumpButtonType.Reply, 0);

            gump.AddHtml( x+31, y+26, 274, 314, page1Text, (bool)false, (bool)false);
            gump.AddHtml( x+343, y+26, 274, 314, page2Text, (bool)false, (bool)false);
            gump.AddImage(x+316, y+341, 10204);
            gump.AddImageTiled(x+316, y+28, 17, 318, 10201);
            gump.AddImage(x+316, y+13, 10202);
            gump.AddHtml( x+31, y+333, 274, 20, "<CENTER><SMALL><B>" + (page+1), (bool)false, (bool)false);
            gump.AddHtml( x+343, y+333, 274, 20, "<CENTER><SMALL><B>" + (page+2), (bool)false, (bool)false);

            /*if ( page + 2 < m_Book.HTMLContent.CachedHTMLContent.Length )
                gump.AddButton(294 + x + m_Book.NextPageButtonOffset.X, 4 + y + m_Book.NextPageButtonOffset.Y, 2236, 2236, (int)Buttons.NextPage, GumpButtonType.Reply, 0);

            if ( page - 2 >= 0 )
                gump.AddButton(23 + x + m_Book.PrevPageButtonOffset.X, 5 + y + m_Book.PrevPageButtonOffset.Y, 2235, 2235, (int)Buttons.PreviousPage, GumpButtonType.Reply, 0);
            */
        }
 public void Draw(Gump g, int x, int y, bool player)
 {
     if (!player)
         g.AddBackground(x, y, 90, 115, 3000);
     g.AddHtml(x, y + 5, 32, 25, String.Format("<BODY TEXT='{0}'><center>{1}</center></BODY>", GetHue(), GetValueString(false)), false, false);
     g.AddHtml(x, y + 25, 32, 25, String.Format("<BODY TEXT='{0}'><center>{1}</center></BODY>", GetHue(), String.Format("{0}", (char)GetSymbol())), false, false);
 }
 void IHTMLBookGump.DrawToSurface(Gump gump, int x, int y, string page1Text, string page2Text, int page)
 {
     gump.AddBackground( x, y, 291, 333, 9350 );
     gump.AddHtml( 10+x, 10+y, 274, 167*2, page1Text, (bool)false, (bool)false);
 }
		public static void DisplayStyle( Gump gump, StyleType style, int x, int y, int width, int height )
		{
			switch ( style )
			{
					case StyleType.OriginalBlack:{ gump.AddBackground( x, y, width, height, 0 ); gump.AddImageTiled( x, y, width, height, 2624 ); break; }
					case StyleType.DistroGray:{ gump.AddBackground( x, y, width, height, 5054 ); break; }
					case StyleType.Marble:{ gump.AddBackground( x, y, width, height, 5100 ); break; }
					case StyleType.BlackBorder:{ gump.AddBackground( x, y, width, height, 2620 ); break; }
					case StyleType.GrayEmbroidered:{ gump.AddBackground( x, y, width, height, 2600 ); break; }
					case StyleType.Offwhite:{ gump.AddBackground( x, y, width, height, 3000 ); break; }
					case StyleType.OffwhiteBorder:{ gump.AddBackground( x, y, width, height, 3500 ); break; }
					case StyleType.GrayMultiBorder:{ gump.AddBackground( x, y, width, height, 3600 ); break; }
					case StyleType.DarkGray:{ gump.AddBackground( x, y, width, height, 5120 ); break; }
					case StyleType.Scroll:{ gump.AddBackground( x - 17, y, width + 34, height, 5170 ); break; }
			}
		}
 void IHTMLBookGump.DrawToSurface(Gump gump, int x, int y, string page1Text, string page2Text, int page)
 {
     gump.AddBackground(x, y, 316, 360, 5170);
     gump.AddHtml( 24+x, 29+y, 274, 167*2, page1Text, (bool)false, (bool)false);
 }
		internal void BaseSkinByType(Gump g)
		{
			if (relplug == null)
			{ SkillSettings.DoTell("Base Type is invalid. Cannot skin."); }
			g.AddPage(0);
			string switchby = relplug.getGumpType();
			if (switchby == "Control")
			{
				//this.X = sk.GetCoord("Control", "X", sk ); this.Y = sk.SelectionY;
				g.X = 0; g.Y = 0;
				if (!Skin.WindowInfo.ContainsKey("Control"))
				{ SkillSettings.DoTell("No key for Control gump skin."); return; }
				WindowInfo inf = Skin.WindowInfo["Control"];
				g.X = inf.X; g.Y = inf.Y;
				//this.AddBackground(sk.GetCoord("Control", "X", sk ), sk.SelectionY, sk.GetCoord("Control", "W", sk ), sk.GetCoord("Control", "H", sk ), sk.SelectBGID);				
				g.AddBackground(0, 0, inf.W, inf.H, inf.bgID);
				g.AddImageTiled(Skin.BarSHX, Skin.BarSHY, Skin.BarSHW, Skin.BarSHH, Skin.SelectLineH);
				g.AddHtml(Skin.TMSSX, Skin.TMSSY, 140, 20, "<basefont size=5 face=1 color=#CC0000><Center>TMSS - //4// -</center></basefont>", false, false);
				//<basefont size=5 face=1 color=#CC0000><Center>TM Skill & Stat System v3.0</center></basefont>								
			}
			else if (switchby == "Master")
			{
				g.X = 0; g.Y = 0;
				if (!Skin.WindowInfo.ContainsKey("Master"))
				{ SkillSettings.DoTell("No key for Master gump skin."); return; }
				WindowInfo inf = Skin.WindowInfo["Master"];				
				//this.AddBackground(sk.MasterX, sk.MasterY, sk.MasterW, sk.MasterH, sk.MasterBGID);
				g.X = inf.X; g.Y = inf.Y;
				g.AddBackground(0, 0, inf.W, inf.H, inf.bgID);
				g.AddImageTiled(Skin.BarMHX, Skin.BarMHY, Skin.BarMHW, Skin.BarMHH, Skin.MasterLineH);
				g.AddImageTiled(Skin.BarMVX, Skin.BarMVY, Skin.BarMVW, Skin.BarMVH, Skin.MasterLineV);
				g.AddItem(Skin.IconMX, Skin.IconMY, Skin.IconMID, Skin.IconMColor);				
			}
			else if (switchby == "Underbar")
			{
				g.X = 0; g.Y = 0;
				if (!Skin.WindowInfo.ContainsKey("Underbar"))
				{ SkillSettings.DoTell("No key for Underbar gump skin."); return; }
				WindowInfo inf = Skin.WindowInfo["Underbar"];
				g.X = inf.X; g.Y = inf.Y;
				g.AddBackground(0, 0, inf.W, inf.H, inf.bgID);
				//this.AddBackground(sk.sk.GetCoord("Underbar", "X", );, sk.sk.GetCoord("Underbar", "Y", );, sk.HelpW, sk.HelpH, sk.HelpBGID);				
			}
			else SkillSettings.DoTell("Unknown Gump Type. Cannot apply base skin.");
		}
		public void DrawList(Gump g, int x, int y)
		{
			int b = 0;
			g.AddBackground(x, y - 5, 190, 35 + (35 * EndWinners.Count), 83);
			g.AddHtml(x, y + 3, 190, 25, String.Format("<BODY TEXT=\"#330000\"><center>{0}</center></BODY>", EndWinners.Count == 1 ? "Round Winner" : "Round Winners"), false, false);
			foreach (WinnerEntry entry in EndWinners)
			{
				g.AddHtml(x + 10, y + 17 + (35 * b), 140, 25, String.Format("<BODY TEXT='white'><left>{0}</left></BODY>", entry.m_Player.Mobile.Name), false, false);
				g.AddHtml(x + 10, y + 32 + (35 * b), 140, 25, String.Format("<BODY TEXT=\"#FFCC00\"><left>{0:0,0}gp</left></BODY>", (double)entry.m_Amount), false, false);
				if (EndWinners.Count - 1 != b)
					g.AddHtml(x + 9, y + 45 + (35 * b), 173, 25, String.Format("<BODY TEXT='black'><center>-----------------------------------</center></BODY>"), false, false);
				if (entry.m_Player.Result.Hand.Cards != null)
					for (int i = 0; i < entry.m_Player.Result.Hand.Cards.Length; i++)
						entry.m_Player.Result.Hand.Cards[i].Draw(g, x + 100 + (15 * i), y + 12 + (35 * b), true);
				b++;
			}
		}
 void IHTMLBookGump.DrawToSurface(Gump gump, int x, int y, string page1Text, string page2Text, int page)
 {
     gump.AddBackground( x, y, 309, 344, 9250 );
     gump.AddHtml( 18+x, 17+y, 274, 167*2, page1Text, (bool)false, (bool)false);
 }
 void IHTMLBookGump.DrawToSurface(Gump gump, int x, int y, string page1Text, string page2Text, int page)
 {
     gump.AddBackground(x, y, 343, 376, 2600);
     gump.AddHtml( 42+x, 33+y, 274, 167*2, page1Text, (bool)false, (bool)false);
 }
Exemple #10
0
        public override void Gump(Mobile from, Gump gump, ACCGumpParams subParams)
        {
            gump.AddButton(195, 40, 2445, 2445, 101, GumpButtonType.Reply, 0);
            gump.AddLabel(200, 41, 1153, "Manage System");
            gump.AddButton(310, 40, 2445, 2445, 102, GumpButtonType.Reply, 0);
            gump.AddLabel(342, 41, 1153, "Import");

            if (subParams == null || !(subParams is PGGumpParams))
            {
                gump.AddHtml(215, 65, 300, 25, "<basefont size=7 color=white><center>Public Gates</center></font>", false, false);
                gump.AddHtml(140, 95, 450, 250, "<basefont color=white><center>Welcome to the Public Gate Admin Gump!</center><br>With this gump, you can manage the entire system and import and export locations or full categories.  Please choose an option from the top bar.<br><br>Manage System allows you to add/change/delete locations and categories from anywhere in the world.<br><br>Im/Ex port allows you to import or export categories and locations to files that you can distribute to other servers that use this system.</font>", false, false);
                return;
            }

            Params = subParams as PGGumpParams;

            switch ((int)Params.Page)
            {
                #region Manage Gump Code
                case (int)Pages.Manage:
                    {
                        gump.AddBackground(640, 0, 160, 400, 5120);
                        gump.AddButton(425, 40, 2445, 2445, 123, GumpButtonType.Reply, 0);
                        gump.AddLabel(456, 41, 1153, "Export");

                        for (int i = 0; i < m_CategoryList.Count && i < 50; i++)
                        {
                            PGCategory PGC = m_CategoryList[i];
                            if (PGC != null)
                            {
                                gump.AddButton(650, 10 + i * 30, 2501, 2501, 150 + i, GumpButtonType.Reply, 0);
                                gump.AddButton(655, 12 + i * 30, (Params.SelectedCategory.Key == PGC ? 5401 : 5402), (Params.SelectedCategory.Key == PGC ? 5402 : 5401), 150 + i, GumpButtonType.Reply, 0);
                                gump.AddLabel(675, 10 + i * 30, 1153, PGC.Name);
                            }
                        }

                        if (Params.SelectedCategory.Key != null)
                        {
                            gump.AddBackground(425, 75, 170, 285, 5120);
                            gump.AddButton(195, 65, 2445, 2445, 121, GumpButtonType.Reply, 0);
                            gump.AddLabel(206, 66, 1153, "Add Category");
                            gump.AddButton(310, 65, 2445, 2445, 122, GumpButtonType.Reply, 0);
                            gump.AddLabel(322, 66, 1153, "Add Location");

                            for (int i = 0, c = 0, r = 0; i < Params.SelectedCategory.Key.Locations.Count; i++)
                            {
                                PGLocation PGL = Params.SelectedCategory.Key.Locations[i];
                                if (PGL != null)
                                {
                                    gump.AddButton(120 + c * 150, 100 + r * 30, 2501, 2501, 200 + i, GumpButtonType.Reply, 0);
                                    gump.AddButton(125 + c * 150, 102 + r * 30, (Params.SelectedLocation.Key == PGL ? 5401 : 5402), (Params.SelectedLocation.Key == PGL ? 5402 : 5401), 200 + i, GumpButtonType.Reply, 0);
                                    gump.AddLabel(145 + c * 150, 100 + r * 30, 1153, PGL.Name);
                                    r += (c == 1 ? 1 : 0);
                                    c += (c == 1 ? -1 : 1);
                                }
                            }

                            if (Params.SelectedLocation.Key != null)
                            {
                                gump.AddButton(550, 265, 2642, 2643, 103, GumpButtonType.Reply, 0); //Apply Location

                                gump.AddImage(440, 85, 2501);
                                gump.AddTextEntry(446, 85, 130, 20, 0, 105, Params.SelectedLocation.Key.Name);

                                gump.AddImage(445, 110, 2443);
                                gump.AddImage(513, 110, 2443);
                                gump.AddImage(445, 135, 2443);
                                gump.AddImage(513, 135, 2443);
                                gump.AddImage(445, 160, 2443);

                                gump.AddTextEntry(450, 110, 53, 20, 0, 106, Params.SelectedLocation.Key.Location.X.ToString());
                                gump.AddTextEntry(518, 110, 53, 20, 0, 107, Params.SelectedLocation.Key.Location.Y.ToString());
                                gump.AddTextEntry(450, 135, 53, 20, 0, 108, Params.SelectedLocation.Key.Location.Z.ToString());
                                gump.AddTextEntry(518, 135, 53, 20, 0, 109, Params.SelectedLocation.Key.Hue.ToString());
                                gump.AddTextEntry(450, 160, 53, 20, 0, 110, Params.SelectedLocation.Key.Cost.ToString());

                                gump.AddLabel(435, 112, 1153, "X");
                                gump.AddLabel(578, 112, 1153, "Y");
                                gump.AddLabel(435, 137, 1153, "Z");
                                gump.AddLabel(578, 137, 1153, "H");
                                gump.AddLabel(435, 162, 1153, "C");

                                gump.AddRadio(435, 190, 208, 209, (Params.SelectedLocation.Key.Map == Map.Trammel), 111);
                                gump.AddRadio(570, 190, 208, 209, (Params.SelectedLocation.Key.Map == Map.Malas), 112);
                                gump.AddRadio(435, 215, 208, 209, (Params.SelectedLocation.Key.Map == Map.Felucca), 113);
                                gump.AddRadio(570, 215, 208, 209, (Params.SelectedLocation.Key.Map == Map.Ilshenar), 114);
                                gump.AddRadio(435, 240, 208, 209, (Params.SelectedLocation.Key.Map == Map.Tokuno), 115);

                                gump.AddLabel(460, 192, 1153, "Tram");
                                gump.AddLabel(530, 192, 1153, "Malas");
                                gump.AddLabel(460, 217, 1153, "Fel");
                                gump.AddLabel(542, 217, 1153, "Ilsh");
                                gump.AddLabel(460, 242, 1153, "Tokuno");

                                gump.AddLabel(465, 282, 1153, "Young?");
                                gump.AddCheck(440, 280, 210, 211, Params.SelectedLocation.Key.GetFlag(EntryFlag.Young), 120);
                                gump.AddLabel(465, 307, 1153, "Gen?");
                                gump.AddCheck(440, 305, 210, 211, Params.SelectedLocation.Key.GetFlag(EntryFlag.Generate), 116);
                                gump.AddLabel(515, 307, 1153, "Staff?");
                                gump.AddCheck(565, 305, 210, 211, Params.SelectedLocation.Key.GetFlag(EntryFlag.StaffOnly), 117);
                                gump.AddLabel(465, 332, 1153, "Reds?");
                                gump.AddCheck(440, 330, 210, 211, Params.SelectedLocation.Key.GetFlag(EntryFlag.Reds), 118);
                                gump.AddLabel(522, 332, 1153, "Chrg?");
                                gump.AddCheck(565, 330, 210, 211, Params.SelectedLocation.Key.GetFlag(EntryFlag.Charge), 119);
                            }

                            else
                            {
                                gump.AddButton(550, 265, 2642, 2643, 104, GumpButtonType.Reply, 0); //Apply Category

                                gump.AddImage(440, 110, 2501);
                                gump.AddTextEntry(446, 110, 130, 20, 0, 105, Params.SelectedCategory.Key.Name);

                                gump.AddImage(445, 160, 2443);
                                gump.AddTextEntry(450, 160, 53, 20, 0, 110, Params.SelectedCategory.Key.Cost.ToString());
                                gump.AddLabel(435, 162, 1153, "C");

                                gump.AddLabel(465, 282, 1153, "Young?");
                                gump.AddCheck(440, 280, 210, 211, Params.SelectedCategory.Key.GetFlag(EntryFlag.Young), 120);
                                gump.AddLabel(465, 307, 1153, "Gen?");
                                gump.AddCheck(440, 305, 210, 211, Params.SelectedCategory.Key.GetFlag(EntryFlag.Generate), 116);
                                gump.AddLabel(515, 307, 1153, "Staff?");
                                gump.AddCheck(565, 305, 210, 211, Params.SelectedCategory.Key.GetFlag(EntryFlag.StaffOnly), 117);
                                gump.AddLabel(465, 332, 1153, "Reds?");
                                gump.AddCheck(440, 330, 210, 211, Params.SelectedCategory.Key.GetFlag(EntryFlag.Reds), 118);
                                gump.AddLabel(522, 332, 1153, "Chrg?");
                                gump.AddCheck(565, 330, 210, 211, Params.SelectedCategory.Key.GetFlag(EntryFlag.Charge), 119);
                            }
                        }
                        break;
                    }
                #endregion //Manage Gump Code

                #region Import Gump Code
                case (int)Pages.Import:
                    {//Import
                        if (!Directory.Exists("ACC Exports"))
                        {
                            from.SendMessage("There are no files to import!");
                            return;
                        }

                        gump.AddButton(195, 65, 2445, 2445, 124, GumpButtonType.Reply, 0); //Switch to Systems
                        gump.AddLabel(220, 66, 1153, "Systems");

                        gump.AddButton(310, 65, 2445, 2445, 125, GumpButtonType.Reply, 0); //Switch to Categories
                        gump.AddLabel(328, 66, 1153, "Categories");

                        gump.AddButton(425, 65, 2445, 2445, 126, GumpButtonType.Reply, 0); //Switch to Locations
                        gump.AddLabel(447, 66, 1153, "Locations");
                        switch ((int)Params.ImportSelection)
                        {
                            case (int)ImportSelections.Systems: { Dirs = Directory.GetFiles("ACC Exports/", "*.pgs"); break; }
                            case (int)ImportSelections.Categories: { Dirs = Directory.GetFiles("ACC Exports/", "*.pgc"); break; }
                            case (int)ImportSelections.Locations: { Dirs = Directory.GetFiles("ACC Exports/", "*.pgl"); break; }
                            default: { return; }
                        }
                        if (Dirs == null || Dirs.Length == 0)
                        {
                            from.SendMessage("There are no files of that type!");
                            return;
                        }
                        for (int i = 0, r = 0, c = 0; i < Dirs.Length && c < 3; i++)
                        {
                            string s = Dirs[i];
                            s = s.Remove(0, 12);
                            s = s.Remove(s.Length - 4, 4);
                            if (Params.ImportSelection == ImportSelections.Systems)
                                s = s.Remove(0, 9);

                            gump.AddButton(120 + c * 150, 100 + r * 30, 2501, 2501, 300 + i, GumpButtonType.Reply, 0);
                            gump.AddLabelCropped(125 + c * 150, 101 + r * 30, 140, 30, 1153, s);

                            c += (r == 7 ? 1 : 0);
                            r += (r == 7 ? -7 : 1);
                        }
                        break;
                    }
                #endregion //Import Gump Code
            }
        }