示例#1
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            int type, index;

            if (SplitButtonID(info.ButtonID, 1, out type, out index))
            {
                switch (type)
                {
                case 0:
                {
                    if (index < BaseCommandImplementor.Implementors.Count)
                    {
                        BaseCommandImplementor impl = (BaseCommandImplementor)BaseCommandImplementor.Implementors[index];

                        if (m_From.AccessLevel >= impl.AccessLevel)
                        {
                            m_Batch.Scope = impl;
                        }
                    }

                    break;
                }
                }
            }

            m_From.SendGump(new BatchGump(m_From, m_Batch));
        }
示例#2
0
        public override bool ValidateArgs(BaseCommandImplementor impl, CommandEventArgs e)
        {
            if (e.Length >= 1)
            {
                Type t = ScriptCompiler.FindTypeByName(e.GetString(0));

                if (t == null)
                {
                    e.Mobile.SendMessage("No type with that name was found.");

                    string match = e.GetString(0).Trim();

                    if (match.Length < 3)
                    {
                        e.Mobile.SendMessage("Invalid search string.");
                        e.Mobile.SendGump(new Server.Gumps.AddGump(e.Mobile, match, 0, Type.EmptyTypes, false));
                    }
                    else
                    {
                        e.Mobile.SendGump(new Server.Gumps.AddGump(e.Mobile, match, 0, (Type[])Server.Gumps.AddGump.Match(match).ToArray(typeof(Type)), true));
                    }
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                e.Mobile.SendGump(new Server.Gumps.CategorizedAddGump(e.Mobile));
            }

            return(false);
        }
示例#3
0
        public void Render()
        {
            AddNewPage();

            /* Header */
            AddEntryHeader(20);
            AddEntryHtml(140, Center("Change Scope"));
            AddEntryHeader(20);

            /* Options */
            for (int i = 0; i < BaseCommandImplementor.Implementors.Count; ++i)
            {
                BaseCommandImplementor impl = (BaseCommandImplementor)BaseCommandImplementor.Implementors[i];

                if (m_From.AccessLevel < impl.AccessLevel)
                {
                    continue;
                }

                AddNewLine();

                AddEntryLabel(20 + OffsetSize + 140, impl.Accessors[0]);
                AddEntryButton(20, ArrowRightID1, ArrowRightID2, GetButtonID(1, 0, i), ArrowRightWidth, ArrowRightHeight);
            }

            FinishPage();
        }
示例#4
0
        public override bool ValidateArgs( BaseCommandImplementor impl, CommandEventArgs e )
        {
            if ( e.Length >= 1 )
            {
                Type t = ScriptCompiler.FindTypeByName( e.GetString( 0 ) );

                if ( t == null )
                {
                    e.Mobile.SendMessage( "No type with that name was found." );

                    string match = e.GetString( 0 ).Trim();

                    if ( match.Length < 3 )
                    {
                        e.Mobile.SendMessage( "Invalid search string." );
                        e.Mobile.SendGump( new Server.Gumps.AddGump( e.Mobile, match, 0, Type.EmptyTypes, false ) );
                    }
                    else
                    {
                        e.Mobile.SendGump( new Server.Gumps.AddGump( e.Mobile, match, 0, (Type[]) Server.Gumps.AddGump.Match( match ).ToArray( typeof( Type ) ), true ) );
                    }
                }
                else
                {
                    return true;
                }
            }
            else
            {
                e.Mobile.SendGump( new Server.Gumps.CategorizedAddGump( e.Mobile ) );
            }

            return false;
        }
示例#5
0
        public static void Register(BaseCommand command)
        {
            m_AllCommands.Add(command);

            ArrayList impls = BaseCommandImplementor.Implementors;

            for (int i = 0; i < impls.Count; ++i)
            {
                BaseCommandImplementor impl = (BaseCommandImplementor)impls[i];

                if ((command.Supports & impl.SupportRequirement) != 0)
                {
                    impl.Register(command);
                }
            }
        }
示例#6
0
 public virtual bool ValidateArgs(BaseCommandImplementor impl, Server.Commands.CommandEventArgs e)
 {
     return(true);
 }
 public static void Register( BaseCommandImplementor impl )
 {
     m_Implementors.Add( impl );
     impl.Register();
 }
 public static void Register(BaseCommandImplementor impl)
 {
     m_Implementors.Add(impl);
     impl.Register();
 }
示例#9
0
 public virtual bool ValidateArgs( BaseCommandImplementor impl, CommandEventArgs e )
 {
     return true;
 }
示例#10
0
            public override bool ValidateArgs( BaseCommandImplementor impl, CommandEventArgs e )
            {
                if ( e.Arguments.Length >= 1 )
                    return true;

                e.Mobile.SendMessage( "Usage: " + Usage );
                return false;
            }