private void SetUpButtons(ContentManager content)
        {
            int buttonPadding = 20;
            int panelPadding = 10;
            int numberOfButtons = 4;

            Panel panel = new Panel(
                "Sprites/UI/Panels/MenuPanelBackground",
                new Vector2(ScreenManager.Viewport.Width / 3, ScreenManager.Viewport.Height / 3 + panelPadding + buttonPadding + 60),
                new Vector2(200 + panelPadding, numberOfButtons * 40 + (numberOfButtons - 1) * buttonPadding + 2 * panelPadding),
                new Color(0, 0, 0.7f, 1f),
                "Menu Buttons Panel",
                0.6f);
            AddScreenUIElement(panel);

            Button newGameButton = new Button(
                "XML/UI/Buttons/MenuButton",
                new Vector2(ScreenManager.Viewport.Width / 3, ScreenManager.Viewport.Height / 3),
                Button.defaultColour,
                Button.highlightedColour,
                "New Game Button",
                "New Game");
            newGameButton.InteractEvent += NewGameEvent;
            AddScreenUIElement(newGameButton);
            // newGameButton.LoadContent(content);
            // AddUIElement(newGameButton, new Vector2(panel.Dimensions.X / 2, panel.Dimensions.Y / 2));

            Button continueButton = new Button(
                "XML/UI/Buttons/MenuButton",
                newGameButton.Position + new Vector2(0, newGameButton.Bounds.Height + buttonPadding),
                Button.defaultColour,
                Button.highlightedColour,
                "Continue Button",
                "Continue");
            continueButton.InteractEvent += ContinueEvent;
            AddScreenUIElement(continueButton);
            // continueButton.LoadContent(content);
            // panel.AddUIElementRelativeTo(continueButton, newGameButton, new Vector2(0, newGameButton.Bounds.Height + buttonPadding));

            Button settingsButton = new Button(
                "XML/UI/Buttons/MenuButton",
                continueButton.Position + new Vector2(0, continueButton.Bounds.Height + buttonPadding),
                Button.defaultColour,
                Button.highlightedColour,
                "Settings Button",
                "Settings");
            settingsButton.InteractEvent += SettingsEvent;
            AddScreenUIElement(settingsButton);

            Button exitButton = new Button(
                "XML/UI/Buttons/MenuButton",
                settingsButton.Position + new Vector2(0, settingsButton.Bounds.Height + buttonPadding),
                new Color(0.588f, 0, 0),
                new Color(1f, 0, 0),
                "Exit Button",
                "Exit");
            exitButton.InteractEvent += ExitEvent;
            AddScreenUIElement(exitButton);
        }
        public void SetHoverInfoText(string text, Vector2 position)
        {
            Text infoText = new Text(
                text,
                Vector2.Zero,
                100,
                Color.White,
                "Hover Info Text");
            infoText.LoadContent(ScreenManager.Content);

            HoverInfo = new Panel(
                "Sprites/UI/Panels/Panel",
                position,
                2 * infoText.TextOrigin,
                Color.Black,
                "Hover Info",
                0.5f);
            HoverInfo.LoadContent(ScreenManager.Content);
            HoverInfo.AddUIElement(infoText, infoText.Position);
        }
        private void CreateAndPopulatePanel(string panelName, Vector2 buttonPosition, bool createSwitchButton = true)
        {
            Panel panel = new Panel(
                "Sprites/UI/Panels/MenuPanelBackground",
                new Vector2(ScreenManager.Viewport.Width / 3, 21 * ScreenManager.Viewport.Height / 40),
                new Vector2(3 * ScreenManager.Viewport.Width / 5, 17 * ScreenManager.Viewport.Height / 20),
                Color.White,
                panelName + " Panel");
            UpgradePanels.Add(panelName, panel);

            // Populate panel here
            DirectoryInfo directory = new DirectoryInfo(ScreenManager.Content.RootDirectory + "/XML/" + panelName);
            if (directory.Exists)
            {
                FileInfo[] files = directory.GetFiles("*.xnb*");

                int yDimensions = 4;
                int xDimensions = 8;
                for (int y = 0; y < yDimensions; y++)
                {
                    for (int x = 0; x < xDimensions; x++)
                    {
                        if (y * xDimensions + x < files.Length)
                        {
                            string key = Path.GetFileNameWithoutExtension(files[y * xDimensions + x].Name);
                            if (panelName != "Shields")
                            {
                                GameObjectData gameObjectData = ScreenManager.Content.Load<GameObjectData>("XML/" + panelName + "/" + key);
                                Image objectImage = new Image(
                                    gameObjectData.TextureAsset,
                                    new Vector2(-2 * panel.Dimensions.X / 5 + x * panel.Dimensions.X / (xDimensions + 1), -2 * panel.Dimensions.Y / 5 + y * panel.Dimensions.Y / yDimensions),
                                    panel.Dimensions.X / (2 * xDimensions + 1),
                                    panel.Dimensions.Y / (2 * yDimensions),
                                    panelName + "/" + key);
                                objectImage.InteractEvent += DisplayShopObjectInformation;
                                panel.LoadAndAddUIElement(objectImage);
                                objectImage.SetHoverInfoText(gameObjectData.Name);
                            }
                            else
                            {
                                ShieldData shieldData = ScreenManager.Content.Load<ShieldData>("XML/" + panelName + "/" + key);
                                Image objectImage = new Image(
                                    shieldData.TextureAsset,
                                    new Vector2(-2 * panel.Dimensions.X / 5 + x * panel.Dimensions.X / xDimensions, -2 * panel.Dimensions.Y / 5 + y * panel.Dimensions.Y / yDimensions),
                                    panel.Dimensions.X / (2 * xDimensions),
                                    panel.Dimensions.Y / (2 * yDimensions),
                                    new Color(shieldData.Colour),
                                    panelName + "/" + key);
                                objectImage.InteractEvent += DisplayShopObjectInformation;
                                panel.LoadAndAddUIElement(objectImage);
                                objectImage.SetHoverInfoText(shieldData.Name);
                            }
                        }
                    }
                }
            }

            if (createSwitchButton)
            {
                CreatePanelSwitchButton(panelName, buttonPosition);
            }

            AddScreenUIElement(panel);
        }
        private void CreateAndPopulateShipModPanel(string panelName, Vector2 buttonPosition)
        {
            Panel panel = new Panel(
                "Sprites/UI/Panels/MenuPanelBackground",
                new Vector2(ScreenManager.Viewport.Width / 3, 21 * ScreenManager.Viewport.Height / 40),
                new Vector2(3 * ScreenManager.Viewport.Width / 5, 17 * ScreenManager.Viewport.Height / 20),
                Color.White,
                panelName + " Panel",
                0);
            UpgradePanels.Add(panelName, panel);

            Button modTypeSwitchButton = new Button(
                "XML/UI/Buttons/MenuButton",
                new Vector2(-panel.Dimensions.X / 3, -panel.Dimensions.Y / 2),
                Button.defaultColour,
                Button.highlightedColour,
                "Ship Mods/Offensive",
                "Offensive");
            modTypeSwitchButton.InteractEvent += ChangePanelEvent;
            panel.LoadAndAddUIElement(modTypeSwitchButton, modTypeSwitchButton.Position);

            modTypeSwitchButton = new Button(
                "XML/UI/Buttons/MenuButton",
                new Vector2(0, -panel.Dimensions.Y / 2),
                Button.defaultColour,
                Button.highlightedColour,
                "Ship Mods/Defensive",
                "Defensive");
            modTypeSwitchButton.InteractEvent += ChangePanelEvent;
            panel.LoadAndAddUIElement(modTypeSwitchButton, modTypeSwitchButton.Position);
            AddScreenUIElement(modTypeSwitchButton);

            modTypeSwitchButton = new Button(
                "XML/UI/Buttons/MenuButton",
                new Vector2(panel.Dimensions.X / 3, -panel.Dimensions.Y / 2),
                Button.defaultColour,
                Button.highlightedColour,
                "Ship Mods/Utility",
                "Utility");
            modTypeSwitchButton.InteractEvent += ChangePanelEvent;
            panel.LoadAndAddUIElement(modTypeSwitchButton, modTypeSwitchButton.Position);
            AddScreenUIElement(modTypeSwitchButton);

            CreateAndPopulatePanel("Ship Mods/Defensive", buttonPosition, false);
            CreateAndPopulatePanel("Ship Mods/Offensive", buttonPosition, false);
            CreateAndPopulatePanel("Ship Mods/Utility", buttonPosition, false);

            CreatePanelSwitchButton(panelName, buttonPosition);
            AddScreenUIElement(panel);
        }
        private void SetUpUI()
        {
            Vector2 shipPanelButtonPosition = new Vector2(120, ScreenManager.Viewport.Height / 20);
            Vector2 buttonSpacing = new Vector2(ScreenManager.Viewport.Width / 8, 0);

            CreateAndPopulatePanel("Ships", shipPanelButtonPosition);
            CreateAndPopulatePanel("Weapons", shipPanelButtonPosition + buttonSpacing);
            CreateAndPopulatePanel("Engines", shipPanelButtonPosition + 2 * buttonSpacing);
            CreateAndPopulatePanel("Shields", shipPanelButtonPosition + 3 * buttonSpacing);
            CreateAndPopulatePanel("Sensors", shipPanelButtonPosition + 4 * buttonSpacing);
            CreateAndPopulateShipModPanel("Ship Mods", shipPanelButtonPosition + 5 * buttonSpacing);

            CurrentObjectInfoPanel = new Panel(
                "Sprites/UI/Panels/MenuPanelBackground",
                new Vector2(82 * ScreenManager.Viewport.Width / 100, ScreenManager.Viewport.Height / 3),
                new Vector2(7 * ScreenManager.Viewport.Width / 20, 2 * ScreenManager.Viewport.Height / 5),
                Color.White,
                "Current Object Info",
                0.5f);
            AddScreenUIElement(CurrentObjectInfoPanel);

            CurrentShipInfoPanel = new Panel(
                "Sprites/UI/Panels/MenuPanelBackground",
                new Vector2(82 * ScreenManager.Viewport.Width / 100, 3 * ScreenManager.Viewport.Height / 4),
                new Vector2(7 * ScreenManager.Viewport.Width / 20, 2 * ScreenManager.Viewport.Height / 5),
                Color.White,
                "Current Ship Info",
                0.5f);
            AddScreenUIElement(CurrentShipInfoPanel);

            Text money = new Text(
                ExtendedScreenManager.Session.Money.ToString(),
                shipPanelButtonPosition + 6 * buttonSpacing,
                Color.White,
                "Current Money");
            AddScreenUIElement(money);

            Image moneyImage = new Image(
                "Sprites/UI/Thumbnails/MoneyThumbnail",
                new Vector2(money.Position.X - money.TextOrigin.X - 20, money.Position.Y),
                new Vector2(1, 1),
                Color.Cyan,
                "Current Money Thumbnail");
            AddScreenUIElement(moneyImage);
            moneyImage.SetHoverInfoText("Current Money");

            CreateNextMissionButton();
            ActivatePanel("Ships");
            SetUpCurrentShipInformation();
            DisplayCurrentShipInformation();
        }