コード例 #1
0
        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;
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        public StartScreenControl()
        {
            Size            = new Vector2(600, 420);
            LargeWindow     = true;
            objectives.Dock = System.Windows.Forms.DockStyle.Left;
            objectives.Size = new Vector2(300, 0);

            options.AddChild(weaponsControl);
            weaponsControl.AddChild(new Label
            {
                Text       = Locale.Resource.MapSelectedWeapons,
                Size       = new Vector2(0, 30),
                TextAnchor = global::Graphics.Orientation.TopLeft,
                Dock       = System.Windows.Forms.DockStyle.Top,
                Font       = new Font
                {
                    SystemFont = Fonts.LargeSystemFont,
                    Color      = System.Drawing.Color.Gold
                },
                Background = null,
                Clickable  = false
            });
            weaponsControl.AddChild(meleeWeaponsContainer);
            weaponsControl.AddChild(rangedWeaponsContainer);

            var meleeWeapons = Enum.GetValues(typeof(MeleeWeapons));

            for (int i = 1; i < meleeWeapons.Length; i++)
            {
                MeleeWeapons wp = (MeleeWeapons)meleeWeapons.GetValue(i);
                var          w  = new Checkbox
                {
                    Text             = "",
                    Background       = null,
                    UnCheckedGraphic = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconOff1.png")
                        {
                            DontScale = true
                        },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = new Vector3(-12, -11, 0)
                    },
                    CheckedGraphic = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconOn1.png")
                        {
                            DontScale = true
                        },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = new Vector3(-12, -11, 0)
                    },
                    UnCheckedHoverGraphic = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconSelected1.png")
                        {
                            DontScale = true
                        },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = new Vector3(-12, -11, 0)
                    },
                    Size   = new Vector2(100, 25),
                    Margin = new System.Windows.Forms.Padding(5)
                };
                Program.Instance.Tooltip.SetToolTip(w, Util.GetLocaleResourceString(wp) + "\n\n" + WeaponsInfo.GetDescription(wp));
                w.Click += new EventHandler((e, o) => { SelectedMeleeWeapon = wp; });
                meleeWeaponsContainer.AddChild(w);
                meleeCheckboxes.Add(wp, w);
            }

            var bullets = Enum.GetValues(typeof(RangedWeapons));

            for (int i = 1; i < bullets.Length; i++)
            {
                RangedWeapons wp = (RangedWeapons)bullets.GetValue(i);
                if (wp == RangedWeapons.Fire)
                {
                    continue;
                }
                var w = new Checkbox
                {
                    Text             = "",
                    Background       = null,
                    UnCheckedGraphic = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconOff1.png")
                        {
                            DontScale = true
                        },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = new Vector3(-12, -11, 0)
                    },
                    CheckedGraphic = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconOn1.png")
                        {
                            DontScale = true
                        },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = new Vector3(-12, -11, 0)
                    },
                    UnCheckedHoverGraphic = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconSelected1.png")
                        {
                            DontScale = true
                        },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = new Vector3(-12, -11, 0)
                    },
                    Size   = new Vector2(100, 25),
                    Margin = new System.Windows.Forms.Padding(5)
                };
                Program.Instance.Tooltip.SetToolTip(w, Util.GetLocaleResourceString(wp) + "\n\n" + WeaponsInfo.GetDescription(wp));
                w.Click += new EventHandler((e, o) => { SelectedRangedWeapon = wp; });
                rangedWeaponsContainer.AddChild(w);
                bulletCheckboxes.Add(wp, w);
            }

            //innerControl.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)
            //});
            innerControl.AddChild(options);

            bottomBar.AddChild(startButton);
            startButton.Click += new EventHandler(startButton_Click);
            bottomBar.AddChild(quitButton);
            quitButton.Click += new EventHandler(quitButton_Click);

            ButtonBase optionsButton = new StoneButton
            {
                Anchor   = Graphics.Orientation.Left,
                Position = new Vector2(20 + quitButton.Size.X, 0),
                Text     = Locale.Resource.GenOptions
            };

            optionsButton.Click += new EventHandler(optionsButton_Click);
            bottomBar.AddChild(optionsButton);
        }
