public InGameMenu()
        {
            Size        = new Vector2(250, 400);
            LargeWindow = true;

            FlowLayout leftButtons = new FlowLayout
            {
                HorizontalFill = true,
                AutoSize       = true,
                Newline        = false,
                Anchor         = Graphics.Orientation.Left
            };

            bottomBar.AddChild(leftButtons);
            ButtonBase returnToMainMenu = new StoneButton
            {
                Text = Locale.Resource.GenQuit
            };

            returnToMainMenu.Click += new EventHandler(returnToMainMenu_Click);
            leftButtons.AddChild(returnToMainMenu);

            ButtonBase restart = new StoneButton
            {
                Text = Locale.Resource.GenRestart
            };

            restart.Click += new EventHandler(restart_Click);
            leftButtons.AddChild(restart);

            ButtonBase options = new StoneButton
            {
                Text = Locale.Resource.GenOptions
            };

            options.Click += new EventHandler(options_Click);
            leftButtons.AddChild(options);

            ButtonBase returnToGame = new LargeStoneButton
            {
                Text   = Locale.Resource.GenResume,
                Anchor = global::Graphics.Orientation.Right,
                Hotkey = new KeyCombination {
                    Key = System.Windows.Forms.Keys.Escape
                },
                Size = new Vector2(210, 62)
            };

            returnToGame.Click += new EventHandler(returnToGame_Click);
            bottomBar.AddChild(returnToGame);
            Result = InGameMenuResult.Resume;
        }
Exemplo n.º 2
0
        public CustomMapControl()
        {
            Background = InterfaceScene.DefaultFormBorder;
            Background.Alpha = 0.2f;
            Size = new Vector2(500, 150);
            Padding = new System.Windows.Forms.Padding(10);

            LargeStoneButton openButton = new LargeStoneButton
            {
                Text = "Open custom map",
                Anchor = Orientation.Center,
                Size = new Vector2(300, 62)
            };
            openButton.Click += new EventHandler(openButton_Click);
            AddChild(openButton);
        }
Exemplo n.º 3
0
        public CustomMapControl()
        {
            Background       = InterfaceScene.DefaultFormBorder;
            Background.Alpha = 0.2f;
            Size             = new Vector2(500, 150);
            Padding          = new System.Windows.Forms.Padding(10);

            LargeStoneButton openButton = new LargeStoneButton
            {
                Text   = "Open custom map",
                Anchor = Orientation.Center,
                Size   = new Vector2(300, 62)
            };

            openButton.Click += new EventHandler(openButton_Click);
            AddChild(openButton);
        }
        public InGameMenu()
        {
            Size = new Vector2(250, 400);
            LargeWindow = true;

            FlowLayout leftButtons = new FlowLayout
            {
                HorizontalFill = true,
                AutoSize = true,
                Newline = false,
                Anchor = Graphics.Orientation.Left
            };
            bottomBar.AddChild(leftButtons);
            ButtonBase returnToMainMenu = new StoneButton
            {
                Text = Locale.Resource.GenQuit
            };
            returnToMainMenu.Click += new EventHandler(returnToMainMenu_Click);
            leftButtons.AddChild(returnToMainMenu);

            ButtonBase restart = new StoneButton
            {
                Text = Locale.Resource.GenRestart
            };
            restart.Click += new EventHandler(restart_Click);
            leftButtons.AddChild(restart);

            ButtonBase options = new StoneButton
            {
                Text = Locale.Resource.GenOptions
            };
            options.Click += new EventHandler(options_Click);
            leftButtons.AddChild(options);

            ButtonBase returnToGame = new LargeStoneButton
            {
                Text = Locale.Resource.GenResume,
                Anchor = global::Graphics.Orientation.Right,
                Hotkey = new KeyCombination { Key = System.Windows.Forms.Keys.Escape },
                Size = new Vector2(210, 62)
            };
            returnToGame.Click += new EventHandler(returnToGame_Click);
            bottomBar.AddChild(returnToGame);
            Result = InGameMenuResult.Resume;
        }
