Exemplo n.º 1
0
		public TrashHandlerAcceptListGump(Mobile user, BaseTrashHandler handler, Gump parent = null)
			: base(
				user,
				parent,
				list: handler.Accepted,
				title: handler.GetType().Name + " Accept List",
				emptyText: "There are no Types in the list.")
		{
			TrashHandler = handler;
		}
Exemplo n.º 2
0
 public TrashHandlerAcceptListGump(Mobile user, BaseTrashHandler handler, Gump parent = null)
     : base(
         user,
         parent,
         list: handler.Accepted,
         title: handler.GetType().Name + " Accept List",
         emptyText: "There are no Types in the list.")
 {
     TrashHandler = handler;
 }
Exemplo n.º 3
0
 public TrashHandlerIgnoreListGump(PlayerMobile user, BaseTrashHandler handler, Gump parent = null)
     : base(
         user,
         parent,
         list: handler.Ignored,
         title: handler.GetType().Name + " Ignore List",
         emptyText: "There are no Types in the list.")
 {
     TrashHandler = handler;
 }
Exemplo n.º 4
0
		public TrashHandlerIgnoreListGump(PlayerMobile user, BaseTrashHandler handler, Gump parent = null)
			: base(
				user,
				parent,
				list: handler.Ignored,
				title: handler.GetType().Name + " Ignore List",
				emptyText: "There are no Types in the list.")
		{
			TrashHandler = handler;
		}
Exemplo n.º 5
0
        private static void CMConfig()
        {
            var handlers = new List <BaseTrashHandler>();

            int count = 0;

            HandlerTypes.ForEach(
                type =>
            {
                BaseTrashHandler handler = type.CreateInstance <BaseTrashHandler>();

                if (handler == null)
                {
                    return;
                }

                handlers.Add(handler);

                if (CMOptions.ModuleDebug)
                {
                    CMOptions.ToConsole(
                        "Created trash handler '{0}' ({1})", handler.GetType().Name, handler.Enabled ? "Enabled" : "Disabled");
                }

                ++count;
            });

            CMOptions.ToConsole("Created {0:#,0} trash handler{1}", count, count != 1 ? "s" : String.Empty);

            handlers.ForEach(
                h =>
            {
                if (!Handlers.ContainsKey(h.UID))
                {
                    Handlers.Add(h.UID, h);
                }
                else
                {
                    Handlers[h.UID] = h;
                }
            });

            ExtendedOPL.OnItemOPLRequest   += AddTrashProperties;
            ExtendedOPL.OnMobileOPLRequest += AddTrashProperties;
        }