Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TreeNode"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TreeNode(Base parent)
            : base(parent)
        {
            m_ToggleButton = new TreeToggleButton(this);
            m_ToggleButton.SetBounds(0, 0, 15, 15);
            m_ToggleButton.Toggled += OnToggleButtonPress;

            m_Title = new TreeNodeLabel(this);
            m_Title.Dock = Pos.Top;
            m_Title.Margin = new Margin(16, 0, 0, 0);
            m_Title.DoubleClicked += OnDoubleClickName;
            m_Title.Clicked += OnClickName;

            m_InnerPanel = new Base(this);
            m_InnerPanel.Dock = Pos.Top;
            m_InnerPanel.Height = 100;
            m_InnerPanel.Margin = new Margin(TreeIndentation, 1, 0, 0);
            m_InnerPanel.Hide();

            IsRoot = parent is TreeControl;
            m_Selected = false;
            IsSelectable = true;

            Dock = Pos.Top;
        }
Exemplo n.º 2
0
        public ScreenSolarSystem(Base parent)
            : base(parent)
        {
            SetSize(parent.Width, parent.Height);

            Gwen.Control.Label label = new Gwen.Control.Label(this);
            label.Text = "Solar System";
            label.SetPosition(30, 30);
            label.TextColor = Color.FromArgb(200, 80, 0, 250);
            label.Font      = Program.fontLogo;


            Gwen.Control.Button buttonOK = new Gwen.Control.Button(this);
            buttonOK.Text = "OK";
            buttonOK.Font = Program.fontButtonLabels;
            buttonOK.SetBounds(300, 500, 200, 50);
            buttonOK.Clicked += onButtonOKClick;


            Gwen.Control.Button buttonPlanet = new Gwen.Control.Button(this);
            buttonPlanet.Text = "Planet";
            buttonPlanet.Font = Program.fontButtonLabels;
            buttonPlanet.SetBounds(550, 500, 200, 50);
            buttonPlanet.Clicked += onButtonPlanetClick;
        }
Exemplo n.º 3
0
        public Screen_TechTree(Base parent)
            : base(parent)
        {
            Gwen.Control.Button buttonOK = new Gwen.Control.Button(this);
            buttonOK.Text = "Back";
            buttonOK.Font = Program.fontButtonLabels;
            buttonOK.SetBounds(500, 500, 50, 50);
            buttonOK.Clicked += onButtonOKClick;

            Tech.Inint();
            SetSize(parent.Width, parent.Height);

            label      = new Gwen.Control.Label(this);
            label.Text = "Tech_Tree Probe";
            label.SetPosition(Program.percentW(85), Program.percentH(85));
            label.TextColor = Color.FromArgb(200, 80, 0, 250);
            label.Font      = Program.fontLogo;

            img = new Gwen.Control.ImagePanel(this);


            updateDrawing();

            img.SetPosition(Program.percentW(0), Program.percentH(0));
            img.SetSize(Program.percentW(80), Program.percentH(80));
            //img.Clicked += new GwenEventHandler<ClickedEventArgs>(img_Clicked);
            img.MouseMoved += new GwenEventHandler <MovedEventArgs>(img_MouseMoved);
            img.MouseDown  += new GwenEventHandler <ClickedEventArgs>(img_MouseDown);
            img.MouseUp    += new GwenEventHandler <ClickedEventArgs>(img_MouseUp);
        }
Exemplo n.º 4
0
        public ScreenPlanet(Base parent)
            : base(parent)
        {
            SetSize(parent.Width, parent.Height);

            Gwen.Control.Label label = new Gwen.Control.Label(this);
            label.Text = "Planet";
            label.SetPosition(30, 30);
            label.TextColor = Color.FromArgb(200, 80, 0, 250);
            label.Font      = Program.fontLogo;

            int width;
            int height;

            Gwen.Control.WindowControl settingsWindow = new Gwen.Control.WindowControl(this);
            settingsWindow.Width             = parent.Width / 2;
            settingsWindow.Height            = parent.Height / 2;
            settingsWindow.SetPosition(width = parent.Width / 2 - settingsWindow.Width / 2, height = parent.Height / 2 - settingsWindow.Height / 2);

            Gwen.Control.Button buttonBack = new Gwen.Control.Button(settingsWindow);
            buttonBack.Text = "Back";
            buttonBack.Font = Program.fontButtonLabels;
            buttonBack.SetBounds(width / 100 * 8, height / 100 * 8, width / 3, height / 3);
            buttonBack.Clicked += onButtonBackClick;
        }