Exemplo n.º 5
0
        public ChallengeMapMenuControl()
        {
            Dock = System.Windows.Forms.DockStyle.Fill;
            AddChild(new ChallengeBackgroundControl());
            AddChild(new GameLogoChallengeImage
            {
                Anchor   = Orientation.Top,
                Position = new Vector2(-15, 50)
            });

            Control profilePanel = new FlowLayout
            {
                HorizontalFill = true,
                Newline        = false,
                AutoSize       = true,
                Anchor         = Orientation.BottomLeft,
                Position       = new Vector2(10, 10),
                Size           = new Vector2(400, 20),
                Origin         = FlowOrigin.BottomRight
            };

            AddChild(profilePanel);
            Control changeProfile = new ClickableTextButton
            {
                Text       = "(Change)",
                AutoSize   = AutoSizeMode.Full,
                Background = null,
            };

            profilePanel.AddChild(changeProfile);
            changeProfile.Click += new EventHandler(profile_Click);
            profilePanel.AddChild(profileName);

            Control buttonsPanel = new Control
            {
                Background = InterfaceScene.DefaultFormBorder,
                Size       = new Vector2(400, 150),
                Anchor     = Orientation.Top,
                Position   = new Vector2(0, 500),
                Padding    = new System.Windows.Forms.Padding(10)
            };

            AddChild(buttonsPanel);

            if (!String.IsNullOrEmpty(Program.Settings.ChallengeSurveyLink))
            {
                var u = new Uri(Program.Settings.ChallengeSurveyLink);
                var s = u.ToString();
                if (!u.IsFile)
                {
                    //Control feedback = new Control
                    //{
                    //    Background = InterfaceScene.DefaultFormBorder,
                    //    Anchor = Orientation.Top,
                    //    Position = new Vector2(300, 500),
                    //    Size=  new Vector2(300, 100),
                    //    Padding = new System.Windows.Forms.Padding(10)
                    //};
                    //AddChild(feedback);
                    //feedback.AddChild(new TextBox
                    //{
                    //    Text = "Tell us what you think of the game!",
                    //    Clickable = false,
                    //    Background = null,
                    //    AutoSize = AutoSizeMode.Full,
                    //});
                    Control survey = new ClickableTextButton
                    {
                        Text       = "Tell us what you think!",
                        Anchor     = Orientation.Right,
                        AutoSize   = AutoSizeMode.Full,
                        Background = null,
                        Position   = new Vector2(25, 45)
                    };
                    survey.Click += new EventHandler((o, e) =>
                    {
                        Util.StartBrowser(s);
                    });
                    buttonsPanel.AddChild(survey);
                }
            }

            ButtonBase challenge = new LargeStoneButton
            {
                Anchor   = Orientation.Right,
                Position = new Vector2(25, 0),
                Text     = "Play"
            };

            buttonsPanel.AddChild(challenge);
            challenge.Click += new EventHandler(challenge_Click);

            ButtonBase tutorial = new StoneButton
            {
                Anchor   = Orientation.TopLeft,
                Position = new Vector2(0, 0),
                Text     = "Tutorial"
            };

            buttonsPanel.AddChild(tutorial);
            tutorial.Click += new EventHandler(tutorial_Click);

            ButtonBase options = new StoneButton
            {
                Anchor   = Orientation.TopLeft,
                Position = new Vector2(0, 45),
                Text     = "Options"
            };

            buttonsPanel.AddChild(options);
            options.Click += new EventHandler(options_Click);

            ButtonBase exit = new StoneButton
            {
                Anchor   = Orientation.TopLeft,
                Position = new Vector2(0, 90),
                Text     = "Exit"
            };

            buttonsPanel.AddChild(exit);
            exit.Click += new EventHandler(exit_Click);

            if (!String.IsNullOrEmpty(Program.Settings.HallOfFameAddress))
            {
                var u = new Uri(Program.Settings.HallOfFameAddress);
                var s = u.ToString();
                if (!u.IsFile)
                {
                    Control hof = new Button
                    {
                        Anchor       = Orientation.Top,
                        Position     = new Vector2(0, 655),
                        HoverTexture = new TextureFromFile("Interface/Common/HallOfFame2Mouseover1.png")
                        {
                            DontScale = true
                        },
                        NormalTexture = new TextureFromFile("Interface/Common/HallOfFame2.png")
                        {
                            DontScale = true
                        },
                        ClickTexture = new TextureFromFile("Interface/Common/HallOfFame2.png")
                        {
                            DontScale = true
                        },
                        Background = new ImageGraphic
                        {
                        },
                        Size = new Vector2(260, 38)
                    };
                    hof.Click += new EventHandler((o, e) =>
                    {
                        Util.StartBrowser(s);
                    });
                    AddChild(hof);
                }
            }

            fader = new Fader {
                State = FadeState.FadedOut
            };
            AddChild(fader);
            Updateable = true;
        }
