public NotifySettingsState(NotifySettings settings, IAccount owner)
        {
            Settings = settings;
            Owner    = owner;

            SetDefaults();
        }
Example #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);
        }
Example #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);
        }
Example #4
0
        public NotifySettingsState(NotifySettings settings, Mobile owner)
        {
            Settings = settings;
            Owner    = owner;

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

			Ignore = false;
			Animate = true;
		}
Example #7
0
		private static void InitSettings(NotifySettings settings)
		{
			settings.Name = "PvP Battles";
			settings.CanIgnore = true;
		}
Example #8
0
 private static void InitSettings(NotifySettings o)
 {
     o.CanIgnore = true;
     o.Desc      = "General broadcasts from the staff and server.";
 }
Example #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);
        }
Example #10
0
        public static bool IsAnimated(Type t, PlayerMobile pm)
        {
            NotifySettings settings = EnsureSettings(t);

            return(settings == null || settings.IsAnimated(pm));
        }
Example #11
0
		private static void InitSettings(NotifySettings settings)
		{
			settings.Name = "Conquests";
			settings.CanIgnore = true;
		}
Example #12
0
 public NotifySettingsState(NotifySettings settings, GenericReader reader)
     : base(reader)
 {
     Settings = settings;
 }
Example #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.";
 }
Example #14
0
 private static void InitSettings(NotifySettings settings)
 {
     settings.Name = "Cure Winner";
     settings.CanIgnore = true;
 }
Example #15
0
 private static void InitSettings(NotifySettings settings)
 {
     settings.Name = "Era Updates";
     settings.CanIgnore = true;
 }
Example #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;
		}
Example #18
0
		private static void InitSettings(NotifySettings settings)
		{
			settings.Name = "Advertising Reports";
			settings.CanIgnore = true;
			settings.Access = AntiAdverts.Access;
		}
Example #19
0
        public static bool IsIgnored(Type t, PlayerMobile pm)
        {
            NotifySettings settings = EnsureSettings(t);

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