コード例 #1
0
ファイル: frmMain.cs プロジェクト: ticktickMOF/Clipper
        /// <summary>
        /// Launches the character selection form.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void selectCharacterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Ensure all hacks are disabled..
            Player.UseExclusions = false;
            Player.UseGMFlag     = false;
            Player.UseJAWait0    = false;
            Player.UseSpeedHack  = false;
            Player.UseStatusHack = false;
            Player.UseZCoordHack = false;

            // Ensure JAWait0 is disabled..
            if (Player.JAWait0Thread != null)
            {
                Player.UseJAWait0 = false;
                Player.JAWait0Thread.Join();
            }

            // Disable the form controls..
            this.DisableFormControls();

            // Show character selector..
            var charSelect = new frmSelectCharacter();

            if (charSelect.ShowDialog() == DialogResult.OK)
            {
                this.EnableFormControls();
            }
        }
コード例 #2
0
ファイル: frmMain.cs プロジェクト: KenshiDRK/Clipper
        /// <summary>
        /// Launches the character selection form.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void selectCharacterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Ensure all hacks are disabled..
            Player.UseExclusions = false;
            Player.UseGMFlag = false;
            Player.UseJAWait0 = false;
            Player.UseSpeedHack = false;
            Player.UseStatusHack = false;
            Player.UseZCoordHack = false;

            // Ensure JAWait0 is disabled..
            if (Player.JAWait0Thread != null)
            {
                Player.UseJAWait0 = false;
                Player.JAWait0Thread.Join();
            }

            // Disable the form controls..
            this.DisableFormControls();

            // Show character selector..
            var charSelect = new frmSelectCharacter();
            if (charSelect.ShowDialog() == DialogResult.OK)
            {
                this.EnableFormControls();
            }
        }