Exemplo n.º 5
0
        public Screen_GameScreen(Base parent)
            : base(parent)
        {
            SetSize(parent.Width, parent.Height);

            label      = new Gwen.Control.Label(this);
            label.Text = "GAME!!!";
            label.SetPosition(Program.percentW(5), Program.percentH(5));
            label.TextColor = Color.FromArgb(200, 80, 0, 250);
            label.Font      = Program.fontLogo;

            img = new Gwen.Control.ImagePanel(this);


            galaxyImage = new Bitmap(Program.percentW(100), Program.percentH(80), PixelFormat.Format32bppArgb);
            DrawControl = new DrawController(galaxyImage);

            updateDrawing();

            img.SetPosition(Program.percentW(0), Program.percentH(20));
            img.SetSize(Program.percentW(100), Program.percentH(80));
            //img.Clicked += new GwenEventHandler<ClickedEventArgs>(img_Clicked);
            img.MouseMoved += new GwenEventHandler <MovedEventArgs>(img_MouseMoved);
            img.MouseDown  += new GwenEventHandler <ClickedEventArgs>(img_MouseDown);
            img.MouseUp    += new GwenEventHandler <ClickedEventArgs>(img_MouseUp);

            Gwen.Control.Button buttonTech = new Gwen.Control.Button(this);
            buttonTech.Text = "Tech Tree";
            buttonTech.Font = Program.fontButtonLabels;
            buttonTech.SetBounds(Program.percentW(80), Program.percentH(84), Program.percentW(20), Program.percentH(8));
            buttonTech.Clicked += onButtonTechClick;

            Gwen.Control.Button buttonMenu = new Gwen.Control.Button(this);
            buttonMenu.Text = "Menu";
            buttonMenu.Font = Program.fontButtonLabels;
            buttonMenu.SetBounds(Program.percentW(0), Program.percentH(0), Program.percentW(13), Program.percentH(8));
            buttonMenu.Clicked += onButtonMenuClick;

            Gwen.Control.Button buttonSolarSystem = new Gwen.Control.Button(this);
            buttonSolarSystem.Text = "Solar System";
            buttonSolarSystem.Font = Program.fontButtonLabels;
            buttonSolarSystem.SetBounds(Program.percentW(0), Program.percentH(92), Program.percentW(19), Program.percentH(8));
            buttonSolarSystem.Clicked += onSolarSystemClick;

            Gwen.Control.Button buttonStep = new Gwen.Control.Button(this);
            buttonStep.Text = "Step";
            buttonStep.Font = Program.fontButtonLabels;
            buttonStep.SetBounds(Program.percentW(90), Program.percentH(92), Program.percentW(10), Program.percentH(8));
            buttonStep.Clicked += onSolarSystemClick;

            buttonCombat      = new Gwen.Control.Button(this);
            buttonCombat.Text = "Combat";
            buttonCombat.Font = Program.fontButtonLabels;
            buttonCombat.SetBounds(Program.percentW(19), Program.percentH(92), Program.percentW(18), Program.percentH(8));
            buttonCombat.Clicked += onCombatClick;
        }
