Exemple #1
0
        void Button1_Click(object sender, EventArgs e)
        {
            var demo = new ShiftDemo();

            ShiftWM.Init(demo, textBox1.Text, null);
            ShiftWM.StartInfoboxSession(textBox1.Text, textBox2.Text, InfoboxTemplate.ButtonType.Ok);
        }
Exemple #2
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            var shiftColors = new Color[14];

            using (var fobj = File.OpenRead(@"C:\Users\Public\Documents\Skin.whoa"))
                shiftColors = Whoa.Whoa.DeserialiseObject <Color[]>(fobj);

            ShiftSkinData.LeftTopCornerColor     = shiftColors[0];
            ShiftSkinData.TitleBarColor          = shiftColors[1];
            ShiftSkinData.RightTopCornerColor    = shiftColors[2];
            ShiftSkinData.LeftSideColor          = shiftColors[3];
            ShiftSkinData.RightSideColor         = shiftColors[4];
            ShiftSkinData.LeftBottomCornerColor  = shiftColors[5];
            ShiftSkinData.BottomSideColor        = shiftColors[6];
            ShiftSkinData.RightBottomCornerColor = shiftColors[7];
            ShiftSkinData.BtnCloseColor          = shiftColors[8];
            ShiftSkinData.BtnMaxColor            = shiftColors[9];
            ShiftSkinData.BtnMinColor            = shiftColors[10];
            ShiftSkinData.BtnCloseHoverColor     = shiftColors[11];
            ShiftSkinData.BtnMaxHoverColor       = shiftColors[12];
            ShiftSkinData.BtnMinHoverColor       = shiftColors[13];

            button5_Click(sender, e);
            ShiftWM.StartInfoboxSession(
                "Loaded Skin",
                "Loaded Skin from C:\\Users\\Public\\Documents\\Skin.whoa",
                InfoboxTemplate.ButtonType.Ok);
        }
Exemple #3
0
        Color SetColor()
        {
            _colorType1 = int.Parse(redUpDown.Value.ToString(CultureInfo.InvariantCulture));
            _colorType2 = int.Parse(greenUpDown.Value.ToString(CultureInfo.InvariantCulture));
            _colorType3 = int.Parse(blueUpDown.Value.ToString(CultureInfo.InvariantCulture));
            try
            {
                _finalColor = Color.FromArgb(_colorType1, _colorType2, _colorType3);


                foreach (var window in ShiftWM.Windows)
                {
                    window.Invoke(new Action(() => window.titleBar.BackColor = _finalColor));
                }


                ShiftWM.StartInfoboxSession(
                    "Success!",
                    $"Changed color to:\r\n{_colorType1}, {_colorType2}, {_colorType3}.",
                    InfoboxTemplate.ButtonType.Ok);
            }
            catch (Exception)
            {
                ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok);
            }
            return(_finalColor);
        }
Exemple #4
0
        void btnSave_Click(object sender, EventArgs e)
        {
            var shiftColors = new Color[14];

            shiftColors[0]  = ShiftSkinData.LeftTopCornerColor;
            shiftColors[1]  = ShiftSkinData.TitleBarColor;
            shiftColors[2]  = ShiftSkinData.RightTopCornerColor;
            shiftColors[3]  = ShiftSkinData.LeftSideColor;
            shiftColors[4]  = ShiftSkinData.RightSideColor;
            shiftColors[5]  = ShiftSkinData.LeftBottomCornerColor;
            shiftColors[6]  = ShiftSkinData.BottomSideColor;
            shiftColors[7]  = ShiftSkinData.RightBottomCornerColor;
            shiftColors[8]  = ShiftSkinData.BtnCloseColor;
            shiftColors[9]  = ShiftSkinData.BtnMaxColor;
            shiftColors[10] = ShiftSkinData.BtnMinColor;
            shiftColors[11] = ShiftSkinData.BtnCloseHoverColor;
            shiftColors[12] = ShiftSkinData.BtnMaxHoverColor;
            shiftColors[13] = ShiftSkinData.BtnMinHoverColor;

            using (var fobj = File.OpenWrite(@"C:\Users\Public\Documents\Skin.whoa"))
                Whoa.Whoa.SerialiseObject(fobj, shiftColors);

            ShiftWM.StartInfoboxSession(
                "Saved Skin",
                "Saved Skin to C:\\Users\\Public\\Documents\\Skin.whoa",
                InfoboxTemplate.ButtonType.Ok);
        }