コード例 #4
0
        protected override void OnConstruct()
        {
            Size = new Vector2(1000, 600);
            Padding = new System.Windows.Forms.Padding(20);
            Anchor = global::Graphics.Orientation.Center;
            Clickable = true;
            ControlBox = false;
            ClearChildren();

            var topBar = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Top,
                Size = new Vector2(0, 70),
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
                Padding = new System.Windows.Forms.Padding(0, 0, 0, 5)
            };
            AddChild(topBar);

            Control topLeftBar = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Left,
                Size = new Vector2(500, 0)
            };
            topBar.AddChild(topLeftBar);
            var winLoseTextBox = new Label
            {
                Font = new Graphics.Content.Font
                {
                    SystemFont = Fonts.HugeSystemFont,
                    Color = System.Drawing.Color.Green,
                },
                AutoSize = AutoSizeMode.Full,
                TextAnchor = global::Graphics.Orientation.TopLeft,
                Dock = System.Windows.Forms.DockStyle.Top,
                Background = null,
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
            };
            topLeftBar.AddChild(winLoseTextBox);

            if (GameState == GameState.Won)
            {
                winLoseTextBox.Text = Locale.Resource.ScoreVictory;
                winLoseTextBox.Font.Color = System.Drawing.Color.Green;
            }
            else
            {
                winLoseTextBox.Text = Locale.Resource.ScoreDefeat;
                winLoseTextBox.Font.Color = System.Drawing.Color.Red;
                topLeftBar.AddChild(new Label
                {
                    Font = new Font
                    {
                        SystemFont = Fonts.MediumSystemFont,
                        Color = System.Drawing.Color.White
                    },
                    Background = null,
                    Dock = System.Windows.Forms.DockStyle.Fill,
                    Text = LostGameReason,
                    TextAnchor = global::Graphics.Orientation.TopLeft,
                });
            }

            Control trPanel = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Right,
                Size = new Vector2(200, 40)
            };
            topBar.AddChild(trPanel);

            var gt = new DateTime(TimeSpan.FromSeconds(GameTime).Ticks);

            var timeLeftTextBox = new Label
            {
                Dock = System.Windows.Forms.DockStyle.Bottom,
                Background = null,
                Size = new Vector2(120, 20),
                TextAnchor = global::Graphics.Orientation.BottomRight,
            };
            timeLeftTextBox.Text = Locale.Resource.GenTime + ": " + gt.ToString("mm:ss");

            trPanel.AddChild(timeLeftTextBox);
            if (SilverEnabled)
            {
                Control silverTextContainer = new Control
                {
                    Dock = System.Windows.Forms.DockStyle.Bottom,
                    Size = new Vector2(0, 30),
                };
                trPanel.AddChild(silverTextContainer);
                silverTextContainer.AddChild(new SilverText
                {
                    Anchor = Orientation.BottomRight,
                    Size = new Vector2(120, 30),
                    Background = null,
                    SilverYield = SilverYield
                });
            }

            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.Top,
                Size = new Vector2(0, 1)
            });

            Control bottomBar = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Bottom,
                Size = new Vector2(0, 50)
            };
            AddChild(bottomBar);

            FlowLayout leftBottomFlow = new FlowLayout
            {
                AutoSize = true,
                HorizontalFill = true,
                Newline = false,
                Anchor = Orientation.BottomLeft
            };
            bottomBar.AddChild(leftBottomFlow);

            FlowLayout rightBottomFlow = new FlowLayout
            {
                AutoSize = true,
                HorizontalFill = true,
                Newline = false,
                Anchor = Orientation.BottomRight,
                Origin = FlowOrigin.BottomRight,
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
            };
            bottomBar.AddChild(rightBottomFlow);

            ButtonBase mainMenuButton = new StoneButton
            {
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            if (FirstTimeCompletedMap)
                mainMenuButton.Text = Locale.Resource.GenContinue;
            else
                mainMenuButton.Text = Locale.Resource.GenMainMenu;
            rightBottomFlow.AddChild(mainMenuButton);
            mainMenuButton.Click += new EventHandler(mainMenuButton_Click);

            ButtonBase playAgainButton = new StoneButton
            {
                Text = Locale.Resource.GenPlayAgain,
                Visible = EarnedGoldCoins == 0,
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            rightBottomFlow.AddChild(playAgainButton);
            playAgainButton.Click += new EventHandler(playAgainButton_Click);

            if (FirstTimeCompletedMap && Program.Settings.DisplayMapRatingDialog == MapRatingDialogSetup.Optional)
            {
                ButtonBase rateMapButton = new StoneButton
                {
                    Text = Locale.Resource.GenRateMap,
                    AutoSize = AutoSizeMode.Horizontal,
                    Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
                };
                rightBottomFlow.AddChild(rateMapButton);
                rateMapButton.Click += new EventHandler(rateMapButton_Click);
            }

            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.Bottom,
                Size = new Vector2(0, 1)
            });

            Control main = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Fill
            };
            AddChild(main);

            //////////////////////////
            // STATS /////////////////
            //////////////////////////

            StatsControl stats = new StatsControl
            {
                Dock = System.Windows.Forms.DockStyle.Fill,
                Visible = false
            };
            stats.GameState = GameState;
            stats.LostGameReason = LostGameReason;
            stats.Statistics = Statistics;
            stats.Map = Map;
            main.AddChild(stats);

            //////////////////////////
            // REWARDS ///////////////
            //////////////////////////

            ResultsAndRewardsControl rewards = new ResultsAndRewardsControl
            {
                Dock = System.Windows.Forms.DockStyle.Fill,
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
                Anchor = global::Graphics.Orientation.TopRight
            };
            rewards.GameState = GameState;
            rewards.EarnedGoldCoins = EarnedGoldCoins;
            rewards.NPlaythroughs = NPlaythroughs;
            rewards.AchievementsEarned = AchievementsEarned;
            rewards.SilverYield = SilverYield;
            rewards.PreviousMaxSilverYield = PreviousMaxSilverYield;
            rewards.FirstTimeCompletedMap = FirstTimeCompletedMap;
            rewards.CurrentStages = CurrentStages;
            rewards.BestStages = BestStages;
            rewards.Map = Map;
            main.AddChild(rewards);

            /////////////////////
            // Switch buttons
            /////////////////////

            CheckboxBase rnrButton = new StoneCheckbox
            {
                Text = Locale.Resource.ScoreRewardsAndResults,
                Font = new Font
                {
                    SystemFont = Fonts.MediumSystemFont,
                    Color = System.Drawing.Color.White,
                    Backdrop = System.Drawing.Color.Black
                },
                Checked = true,
                AutoCheck = false,
                Size = new Vector2(200, 38),
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            leftBottomFlow.AddChild(rnrButton);

            CheckboxBase statsButton = new StoneCheckbox
            {
                Text = Locale.Resource.ScoreStats,
                Font = new Font
                {
                    SystemFont = Fonts.MediumSystemFont,
                    Color = System.Drawing.Color.White,
                    Backdrop = System.Drawing.Color.Black
                },
                Checked = false,
                AutoCheck = false,
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            leftBottomFlow.AddChild(statsButton);

            if (HideStats)
            {
                leftBottomFlow.Visible = false;
                stats.Visible = false;
            }
            else
            {
                statsButton.Click += new EventHandler((o, e) =>
                {
                    rnrButton.Checked = rewards.Visible = false;
                    statsButton.Checked = stats.Visible = true;
                });
                rnrButton.Click += new EventHandler((o, e) =>
                {
                    rnrButton.Checked = rewards.Visible = true;
                    statsButton.Checked = stats.Visible = false;
                });
            }

            base.OnConstruct();
        }
コード例 #5
0
        protected override void OnConstruct()
        {
            Size       = new Vector2(1000, 600);
            Padding    = new System.Windows.Forms.Padding(20);
            Anchor     = global::Graphics.Orientation.Center;
            Clickable  = true;
            ControlBox = false;
            ClearChildren();

            var topBar = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Top,
                Size = new Vector2(0, 70),
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
                Padding = new System.Windows.Forms.Padding(0, 0, 0, 5)
            };

            AddChild(topBar);

            Control topLeftBar = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Left,
                Size = new Vector2(500, 0)
            };

            topBar.AddChild(topLeftBar);
            var winLoseTextBox = new Label
            {
                Font = new Graphics.Content.Font
                {
                    SystemFont = Fonts.HugeSystemFont,
                    Color      = System.Drawing.Color.Green,
                },
                AutoSize   = AutoSizeMode.Full,
                TextAnchor = global::Graphics.Orientation.TopLeft,
                Dock       = System.Windows.Forms.DockStyle.Top,
                Background = null,
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
            };

            topLeftBar.AddChild(winLoseTextBox);


            if (GameState == GameState.Won)
            {
                winLoseTextBox.Text       = Locale.Resource.ScoreVictory;
                winLoseTextBox.Font.Color = System.Drawing.Color.Green;
            }
            else
            {
                winLoseTextBox.Text       = Locale.Resource.ScoreDefeat;
                winLoseTextBox.Font.Color = System.Drawing.Color.Red;
                topLeftBar.AddChild(new Label
                {
                    Font = new Font
                    {
                        SystemFont = Fonts.MediumSystemFont,
                        Color      = System.Drawing.Color.White
                    },
                    Background = null,
                    Dock       = System.Windows.Forms.DockStyle.Fill,
                    Text       = LostGameReason,
                    TextAnchor = global::Graphics.Orientation.TopLeft,
                });
            }

            Control trPanel = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Right,
                Size = new Vector2(200, 40)
            };

            topBar.AddChild(trPanel);

            var gt = new DateTime(TimeSpan.FromSeconds(GameTime).Ticks);

            var timeLeftTextBox = new Label
            {
                Dock       = System.Windows.Forms.DockStyle.Bottom,
                Background = null,
                Size       = new Vector2(120, 20),
                TextAnchor = global::Graphics.Orientation.BottomRight,
            };

            timeLeftTextBox.Text = Locale.Resource.GenTime + ": " + gt.ToString("mm:ss");

            trPanel.AddChild(timeLeftTextBox);
            if (SilverEnabled)
            {
                Control silverTextContainer = new Control
                {
                    Dock = System.Windows.Forms.DockStyle.Bottom,
                    Size = new Vector2(0, 30),
                };
                trPanel.AddChild(silverTextContainer);
                silverTextContainer.AddChild(new SilverText
                {
                    Anchor      = Orientation.BottomRight,
                    Size        = new Vector2(120, 30),
                    Background  = null,
                    SilverYield = SilverYield
                });
            }



            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.Top,
                Size = new Vector2(0, 1)
            });

            Control bottomBar = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Bottom,
                Size = new Vector2(0, 50)
            };

            AddChild(bottomBar);

            FlowLayout leftBottomFlow = new FlowLayout
            {
                AutoSize       = true,
                HorizontalFill = true,
                Newline        = false,
                Anchor         = Orientation.BottomLeft
            };

            bottomBar.AddChild(leftBottomFlow);

            FlowLayout rightBottomFlow = new FlowLayout
            {
                AutoSize       = true,
                HorizontalFill = true,
                Newline        = false,
                Anchor         = Orientation.BottomRight,
                Origin         = FlowOrigin.BottomRight,
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
            };

            bottomBar.AddChild(rightBottomFlow);

            ButtonBase mainMenuButton = new StoneButton
            {
                AutoSize = AutoSizeMode.Horizontal,
                Padding  = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };

            if (FirstTimeCompletedMap)
            {
                mainMenuButton.Text = Locale.Resource.GenContinue;
            }
            else
            {
                mainMenuButton.Text = Locale.Resource.GenMainMenu;
            }
            rightBottomFlow.AddChild(mainMenuButton);
            mainMenuButton.Click += new EventHandler(mainMenuButton_Click);

            ButtonBase playAgainButton = new StoneButton
            {
                Text     = Locale.Resource.GenPlayAgain,
                Visible  = EarnedGoldCoins == 0,
                AutoSize = AutoSizeMode.Horizontal,
                Padding  = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };

            rightBottomFlow.AddChild(playAgainButton);
            playAgainButton.Click += new EventHandler(playAgainButton_Click);

            if (FirstTimeCompletedMap && Program.Settings.DisplayMapRatingDialog == MapRatingDialogSetup.Optional)
            {
                ButtonBase rateMapButton = new StoneButton
                {
                    Text     = Locale.Resource.GenRateMap,
                    AutoSize = AutoSizeMode.Horizontal,
                    Padding  = new System.Windows.Forms.Padding(5, 0, 5, 0)
                };
                rightBottomFlow.AddChild(rateMapButton);
                rateMapButton.Click += new EventHandler(rateMapButton_Click);
            }

            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.Bottom,
                Size = new Vector2(0, 1)
            });

            Control main = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Fill
            };

            AddChild(main);

            //////////////////////////
            // STATS /////////////////
            //////////////////////////

            StatsControl stats = new StatsControl
            {
                Dock    = System.Windows.Forms.DockStyle.Fill,
                Visible = false
            };

            stats.GameState      = GameState;
            stats.LostGameReason = LostGameReason;
            stats.Statistics     = Statistics;
            stats.Map            = Map;
            main.AddChild(stats);

            //////////////////////////
            // REWARDS ///////////////
            //////////////////////////

            ResultsAndRewardsControl rewards = new ResultsAndRewardsControl
            {
                Dock = System.Windows.Forms.DockStyle.Fill,
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
                Anchor = global::Graphics.Orientation.TopRight
            };

            rewards.GameState              = GameState;
            rewards.EarnedGoldCoins        = EarnedGoldCoins;
            rewards.NPlaythroughs          = NPlaythroughs;
            rewards.AchievementsEarned     = AchievementsEarned;
            rewards.SilverYield            = SilverYield;
            rewards.PreviousMaxSilverYield = PreviousMaxSilverYield;
            rewards.FirstTimeCompletedMap  = FirstTimeCompletedMap;
            rewards.CurrentStages          = CurrentStages;
            rewards.BestStages             = BestStages;
            rewards.Map = Map;
            main.AddChild(rewards);

            /////////////////////
            // Switch buttons
            /////////////////////

            CheckboxBase rnrButton = new StoneCheckbox
            {
                Text = Locale.Resource.ScoreRewardsAndResults,
                Font = new Font
                {
                    SystemFont = Fonts.MediumSystemFont,
                    Color      = System.Drawing.Color.White,
                    Backdrop   = System.Drawing.Color.Black
                },
                Checked   = true,
                AutoCheck = false,
                Size      = new Vector2(200, 38),
                AutoSize  = AutoSizeMode.Horizontal,
                Padding   = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };

            leftBottomFlow.AddChild(rnrButton);


            CheckboxBase statsButton = new StoneCheckbox
            {
                Text = Locale.Resource.ScoreStats,
                Font = new Font
                {
                    SystemFont = Fonts.MediumSystemFont,
                    Color      = System.Drawing.Color.White,
                    Backdrop   = System.Drawing.Color.Black
                },
                Checked   = false,
                AutoCheck = false,
                AutoSize  = AutoSizeMode.Horizontal,
                Padding   = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };

            leftBottomFlow.AddChild(statsButton);

            if (HideStats)
            {
                leftBottomFlow.Visible = false;
                stats.Visible          = false;
            }
            else
            {
                statsButton.Click += new EventHandler((o, e) =>
                {
                    rnrButton.Checked   = rewards.Visible = false;
                    statsButton.Checked = stats.Visible = true;
                });
                rnrButton.Click += new EventHandler((o, e) =>
                {
                    rnrButton.Checked   = rewards.Visible = true;
                    statsButton.Checked = stats.Visible = false;
                });
            }

            base.OnConstruct();
        }
