Can't figure out why this gump won't come up when I use the command.
I don't get an invalid command response, nor do I get the Message sent from the command method for testing.
Must be something simple that I'm overlooking
I don't get an invalid command response, nor do I get the Message sent from the command method for testing.
Must be something simple that I'm overlooking
Code:
using System;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Commands;
using System.Collections.Generic;
using Server.Mobiles;
namespace Server.Gumps
{
public class TestGump : Gump
{
List<string> AttName = new List<string>() { "Bonus", "Bonus", "Bonus" };
Mobile caller;
public static void Initialize()
{
CommandSystem.Register("Test", AccessLevel.Player, new CommandEventHandler(Test_OnCommand));
}
[Usage("Test")]
[Description("Test gunno")]
public static void Test_OnCommand(CommandEventArgs e)
{
/* if (e.Mobile.HasGump(typeof(TestGump)))
e.Mobile.CloseGump(typeof(TestGump));
*/
e.Mobile.SendGump(new TestGump(e.Mobile));
e.Mobile.SendMessage("TESTING");
}
public TestGump(Mobile m) : base( 100, 100 )
{
caller = m;
AttName =
this.Closable=true;
this.Disposable=true;
this.Dragable=true;
this.Resizable=false;
AddPage(0);
AddBackground(71, 41, 374, 525, 9270);
AddImageTiled(85, 56, 346, 496, 9354); //white background
AddButton(429, 41, 22150, 248, 0, GumpButtonType.Reply, 0); // close button
AddHtml( 87, 56, 343, 34, @"Test", (bool)false, (bool)false);
AddHtml( 88, 91, 339, 26, @"test", (bool)false, (bool)false);
AddImageTiled(87, 124, 341, 21, 10004); // exp bar background
AddImageTiled(90, 126, 250, 17, 30073); // exp green bar
AddHtml( 92, 122, 332, 22, @"test", (bool)false, (bool)false);
//var AttNameCount = Enum.GetNames(typeof(AttName)).Length;
for( int i = 0; i > AttName.Count; i++ )
{
AddButton(90, 157 + ((15*i)*i), 22153, 248, 0, GumpButtonType.Reply, 0); // |?| 1
AddHtml( 110, 155 + ((15*i)*i), 155, 22, AttName[i], (bool)false, (bool)false); // label 1
AddButton(284, 158 + ((15*i)*i), 5401, 248, 0, GumpButtonType.Reply, 0); // |-| 1
AddButton(330, 158 + ((15*i)*i), 5402, 248, 0, GumpButtonType.Reply, 0); // |+| 1
AddHtml( 353, 155 + ((15*i)*i), 69, 22, AttName[i] + " Count", (bool)false, (bool)false); // amount 1
}
/* AddButton(90, 181, 22153, 248, 0, GumpButtonType.Reply, 0); // |?|2
AddHtml( 110, 179, 155, 22, @"bonus hits", (bool)false, (bool)false); // 2
AddButton(284, 182, 5401, 248, 0, GumpButtonType.Reply, 0); // |-|2
AddButton(330, 182, 5402, 248, 0, GumpButtonType.Reply, 0); // |+|2
AddHtml( 353, 179, 69, 22, @"bonus hits amount", (bool)false, (bool)false); // 2
AddButton(90, 209, 22153, 248, 0, GumpButtonType.Reply, 0);
AddHtml( 110, 207, 155, 22, @"bonus hits", (bool)false, (bool)false);
AddButton(284, 210, 5401, 248, 0, GumpButtonType.Reply, 0);
AddButton(330, 210, 5402, 248, 0, GumpButtonType.Reply, 0);
AddHtml( 353, 207, 69, 22, @"bonus hits amount", (bool)false, (bool)false); */
AddButton(350, 526, 5204, 248, 0, GumpButtonType.Reply, 0); // cancel
AddBackground(349, 514, 81, 39, 9250);
AddHtml( 352, 521, 76, 22, @"<Center><big>Cancel</big></center>", (bool)false, (bool)false);
AddButton(87, 525, 5200, 248, 0, GumpButtonType.Reply, 0); // apply
AddBackground(85, 514, 81, 39, 9250);
AddHtml( 86, 523, 76, 22, @"<Center><big>Apply</big></center>", (bool)false, (bool)false);
}
public override void OnResponse(NetState sender, RelayInfo info)
{
Mobile from = sender.Mobile;
switch(info.ButtonID)
{
case 0:
{
break;
}
}
}
}
}