using System;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Mobiles;
using Server.Misc;
using Server.Commands;

namespace Server.Gumps
{
	public class TradesGump : Gump
	{
        public static void Initialize()
		{
			CommandSystem.Register("Trades", AccessLevel.Player, Trades_OnCommand);
		}

		[Usage("Trades")]
		[Description("Opens the trades skill gump.")]
		public static void Trades_OnCommand(CommandEventArgs e)
		{
			Mobile m = e.Mobile;
			m.CloseGump(typeof(TradesGump));
			m.SendGump(new TradesGump(m));
		}
		public TradesGump( Mobile m ) : base( 50, 50 )
		{
			string name = "";
				name = name + "" + SkillCheck.TradeName( Trades.Alchemy ) + "<BR>";
				name = name + "" + SkillCheck.TradeName( Trades.Blacksmith ) + "<BR>";
				name = name + "" + SkillCheck.TradeName( Trades.Carpentry ) + "<BR>";
				name = name + "" + SkillCheck.TradeName( Trades.Cartography ) + "<BR>";
				name = name + "" + SkillCheck.TradeName( Trades.Cooking ) + "<BR>";
				name = name + "" + SkillCheck.TradeName( Trades.Fishing ) + "<BR>";
				name = name + "" + SkillCheck.TradeName( Trades.Fletching ) + "<BR>";
				name = name + "" + SkillCheck.TradeName( Trades.Inscribe ) + "<BR>";
				name = name + "" + SkillCheck.TradeName( Trades.Lumberjacking ) + "<BR>";
				name = name + "" + SkillCheck.TradeName( Trades.Mining ) + "<BR>";
				name = name + "" + SkillCheck.TradeName( Trades.Tailoring ) + "<BR>";
				name = name + "" + SkillCheck.TradeName( Trades.Tinkering ) + "<BR>";

			string level = "";
				level = level + "" + (SkillCheck.TradeSkill( m, Trades.Alchemy, false )).ToString("0.0") + "<BR>";
				level = level + "" + (SkillCheck.TradeSkill( m, Trades.Blacksmith, false )).ToString("0.0") + "<BR>";
				level = level + "" + (SkillCheck.TradeSkill( m, Trades.Carpentry, false )).ToString("0.0") + "<BR>";
				level = level + "" + (SkillCheck.TradeSkill( m, Trades.Cartography, false )).ToString("0.0") + "<BR>";
				level = level + "" + (SkillCheck.TradeSkill( m, Trades.Cooking, false )).ToString("0.0") + "<BR>";
				level = level + "" + (SkillCheck.TradeSkill( m, Trades.Fishing, false )).ToString("0.0") + "<BR>";
				level = level + "" + (SkillCheck.TradeSkill( m, Trades.Fletching, false )).ToString("0.0") + "<BR>";
				level = level + "" + (SkillCheck.TradeSkill( m, Trades.Inscribe, false )).ToString("0.0") + "<BR>";
				level = level + "" + (SkillCheck.TradeSkill( m, Trades.Lumberjacking, false )).ToString("0.0") + "<BR>";
				level = level + "" + (SkillCheck.TradeSkill( m, Trades.Mining, false )).ToString("0.0") + "<BR>";
				level = level + "" + (SkillCheck.TradeSkill( m, Trades.Tailoring, false )).ToString("0.0") + "<BR>";
				level = level + "" + (SkillCheck.TradeSkill( m, Trades.Tinkering, false )).ToString("0.0") + "<BR>";

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

			AddPage(0);
			AddImage(21, 313, 2083);
			AddImage(19, 106, 2082);
			AddImage(19, 244, 2081);
			AddImage(18, 36, 2081);
			AddImage(0, 0, 2080);
			AddImage(42, 38, 2091);
			AddImage(42, 293, 2091);
			AddImage(19, 174, 2082);
			AddHtml( 38, 58, 137, 226, @"<BODY><BASEFONT Color=#5c4c32><BIG>" + name + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
			AddHtml( 205, 58, 48, 226, @"<BODY><BASEFONT Color=#5c4c32><BIG><RIGHT>" + level + "</RIGHT></BIG></BASEFONT></BODY>", (bool)false, (bool)false);

			AddHtml( 38, 8, 231, 20, @"<BODY><BASEFONT Color=#111f5f><BIG><CENTER>TRADES</CENTER></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
		}

		public override void OnResponse( NetState sender, RelayInfo info )
		{
		}
	}
}
