コード例 #1
0
        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();
        }
コード例 #2
0
        public override void LoadContent()
        {
            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            //if (ConfigurationManager.AppSettings["ActiveMod"] != "")
            if (!string.IsNullOrEmpty(config.AppSettings.Settings["ActiveMod"].Value))
            {

                //if (!File.Exists(string.Concat("Mods/", ConfigurationManager.AppSettings["ActiveMod"], ".xml")))
                if (!File.Exists(string.Concat("Mods/", config.AppSettings.Settings["ActiveMod"].Value, ".xml")))
                {
                    //Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
                    config.AppSettings.Settings["ActiveMod"].Value = "";
                    config.Save();
                    Ship_Game.ResourceManager.WhichModPath = "Content";
                    Ship_Game.ResourceManager.Reset();
                    Ship_Game.ResourceManager.Initialize(base.ScreenManager.Content);
                }
                else
                {
                    //Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
                    FileInfo FI = new FileInfo(string.Concat("Mods/", config.AppSettings.Settings["ActiveMod"].Value, ".xml"));
                    Stream file = FI.OpenRead();
                    ModInformation data = (ModInformation)Ship_Game.ResourceManager.ModSerializer.Deserialize(file);
                    //file.Close();
                    file.Dispose();
                    ModEntry me = new ModEntry(base.ScreenManager, data, Path.GetFileNameWithoutExtension(FI.Name));
                    GlobalStats.ActiveMod = me;
                    GlobalStats.ActiveModInfo = me.mi;
                    Ship_Game.ResourceManager.LoadMods(string.Concat("Mods/", config.AppSettings.Settings["ActiveMod"].Value));
                }
            }
            base.ScreenManager.musicCategory.SetVolume(GlobalStats.Config.MusicVolume);
            base.ScreenManager.racialMusic.SetVolume(GlobalStats.Config.MusicVolume);
            base.ScreenManager.combatMusic.SetVolume(GlobalStats.Config.MusicVolume);
            base.ScreenManager.weaponsCategory.SetVolume(GlobalStats.Config.EffectsVolume);
            base.ScreenManager.defaultCategory.SetVolume(GlobalStats.Config.EffectsVolume *.5f);
            if(GlobalStats.Config.EffectsVolume ==0 && GlobalStats.Config.MusicVolume == 0)
                base.ScreenManager.GlobalCategory.SetVolume(0);
            else
                base.ScreenManager.GlobalCategory.SetVolume(1);

            string basepath = "Stardrive Main Logo 2_";
            for (int i = 0; i < 81; i++)
            {
                string remainder = i.ToString(this.fmt);
                Texture2D logo = base.ScreenManager.Content.Load<Texture2D>(string.Concat("MainMenu/Stardrive logo/", basepath, remainder));
                this.LogoAnimation.Add(logo);
            }
            if (base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight <= 1080)
            {
                this.StarField = base.ScreenManager.Content.Load<Texture2D>("MainMenu/nebula_stars_bg");
                this.StarFieldRect = new Rectangle(0, 0, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight);
            }
            else
            {
                this.StarFieldRect = new Rectangle(0, 0, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight);
                this.StarField = base.ScreenManager.Content.Load<Texture2D>("MainMenu/HR_nebula_stars_bg");
            }
            Vector2 Cursor = new Vector2((float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 200), (float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - 100));
            this.PlayGame = new UIButton()
            {
                Rect = new Rectangle((int)Cursor.X, (int)Cursor.Y, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Width, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height),
                NormalTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"],
                HoverTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_hover"],
                PressedTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_pressed"],
                Text = Localizer.Token(1)
            };
            this.Buttons.Add(this.PlayGame);
            this.PlayGame.Launches = "New Campaign";
            Cursor.Y = Cursor.Y + (float)(Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height + 15);
            this.Adventure = new UIButton()
            {
                Rect = new Rectangle((int)Cursor.X, (int)Cursor.Y, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Width, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height),
                NormalTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"],
                HoverTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_hover"],
                PressedTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_pressed"],
                Text = "Battle Mode"
            };
            Cursor.Y = Cursor.Y + (float)(Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height + 15);
            this.Tutorials = new UIButton()
            {
                Rect = new Rectangle((int)Cursor.X, (int)Cursor.Y, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Width, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height),
                NormalTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"],
                HoverTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_hover"],
                PressedTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_pressed"],
                Text = Localizer.Token(3),
                Launches = "Tutorials"
            };
            this.Buttons.Add(this.Tutorials);
            Cursor.Y = Cursor.Y + (float)(Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height + 15);
            this.Load = new UIButton()
            {
                Rect = new Rectangle((int)Cursor.X, (int)Cursor.Y, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Width, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height),
                NormalTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"],
                HoverTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_hover"],
                PressedTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_pressed"],
                Text = Localizer.Token(2),
                Launches = "Load Game"
            };
            this.Buttons.Add(this.Load);
            Cursor.Y = Cursor.Y + (float)(Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height + 15);
            this.Options = new UIButton()
            {
                Rect = new Rectangle((int)Cursor.X, (int)Cursor.Y, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Width, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height),
                NormalTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"],
                HoverTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_hover"],
                PressedTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_pressed"],
                Text = Localizer.Token(4),
                Launches = "Options"
            };
            this.Buttons.Add(this.Options);
            Cursor.Y = Cursor.Y + (float)(Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height + 15);
            this.Mods = new UIButton()
            {
                Rect = new Rectangle((int)Cursor.X, (int)Cursor.Y, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Width, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height),
                NormalTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"],
                HoverTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_hover"],
                PressedTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_pressed"],
                Text = "Mods",
                Launches = "Mods"
            };
            this.Buttons.Add(this.Mods);
            Cursor.Y = Cursor.Y + (float)(Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height + 15);
            this.Exit = new UIButton()
            {
                Rect = new Rectangle((int)Cursor.X, (int)Cursor.Y, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Width, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height),
                NormalTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"],
                HoverTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_hover"],
                PressedTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_pressed"],
                Text = Localizer.Token(5),
                Launches = "Exit"
            };
            this.Buttons.Add(this.Exit);
            Cursor.Y = Cursor.Y + (float)(Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height + 15);
            base.ScreenManager.inter.ObjectManager.Clear();
            base.ScreenManager.inter.LightManager.Clear();
            this.shieldModel = base.ScreenManager.Content.Load<Model>("Model/Projectiles/shield");
            this.shieldTex = base.ScreenManager.Content.Load<Texture2D>("Model/Projectiles/shield_d");
            this.shieldAlpha = base.ScreenManager.Content.Load<Texture2D>("Model/Projectiles/shieldgradient");
            this.ShieldEffect = base.ScreenManager.Content.Load<Effect>("Effects/scale");
            Beam.BeamEffect = base.ScreenManager.Content.Load<Effect>("Effects/BeamFX");
            ShieldManager.shieldModel = this.shieldModel;
            ShieldManager.shieldTexture = this.shieldTex;
            ShieldManager.gradientTexture = this.shieldAlpha;
            ShieldManager.ShieldEffect = this.ShieldEffect;
            this.Portrait = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 960, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - 540, 1920, 1080);
            while (this.Portrait.Width < base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth && this.Portrait.Height < base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight)
            {
                this.Portrait.Width = this.Portrait.Width + 12;
                this.Portrait.X = base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - this.Portrait.Width / 2;
                this.Portrait.Height = this.Portrait.Height + 7;
                this.Portrait.Y = base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - this.Portrait.Height / 2;
            }
            if (GlobalStats.ActiveMod != null && !string.IsNullOrEmpty(GlobalStats.ActiveMod.MainMenuMusic))
            {
                this.PlayMp3(string.Concat("Mods/", GlobalStats.ActiveMod.ModPath, "/", GlobalStats.ActiveMod.MainMenuMusic));
            }
            else if (base.ScreenManager.Music == null || base.ScreenManager.Music != null && base.ScreenManager.Music.IsStopped)
            {
                base.ScreenManager.musicCategory.SetVolume(GlobalStats.Config.MusicVolume);
                base.ScreenManager.Music = AudioManager.GetCue("SD_Theme_Reprise_06");
                base.ScreenManager.Music.Play();
            }
            //this.whichPlanet = 1;
            //Added by McShooterz: Random Main menu planet
            Random rd = new Random();
            int planetIndex = rd.Next(1,30);
            Model planetModel = base.ScreenManager.Content.Load<Model>(string.Concat("Model/SpaceObjects/planet_", planetIndex));
            ModelMesh mesh = planetModel.Meshes[0];
            this.planetSO = new SceneObject(mesh)
            {
                ObjectType = ObjectType.Dynamic,
                World = (((((Matrix.Identity * Matrix.CreateScale(25f)) * Matrix.CreateRotationZ(1.57079637f - this.Zrotate)) * Matrix.CreateRotationX(MathHelper.ToRadians(20f))) * Matrix.CreateRotationY(MathHelper.ToRadians(65f))) * Matrix.CreateRotationZ(1.57079637f)) * Matrix.CreateTranslation(this.ShipPosition.X - 30000f, this.ShipPosition.Y - 500f, 80000f)
            };
            base.ScreenManager.inter.ObjectManager.Submit(this.planetSO);
            //Added by McShooterz: random ship in main menu
            this.ShipPosition = new Vector2((float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 1200), (float)(this.LogoRect.Y + 400 - base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2));
            // FrostHand: do we actually need to show Model/Ships/speeder/ship07 in base version? Or could show random ship for base and modded version?
            if (GlobalStats.ActiveMod != null && ResourceManager.MainMenuShipList.ModelPaths.Count > 0)
            {
                int shipIndex = rd.Next(0, ResourceManager.MainMenuShipList.ModelPaths.Count);
                this.shipSO = new SceneObject(((ReadOnlyCollection<ModelMesh>)Ship_Game.ResourceManager.GetModel(ResourceManager.MainMenuShipList.ModelPaths[shipIndex]).Meshes)[0]);
                this.shipSO.ObjectType = ObjectType.Dynamic;
                this.shipSO.World = this.worldMatrix;
                this.shipSO.Visibility = ObjectVisibility.Rendered;
                base.ScreenManager.inter.ObjectManager.Submit(this.shipSO);
            }
            else
            {
                this.shipSO = new SceneObject(((ReadOnlyCollection<ModelMesh>)Ship_Game.ResourceManager.GetModel("Model/Ships/speeder/ship07").Meshes)[0]);
                this.shipSO.ObjectType = ObjectType.Dynamic;
                this.shipSO.World = this.worldMatrix;
                this.shipSO.Visibility = ObjectVisibility.Rendered;
                base.ScreenManager.inter.ObjectManager.Submit(this.shipSO);
            }
            LightRig rig = base.ScreenManager.Content.Load<LightRig>("example/MM_light_rig");
            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 height = width / (float)viewport.Height;
            Vector3 camPos = new Vector3(0f, 0f, 1500f) * 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.CreateOrthographic((float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth, (float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight, 1f, 80000f);
            base.LoadContent();
            this.LogoRect = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 600, 128, 512, 128);
            this.MoonPosition = new Vector2((float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 300), (float)(this.LogoRect.Y + 70 - base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2));
            this.planetSO.World = (((((Matrix.Identity * Matrix.CreateScale(this.scale)) * Matrix.CreateRotationZ(1.57079637f - this.Zrotate)) * Matrix.CreateRotationX(MathHelper.ToRadians(20f))) * Matrix.CreateRotationY(MathHelper.ToRadians(65f))) * Matrix.CreateRotationZ(1.57079637f)) * Matrix.CreateTranslation(new Vector3(this.MoonPosition, this.zshift));
        }