コード例 #3
0
ファイル: frmMain.cs プロジェクト: ticktickMOF/Clipper
        /// <summary>
        /// Default Constructor
        /// </summary>
        public frmMain()
        {
            InitializeComponent();

            // Set always on top option..
            this.TopMost = Globals.Instance.Config.AlwaysOnTop;

            // Set minimize to tray option..
            this.niTrayIcon.Visible = Globals.Instance.Config.MinimizeToTray;

            // Disable the form controls..
            this.DisableFormControls();

            // Show character selector..
            var charSelect = new frmSelectCharacter();

            if (charSelect.ShowDialog() == DialogResult.OK)
            {
                this.EnableFormControls();
            }

            // Setup application exit event handler..
            Globals.Instance.IsClosing   = false;
            Application.ApplicationExit += (sender, args) =>
            {
                // Inform the application we are closing..
                Globals.Instance.IsClosing = true;

                // Cancel the JAWait0 thread..
                if (Player.JAWait0Thread != null)
                {
                    Player.JAWait0Thread.Join();
                }
            };

            // Enable scan thread..
            var scanThread = new Thread(() =>
            {
                while (!Globals.Instance.IsClosing)
                {
                    Thread.Sleep(100);

                    // Skip if process is missing..
                    if (Globals.Instance.CurrentProcess == null || Globals.Instance.CurrentProcess.HasExited)
                    {
                        continue;
                    }

                    // Update the players speed..
                    this.InvokeEx(f =>
                    {
                        var speed             = Player.Speed;
                        f.lblPlayerSpeed.Text = string.Format("{0} ({1}%)", speed.ToString(), Math.Round(100 * (speed / 5 - 1)));
                    });

                    // Scan for detections..
                    Player.ScanForPlayers();

                    // Disply status..
                    if (Player.IsDetectingPlayer)
                    {
                        this.InvokeEx(f => f.lblDetectStatus.ForeColor = Color.Red);
                        this.InvokeEx(f => f.lblDetectStatus.Text      = Player.DetectedPlayerName);
                    }
                    else
                    {
                        this.InvokeEx(f => f.lblDetectStatus.ForeColor = Color.Lime);
                        this.InvokeEx(f => f.lblDetectStatus.Text      = "Undetected!");
                    }

                    // Display player name attached to..
                    this.InvokeEx(f =>
                    {
                        var name = Player.Name;
                        f.ssCharacterName.Text = (String.IsNullOrEmpty(name)) ? "None" : name;
                        f.niTrayIcon.Text      = (String.IsNullOrEmpty(name)) ? "Clipper" : name;
                    });
                }
            })
            {
                IsBackground = true
            };

            scanThread.Start();

            // Tooltip Initialization..
            var toolTip = new ToolTip
            {
                AutoPopDelay = 5000,
                InitialDelay = 500,
                ReshowDelay  = 500,
                ShowAlways   = true
            };

            toolTip.SetToolTip(this.chkUseExclusions, "Enables the use of player and zone exclusions.");
            toolTip.SetToolTip(this.chkAutoDisableJAWait0, "Enables or disables the auto-disable feature while using JAWait0.");
            toolTip.SetToolTip(this.chkAutoDisablePositionHacks, "Enables or disables the auto-disable feature while using positional hacks.");
            toolTip.SetToolTip(this.chkAutoDisableSpeedHack, "Enables or disables the auto-disable feature while using the speed hack.");
            toolTip.SetToolTip(this.chkEnableSpeedHack, "Enables or disables the use of the speed hack.");
            toolTip.SetToolTip(this.chkLockZCoord, "Enables or disables locking the players Z axis.");
            toolTip.SetToolTip(this.chkStatusAutoDisable, "Enables or disables the auto-disable feature while using status hacks.");
            toolTip.SetToolTip(this.chkUseGMFlag, "Enables or disables the use of the GM flag hack.");
            toolTip.SetToolTip(this.chkUseJAWait0, "Enables or disables the use of the JAWai0 hack.");
            toolTip.SetToolTip(this.rbStatusNone, "Sets the players status to none and disables the status hack.");
            toolTip.SetToolTip(this.rbStatusChocobo, "Sets the players status to riding a chocobo.");
            toolTip.SetToolTip(this.rbStatusMaintenance, "Sets the players status to maintenance mode. (Clipping)");
            toolTip.SetToolTip(this.tbPlayerSpeed, "Sets the players speed while using the speed hack.");
            toolTip.SetToolTip(this.tbPlayerSpeedDisabled, "Sets the players disabled speed while using the speed hack.");
            toolTip.SetToolTip(this.btnPosD, "Bumps a players position down.");
            toolTip.SetToolTip(this.btnPosE, "Bumps a players position east.");
            toolTip.SetToolTip(this.btnPosN, "Bumps a players position north.");
            toolTip.SetToolTip(this.btnPosNE, "Bumps a players position north-east.");
            toolTip.SetToolTip(this.btnPosNW, "Bumps a players position north-west.");
            toolTip.SetToolTip(this.btnPosS, "Bumps a players position south.");
            toolTip.SetToolTip(this.btnPosSE, "Bumps a players position south-east.");
            toolTip.SetToolTip(this.btnPosSW, "Bumps a players position south-west.");
            toolTip.SetToolTip(this.btnPosU, "Bumps a players position up.");
            toolTip.SetToolTip(this.btnPosW, "Bumps a players position west.");
        }
