コード例 #1
0
 public override void OnDoubleClick(Mobile from)
 {
     if (IsChildOf(from.Backpack))
     {
         BoundingBoxPicker.Begin(from, new BoundingBoxCallback(BoundingBox_Callback), null);
     }
     else
     {
         from.SendLocalizedMessage(1042001);
     }
 }
コード例 #2
0
 private static void InternalAvg_OnCommand(CommandEventArgs e, bool outline)
 {
     if (e.Length >= 1)
     {
         BoundingBoxPicker.Begin(e.Mobile, new BoundingBoxCallback(TileBox_Callback), new TileState(TileZType.MapAverage, 0, e.Arguments, outline));
     }
     else
     {
         e.Mobile.SendMessage("Format: {0}Avg <type> [params] [set {{<propertyName> <value> ...}}]", outline ? "Outline" : "Tile");
     }
 }
コード例 #3
0
 public override void OnDoubleClick(Mobile from)
 {
     if (IsChildOf(from.Backpack))
     {
         BoundingBoxPicker.Begin(from, new BoundingBoxCallback(BuildRugBox_Callback), this);
     }
     else
     {
         from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
     }
 }
コード例 #4
0
 public static void Tile_OnCommand(CommandEventArgs e)
 {
     if (e.Length >= 1)
     {
         BoundingBoxPicker.Begin(e.Mobile, new BoundingBoxCallback(TileBox_Callback), new TileState(e.Arguments));
     }
     else
     {
         e.Mobile.SendMessage("Format: Add <type> [params] [set {<propertyName> <value> ...}]");
     }
 }
コード例 #5
0
ファイル: Archive.cs プロジェクト: zerodowned/angelisland
 protected override void OnTarget(Mobile from, object target)
 {
     if (target is Archive)
     {
         // Request a callback from a bounding box to establish 2D rect for use with command
         BoundingBoxPicker.Begin(from, new BoundingBoxCallback(Archive.CollectionBox_Callback), target);
     }
     else
     {
         from.SendMessage("This command only works on archives.");
     }
 }
コード例 #6
0
 public override void OnDoubleClick(Mobile from)
 {
     if (IsChildOf(from.Backpack))
     {
         from.CloseGump(typeof(CarpetGump));
         BoundingBoxPicker.Begin(from, new BoundingBoxCallback(BoundingBox_Callback), null);
     }
     else
     {
         from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
     }
 }
コード例 #7
0
        public static void GenMulti_OnCommand(CommandEventArgs args)
        {
            Mobile m    = args.Mobile;
            string file = args.GetString(0);

            if (String.IsNullOrEmpty(file))
            {
                m.SendMessage("Format: GenMulti <fileName>");
                return;
            }

            BoundingBoxPicker.Begin(m, new BoundingBoxCallback(boxPicker_callback), file + ".txt");
        }
コード例 #8
0
        private static void Internal_OnCommand(CommandEventArgs e, bool outline)
        {
            Mobile from = e.Mobile;

            if (e.Length >= 1)
            {
                BoundingBoxPicker.Begin(from, (map, start, end) =>
                                        TileBox_Callback(from, start, end, new TileState(TileZType.Start, 0, e.Arguments, outline)));
            }
            else
            {
                from.SendMessage("Format: {0} <type> [params] [set {{<propertyName> <value> ...}}]",
                                 outline ? "Outline" : "Tile");
            }
        }
コード例 #9
0
ファイル: WriteMulti.cs プロジェクト: zerodowned/UO-Forever
        public static void DefineMultiArea(Mobile m, string dirname, int zmin, int zmax, bool includeitems, bool includestatics,
                                           bool includemultis, bool includeinvisible, bool includeaddons)
        {
            object[] multiargs = new object[8];
            multiargs[0] = dirname;
            multiargs[1] = zmin;
            multiargs[2] = zmax;
            multiargs[3] = includeitems;
            multiargs[4] = includestatics;
            multiargs[5] = includemultis;
            multiargs[6] = includeinvisible;
            multiargs[7] = includeaddons;

            BoundingBoxPicker.Begin(m, new BoundingBoxCallback(DefineMultiArea_Callback), multiargs);
        }
