Example #1
0
        public override ActionResult DoAction()
        {
            ActionResult res = ActionResult.NoSelection;

            UndoUtility.RecordSelection("Bevel Edges");

            foreach (ProBuilderMesh pb in MeshSelection.topInternal)
            {
                pb.ToMesh();

                List <Face> faces = Bevel.BevelEdges(pb, pb.selectedEdges, m_BevelSize);
                res = faces != null ? new ActionResult(ActionResult.Status.Success, "Bevel Edges") : new ActionResult(ActionResult.Status.Failure, "Failed Bevel Edges");

                if (res)
                {
                    pb.SetSelectedFaces(faces);
                }

                pb.Refresh();
                pb.Optimize();
            }

            ProBuilderEditor.Refresh();

            return(res);
        }
        public static void Main(string[] args)
        {
            //ExStart:1
            // The path to the documents directory.
            string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

            // Create directory if it is not already present.
            bool IsExists = System.IO.Directory.Exists(dataDir);

            if (!IsExists)
            {
                System.IO.Directory.CreateDirectory(dataDir);
            }

            //Instantiate a new Workbook
            Workbook book = new Workbook();

            //Add a Data Worksheet
            Worksheet dataSheet = book.Worksheets.Add("DataSheet");

            //Add Chart Worksheet
            Worksheet sheet = book.Worksheets.Add("MyChart");

            //Put some values into the cells in the data worksheet
            dataSheet.Cells["B1"].PutValue(1);
            dataSheet.Cells["B2"].PutValue(2);
            dataSheet.Cells["B3"].PutValue(3);
            dataSheet.Cells["A1"].PutValue("A");
            dataSheet.Cells["A2"].PutValue("B");
            dataSheet.Cells["A3"].PutValue("C");


            //Define the Chart Collection
            ChartCollection charts = sheet.Charts;
            //Add a Column chart to the Chart Worksheet
            int chartSheetIdx = charts.Add(ChartType.Column, 5, 0, 25, 15);

            //Get the newly added Chart
            Aspose.Cells.Charts.Chart chart = book.Worksheets[2].Charts[0];

            //Set the background/foreground color for PlotArea/ChartArea
            chart.PlotArea.Area.BackgroundColor  = Color.White;
            chart.ChartArea.Area.BackgroundColor = Color.White;
            chart.PlotArea.Area.ForegroundColor  = Color.White;
            chart.ChartArea.Area.ForegroundColor = Color.White;

            //Hide the Legend
            chart.ShowLegend = false;

            //Add Data Series for the Chart
            chart.NSeries.Add("DataSheet!B1:B3", true);
            //Specify the Category Data
            chart.NSeries.CategoryData = "DataSheet!A1:A3";

            //Get the Data Series
            Aspose.Cells.Charts.Series ser = chart.NSeries[0];

            //Apply the 3-D formatting
            ShapePropertyCollection spPr = ser.ShapeProperties;
            Format3D fmt3d = spPr.Format3D;

            //Specify Bevel with its height/width
            Bevel bevel = fmt3d.TopBevel;

            bevel.Type   = BevelPresetType.Circle;
            bevel.Height = 2;
            bevel.Width  = 5;

            //Specify Surface material type
            fmt3d.SurfaceMaterialType = PresetMaterialType.WarmMatte;

            //Specify surface lighting type
            fmt3d.SurfaceLightingType = LightRigType.ThreePoint;

            //Specify lighting angle
            fmt3d.LightingAngle = 20;

            //Specify Series background/foreground and line color
            ser.Area.BackgroundColor = Color.Maroon;
            ser.Area.ForegroundColor = Color.Maroon;
            ser.Border.Color         = Color.Maroon;

            //Save the Excel file
            book.Save(dataDir + "3d_format.out.xlsx");
            //ExEnd:1
        }