コード例 #6
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;
        }
コード例 #7
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);
        }
コード例 #8
0
        public StartScreenControl()
        {
            Size = new Vector2(600, 420);
            LargeWindow = true;
            objectives.Dock = System.Windows.Forms.DockStyle.Left;
            objectives.Size = new Vector2(300, 0);

            options.AddChild(weaponsControl);
            weaponsControl.AddChild(new Label
            {
                Text = Locale.Resource.MapSelectedWeapons,
                Size = new Vector2(0, 30),
                TextAnchor = global::Graphics.Orientation.TopLeft,
                Dock = System.Windows.Forms.DockStyle.Top,
                Font = new Font
                {
                    SystemFont = Fonts.LargeSystemFont,
                    Color = System.Drawing.Color.Gold
                },
                Background = null,
                Clickable = false
            });
            weaponsControl.AddChild(meleeWeaponsContainer);
            weaponsControl.AddChild(rangedWeaponsContainer);

            var meleeWeapons = Enum.GetValues(typeof(MeleeWeapons));
            for (int i = 1; i < meleeWeapons.Length; i++)
            {
                MeleeWeapons wp = (MeleeWeapons)meleeWeapons.GetValue(i);
                var w = new Checkbox
                {
                    Text = "",
                    Background = null,
                    UnCheckedGraphic = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconOff1.png") { DontScale = true },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = new Vector3(-12, -11, 0)
                    },
                    CheckedGraphic = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconOn1.png") { DontScale = true },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = new Vector3(-12, -11, 0)
                    },
                    UnCheckedHoverGraphic = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconSelected1.png") { DontScale = true },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = new Vector3(-12, -11, 0)
                    },
                    Size = new Vector2(100, 25),
                    Margin = new System.Windows.Forms.Padding(5)
                };
                Program.Instance.Tooltip.SetToolTip(w, Util.GetLocaleResourceString(wp) + "\n\n" + WeaponsInfo.GetDescription(wp));
                w.Click += new EventHandler((e, o) => { SelectedMeleeWeapon = wp; });
                meleeWeaponsContainer.AddChild(w);
                meleeCheckboxes.Add(wp, w);
            }

            var bullets = Enum.GetValues(typeof(RangedWeapons));
            for (int i = 1; i < bullets.Length; i++)
            {
                RangedWeapons wp = (RangedWeapons)bullets.GetValue(i);
                if (wp == RangedWeapons.Fire) continue;
                var w = new Checkbox
                {
                    Text = "",
                    Background = null,
                    UnCheckedGraphic = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconOff1.png") { DontScale = true },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = new Vector3(-12, -11, 0)
                    },
                    CheckedGraphic = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconOn1.png") { DontScale = true },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = new Vector3(-12, -11, 0)
                    },
                    UnCheckedHoverGraphic = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconSelected1.png") { DontScale = true },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = new Vector3(-12, -11, 0)
                    },
                    Size = new Vector2(100, 25),
                    Margin = new System.Windows.Forms.Padding(5)
                };
                Program.Instance.Tooltip.SetToolTip(w, Util.GetLocaleResourceString(wp) + "\n\n" + WeaponsInfo.GetDescription(wp));
                w.Click += new EventHandler((e, o) => { SelectedRangedWeapon = wp; });
                rangedWeaponsContainer.AddChild(w);
                bulletCheckboxes.Add(wp, w);
            }

            //innerControl.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)
            //});
            innerControl.AddChild(options);

            bottomBar.AddChild(startButton);
            startButton.Click += new EventHandler(startButton_Click);
            bottomBar.AddChild(quitButton);
            quitButton.Click += new EventHandler(quitButton_Click);

            ButtonBase optionsButton = new StoneButton
            {
                Anchor = Graphics.Orientation.Left,
                Position = new Vector2(20 + quitButton.Size.X, 0),
                Text = Locale.Resource.GenOptions
            };
            optionsButton.Click += new EventHandler(optionsButton_Click);
            bottomBar.AddChild(optionsButton);
        }