コード例 #10
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack))
     {
         from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
     }
     else if (from.HasGump(typeof(CarpetGump)))
     {
         from.SendMessage("You are already choosing a style of carpet.");
     }
     else
     {
         BoundingBoxPicker.Begin(from, new BoundingBoxCallback(BoundingBox_Callback), null);
     }
 }
コード例 #11
0
        private static void OnAddRegion(CommandEventArgs e)
        {
            BaseHouse bh = BaseHouse.FindHouseAt(e.Mobile);

            if (bh == null)
            {
                e.Mobile.SendMessage("You must be standing in the house you are defining regions for.");
                return;
            }
            if (bh is StaticHouse == false)
            {
                e.Mobile.SendMessage("You may only define regions for static houses.");
                return;
            }
            BoundingBoxPicker.Begin(e.Mobile, new BoundingBoxCallback(AddRegionCallback), bh);
        }
コード例 #12
0
 static void InternalZ_OnCommand(CommandEventArgs e, bool outline)
 {
     if (e.Length >= 2)
     {
         var subArgs = new string[e.Length - 1];
         for (var i = 0; i < subArgs.Length; ++i)
         {
             subArgs[i] = e.Arguments[i + 1];
         }
         BoundingBoxPicker.Begin(e.Mobile, new BoundingBoxCallback(TileBox_Callback), new TileState(TileZType.Fixed, e.GetInt32(0), subArgs, outline));
     }
     else
     {
         e.Mobile.SendMessage("Format: {0}Z <z> <type> [params] [set {{<propertyName> <value> ...}}]", outline ? "Outline" : "Tile");
     }
 }
コード例 #13
0
        public static void TileZ_OnCommand(CommandEventArgs e)
        {
            if (e.Length >= 2)
            {
                string[] subArgs = new string[e.Length - 1];

                for (int i = 0; i < subArgs.Length; ++i)
                {
                    subArgs[i] = e.Arguments[i + 1];
                }

                BoundingBoxPicker.Begin(e.Mobile, new BoundingBoxCallback(TileBox_Callback), new TileState(e.GetInt32(0), subArgs));
            }
            else
            {
                e.Mobile.SendMessage("Format: TileZ <z> <type> [params] [set {<propertyName> <value> ...}]");
            }
        }
コード例 #14
0
ファイル: HouseGenGump.cs プロジェクト: Alcluin/land-of
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            base.OnResponse(sender, info);
            switch (info.ButtonID)
            {
            case 0:
                sender.Mobile.SendGump(new HouseGenItem(this.index, data));
                break;

            case 1:
                //Add
                sender.Mobile.SendMessage(32, @"Select the area to add to house.");
                BoundingBoxPicker.Begin(sender.Mobile, OnAreaSelected, null);
                break;

            case 2:
                //Save
                data.Rects = rects;
                sender.Mobile.SendGump(new HouseGenItem(this.index, data));
                break;

            default:
                //Item at index
                var index = info.ButtonID - ButtonOffset;
                var t     = (info.ButtonID - ButtonOffset) / rects.Count;
                var i     = (info.ButtonID - ButtonOffset) % rects.Count;

                if (t < 1)
                {
                    var p = rects[i];
                    var n = new Point3D(data.Multi.X + p.X, data.Multi.Y + p.Y, data.Multi.Z);
                    ShowArea(i);
                    sender.Mobile.SendGump(new HouseGenAreaList(this.index, this.data, rects));
                }
                else
                {
                    var p = rects[i];
                    rects.Remove(p);
                    sender.Mobile.SendGump(new HouseGenAreaList(this.index, this.data, rects));
                }
                break;
            }
        }
