Пример #1
0
        public NotifySettingsState(NotifySettings settings, IAccount owner)
        {
            Settings = settings;
            Owner    = owner;

            SetDefaults();
        }
Пример #2
0
        public static NotifySettings EnsureSettings(Type t)
        {
            if (t == null || !t.IsEqualOrChildOf <NotifyGump>())
            {
                return(null);
            }

            NotifySettings settings;
            bool           init = false;

            if (!Settings.TryGetValue(t, out settings))
            {
                Settings.Add(t, settings = new NotifySettings(t));
                init = true;
            }
            else if (settings == null)
            {
                Settings[t] = settings = new NotifySettings(t);
                init        = true;
            }

            if (init)
            {
                var m = t.GetMethod("InitSettings", BindingFlags.Static | BindingFlags.NonPublic);

                if (m != null)
                {
                    m.Invoke(null, new object[] { settings });
                }
            }

            return(settings);
        }
Пример #3
0
        public static NotifySettings EnsureSettings(Type t)
        {
            if (t == null || !t.IsEqualOrChildOf <NotifyGump>())
            {
                return(null);
            }

            NotifySettings settings = null;
            var            init     = false;

            Settings.AddOrReplace(
                t,
                s =>
            {
                init = true;
                return(settings = s ?? new NotifySettings(t));
            });

            if (init && settings != null)
            {
                var m = t.GetMethod("InitSettings", BindingFlags.Static | BindingFlags.NonPublic);

                if (m != null)
                {
                    m.Invoke(null, new object[] { settings });
                }
            }

            return(settings);
        }
Пример #4
0
        public NotifySettingsState(NotifySettings settings, Mobile owner)
        {
            Settings = settings;
            Owner    = owner;

            Ignore  = false;
            Animate = true;
        }
Пример #5
0
		public NotifySettingsState(NotifySettings settings, GenericReader reader)
			: base(reader)
		{
			Settings = settings;
		}
Пример #6
0
		public NotifySettingsState(NotifySettings settings, PlayerMobile owner)
		{
			Settings = settings;
			Owner = owner;

			Ignore = false;
			Animate = true;
		}
Пример #7
0
		private static void InitSettings(NotifySettings settings)
		{
			settings.Name = "PvP Battles";
			settings.CanIgnore = true;
		}
Пример #8
0
 private static void InitSettings(NotifySettings o)
 {
     o.CanIgnore = true;
     o.Desc      = "General broadcasts from the staff and server.";
 }
Пример #9
0
        public static NotifySettings EnsureSettings(Type t)
        {
            if (t == null || !t.IsEqualOrChildOf <NotifyGump>())
            {
                return(null);
            }

            Type st;

            if (SettingsMap.TryGetValue(t, out st) && st != null)
            {
                var o = Settings.GetValue(st);

                if (o != null)
                {
                    return(o);
                }
            }

            const BindingFlags f = BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.NonPublic;

            var m = t.GetMethod("InitSettings", f);

            if (m == null)
            {
                foreach (var p in t.EnumerateHierarchy())
                {
                    m = p.GetMethod("InitSettings", f);

                    if (m != null)
                    {
                        st = p;
                        break;
                    }
                }
            }

            if (st == null)
            {
                st = t;
            }

            var init = false;

            NotifySettings settings;

            if (!Settings.TryGetValue(st, out settings) || settings == null)
            {
                Settings[st] = settings = new NotifySettings(st);
                init         = true;
            }

            SettingsMap[t] = st;

            if (init && m != null)
            {
                m.Invoke(null, new object[] { settings });
            }

            return(settings);
        }
Пример #10
0
        public static bool IsAnimated(Type t, PlayerMobile pm)
        {
            NotifySettings settings = EnsureSettings(t);

            return(settings == null || settings.IsAnimated(pm));
        }
Пример #11
0
		private static void InitSettings(NotifySettings settings)
		{
			settings.Name = "Conquests";
			settings.CanIgnore = true;
		}
Пример #12
0
 public NotifySettingsState(NotifySettings settings, GenericReader reader)
     : base(reader)
 {
     Settings = settings;
 }
Пример #13
0
 private static void InitSettings(NotifySettings o)
 {
     o.Name = "Misc Notifications";
     o.Desc = "Any notifications that do not fall into a more specific category.";
 }
Пример #14
0
 private static void InitSettings(NotifySettings settings)
 {
     settings.Name = "Cure Winner";
     settings.CanIgnore = true;
 }
Пример #15
0
 private static void InitSettings(NotifySettings settings)
 {
     settings.Name = "Era Updates";
     settings.CanIgnore = true;
 }
Пример #16
0
		private static void InitSettings(NotifySettings settings)
		{
			settings.Name = "Vita-Nex: Core Updates";
			settings.Access = UpdateService.CSOptions.NotifyAccess;
		}
		private static void InitSettings(NotifySettings settings)
		{
			settings.Name = "Creature Deaths";
			settings.CanIgnore = true;
		}
Пример #18
0
		private static void InitSettings(NotifySettings settings)
		{
			settings.Name = "Advertising Reports";
			settings.CanIgnore = true;
			settings.Access = AntiAdverts.Access;
		}
Пример #19
0
        public static bool IsIgnored(Type t, PlayerMobile pm)
        {
            NotifySettings settings = EnsureSettings(t);

            return(settings != null && settings.IsIgnored(pm));
        }