private void LoadConfig(object sender, EventArgs args)
        {
            this.config = Registry.Resolve <BuiltinEventConfig>();

            SetupControlProperties();
            SetupConfigEventHandlers();
        }
        private void LoadConfig(object sender, EventArgs args)
        {
            config = container.Resolve <BuiltinEventConfig>();

            SetupControlProperties();
            SetupConfigEventHandlers();
        }
Esempio n. 3
0
        public override void LoadConfig(IPluginConfig config)
        {
            this.Config = Registry.Resolve <BuiltinEventConfig>();

            this.Config.UpdateIntervalChanged += (o, e) =>
            {
                this.Start();
            };
        }
Esempio n. 4
0
        public BuiltinEventConfigPanel()
        {
            InitializeComponent();

            this.config = Registry.Resolve <BuiltinEventConfig>();

            SetupControlProperties();
            SetupConfigEventHandlers();
        }
Esempio n. 5
0
        public static BuiltinEventConfig LoadConfig(IPluginConfig Config)
        {
            var result = new BuiltinEventConfig();

            if (Config.EventSourceConfigs.ContainsKey("MiniParse"))
            {
                var obj = Config.EventSourceConfigs["MiniParse"];

                if (obj.TryGetValue("UpdateInterval", out JToken value))
                {
                    result.updateInterval = value.ToObject <int>();
                }

                if (obj.TryGetValue("EnmityIntervalMs", out value))
                {
                    result.enmityIntervalMs = value.ToObject <int>();
                }

                if (obj.TryGetValue("SortKey", out value))
                {
                    result.sortKey = value.ToString();
                }

                if (obj.TryGetValue("SortDesc", out value))
                {
                    result.sortDesc = value.ToObject <bool>();
                }

                if (obj.TryGetValue("UpdateDpsDuringImport", out value))
                {
                    result.updateDpsDuringImport = value.ToObject <bool>();
                }

                if (obj.TryGetValue("EndEncounterAfterWipe", out value))
                {
                    result.endEncounterAfterWipe = value.ToObject <bool>();
                }

                if (obj.TryGetValue("EndEncounterOutOfCombat", out value))
                {
                    result.endEncounterOutOfCombat = value.ToObject <bool>();
                }

                if (obj.TryGetValue("OverlayData", out value))
                {
                    result.OverlayData = value.ToObject <Dictionary <string, JToken> >();
                }

                if (obj.TryGetValue("CutsceneDetctionLog", out value))
                {
                    result.cutsceneDetectionLog = value.ToObject <bool>();
                }
            }

            return(result);
        }
Esempio n. 6
0
        public override void LoadConfig(IPluginConfig cfg)
        {
            this.Config = container.Resolve <BuiltinEventConfig>();

            this.Config.EnmityIntervalChanged += (o, e) =>
            {
                if (memory != null)
                {
                    timer.Change(0, this.Config.EnmityIntervalMs);
                }
            };
        }
        public static BuiltinEventConfig LoadConfig(IPluginConfig Config)
        {
            var result = new BuiltinEventConfig();

            if (Config.EventSourceConfigs.ContainsKey("MiniParse"))
            {
                var obj = Config.EventSourceConfigs["MiniParse"];

                if (obj.TryGetValue("UpdateInterval", out JToken value))
                {
                    result.updateInterval = value.ToObject <int>();
                }

                if (obj.TryGetValue("EnmityIntervalMs", out value))
                {
                    result.enmityIntervalMs = value.ToObject <int>();
                }

                if (obj.TryGetValue("SortKey", out value))
                {
                    result.sortKey = value.ToString();
                }

                if (obj.TryGetValue("SortDesc", out value))
                {
                    result.sortDesc = value.ToObject <bool>();
                }

                if (obj.TryGetValue("UpdateDpsDuringImport", out value))
                {
                    result.updateDpsDuringImport = value.ToObject <bool>();
                }

                if (obj.TryGetValue("EndEncounterAfterWipe", out value))
                {
                    result.endEncounterAfterWipe = value.ToObject <bool>();
                }

                if (obj.TryGetValue("EndEncounterOutOfCombat", out value))
                {
                    result.endEncounterOutOfCombat = value.ToObject <bool>();
                }

                if (obj.TryGetValue("OverlayData", out value))
                {
                    result.OverlayData = value.ToObject <Dictionary <string, JToken> >();

                    // Remove data for overlays that no longer exist.
                    var obsoleteKeys = new List <string>();
                    var overlayUUIDs = new List <string>();

                    foreach (var overlay in Config.Overlays)
                    {
                        if (overlay is Overlays.MiniParseOverlayConfig)
                        {
                            overlayUUIDs.Add(((Overlays.MiniParseOverlayConfig)overlay).Uuid.ToString());
                        }
                    }

                    foreach (var key in result.OverlayData.Keys)
                    {
                        if (!key.StartsWith("overlay#") || key.Length < 44)
                        {
                            continue;
                        }

                        var uuid = key.Substring(8, 36);
                        if (!overlayUUIDs.Contains(uuid))
                        {
                            obsoleteKeys.Add(key);
                        }
                    }

                    foreach (var key in obsoleteKeys)
                    {
                        result.OverlayData.Remove(key);
                    }
                }

                if (obj.TryGetValue("LogLines", out value))
                {
                    result.logLines = value.ToObject <bool>();
                }
            }

            return(result);
        }