コード例 #15
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                switch (info.ButtonID)
                {
                case 0:
                    return;

                case 1:
                    _State[17] = false;
                    break;

                default:
                    _State[17] = true;
                    break;
                }

                foreach (var text in info.TextEntries)
                {
                    _State[text.EntryID < 2 ? text.EntryID : text.EntryID + 7] = text.Text;
                }

                // Reset checks
                for (var x = 2; x <= 8; x++)
                {
                    _State[x] = false;
                }

                foreach (var check in info.Switches)
                {
                    _State[check + 2] = true;                     // Offset by 2 in the state object
                }

                if (Verify(sender.Mobile, _State))
                {
                    BoundingBoxPicker.Begin(sender.Mobile, PickerCallback, _State);
                }
                else
                {
                    sender.Mobile.SendMessage(0x40, "Please review the generation parameters, some are invalid.");
                    sender.Mobile.SendGump(new InternalGump(sender.Mobile, _State));
                }
            }
コード例 #16
0
ファイル: RandomizeCommand.cs プロジェクト: alucardxlx/Ulmeta
        public static void Randomize_OnCommand(Server.Commands.CommandEventArgs args)
        {
            Mobile m = args.Mobile;

            if (args.Length != 4)
            {
                m.SendMessage("Format: Randomize <starting itemID> <ending itemID> <Z level> <bool includeNonFlooring>");
                return;
            }

            int  start = args.GetInt32(0);
            int  end   = args.GetInt32(1);
            int  z     = args.GetInt32(2);
            bool walls = args.GetBoolean(3);

            object[] state = new object[4] {
                start, end, z, walls
            };

            BoundingBoxPicker.Begin(m, new BoundingBoxCallback(BoxPickerCallback), state);
        }
コード例 #17
0
            public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
            {
                if (info.ButtonID == 0)
                {
                    return;
                }
                else if (info.ButtonID == 1)
                {
                    m_State[17] = false;
                }
                else
                {
                    m_State[17] = true;
                }

                foreach (TextRelay text in info.TextEntries)
                {
                    m_State[text.EntryID < 2 ? text.EntryID : text.EntryID + 7] = text.Text;
                }

                // Reset checks
                for (int x = 2; x <= 8; x++)
                {
                    m_State[x] = false;
                }

                foreach (int check in info.Switches)
                {
                    m_State[check + 2] = true; // Offset by 2 in the state object
                }
                if (Verify(sender.Mobile, m_State))
                {
                    BoundingBoxPicker.Begin(sender.Mobile, new BoundingBoxCallback(AddonGenerator.PickerCallback), m_State);
                }
                else
                {
                    sender.Mobile.SendMessage(0x40, "Please review the generation parameters, some are invalid.");
                    sender.Mobile.SendGump(new InternalGump(sender.Mobile, m_State));
                }
            }
コード例 #18
0
        private static void OnAddonGen(CommandEventArgs e)
        {
            //
            // State object:
            // 0: Name
            // 1: Namespace (Server.Items)
            // 2: Items (true)
            // 3: Statics (false)
            // 4: Use range (false)
            // 5: Min Z (-128)
            // 6: Max Z (127)

            object[] state = new object[7];

            state[0] = "";
            state[1] = "Server.Items";
            state[2] = true;
            state[3] = false;
            state[4] = false;
            state[5] = -128;
            state[6] = 127;

            if (e.Arguments.Length > 0)
            {
                state[0] = e.Arguments[0];

                if (e.Arguments.Length > 1)
                {
                    state[1] = e.Arguments[1];
                }

                BoundingBoxPicker.Begin(e.Mobile, new BoundingBoxCallback(PickerCallback), state);
            }
            else
            {
                // Send gump
                e.Mobile.SendGump(new InternalGump(e.Mobile, state));
            }
        }
コード例 #19
0
        private static void InternalZ_OnCommand(CommandEventArgs e, bool outline)
        {
            Mobile from = e.Mobile;

            if (e.Length >= 2)
            {
                string[] subArgs = new string[e.Length - 1];

                for (int i = 0; i < subArgs.Length; ++i)
                {
                    subArgs[i] = e.Arguments[i + 1];
                }

                BoundingBoxPicker.Begin(from, (map, start, end) =>
                                        TileBox_Callback(from, start, end, new TileState(TileZType.Fixed, e.GetInt32(0), subArgs, outline)));
            }
            else
            {
                from.SendMessage("Format: {0}Z <z> <type> [params] [set {{<propertyName> <value> ...}}]",
                                 outline ? "Outline" : "Tile");
            }
        }
