Ejemplo n.º 1
0
        public ManagerForm()
        {
            timer           = new System.Timers.Timer();
            timer.AutoReset = false;
            timer.Elapsed  += Timer_Elapsed;
            overlay_data    = new OverlayData(settings);
            InitializeComponent();
            Visible = true;
            RefreshScreenList();

            add_spot = new HotKeyComboController(addSpotControl, settings.Add_spot);
            add_spot.AddEvent(new EventHandler <KeyPressedEventArgs>(AddSpotlight));
            toggle_follow = new HotKeyComboController(toggleFollowControl, settings.Toggle_follow);
            toggle_follow.AddEvent(new EventHandler <KeyPressedEventArgs>(AddFollow));
            remove_spots = new HotKeyComboController(clearSpotsControl, settings.Remove_spots);
            remove_spots.AddEvent(new EventHandler <KeyPressedEventArgs>(RemoveSpots));

            fadeInControl.Value           = (decimal)settings.FadeInTime;
            fadeOutControl.Value          = (decimal)settings.FadeOutTime;
            spotlightRadiusControl.Value  = settings.Radius;
            featheringRadiusControl.Value = settings.Feathering_radius;
            autoHideDelayControl.Value    = settings.Autohide_delay;
            transparencyControl.Value     = settings.Transparency;

            overlay_form = new OverlayForm(screens[settings.Screen], overlay_data);
            overlay_form.Show();

            refresher = new Thread(new ThreadStart(this.UpdateState));
            refresher.Start();
        }
Ejemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (screenSelectComboBox.SelectedIndex != settings.Screen)
            {
                overlay_form.Close();
                overlay_form = new OverlayForm(screens[screenSelectComboBox.SelectedIndex], overlay_data);
                overlay_form.Show();
                settings.Screen = screenSelectComboBox.SelectedIndex;
            }
            var new_combo_add = new HotKeyCombo(addSpotControl.HotkeyModifiers, addSpotControl.Hotkey);

            if (new_combo_add != settings.Add_spot)
            {
                add_spot.UpdateCombo(new_combo_add);
            }
            new_combo_add = new HotKeyCombo(toggleFollowControl.HotkeyModifiers, toggleFollowControl.Hotkey);
            if (new_combo_add != settings.Toggle_follow)
            {
                toggle_follow.UpdateCombo(new_combo_add);
            }
            new_combo_add = new HotKeyCombo(clearSpotsControl.HotkeyModifiers, clearSpotsControl.Hotkey);
            if (new_combo_add != settings.Remove_spots)
            {
                remove_spots.UpdateCombo(new_combo_add);
            }
            settings.FadeInTime        = (int)fadeInControl.Value;
            settings.FadeOutTime       = (int)fadeOutControl.Value;
            settings.Radius            = (int)spotlightRadiusControl.Value;
            settings.Feathering_radius = (int)featheringRadiusControl.Value;
            settings.Transparency      = transparencyControl.Value;
            settings.Autohide_delay    = (int)autoHideDelayControl.Value;

            settings.SaveSettings();
        }
Ejemplo n.º 3
0
 private void UpdateState()
 {
     while (true)
     {
         overlay_data.Update();
         if (overlay_form.dev.GraphicsDeviceStatus == Microsoft.Xna.Framework.Graphics.GraphicsDeviceStatus.Lost)
         {
             overlay_form.Invoke(new MethodInvoker(delegate { overlay_form.Close(); }));
             overlay_form = new OverlayForm(screens[settings.Screen], overlay_data);
             overlay_form.Show();
         }
         Thread.Sleep(50);
     }
 }