public SpellTimerConfigPanel(SpellTimerOverlay overlay)
        {
            InitializeComponent();

            this.overlay = overlay;
            this.config = overlay.Config;

            SetupConfigEventHandlers();
            SetupControlProperties();
        }
Exemple #2
0
        public SpellTimerConfigPanel(SpellTimerOverlay overlay)
        {
            InitializeComponent();

            this.overlay = overlay;
            this.config  = overlay.Config;

            SetupConfigEventHandlers();
            SetupControlProperties();
        }
        /// <summary>
        /// バージョン 0.2.5.0 以下からのアップデート処理を行います。
        /// </summary>
        private void UpdateFromVersion0_2_5_0OrBelow()
        {
#pragma warning disable 612, 618
            if (this.MiniParseOverlayObsolete != null)
            {
                var miniParseOverlayConfig = new MiniParseOverlayConfig(DefaultMiniParseOverlayName);
                miniParseOverlayConfig.IsVisible = this.MiniParseOverlayObsolete.IsVisible;
                miniParseOverlayConfig.IsClickThru = this.MiniParseOverlayObsolete.IsClickThru;
                miniParseOverlayConfig.Position = this.MiniParseOverlayObsolete.Position;
                miniParseOverlayConfig.Size = this.MiniParseOverlayObsolete.Size;
                miniParseOverlayConfig.Url = this.MiniParseOverlayObsolete.Url;
                miniParseOverlayConfig.SortKey = this.MiniParseOverlayObsolete.SortKey;
                miniParseOverlayConfig.SortType = this.MiniParseOverlayObsolete.SortType;
                miniParseOverlayConfig.MaxFrameRate = this.MiniParseOverlayObsolete.MaxFrameRate;
                miniParseOverlayConfig.GlobalHotkey = this.MiniParseOverlayObsolete.GlobalHotkey;
                miniParseOverlayConfig.GlobalHotkeyEnabled = this.MiniParseOverlayObsolete.GlobalHotkeyEnabled;
                miniParseOverlayConfig.GlobalHotkeyModifiers = this.MiniParseOverlayObsolete.GlobalHotkeyModifiers;

                this.Overlays.Add(miniParseOverlayConfig);

                this.MiniParseOverlayObsolete = null;
            }
            if (this.SpellTimerOverlayObsolete != null)
            {
                var spellTimerOverlayConfig = new SpellTimerOverlayConfig(DefaultSpellTimerOverlayName);
                spellTimerOverlayConfig.IsVisible = this.SpellTimerOverlayObsolete.IsVisible;
                spellTimerOverlayConfig.IsClickThru = this.SpellTimerOverlayObsolete.IsClickThru;
                spellTimerOverlayConfig.Position = this.SpellTimerOverlayObsolete.Position;
                spellTimerOverlayConfig.Size = this.SpellTimerOverlayObsolete.Size;
                spellTimerOverlayConfig.Url = this.SpellTimerOverlayObsolete.Url;
                spellTimerOverlayConfig.MaxFrameRate = this.SpellTimerOverlayObsolete.MaxFrameRate;
                spellTimerOverlayConfig.GlobalHotkey = this.SpellTimerOverlayObsolete.GlobalHotkey;
                spellTimerOverlayConfig.GlobalHotkeyEnabled = this.SpellTimerOverlayObsolete.GlobalHotkeyEnabled;
                spellTimerOverlayConfig.GlobalHotkeyModifiers = this.SpellTimerOverlayObsolete.GlobalHotkeyModifiers;

                this.Overlays.Add(spellTimerOverlayConfig);

                this.SpellTimerOverlayObsolete = null;
            }
#pragma warning restore 612, 618
        }
        /// <summary>
        /// デフォルトのオーバーレイを作成します。
        /// </summary>
        /// <param name="pluginDirectory"></param>
        public void SetDefaultOverlayConfigs(string pluginDirectory)
        {
            var miniparseOverlayConfig = new MiniParseOverlayConfig(DefaultMiniParseOverlayName);
            miniparseOverlayConfig.Position = new Point(20, 20);
            miniparseOverlayConfig.Size = new Size(500, 300);
            miniparseOverlayConfig.Url = new Uri(Path.Combine(pluginDirectory, "resources", "miniparse.html")).ToString(); 

            var spellTimerOverlayConfig = new SpellTimerOverlayConfig(DefaultSpellTimerOverlayName);
            spellTimerOverlayConfig.Position = new Point(20, 520);
            spellTimerOverlayConfig.Size = new Size(200, 300);
            spellTimerOverlayConfig.IsVisible = true;
            spellTimerOverlayConfig.MaxFrameRate = 5;
            spellTimerOverlayConfig.Url = new Uri(Path.Combine(pluginDirectory, "resources", "spelltimer.html")).ToString(); 

            this.Overlays = new OverlayConfigList();
            this.Overlays.Add(miniparseOverlayConfig);
            this.Overlays.Add(spellTimerOverlayConfig);
        }