コード例 #20
0
ファイル: Inventory.cs プロジェクト: zerodowned/angelisland
        public static void Inventory_OnCommand(CommandEventArgs e)
        {
            m_Inv      = new ArrayList();
            m_from     = e.Mobile;
            m_ItemType = null;
            m_verbose  = false;

            // process commandline switches
            foreach (string sx in e.Arguments)
            {
                if (sx == null)
                {
                    continue;
                }

                if (sx.StartsWith("type="))
                {
                    string typeName = sx.Substring(5);
                    // We have an argument, so try to convert to a type
                    m_ItemType = ScriptCompiler.FindTypeByName(typeName);
                    if (m_ItemType == null)
                    {
                        // Invalid
                        e.Mobile.SendMessage(String.Format("No type with the name '{0}' was found.", typeName));
                        return;
                    }
                }
                else if (sx == "-v")
                {
                    m_verbose = true;
                }
            }

            // Request a callback from a bounding box to establish 2D rect
            // for use with command

            BoundingBoxPicker.Begin(e.Mobile, new BoundingBoxCallback(InvBox_Callback), 0x01);
        }
コード例 #21
0
ファイル: Rect2DList.cs プロジェクト: somedude373/NeverFade
        protected override bool OnBeforeListAdd()
        {
            if (InputRect != null)
            {
                return(true);
            }

            Minimize();

            BoundingBoxPicker.Begin(
                User,
                (from, map, start, end, state) =>
            {
                InputMap  = map;
                InputRect = new Rectangle2D(start, end.Clone2D(1, 1));
                HandleAdd();
                InputRect = null;

                Maximize();
            },
                null);

            return(false);
        }
コード例 #22
0
ファイル: Wipe.cs プロジェクト: pallop/Servuo
 public static void BeginWipe(Mobile from, WipeType type)
 {
     BoundingBoxPicker.Begin(from, new BoundingBoxCallback(WipeBox_Callback), type);
 }
コード例 #23
0
ファイル: Export.cs プロジェクト: zerodowned/Ulmeta
 ////////////////////////////////////ITEMS/////////////////////////////////////////////
 private static void ExportItems(Mobile from)
 {
     BoundingBoxPicker.Begin(from, new BoundingBoxCallback(ExportItems1), 1);
 }
コード例 #24
0
 private static void ConvertTile_OnCommand(CommandEventArgs e)
 {
     BoundingBoxPicker.Begin(e.Mobile, new BoundingBoxCallback(ConvertTileBox_Callback), typeof(Item));
 }
コード例 #25
0
 public void ChooseInnArea(Mobile m)
 {
     BoundingBoxPicker.Begin(m, new BoundingBoxCallback(CustomInnRegion_Callback), this);
 }
コード例 #26
0
 public override void Process(Mobile from, BaseCommand command, string[] args)
 {
     BoundingBoxPicker.Begin(from, (map, start, end) => OnTarget(from, map, start, end, command, args));
 }
コード例 #27
0
 public override void Process(Mobile from, BaseCommand command, string[] args)
 {
     BoundingBoxPicker.Begin(from, OnTarget, new object[] { command, args });
 }
コード例 #28
0
 /// <summary>
 /// Requests to add a range of statics to the selected tiles
 /// </summary>
 public void AddRange()
 {
     BoundingBoxPicker.Begin(m_User, new BoundingBoxCallback(AddRangeCallback), null);
 }
コード例 #29
0
ファイル: StaticExport.cs プロジェクト: phpjunkie420/RunUO
 public static void BeginStaEx(Mobile from, string file)
 {
     BoundingBoxPicker.Begin(from, new BoundingBoxCallback(StaExBox_Callback), new object[] { file });
 }
コード例 #30
0
ファイル: Wipe.cs プロジェクト: theinfamousrj/ModernUO
 public static void BeginWipe(Mobile from, WipeType type)
 {
     BoundingBoxPicker.Begin(from, (map, start, end) => DoWipe(from, map, start, end, type));
 }