Example #1
0
        public MainWindow()
        {
            InitializeComponent();
            Subscribe();
            HotkeyButton.Initialize();
            InitializeHotkeyButtons();
            InitiallizeAutoclickers();
            MatchFieldsFromXaml();

            string filePath = Path.Combine(Directory.GetCurrentDirectory(), profileFileName);

            advancedGridHeight = (int) Advanced_Settings.Height;

            this.Closed += (s, e) => {
                App.Current.Shutdown();
                Process.GetCurrentProcess().Kill();
            };

            Thread.Sleep(1);
            wait = false;

            if (File.Exists(filePath)) {
                ImportProfile(File.ReadAllText(filePath));
            }
        }
Example #2
0
 public static bool RegisterHotkey(int i, HotkeyButton img)
 {
     if (i < allSats.Count)
     {
         allSats [i].SetHotkey(img);
         return(true);
     }
     else
     {
         return(false);
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProcessingHotkeyEventArgs"/> class.
 /// </summary>
 /// <param name="player"><inheritdoc cref="Player"/></param>
 /// <param name="hotkey"><inheritdoc cref="Hotkey"/></param>
 /// <param name="isAllowed"><inheritdoc cref="IsAllowed"/></param>
 public ProcessingHotkeyEventArgs(Player player, HotkeyButton hotkey, bool isAllowed = true)
 {
     Player    = player;
     Hotkey    = hotkey;
     IsAllowed = isAllowed;
 }
Example #4
0
        private void InitializeHotkeyButtons()
        {
            //LMB
            lmbHotkeyButton = new HotkeyButton(MouseButtons.XButton2);
            LMBHotkeyText.Text = $"Press [{(lmbHotkeyButton.GetHotkey())}] to start";
            lmbHotkeyButton.HotkeySetEvent += (sender, e) => {
                LMBHotkeyText.Text = $"Press [{(lmbHotkeyButton.GetHotkey())}] to start";
            };
            lmbHotkeyButton.HotkeyPressed += (sender, e) => {
                ToggleLMB();
            };
            lmbHotkeyButton.SelectHotkeyEvent += (sender, e) => {
                LMBHotkeyText.Text = "[Press any key]";
            };

            //RMB

            rmbHotkeyButton = new HotkeyButton(MouseButtons.XButton1);
            RMBHotkeyText.Text = $"Press [{(rmbHotkeyButton.GetHotkey())}] to start";
            rmbHotkeyButton.HotkeySetEvent += (sender, e) => {
                RMBHotkeyText.Text = $"Press [{(rmbHotkeyButton.GetHotkey())}] to start";
            };
            rmbHotkeyButton.HotkeyPressed += (sender, e) => {
                ToggleRMB();
            };
            rmbHotkeyButton.SelectHotkeyEvent += (sender, e) => {
                RMBHotkeyText.Text = "[Press any key]";
            };

            //Blockhit

            blockhitHotkeyButton = new HotkeyButton(Keys.G);
            BlockhitHotkeyText.Text = $"Press [{blockhitHotkeyButton.GetHotkey()}] to enable blockhits";
            blockhitHotkeyButton.HotkeySetEvent += (sender, e) => {
                BlockhitHotkeyText.Text = $"Press [{blockhitHotkeyButton.GetHotkey()}] to enable blockhits";
            };
            blockhitHotkeyButton.HotkeyPressed += (sender, e) => {
                blockHit = !blockHit;
                BlockhitHotkeyText.Text = $"Press [{blockhitHotkeyButton.GetHotkey()}] to {((blockHit) ? "disable" : "enable")} blockhits";

                if (blockHit) {
                    BlockhitChangeHotkey.Background = toggledColor;
                } else {
                    BlockhitChangeHotkey.ClearValue(BackgroundProperty);
                }

                if (playToggleSounds) {
                    BackgroundBeep.Beep(blockHit ? 16000 : 8000, 1);
                }
            };

            blockhitHotkeyButton.SelectHotkeyEvent += (sender, e) => {
                BlockhitHotkeyText.Text = "[Press any key]";
            };

            //Panic button
            panicHotkeyButton = new HotkeyButton(Keys.Multiply);
            PanicButtonTextBlock.Text = $"Panic Button [{panicHotkeyButton.GetHotkey()}]";
            panicHotkeyButton.HotkeySetEvent += (sender, e) => {
                PanicButtonTextBlock.Text = $"Panic Button [{panicHotkeyButton.GetHotkey()}]";
            };
            panicHotkeyButton.HotkeyPressed += (sender, e) => {
                Close();
            };
            panicHotkeyButton.SelectHotkeyEvent += (sender, e) => {
                PanicButtonTextBlock.Text = "[Press any key]";
            };
        }
Example #5
0
 public void SetHotkey(HotkeyButton i)
 {
     hotkey = i;
 }