コード例 #9
0
        public Interface()
        {
            Dock = System.Windows.Forms.DockStyle.Fill;
            AddChild(IngameInterfaceContainer);
            if (Program.Settings.DisplayConsole)
            {
                AddChild(Console);
            }
            AddChild(HUD);
            AddChild(TextContainer);

            ButtonBase menu = new StoneButton
            {
                Text          = Locale.Resource.GenMenu,
                Anchor        = global::Graphics.Orientation.BottomLeft,
                DisplayHotkey = false,
                Position      = new Vector2(5, 3),
            };

            menu.Click += new EventHandler(menu_Click);
            AddChild(menu);

            if (Program.Settings.CanSelectCheckpoint)
            {
                AddChild(new CheckpointsControl());
            }

            if (Program.Settings.DisplayFPS)
            {
                AddChild(fpsTextBox = new Graphics.Interface.Label
                {
                    Size   = new Vector2(100, 60),
                    Anchor = global::Graphics.Orientation.TopRight,
                    Text   = "fps",
                });
            }

            if (Program.Settings.DisplayDPS)
            {
                AddChild(dpsMeter);
            }

            if (Program.Settings.UseCPUPerformanceCounter)
            {
                cpuCounter = new System.Diagnostics.PerformanceCounter
                {
                    CategoryName = "Process",
                    CounterName  = "% Processor Time",
                    InstanceName = "Client.vshost",
                };
            }
            //InformationPopupContainer.Size = Common.Math.ToVector2(Program.Instance.Size);
            InformationPopupContainer.Size = new Vector2(Program.Settings.GraphicsDeviceSettings.Resolution.Width, Program.Settings.GraphicsDeviceSettings.Resolution.Height);
            AddChild(profilersResults);
            AddChild(silverText);
            AddChild(InformationPopupContainer);
            AddChild(PopupContainer);
            if (Program.Settings.DisplayRendererStatus)
            {
                AddChild(new RenderTreeVisualizer {
                    Anchor = Orientation.Top, Position = new Vector2(0, 40), Renderer = (Graphics.Renderer.Renderer)Game.Instance.SceneRendererConnector.Renderer
                });
            }
            Updateable = true;
        }