Exemplo n.º 6
0
        public SelectProfileControl()
        {
            Background       = InterfaceScene.DefaultFormBorder;
            Size             = new Vector2(500, 200);
            Padding          = new System.Windows.Forms.Padding(20);
            Background.Alpha = 0.2f;

            Control right = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Fill
            };
            Control left = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Left,
                Size = new Vector2(140, 0)
            };

            Control profileContainer = new Control
            {
                Size   = new Vector2(243, 70),
                Anchor = Orientation.Top
            };

            profileContainer.AddChild(new Label
            {
                Text       = Locale.Resource.GenProfile,
                AutoSize   = AutoSizeMode.Full,
                Font       = Fonts.Default,
                Anchor     = Orientation.TopLeft,
                Background = null,
            });
            profiles = new StoneDropDownBar
            {
                Position = new Vector2(0, 15),
                Anchor   = Orientation.TopLeft
            };
            profileContainer.AddChild(profiles);
            PopuplateProfiles();

            Control newRemoveFlow = new FlowLayout
            {
                HorizontalFill = true,
                Newline        = false,
                AutoSize       = true,
                Position       = new Vector2(0, 45),
                Anchor         = Orientation.TopRight,
            };

            profileContainer.AddChild(newRemoveFlow);

            var newProfile = new ClickableTextButton
            {
                Text       = Locale.Resource.GenNew,
                AutoSize   = AutoSizeMode.Full,
                TextAnchor = Orientation.Center,
                Margin     = new System.Windows.Forms.Padding(3, 0, 3, 0)
            };

            newProfile.Click += new EventHandler(newProfile_Click);
            newRemoveFlow.AddChild(newProfile);

            var removeProfile = new ClickableTextButton
            {
                Text       = Locale.Resource.GenRemove,
                AutoSize   = AutoSizeMode.Full,
                TextAnchor = Orientation.Center,
                Margin     = new System.Windows.Forms.Padding(3, 0, 3, 0)
            };

            removeProfile.Click += new EventHandler(removeProfile_Click);
            newRemoveFlow.AddChild(removeProfile);

            var start = new LargeStoneButton
            {
                Text     = Locale.Resource.GenLogin,
                Position = new Vector2(0, 90),
                Anchor   = Orientation.Top,
                Size     = new Vector2(230, 62)
            };

            start.Click += new EventHandler(start_Click);
            right.AddChild(start);

            FlowLayout leftFlow = new FlowLayout
            {
                AutoSize       = true,
                HorizontalFill = false,
                Newline        = false,
                Anchor         = Orientation.Center
            };

            left.AddChild(leftFlow);


            var support = new StoneButton
            {
                Text   = Locale.Resource.GenSupport,
                Margin = new System.Windows.Forms.Padding(5)
            };

            support.Click += new EventHandler(support_Click);
            leftFlow.AddChild(support);

            var options = new StoneButton
            {
                Text   = Locale.Resource.GenOptions,
                Margin = new System.Windows.Forms.Padding(5)
            };

            options.Click += new EventHandler(options_Click);
            leftFlow.AddChild(options);

            var quit = new StoneButton
            {
                Text   = Locale.Resource.GenQuit,
                Margin = new System.Windows.Forms.Padding(5)
            };

            quit.Click += new EventHandler(quit_Click);
            leftFlow.AddChild(quit);

            right.AddChild(profileContainer);
            AddChild(left);

            AddChild(new Control
            {
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureConcretizer
                    {
                        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 255, 255))
                    },
                    SizeMode = SizeMode.AutoAdjust
                },
                Dock = System.Windows.Forms.DockStyle.Left,
                Size = new Vector2(1, 1)
            });

            AddChild(right);
        }
        public ChallengeMapMenuControl()
        {
            Dock = System.Windows.Forms.DockStyle.Fill;
            AddChild(new ChallengeBackgroundControl());
            AddChild(new GameLogoChallengeImage
            {
                Anchor = Orientation.Top,
                Position = new Vector2(-15, 50)
            });

            Control profilePanel = new FlowLayout
            {
                HorizontalFill = true,
                Newline = false,
                AutoSize = true,
                Anchor = Orientation.BottomLeft,
                Position = new Vector2(10, 10),
                Size = new Vector2(400, 20),
                Origin = FlowOrigin.BottomRight
            };
            AddChild(profilePanel);
            Control changeProfile = new ClickableTextButton
            {
                Text = "(Change)",
                AutoSize = AutoSizeMode.Full,
                Background = null,
            };
            profilePanel.AddChild(changeProfile);
            changeProfile.Click += new EventHandler(profile_Click);
            profilePanel.AddChild(profileName);

            Control buttonsPanel = new Control
            {
                Background = InterfaceScene.DefaultFormBorder,
                Size = new Vector2(400, 150),
                Anchor = Orientation.Top,
                Position = new Vector2(0, 500),
                Padding = new System.Windows.Forms.Padding(10)
            };
            AddChild(buttonsPanel);

            if (!String.IsNullOrEmpty(Program.Settings.ChallengeSurveyLink))
            {
                var u = new Uri(Program.Settings.ChallengeSurveyLink);
                var s = u.ToString();
                if (!u.IsFile)
                {
                    //Control feedback = new Control
                    //{
                    //    Background = InterfaceScene.DefaultFormBorder,
                    //    Anchor = Orientation.Top,
                    //    Position = new Vector2(300, 500),
                    //    Size=  new Vector2(300, 100),
                    //    Padding = new System.Windows.Forms.Padding(10)
                    //};
                    //AddChild(feedback);
                    //feedback.AddChild(new TextBox
                    //{
                    //    Text = "Tell us what you think of the game!",
                    //    Clickable = false,
                    //    Background = null,
                    //    AutoSize = AutoSizeMode.Full,
                    //});
                    Control survey = new ClickableTextButton
                    {
                        Text = "Tell us what you think!",
                        Anchor = Orientation.Right,
                        AutoSize = AutoSizeMode.Full,
                        Background = null,
                        Position = new Vector2(25, 45)
                    };
                    survey.Click += new EventHandler((o, e) =>
                    {
                        Util.StartBrowser(s);
                    });
                    buttonsPanel.AddChild(survey);
                }
            }

            ButtonBase challenge = new LargeStoneButton
            {
                Anchor = Orientation.Right,
                Position = new Vector2(25, 0),
                Text = "Play"
            };
            buttonsPanel.AddChild(challenge);
            challenge.Click += new EventHandler(challenge_Click);

            ButtonBase tutorial = new StoneButton
            {
                Anchor = Orientation.TopLeft,
                Position = new Vector2(0, 0),
                Text = "Tutorial"
            };
            buttonsPanel.AddChild(tutorial);
            tutorial.Click += new EventHandler(tutorial_Click);

            ButtonBase options = new StoneButton
            {
                Anchor = Orientation.TopLeft,
                Position = new Vector2(0, 45),
                Text = "Options"
            };
            buttonsPanel.AddChild(options);
            options.Click += new EventHandler(options_Click);

            ButtonBase exit = new StoneButton
            {
                Anchor = Orientation.TopLeft,
                Position = new Vector2(0, 90),
                Text = "Exit"
            };
            buttonsPanel.AddChild(exit);
            exit.Click += new EventHandler(exit_Click);

            if (!String.IsNullOrEmpty(Program.Settings.HallOfFameAddress))
            {
                var u = new Uri(Program.Settings.HallOfFameAddress);
                var s = u.ToString();
                if (!u.IsFile)
                {
                    Control hof = new Button
                    {
                        Anchor = Orientation.Top,
                        Position = new Vector2(0, 655),
                        HoverTexture = new TextureFromFile("Interface/Common/HallOfFame2Mouseover1.png") { DontScale = true },
                        NormalTexture = new TextureFromFile("Interface/Common/HallOfFame2.png") { DontScale = true },
                        ClickTexture = new TextureFromFile("Interface/Common/HallOfFame2.png") { DontScale = true },
                        Background = new ImageGraphic
                        {
                        },
                        Size = new Vector2(260, 38)
                    };
                    hof.Click += new EventHandler((o, e) =>
                    {
                        Util.StartBrowser(s);
                    });
                    AddChild(hof);
                }
            }

            fader = new Fader { State = FadeState.FadedOut };
            AddChild(fader);
            Updateable = true;
        }