Exemplo n.º 6
0
        public Screen_Combat(Base parent)
            : base(parent)
        {
            SetSize(parent.Width, parent.Height);

            imgCombatMap = new Gwen.Control.ImagePanel(this);

            tacticState.New(ref seed);
            ShipsCounter.ShipsCount(ref seed);
            pictureMap.Width  = Program.percentW(100);
            pictureMap.Height = Program.percentH(82);
            tacticDraw.New(pictureMap, seed, tacticState);

            UpdateDrawing();

            imgCombatMap.SetPosition(Program.percentW(0), Program.percentH(0));
            imgCombatMap.SetSize(pictureMap.Width, pictureMap.Height);
            imgCombatMap.MouseDown += new GwenEventHandler <ClickedEventArgs>(imgCombatMap_MouseDown);

            buttonStep      = new Gwen.Control.Button(this);
            buttonStep.Text = "Step";
            buttonStep.Font = Program.fontButtonLabels;
            buttonStep.SetBounds(Program.percentW(82), Program.percentH(82), Program.percentW(18), Program.percentH(6));
            buttonStep.Clicked += onStepClick;

            buttonConcede      = new Gwen.Control.Button(this);
            buttonConcede.Text = "Concede";
            buttonConcede.Font = Program.fontButtonLabels;
            buttonConcede.SetBounds(Program.percentW(82), Program.percentH(88), Program.percentW(18), Program.percentH(6));
            buttonConcede.Clicked += onConcedeClick;

            buttonAutoBattle      = new Gwen.Control.Button(this);
            buttonAutoBattle.Text = "Auto Battle";
            buttonAutoBattle.Font = Program.fontButtonLabels;
            buttonAutoBattle.SetBounds(Program.percentW(82), Program.percentH(94), Program.percentW(18), Program.percentH(6));
            buttonAutoBattle.Clicked += onAutoBattleClick;

            labelStep           = new Gwen.Control.Label(this);
            labelStep.Text      = "Ходит 1-й игрок";
            labelStep.Font      = Program.fontText;
            labelStep.TextColor = Color.GreenYellow;
            labelStep.SetBounds(Program.percentW(65), Program.percentH(90), Program.percentW(20), Program.percentH(8));

            labelDescription           = new Gwen.Control.Label(this);
            labelDescription.Text      = "";
            labelDescription.Font      = Program.fontText;
            labelDescription.TextColor = Color.GreenYellow;
            labelDescription.SetBounds(Program.percentW(0), Program.percentH(82), Program.percentW(50), Program.percentH(18));
        }
Exemplo n.º 7
0
        private void EndCombat(int win)
        {
            Gwen.Control.WindowControl windowEnd = new Gwen.Control.WindowControl(this);
            windowEnd.Width  = this.Width / 2;
            windowEnd.Height = this.Height / 2;
            windowEnd.SetPosition(this.Width / 2 - windowEnd.Width / 2, this.Height / 2 - windowEnd.Height / 2);

            Gwen.Control.Label labelWin = new Gwen.Control.Label(windowEnd);
            labelWin.Text = "Win Player " + win.ToString();
            labelWin.Font = Program.fontLogo;
            labelWin.SetBounds(windowEnd.Width / 2 - labelWin.Width / 2, windowEnd.Height / 2 - labelWin.Height, windowEnd.Width, windowEnd.Height * 15 / 100);

            Gwen.Control.Button buttonOK = new Gwen.Control.Button(windowEnd);
            buttonOK.Text = "OK";
            buttonOK.Font = Program.fontButtonLabels;
            buttonOK.SetBounds(windowEnd.Width / 2 - buttonOK.Width / 2, windowEnd.Height * 70 / 100, windowEnd.Width * 25 / 100, windowEnd.Height * 15 / 100);
            buttonOK.Clicked += onOKClick;

            windowEnd.IsClosable = false;
        }
