예제 #1
0
파일: Main.cs 프로젝트: Cerberus-ik/Cetus
        private void Form1_Load(object sender, EventArgs e)
        {
            new ToolTip().SetToolTip(checkBoxEnergyMode, "Disables the live viewing field on the minimap");

            //String[] args = new String[0];
            //args[0] = "500";
            //args[1] = "500";

            game = new Game();

            designer = new Designer(game);
            designer.scaling = scaleFactor;
            designer.initializeBitmap(game.spielbrett.Spielfelder);

            drawBitmap();
            drawMinimap();

            sliderSpeed.MouseWheel += sliderSpeed_MouseWheel;
            trackBarFieldPercent.MouseWheel += tracktrackBarFieldPercent__MouseWheel;
            trackBarScalingLevel.MouseWheel += trackBarScalingLevel_MouseWheel;

            this.MouseWheel += cetusForm_MouseWheel;
            this.Resize += Form1_Resize;

            _timer = new DispatcherTimer(DispatcherPriority.Normal);
            _timer.Tick += new EventHandler(dispTimer_Tick);
            _timer.Interval = TimeSpan.FromMilliseconds(500);

            pictureBox.MouseDown += pictureBox_MouseDown;
            pictureBox.MouseMove += pictureBox_MouseMove;
            pictureBox.MouseUp += pictureBox_MouseUp;
        }
예제 #2
0
파일: Main.cs 프로젝트: Cerberus-ik/Cetus
        private void btnApply_Click(object sender, EventArgs e)
        {
            int width;
            int height;

            bool widthValid = Int32.TryParse(txtBoxWidth.Text, out width);
            bool heightValid = Int32.TryParse(txtBoxHeight.Text, out height);

            if (!heightValid || !widthValid)
            {
                MessageBox.Show("Please enter valid values");
                return;
            }

            if (height <= 1 || height > 5000 || width <= 1 || width > 5000)
            {
                MessageBox.Show("Please enter valid values");
                return;
            }

            game = new Game();
            game.initializeSpielBrett(width, height);

            designer = new Designer(game);
            designer.scaling = scaleFactor;
            designer.initializeBitmap(game.spielbrett.Spielfelder);

            drawBitmap();
            drawMinimap();
        }