Exemplo n.º 8
0
        public SelectProfileControl()
        {
            Background = InterfaceScene.DefaultFormBorder;
            Size = new Vector2(500, 200);
            Padding = new System.Windows.Forms.Padding(20);
            Background.Alpha = 0.2f;

            Control right = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Fill
            };
            Control left = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Left,
                Size = new Vector2(140, 0)
            };

            Control profileContainer = new Control
            {
                Size = new Vector2(243, 70),
                Anchor = Orientation.Top
            };
            profileContainer.AddChild(new Label
            {
                Text = Locale.Resource.GenProfile,
                AutoSize = AutoSizeMode.Full,
                Font = Fonts.Default,
                Anchor = Orientation.TopLeft,
                Background = null,
            });
            profiles = new StoneDropDownBar
            {
                Position = new Vector2(0, 15),
                Anchor = Orientation.TopLeft
            };
            profileContainer.AddChild(profiles);
            PopuplateProfiles();

            Control newRemoveFlow = new FlowLayout
            {
                HorizontalFill = true,
                Newline = false,
                AutoSize = true,
                Position = new Vector2(0, 45),
                Anchor = Orientation.TopRight,
            };
            profileContainer.AddChild(newRemoveFlow);

            var newProfile = new ClickableTextButton
            {
                Text = Locale.Resource.GenNew,
                AutoSize = AutoSizeMode.Full,
                TextAnchor = Orientation.Center,
                Margin = new System.Windows.Forms.Padding(3, 0, 3, 0)
            };
            newProfile.Click += new EventHandler(newProfile_Click);
            newRemoveFlow.AddChild(newProfile);

            var removeProfile = new ClickableTextButton
            {
                Text = Locale.Resource.GenRemove,
                AutoSize = AutoSizeMode.Full,
                TextAnchor = Orientation.Center,
                Margin = new System.Windows.Forms.Padding(3, 0, 3, 0)
            };
            removeProfile.Click += new EventHandler(removeProfile_Click);
            newRemoveFlow.AddChild(removeProfile);

            var start = new LargeStoneButton
            {
                Text = Locale.Resource.GenLogin,
                Position = new Vector2(0, 90),
                Anchor = Orientation.Top,
                Size = new Vector2(230, 62)
            };
            start.Click += new EventHandler(start_Click);
            right.AddChild(start);

            FlowLayout leftFlow = new FlowLayout
            {
                AutoSize = true,
                HorizontalFill = false,
                Newline = false,
                Anchor = Orientation.Center
            };
            left.AddChild(leftFlow);

            var support = new StoneButton
            {
                Text = Locale.Resource.GenSupport,
                Margin = new System.Windows.Forms.Padding(5)
            };
            support.Click += new EventHandler(support_Click);
            leftFlow.AddChild(support);

            var options = new StoneButton
            {
                Text = Locale.Resource.GenOptions,
                Margin = new System.Windows.Forms.Padding(5)
            };
            options.Click += new EventHandler(options_Click);
            leftFlow.AddChild(options);

            var quit = new StoneButton
            {
                Text = Locale.Resource.GenQuit,
                Margin = new System.Windows.Forms.Padding(5)
            };
            quit.Click += new EventHandler(quit_Click);
            leftFlow.AddChild(quit);

            right.AddChild(profileContainer);
            AddChild(left);

            AddChild(new Control
            {
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureConcretizer
                    {
                        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 255, 255))
                    },
                    SizeMode = SizeMode.AutoAdjust
                },
                Dock = System.Windows.Forms.DockStyle.Left,
                Size = new Vector2(1, 1)
            });

            AddChild(right);
        }