Example #3
0
        void AddCreditsWindow(Manager gui)
        {
            CreditsWindow           = new Bevel(gui);
            CreditsWindow.Parent    = MainMenuBackground;
            CreditsWindow.Height    = MainMenuBackground.ClientHeight;
            CreditsWindow.Color     = Color.Black;
            CreditsWindow.Style     = BevelStyle.None;
            CreditsWindow.Visible   = false;
            CreditsWindow.Top       = 0;
            CreditsWindow.StayOnTop = true;
            CreditsWindow.Width     = MainMenuBackground.ClientWidth;

            var i    = 0;
            var NLNL = new string[] { Environment.NewLine + Environment.NewLine };

            foreach (var CreditsText in Cutscenes.Director.GetCreditTexts(false))
            {
                var Top  = 110 + i * 23 + (i > 4 ? 23 : 0);
                var Text = CreditsText.Split(NLNL, StringSplitOptions.RemoveEmptyEntries);
                if (Text.Length == 2)
                {
                    var Label = new Label(gui);
                    Label.Init();
                    Label.Width     = 300;
                    Label.Height    = 100;
                    Label.Alignment = Alignment.TopLeft;
                    Label.TextColor = Color.Black;
                    Label.Parent    = CreditsWindow;
                    Label.Text      = Text[0];
                    Label.Top       = Top;
                    Label.Left      = MainMenuBackground.ClientWidth / 2 - Label.Width / 2;

                    Label = new Label(gui);
                    Label.Init();
                    Label.Width     = 300;
                    Label.Height    = 100;
                    Label.Alignment = Alignment.TopRight;
                    Label.TextColor = new Color(188, 22, 0, 255);
                    Label.Parent    = CreditsWindow;
                    Label.Text      = Text[1];
                    Label.Top       = Top;
                    Label.Left      = MainMenuBackground.ClientWidth / 2 - Label.Width / 2;
                }
                else
                {
                    var Label = new Label(gui);
                    Label.Init();
                    Label.Width     = 300;
                    Label.Height    = 100;
                    Label.Alignment = Alignment.TopCenter;
                    Label.TextColor = Color.Black;
                    Label.Parent    = CreditsWindow;
                    Label.Text      = Text[0];
                    Label.Top       = Top;
                    Label.Left      = MainMenuBackground.ClientWidth / 2 - Label.Width / 2;
                }
                i++;
            }

            var OKButton = new MenuButton(gui, ClickSound, FocusSound, GameSettings);

            OKButton.Init();
            OKButton.Parent = CreditsWindow;
            OKButton.Text   = GlblRes.OK;
            OKButton.Click += (s, e) =>
            {
                CreditsWindow.Hide();
                ShowLogo(true);
            };

            OKButton.Width  = 120;
            OKButton.Height = 24;
            OKButton.Left   = (MainMenuBackground.ClientWidth) - (OKButton.Width) - 6;
            OKButton.Top    = MainMenuBackground.ClientHeight - OKButton.Height - 6 - (30 * 0);
            OKButton.Anchor = Anchors.Top;

            gui.Add(CreditsWindow);
        }
        void AddExitConfirmationWindow(Manager gui)
        {
            ExitConfirmationWindow = new Window(gui);
            ExitConfirmationWindow.Init();
            ExitConfirmationWindow.Text        = GlblRes.Really_quit;
            ExitConfirmationWindow.Width       = 290;
            ExitConfirmationWindow.Height      = 130;
            ExitConfirmationWindow.Resizable   = false;
            ExitConfirmationWindow.IconVisible = false;
            ExitConfirmationWindow.Movable     = false;
            ExitConfirmationWindow.Center(new Point(Game.VIRTUAL_WIDTH, Game.VIRTUAL_HEIGHT));
            ExitConfirmationWindow.Visible            = false;
            ExitConfirmationWindow.CloseButtonVisible = false;

            var Bevel = new Bevel(gui);

            Bevel.Parent = ExitConfirmationWindow;
            Bevel.Anchor = Anchors.Bottom | Anchors.Left | Anchors.Right;
            Bevel.Height = 35;
            Bevel.Style  = BevelStyle.Raised;
            Bevel.Top    = ExitConfirmationWindow.ClientHeight - Bevel.Height;
            Bevel.Width  = ExitConfirmationWindow.ClientWidth;


            var Text = new Label(gui);

            Text.Text   = GlblRes.Do_you_really_want_to_quit_the_game;
            Text.Parent = ExitConfirmationWindow;
            Text.Top    = 10;
            Text.Left   = 10;
            Text.Width  = ExitConfirmationWindow.ClientWidth - 20;
            Text.Height = 20;

            var Yes = new MenuButton(gui, ClickSound, FocusSound, GameSettings);

            Yes.Parent = Bevel;
            Yes.Width  = 100;
            Yes.Text   = GlblRes.Yes;
            Yes.Left   = 10;
            Yes.Top    = 5;
            Yes.Click += (se, ve) =>
            {
                Engine.Exit();
            };


            var No = new MenuButton(gui, ClickSound, FocusSound, GameSettings);

            No.Parent = Bevel;
            No.Text   = GlblRes.Menu_AddExitConfirmationWindow_No;
            No.Width  = 100;
            No.Left   = 165;
            No.Top    = 5;
            No.Click += (se, ev) =>
            {
                ExitConfirmationWindow.Close();
                ShowLogo(true);
            };

            gui.Add(ExitConfirmationWindow);
        }
        public static void Run()
        {
            // Instantiate a new Workbook
            Workbook book = new Workbook();

            //Rename the first worksheet
            book.Worksheets[0].Name = "DataSheet";

            // Add a Data Worksheet
            Worksheet dataSheet = book.Worksheets["DataSheet"];

            // Add Chart Worksheet
            Worksheet sheet = book.Worksheets.Add("MyChart");

            // Put some values into the cells in the data worksheet
            dataSheet.Cells["B1"].PutValue(1);
            dataSheet.Cells["B2"].PutValue(2);
            dataSheet.Cells["B3"].PutValue(3);
            dataSheet.Cells["A1"].PutValue("A");
            dataSheet.Cells["A2"].PutValue("B");
            dataSheet.Cells["A3"].PutValue("C");


            // Define the Chart Collection
            ChartCollection charts = sheet.Charts;
            // Add a Column chart to the Chart Worksheet
            int chartSheetIdx = charts.Add(ChartType.Column, 5, 0, 25, 15);

            // Get the newly added Chart
            Aspose.Cells.Charts.Chart chart = book.Worksheets["MyChart"].Charts[0];

            // Set the background/foreground color for PlotArea/ChartArea
            chart.PlotArea.Area.BackgroundColor  = Color.White;
            chart.ChartArea.Area.BackgroundColor = Color.White;
            chart.PlotArea.Area.ForegroundColor  = Color.White;
            chart.ChartArea.Area.ForegroundColor = Color.White;

            // Hide the Legend
            chart.ShowLegend = false;

            // Add Data Series for the Chart
            chart.NSeries.Add("DataSheet!B1:B3", true);

            // Specify the Category Data
            chart.NSeries.CategoryData = "DataSheet!A1:A3";

            // Get the Data Series
            Aspose.Cells.Charts.Series ser = chart.NSeries[0];

            // Apply the 3-D formatting
            ShapePropertyCollection spPr = ser.ShapeProperties;
            Format3D fmt3d = spPr.Format3D;

            // Specify Bevel with its height/width
            Bevel bevel = fmt3d.TopBevel;

            bevel.Type   = BevelPresetType.Circle;
            bevel.Height = 2;
            bevel.Width  = 5;

            // Specify Surface material type
            fmt3d.SurfaceMaterialType = PresetMaterialType.WarmMatte;

            // Specify surface lighting type
            fmt3d.SurfaceLightingType = LightRigType.ThreePoint;

            // Specify lighting angle
            fmt3d.LightingAngle = 20;

            // Specify Series background/foreground and line color
            ser.Area.BackgroundColor = Color.Maroon;
            ser.Area.ForegroundColor = Color.Maroon;
            ser.Border.Color         = Color.Maroon;

            // Save the Excel file
            book.Save(outputDir + "outputApplying3DFormat.xlsx");

            Console.WriteLine("Applying3DFormat executed successfully.");
        }
        void AddSettingsWindow(Manager gui)
        {
            SettingsWindow                    = new Window(gui);
            SettingsWindow.Width              = 300;
            SettingsWindow.Height             = 200;
            SettingsWindow.CloseButtonVisible = false;
            SettingsWindow.Text               = GlblRes.Settings;
            SettingsWindow.Parent             = MainMenuBackground;
            SettingsWindow.Init();
            SettingsWindow.Center(new Point(Game.VIRTUAL_WIDTH, Game.VIRTUAL_HEIGHT));
            SettingsWindow.Visible     = false;
            SettingsWindow.Resizable   = false;
            SettingsWindow.IconVisible = false;
            SettingsWindow.DragAlpha   = 255;
            SettingsWindow.Movable     = false;

            var MusicVolumeLabel = new Label(gui);

            MusicVolumeLabel.Init();
            MusicVolumeLabel.Width  = 120;
            MusicVolumeLabel.Parent = SettingsWindow;
            MusicVolumeLabel.Text   = GlblRes.Music_Volume;
            MusicVolumeLabel.Top    = 5;
            MusicVolumeLabel.Left   = 5;

            var MusicVolumeBar = new TrackBar(gui);

            MusicVolumeBar.Init();
            MusicVolumeBar.Width         = 160;
            MusicVolumeBar.Value         = (int)(GameSettings.MusicVolume * 100);
            MusicVolumeBar.ValueChanged += (o, e) =>
            {
                GameSettings.MusicVolume = (float)MusicVolumeBar.Value / 100f;
                Engine.ApplyGameSettingsVolume();
                MediaPlayer.Volume = MathHelper.Clamp(GameSettings.MusicVolume, 0.0f, 1.0f);
                MainMenuLabel.Text = string.Empty;
            };
            MusicVolumeBar.Top    = 5;
            MusicVolumeBar.Left   = 120;
            MusicVolumeBar.Parent = SettingsWindow;

            var SoundVolumeLabel = new Label(gui);

            SoundVolumeLabel.Init();
            SoundVolumeLabel.Width  = 120;
            SoundVolumeLabel.Parent = SettingsWindow;
            SoundVolumeLabel.Text   = GlblRes.Sound_Volume;
            SoundVolumeLabel.Top    = 30;
            SoundVolumeLabel.Left   = 5;

            var SoundVolumeBar = new TrackBar(gui);

            SoundVolumeBar.Init();
            SoundVolumeBar.Width         = 160;
            SoundVolumeBar.Value         = (int)(GameSettings.SoundEffectVolume * 100);
            SoundVolumeBar.ValueChanged += (o, e) =>
            {
                GameSettings.SoundEffectVolume = (float)SoundVolumeBar.Value / 100f;
                Engine.ApplyGameSettingsVolume();
                MainMenuLabel.Text = string.Empty;
            };
            SoundVolumeBar.Top    = 30;
            SoundVolumeBar.Left   = 120;
            SoundVolumeBar.Parent = SettingsWindow;

            var BloomLabel = new Label(gui);

            BloomLabel.Init();
            BloomLabel.Width  = 120;
            BloomLabel.Parent = SettingsWindow;
            BloomLabel.Text   = GlblRes.Bloom;
            BloomLabel.Top    = 55;
            BloomLabel.Left   = 5;

            var BloomCheckBox = new CheckBox(gui);

            BloomCheckBox.Init();
            BloomCheckBox.Parent          = SettingsWindow;
            BloomCheckBox.Text            = string.Empty;
            BloomCheckBox.Checked         = GameSettings.Bloom;
            BloomCheckBox.CheckedChanged += (o, e) =>
            {
                GameSettings.Bloom = BloomCheckBox.Checked;
                MainMenuLabel.Text = GlblRes.Restart_the_game_for_this_setting_to_take_effect;
            };
            BloomCheckBox.Top  = 55;
            BloomCheckBox.Left = 120;

            var VSyncLabel = new Label(gui);

            VSyncLabel.Init();
            VSyncLabel.Width  = 120;
            VSyncLabel.Parent = SettingsWindow;
            VSyncLabel.Text   = GlblRes.VSync;
            VSyncLabel.Top    = 80;
            VSyncLabel.Left   = 5;

            var VSyncCheckBox = new CheckBox(gui);

            VSyncCheckBox.Init();
            VSyncCheckBox.Parent          = SettingsWindow;
            VSyncCheckBox.Text            = string.Empty;
            VSyncCheckBox.Checked         = GameSettings.VSync;
            VSyncCheckBox.CheckedChanged += (o, e) =>
            {
                GameSettings.VSync = VSyncCheckBox.Checked;
                MainMenuLabel.Text = GlblRes.Restart_the_game_for_this_setting_to_take_effect;
            };
            VSyncCheckBox.Top  = 80;
            VSyncCheckBox.Left = 120;

            var DisplayModeLabel = new Label(gui);

            DisplayModeLabel.Init();
            DisplayModeLabel.Width  = 120;
            DisplayModeLabel.Parent = SettingsWindow;
            DisplayModeLabel.Text   = GlblRes.Display_Mode;
            DisplayModeLabel.Top    = 105;
            DisplayModeLabel.Left   = 5;

            var DisplayModeCombo = new ComboBox(gui);

            DisplayModeCombo.Init();

            DisplayModeCombo.Items             = GetDisplayModes();
            DisplayModeCombo.Width             = 120;
            DisplayModeCombo.Parent            = SettingsWindow;
            DisplayModeCombo.Width             = 160;
            DisplayModeCombo.Text              = DisplayModeToString(GameSettings.DisplayMode);
            DisplayModeCombo.ItemIndexChanged += (o, e) =>
            {
                GameSettings.DisplayMode = StringToDisplayMode(DisplayModeCombo.Text);
                MainMenuLabel.Text       = GlblRes.Restart_the_game_for_this_setting_to_take_effect;
            };
            DisplayModeCombo.Top  = 105;
            DisplayModeCombo.Left = 120;

            var Bevel = new Bevel(gui);

            Bevel.Parent = SettingsWindow;
            Bevel.Anchor = Anchors.Bottom | Anchors.Left | Anchors.Right;
            Bevel.Height = 35;
            Bevel.Style  = BevelStyle.Raised;
            Bevel.Top    = SettingsWindow.ClientHeight - Bevel.Height;
            Bevel.Width  = SettingsWindow.ClientWidth;

            var OKButton = new MenuButton(gui, ClickSound, FocusSound, GameSettings);

            OKButton.Init();
            OKButton.Parent = Bevel;
            OKButton.Text   = GlblRes.OK;
            OKButton.Click += (s, e) =>
            {
                SettingsWindow.Close();
                ShowLogo(true);
                GameSettings.Save(Engine.Game.SaveGameFolder);
            };
            OKButton.Width = 130;
            OKButton.Left  = 150;
            OKButton.Top   = 5;

            gui.Add(SettingsWindow);
        }