コード例 #4
0
ファイル: frmMain.cs プロジェクト: KenshiDRK/Clipper
        /// <summary>
        /// Default Constructor
        /// </summary>
        public frmMain()
        {
            InitializeComponent();

            // Set always on top option..
            this.TopMost = Globals.Instance.Config.AlwaysOnTop;

            // Set minimize to tray option..
            this.niTrayIcon.Visible = Globals.Instance.Config.MinimizeToTray;

            // Disable the form controls..
            this.DisableFormControls();

            // Show character selector..
            var charSelect = new frmSelectCharacter();
            if (charSelect.ShowDialog() == DialogResult.OK)
            {
                this.EnableFormControls();
            }

            // Setup application exit event handler..
            Globals.Instance.IsClosing = false;
            Application.ApplicationExit += (sender, args) =>
                {
                    // Inform the application we are closing..
                    Globals.Instance.IsClosing = true;

                    // Cancel the JAWait0 thread..
                    if (Player.JAWait0Thread != null)
                        Player.JAWait0Thread.Join();
                };

            // Enable scan thread..
            var scanThread = new Thread(() =>
                {
                    while (!Globals.Instance.IsClosing)
                    {
                        Thread.Sleep(100);

                        // Skip if process is missing..
                        if (Globals.Instance.CurrentProcess == null || Globals.Instance.CurrentProcess.HasExited)
                        {
                            continue;
                        }

                        // Update the players speed..
                        this.InvokeEx(f =>
                            {
                                var speed = Player.Speed;
                                f.lblPlayerSpeed.Text = string.Format("{0} ({1}%)", speed.ToString(), Math.Round(100 * (speed / 5 - 1)));
                            });

                        // Scan for detections..
                        Player.ScanForPlayers();

                        // Disply status..
                        if (Player.IsDetectingPlayer)
                        {
                            this.InvokeEx(f => f.lblDetectStatus.ForeColor = Color.Red);
                            this.InvokeEx(f => f.lblDetectStatus.Text = Player.DetectedPlayerName);
                        }
                        else
                        {
                            this.InvokeEx(f => f.lblDetectStatus.ForeColor = Color.Lime);
                            this.InvokeEx(f => f.lblDetectStatus.Text = "Undetected!");
                        }

                        // Display player name attached to..
                        this.InvokeEx(f =>
                            {
                                var name = Player.Name;
                                f.ssCharacterName.Text = (String.IsNullOrEmpty(name)) ? "None" : name;
                                f.niTrayIcon.Text = (String.IsNullOrEmpty(name)) ? "Clipper" : name;
                            });
                    }
                })
                {
                    IsBackground = true
                };
            scanThread.Start();

            // Tooltip Initialization..
            var toolTip = new ToolTip
                {
                    AutoPopDelay = 5000,
                    InitialDelay = 500,
                    ReshowDelay = 500,
                    ShowAlways = true
                };
            toolTip.SetToolTip(this.chkUseExclusions, "Enables the use of player and zone exclusions.");
            toolTip.SetToolTip(this.chkAutoDisableJAWait0, "Enables or disables the auto-disable feature while using JAWait0.");
            toolTip.SetToolTip(this.chkAutoDisablePositionHacks, "Enables or disables the auto-disable feature while using positional hacks.");
            toolTip.SetToolTip(this.chkAutoDisableSpeedHack, "Enables or disables the auto-disable feature while using the speed hack.");
            toolTip.SetToolTip(this.chkEnableSpeedHack, "Enables or disables the use of the speed hack.");
            toolTip.SetToolTip(this.chkLockZCoord, "Enables or disables locking the players Z axis.");
            toolTip.SetToolTip(this.chkStatusAutoDisable, "Enables or disables the auto-disable feature while using status hacks.");
            toolTip.SetToolTip(this.chkUseGMFlag, "Enables or disables the use of the GM flag hack.");
            toolTip.SetToolTip(this.chkUseJAWait0, "Enables or disables the use of the JAWai0 hack.");
            toolTip.SetToolTip(this.rbStatusNone, "Sets the players status to none and disables the status hack.");
            toolTip.SetToolTip(this.rbStatusChocobo, "Sets the players status to riding a chocobo.");
            toolTip.SetToolTip(this.rbStatusMaintenance, "Sets the players status to maintenance mode. (Clipping)");
            toolTip.SetToolTip(this.tbPlayerSpeed, "Sets the players speed while using the speed hack.");
            toolTip.SetToolTip(this.tbPlayerSpeedDisabled, "Sets the players disabled speed while using the speed hack.");
            toolTip.SetToolTip(this.btnPosD, "Bumps a players position down.");
            toolTip.SetToolTip(this.btnPosE, "Bumps a players position east.");
            toolTip.SetToolTip(this.btnPosN, "Bumps a players position north.");
            toolTip.SetToolTip(this.btnPosNE, "Bumps a players position north-east.");
            toolTip.SetToolTip(this.btnPosNW, "Bumps a players position north-west.");
            toolTip.SetToolTip(this.btnPosS, "Bumps a players position south.");
            toolTip.SetToolTip(this.btnPosSE, "Bumps a players position south-east.");
            toolTip.SetToolTip(this.btnPosSW, "Bumps a players position south-west.");
            toolTip.SetToolTip(this.btnPosU, "Bumps a players position up.");
            toolTip.SetToolTip(this.btnPosW, "Bumps a players position west.");
        }