public override void LoadContent()
        {
            this.Window = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 350, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - 300, 700, 600);
            this.SaveMenu = new Menu1(base.ScreenManager, this.Window);
            Rectangle sub = new Rectangle(this.Window.X + 20, this.Window.Y + 20, this.Window.Width - 40, 80);
            this.NameSave = new Submenu(base.ScreenManager, sub);
            this.NameSave.AddTab("Load Saved Game...");
            Vector2 Cursor = new Vector2((float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 84), (float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - 100));
            this.TitlePosition = new Vector2((float)(sub.X + 20), (float)(sub.Y + 45));
            Rectangle scrollList = new Rectangle(sub.X, sub.Y + 90, sub.Width, this.Window.Height - sub.Height - 50);
            this.AllSaves = new Submenu(base.ScreenManager, scrollList);
            this.AllSaves.AddTab("Saved Fleets");
            this.SavesSL = new ScrollList(this.AllSaves);
            FileInfo[] filesFromDirectory;

            if (GlobalStats.ActiveMod != null && Directory.Exists(string.Concat(Ship_Game.ResourceManager.WhichModPath, "/FleetDesigns")))
            {
                filesFromDirectory = HelperFunctions.GetFilesFromDirectory(string.Concat(Ship_Game.ResourceManager.WhichModPath, "/FleetDesigns"));
            }
            else
            {
                filesFromDirectory = HelperFunctions.GetFilesFromDirectory("Content/FleetDesigns");
            }

            for (int i = 0; i < (int)filesFromDirectory.Length; i++)
            {
                FileInfo FI = filesFromDirectory[i];
                bool OK = true;
                XmlSerializer serializer1 = new XmlSerializer(typeof(FleetDesign));
                foreach (FleetDataNode node in ((FleetDesign)serializer1.Deserialize(FI.OpenRead())).Data)
                {
                    if (EmpireManager.GetEmpireByName(this.parentScreen.EmpireUI.screen.PlayerLoyalty).WeCanBuildThis(node.ShipName))
                    {
                        continue;
                    }
                    OK = false;
                    break;
                }
                if (OK)
                {
                    this.SavesSL.AddItem(FI);
                }
            }

            string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            FileInfo[] fileInfoArray = HelperFunctions.GetFilesFromDirectory(string.Concat(path, "/StarDrive/Fleet Designs"));
            for (int j = 0; j < (int)fileInfoArray.Length; j++)
            {
                FileInfo FI = fileInfoArray[j];
                bool OK = true;
                XmlSerializer serializer1 = new XmlSerializer(typeof(FleetDesign));
                foreach (FleetDataNode node in ((FleetDesign)serializer1.Deserialize(FI.OpenRead())).Data)
                {
                    if (EmpireManager.GetEmpireByName(this.parentScreen.EmpireUI.screen.PlayerLoyalty).WeCanBuildThis(node.ShipName))
                    {
                        continue;
                    }
                    OK = false;
                    break;
                }
                if (OK)
                {
                    this.SavesSL.AddItem(FI);
                }
            }
            this.EnternamePos = this.TitlePosition;
            this.EnterNameArea = new UITextEntry();

                this.EnterNameArea.Text = "";
                this.EnterNameArea.ClickableArea = new Rectangle((int)this.EnternamePos.X, (int)this.EnternamePos.Y - 2, (int)Fonts.Arial20Bold.MeasureString(this.EnterNameArea.Text).X + 20, Fonts.Arial20Bold.LineSpacing);

            this.Save = new UIButton()
            {
                Rect = new Rectangle(sub.X + sub.Width - 88, this.EnterNameArea.ClickableArea.Y - 2, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"].Width, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"].Height),
                NormalTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"],
                HoverTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px_hover"],
                PressedTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px_pressed"],
                Text = "Load"
            };
            this.Buttons.Add(this.Save);
            Cursor.Y = Cursor.Y + (float)(ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"].Height + 15);
            base.LoadContent();
            base.LoadContent();
        }
 public override void LoadContent()
 {
     this.Window = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 280, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - 300, 560, 600);
     this.SaveMenu = new Menu1(base.ScreenManager, this.Window);
     this.close = new CloseButton(new Rectangle(this.Window.X + this.Window.Width - 35, this.Window.Y + 10, 20, 20));
     Rectangle sub = new Rectangle(this.Window.X + 20, this.Window.Y + 20, this.Window.Width - 40, 80);
     this.NameSave = new Submenu(base.ScreenManager, sub);
     this.NameSave.AddTab(Localizer.Token(6));
     Vector2 Cursor = new Vector2((float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 84), (float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - 100));
     this.TitlePosition = new Vector2((float)(sub.X + 20), (float)(sub.Y + 45));
     Rectangle scrollList = new Rectangle(sub.X, sub.Y + 90, sub.Width, this.Window.Height - sub.Height - 50);
     this.AllSaves = new Submenu(base.ScreenManager, scrollList);
     this.AllSaves.AddTab(Localizer.Token(7));
     this.SavesSL = new ScrollList(this.AllSaves, 55);
     string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
     List<HeaderData> saves = new List<HeaderData>();
     FileInfo[] filesFromDirectory = HelperFunctions.GetFilesFromDirectory(string.Concat(path, "/StarDrive/Saved Games/Headers"));
     for (int i = 0; i < (int)filesFromDirectory.Length; i++)
     {
         Stream file = filesFromDirectory[i].OpenRead();
         try
         {
             HeaderData data = (HeaderData)ResourceManager.HeaderSerializer.Deserialize(file);
             data.SetFileInfo(new FileInfo(string.Concat(path, "/StarDrive/Saved Games/", data.SaveName, ".xml.gz")));
             if (GlobalStats.ActiveMod != null)
             {
                 if (data.ModName != GlobalStats.ActiveMod.ModPath)
                 {
                     //file.Close();
                     file.Dispose();
                     continue;
                 }
             }
             else if (!string.IsNullOrEmpty(data.ModName))
             {
                 //file.Close();
                 file.Dispose();
                 continue;
             }
             saves.Add(data);
             //file.Close();
             file.Dispose();
         }
         catch
         {
             //file.Close();
             file.Dispose();
         }
     //Label0:
       //  continue;
     }
     IOrderedEnumerable<HeaderData> sortedList =
         from header in saves
         orderby header.Time descending
         select header;
     foreach (HeaderData data in sortedList)
     {
         this.SavesSL.AddItem(data);
     }
     this.SavesSL.indexAtTop = 0;
     this.EnternamePos = this.TitlePosition;
     this.EnterNameArea = new UITextEntry();
     //{
         this.EnterNameArea.Text = "";
         this.EnterNameArea.ClickableArea = new Rectangle((int)this.EnternamePos.X, (int)this.EnternamePos.Y - 2, (int)Fonts.Arial20Bold.MeasureString(this.EnterNameArea.Text).X + 20, Fonts.Arial20Bold.LineSpacing);
     //};
     this.Save = new UIButton()
     {
         Rect = new Rectangle(sub.X + sub.Width - 88, this.EnterNameArea.ClickableArea.Y - 2, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"].Width, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"].Height),
         NormalTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"],
         HoverTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px_hover"],
         PressedTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px_pressed"],
         Text = Localizer.Token(8),
         Launches = "Load"
     };
     this.Buttons.Add(this.Save);
     Cursor.Y = Cursor.Y + (float)(ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"].Height + 15);
     base.LoadContent();
     base.LoadContent();
 }
        public ShipInfoUIElement(Rectangle r, Ship_Game.ScreenManager sm, UniverseScreen screen)
        {
            this.screen = screen;
            this.ScreenManager = sm;
            this.ElementRect = r;
            this.FlagRect = new Rectangle(r.X + 150, r.Y + 50, 40, 40);
            this.sel = new Selector(this.ScreenManager, r, Color.Black);
            base.TransitionOnTime = TimeSpan.FromSeconds(0.25);
            base.TransitionOffTime = TimeSpan.FromSeconds(0.25);
            this.SliderRect = new Rectangle(r.X - 100, r.Y + r.Height - 140, 530, 130);
            this.sliding_element = new SlidingElement(this.SliderRect);
            this.Housing = r;
            this.LeftRect = new Rectangle(r.X, r.Y + 44, 180, r.Height - 44);
            this.RightRect = new Rectangle(this.LeftRect.X + this.LeftRect.Width, this.LeftRect.Y, 220, this.LeftRect.Height);
            this.ShipNameArea = new UITextEntry()
            {
                ClickableArea = new Rectangle(this.Housing.X + 41, this.Housing.Y + 65, 200, Fonts.Arial20Bold.LineSpacing)
            };
            int spacing = 2;
            this.Power = new Rectangle(this.Housing.X + 187, this.Housing.Y + 110, 20, 20);
            Rectangle pbarrect = new Rectangle(this.Power.X + this.Power.Width + 15, this.Power.Y, 150, 18);
            this.pBar = new ProgressBar(pbarrect)
            {
                color = "green"
            };
            ShipInfoUIElement.TippedItem ti = new ShipInfoUIElement.TippedItem()
            {
                r = this.Power,
                TIP_ID = 27
            };
            this.ToolTipItems.Add(ti);
            this.Shields = new Rectangle(this.Housing.X + 187, this.Housing.Y + 110 + 20 + spacing, 20, 20);
            Rectangle pshieldsrect = new Rectangle(this.Shields.X + this.Shields.Width + 15, this.Shields.Y, 150, 18);
            this.sBar = new ProgressBar(pshieldsrect)
            {
                color = "blue"
            };
            ti = new ShipInfoUIElement.TippedItem()
            {
                r = this.Shields,
                TIP_ID = 28
            };
            this.ToolTipItems.Add(ti);
            this.Ordnance = new Rectangle(this.Housing.X + 187, this.Housing.Y + 110 + 20 + spacing + 20 + spacing, 20, 20);
            Rectangle pordrect = new Rectangle(this.Ordnance.X + this.Ordnance.Width + 15, this.Ordnance.Y, 150, 18);
            this.oBar = new ProgressBar(pordrect);
            ti = new ShipInfoUIElement.TippedItem()
            {
                r = this.Ordnance,
                TIP_ID = 29
            };
            this.ToolTipItems.Add(ti);
            this.DefenseRect = new Rectangle(this.Housing.X + 13, this.Housing.Y + 112, 22, 22);
            ti = new ShipInfoUIElement.TippedItem()
            {
                r = this.DefenseRect,
                TIP_ID = 30
            };
            this.ToolTipItems.Add(ti);
            this.TroopRect = new Rectangle(this.Housing.X + 13, this.Housing.Y + 137, 22, 22);
            ti = new ShipInfoUIElement.TippedItem()
            {
                r = this.TroopRect,
                TIP_ID = 37
            };
            this.ToolTipItems.Add(ti);
            this.ShipInfoRect = new Rectangle(this.Housing.X + 60, this.Housing.Y + 110, 115, 115);
            Rectangle gridRect = new Rectangle(this.Housing.X + 16, this.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - 45, 34, 24);
            this.gridbutton = new ToggleButton(gridRect, "SelectionBox/button_grid_active", "SelectionBox/button_grid_inactive", "SelectionBox/button_grid_hover", "SelectionBox/button_grid_pressed", "SelectionBox/icon_grid")
            {
                Active = true
            };
            Vector2 OrdersBarPos = new Vector2((float)(this.Power.X + 15), (float)(this.Ordnance.Y + this.Ordnance.Height + spacing + 3));
            OrdersBarPos.X = pordrect.X;
            ToggleButton AttackRuns = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_headon");
            this.CombatStatusButtons.Add(AttackRuns);
            AttackRuns.Action = "attack";
            AttackRuns.HasToolTip = true;
            AttackRuns.WhichToolTip = 1;
            OrdersBarPos.X = OrdersBarPos.X + 25f;
            ToggleButton Artillery = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_aft");
            this.CombatStatusButtons.Add(Artillery);
            Artillery.Action = "arty";
            Artillery.HasToolTip = true;
            Artillery.WhichToolTip = 2;
            OrdersBarPos.X = OrdersBarPos.X + 25f;
            ToggleButton HoldPos = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_x");
            this.CombatStatusButtons.Add(HoldPos);
            HoldPos.Action = "hold";
            HoldPos.HasToolTip = true;
            HoldPos.WhichToolTip = 65;
            OrdersBarPos.X = OrdersBarPos.X + 25f;
            ToggleButton OrbitLeft = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_left");
            this.CombatStatusButtons.Add(OrbitLeft);
            OrbitLeft.Action = "orbit_left";
            OrbitLeft.HasToolTip = true;
            OrbitLeft.WhichToolTip = 3;
            OrdersBarPos.Y = OrdersBarPos.Y + 25f;

            ToggleButton BroadsideLeft = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_bleft");
            this.CombatStatusButtons.Add(BroadsideLeft);
            BroadsideLeft.Action = "broadside_left";
            BroadsideLeft.HasToolTip = true;
            BroadsideLeft.WhichToolTip = 159;
            OrdersBarPos.Y = OrdersBarPos.Y - 25f;
            OrdersBarPos.X = OrdersBarPos.X + 25f;

            ToggleButton OrbitRight = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_right");
            this.CombatStatusButtons.Add(OrbitRight);
            OrbitRight.Action = "orbit_right";
            OrbitRight.HasToolTip = true;
            OrbitRight.WhichToolTip = 4;
            OrdersBarPos.Y = OrdersBarPos.Y + 25f;

            ToggleButton BroadsideRight = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_bright");
            this.CombatStatusButtons.Add(BroadsideRight);
            BroadsideRight.Action = "broadside_right";
            BroadsideRight.HasToolTip = true;
            BroadsideRight.WhichToolTip = 160;
            OrdersBarPos.Y = OrdersBarPos.Y - 25f;
            OrdersBarPos.X = OrdersBarPos.X + 25f;

            ToggleButton Evade = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_stop");
            this.CombatStatusButtons.Add(Evade);
            Evade.Action = "evade";
            Evade.HasToolTip = true;
            Evade.WhichToolTip = 6;
        }
 public override void LoadContent()
 {
     base.ScreenManager.inter.ObjectManager.Clear();
     PrimitiveQuad.graphicsDevice = base.ScreenManager.GraphicsDevice;
     this.aspect = new Vector2((float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth, (float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight);
     this.border = new PrimitiveQuad(this.aspect.X / 2f - 512f, this.aspect.Y / 2f - 512f, 1024f, 1024f);
     this.what = this.border.enclosingRect;
     ToggleButton Internal = new ToggleButton(new Rectangle(this.what.X - 32, this.what.Y + 5, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "I");
     this.DesignStateButtons.Add(Internal);
     Internal.Action = "I";
     ToggleButton InternalO = new ToggleButton(new Rectangle(this.what.X - 32, this.what.Y + 5 + 29, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "IO");
     this.DesignStateButtons.Add(InternalO);
     InternalO.Action = "IO";
     ToggleButton External = new ToggleButton(new Rectangle(this.what.X - 32, this.what.Y + 5 + 58, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "O");
     this.DesignStateButtons.Add(External);
     External.Action = "O";
     ToggleButton Engines = new ToggleButton(new Rectangle(this.what.X - 32, this.what.Y + 5 + 87, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "E");
     this.DesignStateButtons.Add(Engines);
     Engines.Action = "E";
     this.ModuleSlotTexture = base.ScreenManager.Content.Load<Texture2D>("Textures/Ships/singlebox");
     this.LoadModelButton = new DanButton(new Vector2(20f, (float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - 50)), "Load Model");
     this.SaveHullButton = new DanButton(new Vector2((float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 200), (float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - 50)), "Save Hull");
     this.ShipNameBox = new UITextEntry()
     {
         ClickableArea = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 200, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - 115, 180, 20),
         Text = this.HullName
     };
     LightRig rig = base.ScreenManager.Content.Load<LightRig>("example/ShipyardLightrig");
     base.ScreenManager.inter.LightManager.Clear();
     base.ScreenManager.inter.LightManager.Submit(rig);
     base.ScreenManager.environment = base.ScreenManager.Content.Load<SceneEnvironment>("example/scene_environment");
     float width = (float)base.ScreenManager.GraphicsDevice.Viewport.Width;
     Viewport viewport = base.ScreenManager.GraphicsDevice.Viewport;
     float aspectRatio = width / (float)viewport.Height;
     Vector3 camPos = this.cameraPosition * new Vector3(-1f, 1f, 1f);
     this.view = ((Matrix.CreateTranslation(0f, 0f, 0f) * Matrix.CreateRotationY(MathHelper.ToRadians(180f))) * Matrix.CreateRotationX(MathHelper.ToRadians(0f))) * Matrix.CreateLookAt(camPos, new Vector3(camPos.X, camPos.Y, 0f), new Vector3(0f, -1f, 0f));
     this.projection = Matrix.CreatePerspectiveFieldOfView(0.7853982f, aspectRatio, 1f, 10000f);
     this.moduleSlot = base.ScreenManager.Content.Load<Texture2D>("Textures/Ships/singlebox");
     this.DottedLine = base.ScreenManager.Content.Load<Texture2D>("Textures/UI/DottedLine");
     this.Center = new Vector2((float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2), (float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2));
     this.ConfigureSlots();
     this.ThrusterEffect = base.ScreenManager.Content.Load<Effect>("Effects/Thrust");
     this.thruster = new Thruster();
     this.ScreenRect = new Rectangle(0, 0, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight);
     this.thruster.load_and_assign_effects(base.ScreenManager.Content, "Effects/ThrustCylinderB", "Effects/NoiseVolume", this.ThrusterEffect);
     base.LoadContent();
 }
        public override void LoadContent()
        {
            this.Window = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 425, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - 300, 850, 600);
            this.SaveMenu = new Menu1(base.ScreenManager, this.Window);
            Rectangle sub = new Rectangle(this.Window.X + 20, this.Window.Y + 20, this.Window.Width - 40, 80);
            this.NameSave = new Submenu(base.ScreenManager, sub);
            this.NameSave.AddTab(Localizer.Token(4013));
            Vector2 Cursor = new Vector2((float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 84), (float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - 100));
            this.TitlePosition = new Vector2((float)(sub.X + 20), (float)(sub.Y + 45));
            Rectangle scrollList = new Rectangle(sub.X, sub.Y + 90, sub.Width, this.Window.Height - sub.Height - 50);
            this.AllSaves = new Submenu(base.ScreenManager, scrollList);
            this.AllSaves.AddTab(Localizer.Token(4013));
            this.ModsSL = new ScrollList(this.AllSaves, 140);
            FileInfo[] filesFromDirectoryNoSub = ResourceManager.GetFilesFromDirectoryNoSub("Mods");
            for (int i = 0; i < (int)filesFromDirectoryNoSub.Length; i++)
            {
                FileInfo FI = filesFromDirectoryNoSub[i];
                Stream file = FI.OpenRead();
                ModInformation data;
                if(FI.Name.Contains(".txt"))
                    continue;
                try
                {

                    data = (ModInformation)ResourceManager.ModSerializer.Deserialize(file);
                }
                catch (Exception ex)
                {
                    ex.Data.Add("Load Error in file", FI.Name);

                    throw;
                }
                //file.Close();
                file.Dispose();
                ModEntry me = new ModEntry(base.ScreenManager, data, Path.GetFileNameWithoutExtension(FI.Name));
                this.ModsSL.AddItem(me);
            }
            this.EnternamePos = this.TitlePosition;
            this.EnterNameArea = new UITextEntry();
            //{
                this.EnterNameArea.Text = "";
                this.EnterNameArea.ClickableArea = new Rectangle((int)this.EnternamePos.X, (int)this.EnternamePos.Y - 2, (int)Fonts.Arial20Bold.MeasureString(this.EnterNameArea.Text).X + 20, Fonts.Arial20Bold.LineSpacing);
            //};
            this.Save = new UIButton()
            {
                Rect = new Rectangle(sub.X + sub.Width - 88, this.EnterNameArea.ClickableArea.Y - 2, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"].Width, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"].Height),
                NormalTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"],
                HoverTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px_hover"],
                PressedTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px_pressed"],
                Text = Localizer.Token(8),
                Launches = "Load"
            };
            this.Buttons.Add(this.Save);
            Cursor.Y = Cursor.Y + (float)(ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"].Height + 15);

            this.Visit = new UIButton()
            {
                Rect = new Rectangle(this.Window.X + 3, this.Window.Y + this.Window.Height + 20, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Width, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height),
                NormalTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"],
                HoverTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_hover"],
                PressedTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_pressed"],
                Text = Localizer.Token(4015),
                Launches = "Visit"
            };
            this.Buttons.Add(this.Visit);

            this.shiptool = new UIButton()
            {
                Rect = new Rectangle(this.Window.X + 200, this.Window.Y + this.Window.Height + 20, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Width, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height),
                NormalTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"],
                HoverTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_hover"],
                PressedTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_pressed"],

                Text = Localizer.Token(4044),

                Launches = "shiptool"
            };
            this.Buttons.Add(this.shiptool);
            this.Disable = new UIButton()
            {
                Rect = new Rectangle(this.Window.X + this.Window.Width - 172, this.Window.Y + this.Window.Height + 20, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Width, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height),
                NormalTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"],
                HoverTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_hover"],
                PressedTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_pressed"],
                Text = Localizer.Token(4016),
                Launches = "Disable"
            };
            this.Buttons.Add(this.Disable);
            base.LoadContent();
        }
        public override void LoadContent()
        {
            this.Window = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 350, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - 300, 700, 600);
            this.SaveMenu = new Menu1(base.ScreenManager, this.Window);
            Rectangle sub = new Rectangle(this.Window.X + 20, this.Window.Y + 20, this.Window.Width - 40, 80);
            this.NameSave = new Submenu(base.ScreenManager, sub);
            this.NameSave.AddTab("Save Fleet As...");
            Vector2 Cursor = new Vector2((float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 84), (float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - 100));
            this.TitlePosition = new Vector2((float)(sub.X + 20), (float)(sub.Y + 45));
            Rectangle scrollList = new Rectangle(sub.X, sub.Y + 90, sub.Width, this.Window.Height - sub.Height - 50);
            this.AllSaves = new Submenu(base.ScreenManager, scrollList);
            this.AllSaves.AddTab("All Fleet Designs");
            this.SavesSL = new ScrollList(this.AllSaves);
            string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            FileInfo[] filesFromDirectory = HelperFunctions.GetFilesFromDirectory(string.Concat(path, "/StarDrive/Fleet Designs"));
            for (int i = 0; i < (int)filesFromDirectory.Length; i++)
            {
                FileInfo FI = filesFromDirectory[i];
                this.SavesSL.AddItem(FI);
            }
            FileInfo[] fileInfoArray = HelperFunctions.GetFilesFromDirectory("Content/FleetDesigns");
            for (int j = 0; j < (int)fileInfoArray.Length; j++)
            {
                FileInfo FI = fileInfoArray[j];
                this.SavesSL.AddItem(FI);
            }
            this.EnternamePos = this.TitlePosition;
            this.EnterNameArea = new UITextEntry();

                this.EnterNameArea.Text = this.f.Name;
                this.EnterNameArea.ClickableArea = new Rectangle((int)this.EnternamePos.X, (int)this.EnternamePos.Y - 2, (int)Fonts.Arial20Bold.MeasureString(this.EnterNameArea.Text).X + 20, Fonts.Arial20Bold.LineSpacing);

            this.Save = new UIButton()
            {
                Rect = new Rectangle(sub.X + sub.Width - 88, this.EnterNameArea.ClickableArea.Y - 2, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"].Width, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"].Height),
                NormalTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"],
                HoverTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px_hover"],
                PressedTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px_pressed"],
                Text = "Save"
            };
            this.Buttons.Add(this.Save);
            Cursor.Y = Cursor.Y + (float)(ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"].Height + 15);
            base.LoadContent();
            base.LoadContent();
        }