Example #7
0
        void AddLoadGameWindow(Manager gui)
        {
            var LoadButton = new MenuButton(gui, ClickSound, FocusSound, GameSettings);

            LoadGameWindow                    = new Window(gui);
            LoadGameWindow.Width              = 300;
            LoadGameWindow.Height             = 200;
            LoadGameWindow.CloseButtonVisible = false;
            LoadGameWindow.Text               = GlblRes.Load_Savegame;
            LoadGameWindow.Parent             = MainMenuBackground;
            LoadGameWindow.Init();
            LoadGameWindow.Center(new Point(Game.VIRTUAL_WIDTH, Game.VIRTUAL_HEIGHT));
            LoadGameWindow.Visible     = false;
            LoadGameWindow.Resizable   = false;
            LoadGameWindow.IconVisible = false;
            LoadGameWindow.DragAlpha   = 255;
            LoadGameWindow.Movable     = false;

            var SaveGameScreenshot = new ImageBox(gui);

            SaveGameScreenshot.Parent   = MainMenuBackground;
            SaveGameScreenshot.Width    = MainMenuBackground.Width;
            SaveGameScreenshot.Height   = MainMenuBackground.Height;
            SaveGameScreenshot.Visible  = false;
            SaveGameScreenshot.SizeMode = SizeMode.Stretched;

            LoadGameWindow.Closed += (s, e) => { LoadGameListbox.ItemIndex = -1; };

            LoadGameListbox                   = new ListBox(gui);
            LoadGameListbox.Width             = LoadGameWindow.ClientWidth;
            LoadGameListbox.Parent            = LoadGameWindow;
            LoadGameListbox.Height            = LoadGameWindow.ClientHeight - 35;
            LoadGameListbox.ItemIndexChanged += (s, e) =>
            {
                ClickSound.Play(GameSettings.SoundEffectVolume, 0f, 0f);
                MainMenuLabel.Text = string.Empty;
                if (LoadGameListbox.ItemIndex > -1)
                {
                    if (SaveGameScreenshot.Image != null)
                    {
                        SaveGameScreenshot.Image.Dispose();
                    }

                    var Screenshot = SaveGames[SaveGames.Keys.ElementAt(LoadGameListbox.ItemIndex)].Screenshot;
                    if (Screenshot != null)
                    {
                        using (Stream ScreenshotStream = new MemoryStream(Screenshot))
                        {
                            SaveGameScreenshot.Image = Texture2D.FromStream(Engine.Renderer.GraphicsDevice, ScreenshotStream);
                        }
                    }

                    SaveGameScreenshot.Show();
                    LoadButton.Enabled = true;
                }
                else
                {
                    SaveGameScreenshot.Hide();
                    LoadButton.Enabled = false;
                }
            };

            var Bevel = new Bevel(gui);

            Bevel.Parent = LoadGameWindow;
            Bevel.Anchor = Anchors.Bottom | Anchors.Left | Anchors.Right;
            Bevel.Height = 35;
            Bevel.Style  = BevelStyle.Raised;
            Bevel.Top    = LoadGameWindow.ClientHeight - Bevel.Height;
            Bevel.Width  = LoadGameWindow.ClientWidth;

            LoadButton.Init();
            LoadButton.Parent  = Bevel;
            LoadButton.Enabled = false;
            LoadButton.Text    = GlblRes.Load_Savegame;
            LoadButton.Click  += (s, e) =>
            {
                MainMenuLabel.Text = string.Empty;
                try
                {
                    Engine.LoadState(SaveGames.Keys.ElementAt(LoadGameListbox.ItemIndex));
                }
                catch
                {
                    MainMenuLabel.Text = GlblRes.Could_not_load_save_game_Maybe_it_was_created_in_an_earlier_game_version;
                    return;
                }

                LoadGameWindow.Close();
                MainMenuBackground.Hide();
                Engine.Resume();
                Engine.Renderer.GUIManager.ShowSoftwareCursor = false;
            };
            LoadButton.Width = 130;
            LoadButton.Left  = 5;
            LoadButton.Top   = 5;

            var CancelButton = new MenuButton(gui, ClickSound, FocusSound, GameSettings);

            CancelButton.Init();
            CancelButton.Parent = Bevel;
            CancelButton.Text   = GlblRes.Cancel;
            CancelButton.Click += (s, e) =>
            {
                LoadGameWindow.Close();
                ShowLogo(true);
            };
            CancelButton.Width = 130;
            CancelButton.Left  = 150;
            CancelButton.Top   = 5;

            gui.Add(LoadGameWindow);
        }
