Example #1
0
        private void LoadForm_Load(object sender, EventArgs e)
        {
            //this.MaximumSize = this.Size;
            //g = this.CreateGraphics();
            this.labelIp.Click += new EventHandler(
                (object responsable, EventArgs evento) =>
            {
                this.textBoxIp.Focus();
            });
            this.labelPuerto.Click += new EventHandler(
                (object responsable, EventArgs evento) =>
            {
                this.textBoxPuerto.Focus();
            });
            this.buttonEmpezar.Click += new EventHandler(
                (object responsable, EventArgs evento) =>
            {
                if (this.textBoxIp.Text.Equals("debug"))
                {
                    return;
                }
                if (this.textBoxIp.Text.Length == 0 && this.textBoxPuerto.Text.Length == 0)
                {
                    return;
                }


                searchRustProcess(out rustProcess);
                if (rustProcess == null)
                {
                    MessageBox.Show("No se ha encontrado ningĂșn proceso de Rust activo ...");
                    return;
                }

                overlay             = Overlay.getInstance(rustProcess);
                overlay.FormClosed += new FormClosedEventHandler(
                    (object enviador, FormClosedEventArgs even) =>
                {
                    this.Show();
                });

                this.Hide();

                overlay.start(this.textBoxIp.Text, Convert.ToInt32(this.textBoxPuerto.Text));

                //this.working = true;
            });
        }
Example #2
0
        private Controller()
        {
            InitializeComponent();

            int maxX = SystemInfo.getSystemInfo(SystemInfo.SystemMetric.SM_CXFULLSCREEN) / 2;
            int maxY = SystemInfo.getSystemInfo(SystemInfo.SystemMetric.SM_CYFULLSCREEN) / 2;

            this.trackBarXCrosshairOffset.Minimum = maxX * -1;
            this.trackBarXCrosshairOffset.Maximum = maxX;

            this.trackBarYCrosshairOffset.Minimum = maxY * -1;
            this.trackBarYCrosshairOffset.Maximum = maxY;

            this.buttonCerrar.Click += new EventHandler(
                (object sender, EventArgs e) =>
            {
                Overlay.getInstance(null).Stop();
                this.Close();
            });
        }