コード例 #3
0
        public override void HandleInput(InputState input)
        {
            this.selector = null;
            if (this.CurrentButton==null &&( input.Escaped || input.RightMouseClick))
            {
                this.ExitScreen();
            }
            foreach (UIButton b in this.Buttons)
            {
                if (CurrentButton != null && b.Launches != "Visit")
                    continue;
                if (!HelperFunctions.CheckIntersection(b.Rect, input.CursorPosition) )
                {

                    b.State = UIButton.PressState.Normal;
                }
                else
                {
                    b.State = UIButton.PressState.Hover;
                    if (input.InGameSelect)
                    {
                        b.State = UIButton.PressState.Pressed;
                    }
                    if (!input.InGameSelect)
                    {
                        continue;
                    }
                    string launches = b.Launches;
                    string str = launches;
                    if (launches == null)
                    {
                        continue;
                    }
                    if (str == "Load")
                    {
                        if (this.ActiveEntry == null)
                        {
                            continue;
                        }

                        this.CurrentButton = b;
                        b.Text = "Loading";
                        if (GlobalStats.ActiveMod != null)
                        {
                            ResourceManager.Reset();
                            ResourceManager.Initialize(base.ScreenManager.Content);
                        }

                        this.modLoad = Task.Factory.StartNew(loadModTask);

                    }
                    else if (str == "Visit")
                    {
                        if (string.IsNullOrEmpty(this.ActiveEntry.mi.URL))
                            Process.Start("http://www.stardrivegame.com/forum/viewtopic.php?f=6&t=696");
                        else
                            Process.Start(this.ActiveEntry.mi.URL);
                    }
                    else if (str == "shiptool" && this.CurrentButton == null)
                    {
                        base.ScreenManager.AddScreen(new ShipToolScreen());
                    }
                    else if (str == "Disable" && this.CurrentButton==null)
                    {
                        GlobalStats.ActiveMod = null;
                        ResourceManager.WhichModPath = "Content";
                        GlobalStats.ActiveMod = null;
                        GlobalStats.ActiveModInfo = null;
                        ResourceManager.Reset();
                        ResourceManager.Initialize(base.ScreenManager.Content);
                        ResourceManager.LoadEmpires();
                        Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
                        config.AppSettings.Settings["ActiveMod"].Value = "";
                        config.Save();
                        this.ExitScreen();
                        this.mmscreen.ResetMusic();
                    }
                }
            }
            if (this.CurrentButton != null)
            {
                if (this.flip)
                {

                    if (CurrentButton.PressColor.A > 253)
                        this.flip = false;
                    else
                        CurrentButton.PressColor.A++;
                }
                else
                {
                    if (CurrentButton.PressColor.A < 1)
                        this.flip = true;
                    else
                        CurrentButton.PressColor.A--;
                }
                if (CurrentButton.State != UIButton.PressState.Pressed)
                    CurrentButton.State = UIButton.PressState.Pressed;
                return;
            }
            this.ModsSL.HandleInput(input);
            foreach (ScrollList.Entry e in this.ModsSL.Entries)
            {
                if (!HelperFunctions.CheckIntersection(e.clickRect, input.CursorPosition))
                {
                    e.clickRectHover = 0;
                }
                else
                {
                    if (e.clickRectHover == 0)
                    {
                        AudioManager.PlayCue("sd_ui_mouseover");
                    }
                    e.clickRectHover = 1;
                    this.selector = new Selector(base.ScreenManager, e.clickRect);
                    if (!input.InGameSelect)
                    {
                        continue;
                    }
                    AudioManager.PlayCue("sd_ui_accept_alt3");
                    this.EnterNameArea.Text = (e.item as ModEntry).mi.ModName;
                    this.ActiveEntry = e.item as ModEntry;
                    foreach(UIButton button in this.Buttons)
                    {
                        if (button.Launches =="Visit")
                        {
                            string Text;
                            if (this.ActiveEntry == null || string.IsNullOrEmpty(this.ActiveEntry.mi.URL))
                                Text = Localizer.Token(4015);
                            else
                                Text = "Goto Mod URL";
                            button.Text = Text;
                            break;
                        }
                    }
                }
            }
            base.HandleInput(input);
        }