AddItem() public method

public AddItem ( int x, int y, int itemID ) : void
x int
y int
itemID int
return void
Esempio n. 1
0
		public override void WriteToGump( Gump g, ref int y )
		{
			if ( ShowDetailed )
			{
				string amount = m_DesiredAmount.ToString();

				g.AddHtmlLocalized( 98, y, 350, 16, 1072205, 0x15F90, false, false ); // Obtain
				g.AddLabel( 143, y, 0x481, amount );

				if ( m_Name.Number > 0 )
				{
					g.AddHtmlLocalized( 143 + amount.Length * 15, y, 190, 18, m_Name.Number, 0x77BF, false, false );
					g.AddItem( 350, y, LabelToItemID( m_Name.Number ) );
				}
				else if ( m_Name.String != null )
				{
					g.AddLabel( 143 + amount.Length * 15, y, 0x481, m_Name.String );
				}
			}
			else
			{
				if ( m_Name.Number > 0 )
					g.AddHtmlLocalized( 98, y, 312, 32, m_Name.Number, 0x15F90, false, false );
				else if ( m_Name.String != null )
					g.AddLabel( 98, y, 0x481, m_Name.String );
			}

			y += 32;
		}
		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.");
		}
Esempio n. 3
0
		public override void WriteToGump( Gump g, ref int y )
		{
			string amount = m_Amount.ToString();

			g.AddHtmlLocalized( 98, y, 312, 16, 1072207, 0x15F90, false, false ); // Deliver
			g.AddLabel( 143, y, 0x481, amount );

			if ( m_Name.Number > 0 )
			{
				g.AddHtmlLocalized( 143 + amount.Length * 15, y, 190, 18, m_Name.Number, 0x77BF, false, false );
				g.AddItem( 350, y, CollectObjective.LabelToItemID( m_Name.Number ) );
			}
			else if ( m_Name.String != null )
			{
				g.AddLabel( 143 + amount.Length * 15, y, 0x481, m_Name.String );
			}

			y += 32;

			g.AddHtmlLocalized( 103, y, 120, 16, 1072379, 0x15F90, false, false ); // Deliver to
			g.AddLabel( 223, y, 0x481, QuesterNameAttribute.GetQuesterNameFor( m_Destination ) );

			y += 16;
		}
 public static void AddItemCentered(int x, int y, int w, int h, int itemID, Gump gump)
 {
     Rectangle2D r = ItemBounds.Table[itemID];
     gump.AddItem(x + ((w - r.Width) / 2) - r.X, y + ((h - r.Height) / 2) - r.Y, itemID);
 }