コード例 #10
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;
        }
コード例 #11
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);
        }
コード例 #12
0
        public Interface()
        {
            Dock = System.Windows.Forms.DockStyle.Fill;
            AddChild(IngameInterfaceContainer);
            if(Program.Settings.DisplayConsole)
                AddChild(Console);
            AddChild(HUD);
            AddChild(TextContainer);

            ButtonBase menu = new StoneButton
            {
                Text = Locale.Resource.GenMenu,
                Anchor = global::Graphics.Orientation.BottomLeft,
                DisplayHotkey = false,
                Position = new Vector2(5, 3),
            };
            menu.Click += new EventHandler(menu_Click);
            AddChild(menu);

            if (Program.Settings.CanSelectCheckpoint)
                AddChild(new CheckpointsControl());

            if(Program.Settings.DisplayFPS)
                AddChild(fpsTextBox = new Graphics.Interface.Label
                    {
                        Size = new Vector2(100, 60),
                        Anchor = global::Graphics.Orientation.TopRight,
                        Text = "fps",
                    });

            if (Program.Settings.DisplayDPS)
                AddChild(dpsMeter);

            if (Program.Settings.UseCPUPerformanceCounter)
            {
                cpuCounter = new System.Diagnostics.PerformanceCounter
                {
                    CategoryName = "Process",
                    CounterName = "% Processor Time",
                    InstanceName = "Client.vshost",

                };
            }
            //InformationPopupContainer.Size = Common.Math.ToVector2(Program.Instance.Size);
            InformationPopupContainer.Size = new Vector2(Program.Settings.GraphicsDeviceSettings.Resolution.Width, Program.Settings.GraphicsDeviceSettings.Resolution.Height);
            AddChild(profilersResults);
            AddChild(silverText);
            AddChild(InformationPopupContainer);
            AddChild(PopupContainer);
            if (Program.Settings.DisplayRendererStatus)
                AddChild(new RenderTreeVisualizer { Anchor = Orientation.Top, Position = new Vector2(0, 40), Renderer = (Graphics.Renderer.Renderer)Game.Instance.SceneRendererConnector.Renderer });
            Updateable = true;
        }