Beispiel #1
0
        public override void Add(ScreenManager screenManager)
        {
            Game.CurrentGameState = GameState.Login;
            base.Add(screenManager);
            (Manager.Game as Application).BackgroundImage = ContentPack.Textures["gui\\background"];

            //Add the logo image
            LogoImage = new ImageBox(Manager) { Image = ContentPack.Textures["gui\\logosmall"], SizeMode = SizeMode.Centered };
            LogoImage.SetSize(LogoImage.Image.Width, LogoImage.Image.Height);
            LogoImage.SetPosition((Window.Width / 2) - (LogoImage.Width / 2), 0);
            LogoImage.Init();
            Window.Add(LogoImage);

            //Add github contribute link
            GithubIcon = new ImageBox(Manager) { Image = ContentPack.Textures["gui\\github"], SizeMode = SizeMode.Auto, };
            GithubIcon.ToolTip.Text = "We love open source! Contribute to Bricklayer at our GitHub repo.";
            GithubIcon.SetSize(GithubIcon.Width, GithubIcon.Height);
            GithubIcon.SetPosition(Window.Width - GithubIcon.Width - 8, Window.Height - GithubIcon.Height - 8);
            GithubIcon.Init();
            GithubIcon.Color = Color.White * .6f;
            //Click/Hover events
            GithubIcon.MouseOut += new MouseEventHandler(delegate(object o, MouseEventArgs e)
            {
                GithubIcon.Color = Color.White * .6f;
            });
            GithubIcon.MouseOver += new MouseEventHandler(delegate(object o, MouseEventArgs e)
            {
                GithubIcon.Color = Color.White;
            });
            GithubIcon.Click += new TomShane.Neoforce.Controls.EventHandler(delegate(object o, TomShane.Neoforce.Controls.EventArgs e)
            {
                if (Manager.Game.IsActive) Process.Start(githubLink); //Open the link in a browser
            });
            Window.Add(GithubIcon);

            //Add version tag
            Version = new Label(Manager) { Font = FontSize.Default14 };
            Version.SetSize(200, 16);
            Version.SetPosition(8, Window.Height - Version.Height - 8);
            Version.Init();
            Version.Text = AssemblyVersionName.GetVersion();
            Window.Add(Version);

            //Add the login window
            Login = new ServerWindow(Manager);
            Login.Init();
            if (Login.Top - 24 < LogoImage.Height + LogoImage.Top) //If it is too close to logo, move it down a bit
                Login.Top = LogoImage.Height + LogoImage.Top - 24;
            Window.Add(Login);
            Login.Show();
        }
Beispiel #2
0
        private void createMusicControls()
        {
            musicFileSelected = false;
            selectedMusicFile = null;
            selectAudio.Enabled = false;
            for (int i = 0; i < musicFiles.Count; i++)
            {

                ImageBox box = new ImageBox(manager);

                box.Init();
                box.DoubleClicks = true;
                box.Parent = gp;
                box.Left = 0;

                box.Passive = false;
                box.Top = 0;
                box.Width = window.Width - 50;
                box.Focused = true;
                box.Height = 30;
                box.SetPosition(10, (30 + ((lastDirecPosition) + i * 25 )));

                box.Image = image2;
                box.Text = musicFiles[i].Name;

                Label tx = new Label(manager);
                tx.Init();
                tx.Passive = false;
                string subD = musicFiles[i].Name;
                tx.Text = subD;
                tx.Tag = musicFiles[i].FullName;
                tx.DoubleClicks = true;

                tx.Height = 20;
                tx.Width = window.Width - 50;

                tx.Left = 25;
                tx.Top = 4;
                tx.Parent = box;
                tx.StayOnTop = true;

                tx.MousePress += new TomShane.Neoforce.Controls.MouseEventHandler(SelectAudioFile);

            }
        }
Beispiel #3
0
        private void createBrowserControls()
        {
            selectAudio.Enabled = false;
            musicFileSelected = false;
            selectedMusicFile = null;
            for (int i = 0; i < subDirectories.Count; i++)
            {

                ImageBox box = new ImageBox(manager);

                box.Init();
                box.DoubleClicks = true;
                box.Parent = gp;
                box.Left = 0;

                box.Passive = false;
                box.Top = 0;
                box.Width = window.Width - 50;
                box.Focused = true;
                box.Height = 30;
                box.SetPosition(10, (30 + (i * 25)));
                lastDirecPosition = (30 + (i * 25));
                box.Image = image;
                box.Text = subDirectories[i];
                box.MousePress += (sender, args) => EnterDirectory(sender, box.Text);

                Label tx = new Label(manager);
                tx.Init();
                tx.Passive = false;
                string subD = (string)subDirectories[i];
                tx.Text = subD;
                tx.DoubleClicks = true;
                //tx.SetPosition(Graphics.GraphicsDevice.Viewport.Width / 2 - 150, (80 + (i * 25)));
                tx.Height = 20;
                tx.Width = window.Width - 50;
                tx.Color = Color.Red;
                tx.BackColor = Color.Red;
                //tx.DoubleClick += (sender, args) => EnterDirectory(sender, box.Text);
                //tx.MouseOver += new TomShane.Neoforce.Controls.MouseEventHandler(EnterDirectory);
                tx.Left = 25;
                tx.Top = 4;
                tx.Parent = box;
                tx.StayOnTop = true;

                tx.MousePress += (sender, args) => EnterDirectory(sender, box.Text);
                tx.MouseOver += (sender, args) => MouseOverDirectory(sender, args);
                tx.MouseOut += (sender, args) => MouseOffDirectory(sender, args);

            }
        }