Exemple #5
0
        void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (IsEdited())
            {
                MessageBox.Show("yay it works");
            }
            var f = new FileOpener();

            ShiftWM.Init(f, "testing", null);
        }
Exemple #6
0
        private void gameTimer_Tick(object sender, EventArgs e)
        {
            ball.Top  += (int)ballY;
            ball.Left += (int)ballX;

            if (ball.Bottom > ClientSize.Height || ball.Top < 0)
            {
                ballY = -ballY;
            }
            if (ball.Right > ClientSize.Width || ball.Left < 0)
            {
                ballX = -ballX;
            }
            if (ball.Bounds.IntersectsWith(playerPaddle.Bounds))
            {
                ballY = -ballY;
            }
            if (goRight)
            {
                playerPaddle.Left += 8;
            }
            if (goLeft)
            {
                playerPaddle.Left -= 8;
            }
            if (playerPaddle.Left < 1)
            {
                goLeft = false;
            }
            if (playerPaddle.Left + playerPaddle.Width > this.Width)
            {
                goRight = false;
            }

            for (int j = 0; j < rows; j++)
            {
                for (int i = 0; i < col; i++)
                {
                    if (ball.Bounds.IntersectsWith(blocks[j, i].Bounds) && blocks[j, i].Visible)
                    {
                        ballY = -ballY;
                        blocks[j, i].Visible = false;
                    }
                }
            }
            if (ball.Top + ball.Height > ClientSize.Height)
            {
                gameTimer.Stop();
                var infoBox = ShiftWM.StartInfoboxSession("Breakout - You Lose! ", "It appears that you have lost the game, meaning\nall codepoints won were lost. Would you\nlike to try again?", InfoboxTemplate.ButtonType.YesNo);
                ShiftWM.StartInfoboxSession(null, infoBox.isOK.ToString(), InfoboxTemplate.ButtonType.Ok);
                infoBox.btnOpt1.Click += InfoboxYes;
                infoBox.btnOpt2.Click += InfoboxYes;
            }
        }
Exemple #7
0
 private void shiftButton1_Click(object sender, EventArgs e)
 {
     ShiftWM.StartInfoboxSession("Test", "lol", InfoboxTemplate.ButtonType.Ok);
 }
Exemple #8
0
 void button2_Click(object sender, EventArgs e)
 => ShiftWM.Init(new Shifter(), "Shifter", Resources.iconShifter);
Exemple #9
0
 private void breakOutToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ShiftWM.Init(new Apps.Breakout(), "Breakout", null);
 }
Exemple #10
0
        private void terminalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var t = new Apps.Terminal();

            ShiftWM.Init(t, "Terminal", Resources.iconTerminal, false);
        }
Exemple #11
0
 private void fileSkimmerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ShiftWM.Init(new Apps.FileSkimmer(), "FileSkimmer", Properties.Resources.iconFileSkimmer);
 }
Exemple #12
0
 private void terminalToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ShiftWM.Init(new Apps.Terminal(), "Terminal", Properties.Resources.iconTerminal);
 }
Exemple #13
0
        private void fileSkimmerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var fs = new FileSkimmer();

            ShiftWM.Init(fs, "File Skimmer", Resources.iconFileSkimmer);
        }
Exemple #14
0
        private void textPadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var t = new TextPad();

            ShiftWM.Init(t, "TextPad", Resources.iconTextPad);
        }
Exemple #15
0
 void button1_Click(object sender, EventArgs e)
 {
     ColorType = 1;
     ShiftWM.Init(new SelectColor(), "Select a color", Resources.iconColourPicker_fw);
 }
Exemple #16
0
 private void textPadToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ShiftWM.Init(new Apps.TextPad(), "TextPad", Properties.Resources.iconTextPad);
 }
Exemple #17
0
 private void shifterToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Apps.ShifterStuff.Shifter app = new Apps.ShifterStuff.Shifter();
     ShiftWM.Init(app, "Shifter", null);
 }