Exemplo n.º 8
0
        public Screen_MainMenu(Base parent) : base(parent)
        {
            SetSize(parent.Width, parent.Height);

            Gwen.Control.Label label = new Gwen.Control.Label(this);
            label.Text = "GalaxyConquest";
            label.SetPosition(70, 30);
            label.TextColor = Color.FromArgb(200, 80, 0, 250);
            label.Font      = Program.fontLogo;


            Gwen.Control.Button buttonNewGame = new Gwen.Control.Button(this);
            buttonNewGame.Text = "New game";
            buttonNewGame.Font = Program.fontButtonLabels;
            buttonNewGame.SetBounds(300, 200, 200, 50);
            buttonNewGame.Pressed += onButtonNewGameClick;

            Gwen.Control.Button buttonLoadGame = new Gwen.Control.Button(this);
            buttonLoadGame.Text = "Load game";
            buttonLoadGame.Disable();
            buttonLoadGame.Font = Program.fontButtonLabels;
            buttonLoadGame.SetBounds(300, 260, 200, 50);

            Gwen.Control.Button buttonSettings = new Gwen.Control.Button(this);
            buttonSettings.Text = "Settings";
            buttonSettings.Font = Program.fontButtonLabels;
            buttonSettings.SetBounds(300, 320, 200, 50);
            buttonSettings.Pressed += onButtonSettingsClick;

            Gwen.Control.Button buttonCredits = new Gwen.Control.Button(this);
            buttonCredits.Text = "Credits";
            buttonCredits.Font = Program.fontButtonLabels;
            buttonCredits.SetBounds(300, 380, 200, 50);

            Gwen.Control.Button buttonQuit = new Gwen.Control.Button(this);
            buttonQuit.Text = "Quit";
            buttonQuit.Font = Program.fontButtonLabels;
            buttonQuit.SetBounds(300, 440, 200, 50);
            buttonQuit.Pressed += onButtonQuitClick;
        }
Exemplo n.º 9
0
        public Screen_NewGame(Base parent)
            : base(parent)
        {
            SetSize(parent.Width, parent.Height);


            label      = new Gwen.Control.Label(this);
            label.Text = "New game";
            label.SetPosition(Program.percentW(5), Program.percentH(5));
            label.TextColor = Color.FromArgb(200, 80, 0, 250);
            label.Font      = Program.fontLogo;

            Gwen.Control.Button buttonBack = new Gwen.Control.Button(this);
            buttonBack.Text = "Back";
            buttonBack.Font = Program.fontButtonLabels;
            buttonBack.SetBounds(Program.percentW(5), Program.percentH(87), Program.percentW(18), Program.percentH(8));
            buttonBack.Clicked += onButtonBackClick;

            Gwen.Control.Button buttonNewGame = new Gwen.Control.Button(this);
            buttonNewGame.Text = "New game";
            buttonNewGame.Font = Program.fontButtonLabels;
            buttonNewGame.SetBounds(Program.percentW(77), Program.percentH(87), Program.percentW(18), Program.percentH(8));
            buttonNewGame.Clicked += onButtonNewGameClick;

            imageGalaxyType       = new Gwen.Control.ImagePanel(this);
            imageGalaxyType.Image = Properties.Resources.icon_newgame_spiral;
            imageGalaxyType.SetBounds(Program.percentW(20), Program.percentH(20), Program.percentW(25), Program.percentH(25));

            Gwen.Control.Button buttonGalaxyTypeLeft = new Gwen.Control.Button(this);
            buttonGalaxyTypeLeft.Text = "<";
            buttonGalaxyTypeLeft.SetBounds(Program.percentW(20), Program.percentH(40), Program.percentW(5), Program.percentH(5));
            buttonGalaxyTypeLeft.Clicked += onButtonGalaxyTypeLeftClick;

            Gwen.Control.Button buttonGalaxyTypeRight = new Gwen.Control.Button(this);
            buttonGalaxyTypeRight.Text = ">";
            buttonGalaxyTypeRight.SetBounds(Program.percentW(40), Program.percentH(40), Program.percentW(5), Program.percentH(5));
            buttonGalaxyTypeRight.Clicked += onButtonGalaxyTypeRightClick;
        }