Example #8
0
        void AddSaveGameWindow(Manager gui)
        {
            var SaveButton  = new MenuButton(gui, ClickSound, FocusSound, GameSettings);
            var NameTextBox = new TextBox(gui);

            SaveGameWindow                    = new Window(gui);
            SaveGameWindow.Width              = 300;
            SaveGameWindow.Height             = 240;
            SaveGameWindow.CloseButtonVisible = false;
            SaveGameWindow.Text               = GlblRes.Save;
            SaveGameWindow.IconVisible        = false;
            SaveGameWindow.Parent             = MainMenuBackground;
            SaveGameWindow.Init();
            SaveGameWindow.Visible   = false;
            SaveGameWindow.Resizable = false;
            SaveGameWindow.Center(new Point(Game.VIRTUAL_WIDTH, Game.VIRTUAL_HEIGHT));
            SaveGameWindow.Movable = false;

            SaveGameWindow.Closed += (s, e) => { SaveGameListbox.ItemIndex = -1; };

            SaveGameListbox                   = new ListBox(gui);
            SaveGameListbox.Width             = SaveGameWindow.ClientWidth;
            SaveGameListbox.Parent            = SaveGameWindow;
            SaveGameListbox.Height            = SaveGameWindow.ClientHeight - 35 - 30;
            SaveGameListbox.ItemIndexChanged += (s, e) =>
            {
                ClickSound.Play(GameSettings.SoundEffectVolume, 0f, 0f);
                if (SaveGameListbox.ItemIndex > -1)
                {
                    NameTextBox.Text = SaveGames[SaveGames.Keys.ElementAt(SaveGameListbox.ItemIndex)].Name;
                }
            };

            var Bevel = new Bevel(gui);

            Bevel.Parent = SaveGameWindow;
            Bevel.Anchor = Anchors.Bottom | Anchors.Left | Anchors.Right;
            Bevel.Height = 35;
            Bevel.Style  = BevelStyle.Raised;
            Bevel.Top    = SaveGameWindow.ClientHeight - Bevel.Height;
            Bevel.Width  = SaveGameWindow.ClientWidth;

            SaveButton.Init();
            SaveButton.Parent  = Bevel;
            SaveButton.Enabled = false;
            SaveButton.Text    = GlblRes.Save;
            SaveButton.Click  += (s, e) =>
            {
                Engine.SaveState(NameTextBox.Text);
                ShowLogo(true);
                SaveGameWindow.Close();
                RefreshSaveGames();
            };
            SaveButton.Width = 130;
            SaveButton.Left  = 5;
            SaveButton.Top   = 5;

            var CancelButton = new MenuButton(gui, ClickSound, FocusSound, GameSettings);

            CancelButton.Init();
            CancelButton.Parent = Bevel;
            CancelButton.Text   = GlblRes.Cancel;
            CancelButton.Click += (s, e) =>
            {
                SaveGameWindow.Close();
                ShowLogo(true);
            };
            CancelButton.Width = 130;
            CancelButton.Left  = Bevel.ClientWidth - 130 - 5;
            CancelButton.Top   = 5;

            gui.Add(SaveGameWindow);

            var SaveGameNameLabel = new Label(gui);

            SaveGameNameLabel.Parent = SaveGameWindow;
            SaveGameNameLabel.Top    = SaveGameListbox.Height + 5;
            SaveGameNameLabel.Left   = 5;
            SaveGameNameLabel.Width  = 95;
            SaveGameNameLabel.Text   = GlblRes.Name;

            NameTextBox.Parent = SaveGameWindow;
            NameTextBox.Init();
            NameTextBox.Left         = 60;
            NameTextBox.Top          = SaveGameListbox.Height + 5;
            NameTextBox.Width        = 220;
            NameTextBox.Height       = 20;
            NameTextBox.TextChanged += (s, e) =>
            {
                SaveButton.Enabled = !string.IsNullOrWhiteSpace(NameTextBox.Text);
            };
            NameTextBox.KeyPress += (s, e) =>
            {
                if (e.Key == Microsoft.Xna.Framework.Input.Keys.Enter)
                {
                    Engine.SaveState(NameTextBox.Text);
                    SaveGameWindow.Close();
                    ShowLogo(true);
                    RefreshSaveGames();
                }
            };

            gui.Add(SaveGameWindow);
        }