Exemplo n.º 10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TreeNode"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TreeNode(Base parent)
            : base(parent)
        {
            m_ToggleButton = new TreeToggleButton(this);
            m_ToggleButton.SetBounds(0, 0, 15, 15);
            m_ToggleButton.Toggled += OnToggleButtonPress;

            m_Title                    = new TreeNodeLabel(this);
            m_Title.Dock               = Pos.Top;
            m_Title.Margin             = new Margin(16, 0, 0, 0);
            m_Title.DoubleClickedLeft += OnDoubleClickName;
            m_Title.Clicked           += OnClickName;

            m_InnerPanel        = new Base(this);
            m_InnerPanel.Dock   = Pos.Top;
            m_InnerPanel.Height = 100;
            m_InnerPanel.Margin = new Margin(TreeIndentation, 1, 0, 0);
            m_InnerPanel.Hide();

            m_Root       = false;
            m_Selected   = false;
            m_Selectable = true;
        }
Exemplo n.º 11
0
        private void onButtonMenuClick(Base control, EventArgs args)
        {
            if (!menuOpenned)
            {
                menuOpenned = true;

                Gwen.Control.WindowControl menuWindow = new Gwen.Control.WindowControl(this);
                menuWindow.Width  = Program.percentW(50);
                menuWindow.Height = Program.percentH(50);
                menuWindow.SetPosition(Program.percentW(25), Program.percentH(20));

                Gwen.Control.Button buttonNewGame = new Gwen.Control.Button(menuWindow);
                buttonNewGame.Text = "New game";
                buttonNewGame.Font = Program.fontButtonLabels;
                buttonNewGame.SetBounds(Program.percentW(12), Program.percentH(0), 200, 50);
                buttonNewGame.Pressed += onButtonNewGameClick;

                Gwen.Control.Button buttonLoadGame = new Gwen.Control.Button(menuWindow);
                buttonLoadGame.Text = "Load game";
                buttonLoadGame.Disable();
                buttonLoadGame.Font = Program.fontButtonLabels;
                buttonLoadGame.SetBounds(Program.percentW(12), Program.percentH(10), 200, 50);

                Gwen.Control.Button buttonSaveGame = new Gwen.Control.Button(menuWindow);
                buttonSaveGame.Text = "Save Game";
                buttonSaveGame.Disable();
                buttonSaveGame.Font = Program.fontButtonLabels;
                buttonSaveGame.SetBounds(Program.percentW(12), Program.percentH(20), 200, 50);

                Gwen.Control.Button buttonQuit = new Gwen.Control.Button(menuWindow);
                buttonQuit.Text = "Quit";
                buttonQuit.Font = Program.fontButtonLabels;
                buttonQuit.SetBounds(Program.percentW(12), Program.percentH(30), 200, 50);
                buttonQuit.Pressed += onButtonQuitClick;
            }
        }
Exemplo n.º 12
0
        public Screen_Settings(Base parent)
            : base(parent)
        {
            SetSize(parent.Width, parent.Height);

            Gwen.Control.Label label = new Gwen.Control.Label(this);
            label.Text = "Settings";
            label.SetPosition(30, 30);
            label.TextColor = Color.FromArgb(200, 80, 0, 250);
            label.Font      = Program.fontLogo;

            Gwen.Control.WindowControl settingsWindow = new Gwen.Control.WindowControl(this);
            settingsWindow.Width  = parent.Width / 2;
            settingsWindow.Height = parent.Height / 2;
            settingsWindow.SetPosition(parent.Width / 2 - settingsWindow.Width / 2, parent.Height / 2 - settingsWindow.Height / 2);

            Gwen.Control.Label musicLabel = new Gwen.Control.Label(settingsWindow);
            musicLabel.Text = "Music:";
            musicLabel.SetPosition(parent.Width / 10, parent.Height / 10);
            musicLabel.TextColor = Color.FromArgb(255, 0, 0, 0);
            musicLabel.Font      = Program.fontText;

            Gwen.Control.HorizontalSlider musicSlider = new Gwen.Control.HorizontalSlider(settingsWindow);
            musicSlider.SetPosition(parent.Width / 5, parent.Height / 10);
            musicSlider.SetSize(parent.Width / 10, musicLabel.Height);

            Gwen.Control.Label sfxLabel = new Gwen.Control.Label(settingsWindow);
            sfxLabel.Text = "SFX:";
            sfxLabel.SetPosition(parent.Width / 10, musicLabel.Y + musicLabel.Height);
            sfxLabel.TextColor = Color.FromArgb(255, 0, 0, 0);
            sfxLabel.Font      = Program.fontText;

            Gwen.Control.CheckBox sfxCheckBox = new Gwen.Control.CheckBox(settingsWindow);
            sfxCheckBox.SetPosition(parent.Width / 5, musicLabel.Y + musicLabel.Height);

            Gwen.Control.Label fpsLabel = new Gwen.Control.Label(settingsWindow);
            fpsLabel.Text = "FPS Limit:";
            fpsLabel.SetPosition(parent.Width / 10, sfxLabel.Y + sfxLabel.Height);
            fpsLabel.TextColor = Color.FromArgb(255, 0, 0, 0);
            fpsLabel.Font      = Program.fontText;

            Gwen.Control.HorizontalSlider fpsSlider = new Gwen.Control.HorizontalSlider(settingsWindow);
            fpsSlider.SetPosition(parent.Width / 5, sfxLabel.Y + sfxLabel.Height);
            fpsSlider.SetSize(parent.Width / 10, sfxLabel.Height);

            Gwen.Control.Label resolutionLabel = new Gwen.Control.Label(settingsWindow);
            resolutionLabel.Text = "Resolution:";
            resolutionLabel.SetPosition(parent.Width / 10, fpsLabel.Y + fpsLabel.Height);
            resolutionLabel.TextColor = Color.FromArgb(255, 0, 0, 0);
            resolutionLabel.Font      = Program.fontText;

            Gwen.Control.ComboBox resolution = new ComboBox(settingsWindow);
            resolution.AddItem("800x600");
            resolution.AddItem("1024x768");
            resolution.SetPosition(parent.Width / 5, fpsLabel.Y + fpsLabel.Height);
            resolution.SetSize(parent.Width / 10, resolutionLabel.Height);

            Gwen.Control.Label fullScreenLabel = new Gwen.Control.Label(settingsWindow);
            fullScreenLabel.Text = "Full screen:";
            fullScreenLabel.SetPosition(parent.Width / 10, resolutionLabel.Y + resolutionLabel.Height);
            fullScreenLabel.TextColor = Color.FromArgb(255, 0, 0, 0);
            fullScreenLabel.Font      = Program.fontText;

            Gwen.Control.CheckBox fullScreenCheckBox = new Gwen.Control.CheckBox(settingsWindow);
            fullScreenCheckBox.SetPosition(parent.Width / 5, resolutionLabel.Y + resolutionLabel.Height);
            if (fullScreen == true)
            {
                fullScreenCheckBox.Toggle();
            }
            fullScreenCheckBox.Checked   += fullScreenEnable;
            fullScreenCheckBox.UnChecked += fullScreenDisable;

            Gwen.Control.Button buttonOK = new Gwen.Control.Button(this);
            buttonOK.Text = "OK";
            buttonOK.Font = Program.fontButtonLabels;
            buttonOK.SetBounds(550, 500, 200, 50);
            buttonOK.Clicked += onButtonOKClick;
        }
Exemplo n.º 13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TreeNode"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TreeNode(ZGE.Components.ZComponent parent)
            : base(parent)
        {
            m_ToggleButton = new TreeToggleButton(this);
            m_ToggleButton.SetBounds(0, 0, 15, 15);
            m_ToggleButton.Toggled += OnToggleButtonPress;

            m_Title = new TreeNodeLabel(this);
            m_Title.Dock = Pos.Top;
            m_Title.Margin = new Margin(16, 0, 0, 0);
            m_Title.DoubleClickedLeft += OnDoubleClickName;
            m_Title.Clicked += OnClickName;

            m_InnerPanel = new GUIControl(this);
            m_InnerPanel.Dock = Pos.Top;
            m_InnerPanel.Height = 100;
            m_InnerPanel.Margin = new Margin(TreeIndentation, 1, 0, 0);
            m_InnerPanel.Hide();

            m_Root = false;
            m_Selected = false;
            m_Selectable = true;
        }