public override void LoadContent() { if (base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth <= 1366 || base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight <= 720) { this.LowRes = true; } Rectangle titleRect = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 203, (this.LowRes ? 10 : 44), 406, 80); Rectangle nameRect = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - (int)((float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth * 0.5f) / 2, titleRect.Y + titleRect.Height + 5, (int)((float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth * 0.5f), 150); Rectangle leftRect = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - (int)((float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth * 0.5f) / 2, nameRect.Y + nameRect.Height + 5, (int)((float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth * 0.5f), base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - (titleRect.Y + titleRect.Height) - (int)(0.28f * (float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight)); if (leftRect.Height > 580) { leftRect.Height = 580; } this.close = new CloseButton(new Rectangle(leftRect.X + leftRect.Width - 40, leftRect.Y + 20, 20, 20)); Rectangle ftlRect = new Rectangle(leftRect.X + 60, leftRect.Y + 100, 270, 50); this.FTLPenaltySlider = new FloatSlider(ftlRect, Localizer.Token(4007)); this.FTLPenaltySlider.SetAmount(GlobalStats.FTLInSystemModifier); this.FTLPenaltySlider.amount = GlobalStats.FTLInSystemModifier; Rectangle EftlRect = new Rectangle(leftRect.X + 60, leftRect.Y + 150, 270, 50); this.EnemyFTLPenaltySlider = new FloatSlider(EftlRect, Localizer.Token(6139)); this.EnemyFTLPenaltySlider.SetAmount(GlobalStats.EnemyFTLInSystemModifier); this.EnemyFTLPenaltySlider.amount = GlobalStats.EnemyFTLInSystemModifier; Ref<bool> acomRef = new Ref<bool>(() => GlobalStats.PlanetaryGravityWells, (bool x) => GlobalStats.PlanetaryGravityWells = x); Checkbox cb = new Checkbox(new Vector2((float)ftlRect.X, (float)(ftlRect.Y + 100)), Localizer.Token(4008), acomRef, Fonts.Arial12Bold); this.Checkboxes.Add(cb); cb.Tip_Token = 2288; //Added by McShooterz: new checkbox to prevent AI federations Ref<bool> pfRef = new Ref<bool>(() => GlobalStats.preventFederations, (bool x) => GlobalStats.preventFederations = x); Checkbox cb2 = new Checkbox(new Vector2((float)(ftlRect.X + 500), (float)(ftlRect.Y)), Localizer.Token(6022), pfRef, Fonts.Arial12Bold); this.Checkboxes.Add(cb2); cb2.Tip_Token = 7011; Ref<bool> FTLsRef = new Ref<bool>(() => GlobalStats.WarpInSystem, (bool x) => GlobalStats.WarpInSystem = x); Checkbox cb3 = new Checkbox(new Vector2((float)(ftlRect.X + 500), (float)(EftlRect.Y)), Localizer.Token(6178), FTLsRef, Fonts.Arial12Bold); this.Checkboxes.Add(cb3); Rectangle gwRect = new Rectangle(leftRect.X + 60, leftRect.Y + 220, 270, 50); this.GravityWellSize = new FloatSlider(gwRect, Localizer.Token(6002),0,20000,GlobalStats.GravityWellRange); //added by gremlin init extra planets slider Rectangle epRect = new Rectangle(leftRect.X + 60, leftRect.Y + 280, 270, 50); this.extraPlanets = new FloatSlider(epRect, "Extra Planets",0,6f,(float)GlobalStats.ExtraPlanets); Rectangle StartingPlanetRichness = new Rectangle(leftRect.X + 60, leftRect.Y + 340, 270, 50); this.StartingPlanetRichness = new FloatSlider(StartingPlanetRichness, "Starting Planet Richness Bonus", 0, 5f, GlobalStats.StartingPlanetRichness); Rectangle MinimumWarpRange = new Rectangle(leftRect.X *2 + 60, leftRect.Y + 340, 270, 50); this.MinimumWarpRange = new FloatSlider(MinimumWarpRange, "Minimum Warp Range", 0, 1200000f, GlobalStats.MinimumWarpRange); Rectangle MemoryLimiter = new Rectangle(leftRect.X + 60, leftRect.Y + 400, 270, 50); this.MemoryLimiter = new FloatSlider(MemoryLimiter, "Memory Limit", 150000, 300000f, GlobalStats.MemoryLimiter); Rectangle OptionIncreaseShipMaintenance = new Rectangle(leftRect.X *2 + 60, leftRect.Y + 400, 270, 50); this.OptionIncreaseShipMaintenance = new FloatSlider(OptionIncreaseShipMaintenance, "Increase Maintenance", 1, 10f, GlobalStats.OptionIncreaseShipMaintenance); //Added by McShooterz: slider to change time for turns Rectangle OptionTurnTimer = new Rectangle(leftRect.X * 2 + 60, leftRect.Y + 275, 270, 50); this.TurnTimer = new FloatSlider(OptionTurnTimer, "Change Turn Timer", 2f, 18f, GlobalStats.TurnTimer); this.MainMenu = new Menu2(base.ScreenManager, leftRect); }
private void LoadGraphics() { this.r = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - this.r.Width / 2, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - this.r.Height / 2, this.r.Width, this.r.Height); this.MainOptionsRect = new Rectangle(this.r.X + 20, this.r.Y + 175, 300, 375); this.SecondaryOptionsRect = new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width + 20, this.MainOptionsRect.Y, 210, 305); this.Resolution = new OptionsScreen.Option() { Name = string.Concat(Localizer.Token(9), ":"), NamePosition = new Vector2((float)(this.MainOptionsRect.X + 20), (float)this.MainOptionsRect.Y) }; string xResolution = base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth.ToString(); string yResolution = base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight.ToString(); string reso = string.Concat(xResolution, " x ", yResolution); this.Resolution.ClickableArea = new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width / 2 + 10, (int)this.Resolution.NamePosition.Y, (int)Fonts.Arial20Bold.MeasureString(reso).X, Fonts.Arial20Bold.LineSpacing); this.Resolution.Value = reso; this.Resolution.highlighted = false; this.FullScreen = new OptionsScreen.Option() { Name = string.Concat(Localizer.Token(10), ":"), NamePosition = new Vector2((float)(this.MainOptionsRect.X + 20), (float)(this.MainOptionsRect.Y + Fonts.Arial20Bold.LineSpacing * 2 + 2 + 20)), Value = Game1.Instance.CurrentMode.ToString(), ClickableArea = new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width / 2 + 10, (int)this.FullScreen.NamePosition.Y, (int)Fonts.Arial20Bold.MeasureString(this.FullScreen.Value.ToString()).X, Fonts.Arial20Bold.LineSpacing) }; Rectangle ftlRect = new Rectangle(this.MainOptionsRect.X + 20, (int)this.FullScreen.NamePosition.Y + 40, 270, 50); this.MusicVolumeSlider = new FloatSlider(ftlRect, "Music Volume"); this.MusicVolumeSlider.SetAmount(GlobalStats.Config.MusicVolume); this.MusicVolumeSlider.amount = GlobalStats.Config.MusicVolume; ftlRect = new Rectangle(this.MainOptionsRect.X + 20, (int)ftlRect.Y + 50, 270, 50); this.EffectsVolumeSlider = new FloatSlider(ftlRect, "Effects Volume"); this.EffectsVolumeSlider.SetAmount(GlobalStats.Config.EffectsVolume); this.EffectsVolumeSlider.amount = GlobalStats.Config.EffectsVolume; Vector2 Cursor = new Vector2((float)(this.SecondaryOptionsRect.X + 10), (float)(this.SecondaryOptionsRect.Y + 10)); this.ResolutionDropDown = new DropOptions(new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width / 2 + 10, (int)this.Resolution.NamePosition.Y + 3, 105, 18)); foreach (DisplayMode mode in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes) { if (mode.Width < 1280) { continue; } OptionsScreen.Option reso1 = new OptionsScreen.Option(); //{ reso1.x = mode.Width; reso1.y = mode.Height; reso1.Name = string.Concat(reso1.x.ToString(), " x ", reso1.y.ToString()); reso1.NamePosition = Cursor; reso1.ClickableArea = new Rectangle((int)reso1.NamePosition.X, (int)reso1.NamePosition.Y, (int)Fonts.Arial12Bold.MeasureString(reso1.Name).X, Fonts.Arial12Bold.LineSpacing); //}; bool oktoadd = true; foreach (OptionsScreen.Option opt in this.ResolutionOptions) { if (opt.x != reso1.x || opt.y != reso1.y) { continue; } oktoadd = false; } if (!oktoadd) { continue; } this.ResolutionDropDown.AddOption(reso1.Name, reso1); this.ResolutionOptions.Add(reso1); Cursor.Y = Cursor.Y + (float)Fonts.Arial12Bold.LineSpacing; } foreach (OptionsScreen.Option resolut in this.ResolutionOptions) { if (base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth != resolut.x || base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight != resolut.y) { continue; } foreach (Entry e in this.ResolutionDropDown.Options) { if ((e.ReferencedObject as OptionsScreen.Option).Name != resolut.Name) { continue; } this.ResolutionDropDown.ActiveIndex = this.ResolutionDropDown.Options.IndexOf(e); } } Cursor = new Vector2((float)this.SecondaryOptionsRect.X, (float)(this.SecondaryOptionsRect.Y + this.SecondaryOptionsRect.Height + 15)); this.Apply.Rect = new Rectangle((int)Cursor.X, (int)Cursor.Y, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Width, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height); }
private void CancelChanges(object sender, EventArgs e1) { Game1.Instance.graphics.PreferredBackBufferWidth = this.startingx; Game1.Instance.graphics.PreferredBackBufferHeight = this.startingy; Game1.Instance.graphics.SynchronizeWithVerticalRetrace = false; Game1.Instance.SetWindowMode(this.StartingMode, this.startingx, this.startingy); this.ModeToSet = this.StartingMode; base.Setup(); if (this.FromGame) { this.uScreen.LoadGraphics(); this.gpmmscreen.LoadGraphics(); this.LoadGraphics(); } else { this.mmscreen.Buttons.Clear(); this.mmscreen.LoadContent(); } this.MainOptionsRect = new Rectangle(this.r.X + 20, this.r.Y + 175, 300, 375); this.SecondaryOptionsRect = new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width, this.MainOptionsRect.Y, 210, 305); this.GamespeedCap = new Checkbox(new Vector2((float)(this.MainOptionsRect.X + 20), (float)(this.MainOptionsRect.Y + 300)), Localizer.Token(2206), new Ref<bool>(() => GlobalStats.LimitSpeed, (bool x) => GlobalStats.LimitSpeed = x), Fonts.Arial12Bold) { Tip_Token = 2205 }; this.Resolution = new OptionsScreen.Option() { Name = string.Concat(Localizer.Token(9), ": "), NamePosition = new Vector2((float)(this.MainOptionsRect.X + 20), (float)(this.MainOptionsRect.Y + 20)) }; string xResolution = base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth.ToString(); string yResolution = base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight.ToString(); this.xtoApply = base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth; this.ytoApply = base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight; string reso = string.Concat(xResolution, " x ", yResolution); this.Resolution.ClickableArea = new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width / 2 + 10, (int)this.Resolution.NamePosition.Y, (int)Fonts.Arial20Bold.MeasureString(reso).X, Fonts.Arial20Bold.LineSpacing); this.Resolution.Value = reso; this.Resolution.highlighted = false; this.FullScreen = new OptionsScreen.Option() { Name = string.Concat(Localizer.Token(10), ": "), NamePosition = new Vector2((float)(this.MainOptionsRect.X + 20), (float)(this.MainOptionsRect.Y + Fonts.Arial20Bold.LineSpacing * 2 + 2 + 20)), Value = Game1.Instance.CurrentMode, ClickableArea = new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width / 2 + 10, (int)this.FullScreen.NamePosition.Y, (int)Fonts.Arial20Bold.MeasureString(this.FullScreen.Value.ToString()).X, Fonts.Arial20Bold.LineSpacing) }; Rectangle ftlRect = new Rectangle(this.MainOptionsRect.X + 20, (int)this.FullScreen.NamePosition.Y + 40, 270, 50); this.MusicVolumeSlider = new FloatSlider(ftlRect, "Music Volume"); this.MusicVolumeSlider.SetAmount(GlobalStats.Config.MusicVolume); this.MusicVolumeSlider.amount = GlobalStats.Config.MusicVolume; ftlRect = new Rectangle(this.MainOptionsRect.X + 20, (int)ftlRect.Y + 50, 270, 50); this.EffectsVolumeSlider = new FloatSlider(ftlRect, "Effects Volume"); this.EffectsVolumeSlider.SetAmount(GlobalStats.Config.EffectsVolume); this.EffectsVolumeSlider.amount = GlobalStats.Config.EffectsVolume; Vector2 Cursor = new Vector2((float)(this.SecondaryOptionsRect.X + 10), (float)(this.SecondaryOptionsRect.Y + 10)); this.ResolutionOptions.Clear(); this.ResolutionDropDown = new DropOptions(new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width / 2 + 10, (int)this.Resolution.NamePosition.Y + 3, 105, 18)); foreach (DisplayMode mode in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes) { if (mode.Width < 1280) { continue; } OptionsScreen.Option reso1 = new OptionsScreen.Option(); //{ reso1.x = mode.Width; reso1.y = mode.Height; reso1.Name = string.Concat(reso1.x.ToString(), " x ", reso1.y.ToString()); reso1.NamePosition = Cursor; reso1.ClickableArea = new Rectangle((int)reso1.NamePosition.X, (int)reso1.NamePosition.Y, (int)Fonts.Arial12Bold.MeasureString(reso1.Name).X, Fonts.Arial12Bold.LineSpacing); //}; bool oktoadd = true; foreach (OptionsScreen.Option opt in this.ResolutionOptions) { if (opt.x != reso1.x || opt.y != reso1.y) { continue; } oktoadd = false; } if (!oktoadd) { continue; } this.ResolutionDropDown.AddOption(reso1.Name, reso1); this.ResolutionOptions.Add(reso1); Cursor.Y = Cursor.Y + (float)Fonts.Arial12Bold.LineSpacing; } foreach (OptionsScreen.Option resolut in this.ResolutionOptions) { if (base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth != resolut.x || base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight != resolut.y) { continue; } foreach (Entry e in this.ResolutionDropDown.Options) { if ((e.ReferencedObject as OptionsScreen.Option).Name != resolut.Name) { continue; } this.ResolutionDropDown.ActiveIndex = this.ResolutionDropDown.Options.IndexOf(e); } } Cursor = new Vector2((float)this.SecondaryOptionsRect.X, (float)(this.SecondaryOptionsRect.Y + this.SecondaryOptionsRect.Height + 15)); this.Apply.Rect = new Rectangle((int)Cursor.X, (int)Cursor.Y, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Width, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height); this.Apply.NormalTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"]; this.Apply.HoverTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_hover"]; this.Apply.PressedTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_pressed"]; this.Apply.Text = Localizer.Token(13); }
private void ApplySettings() { try { this.startingx = base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth; this.startingy = base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight; Game1.Instance.graphics.SynchronizeWithVerticalRetrace = false; Game1.Instance.SetWindowMode(this.ModeToSet, (this.ResolutionDropDown.Active.ReferencedObject as OptionsScreen.Option).x, (this.ResolutionDropDown.Active.ReferencedObject as OptionsScreen.Option).y); base.Setup(); if (this.FromGame) { this.uScreen.LoadGraphics(); this.uScreen.NotificationManager.ReSize(); this.gpmmscreen.LoadGraphics(); this.LoadGraphics(); } else { this.mmscreen.Buttons.Clear(); this.mmscreen.LoadContent(); } this.MainOptionsRect = new Rectangle(this.r.X + 20, this.r.Y + 175, 300, 375); this.SecondaryOptionsRect = new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width + 20, this.MainOptionsRect.Y, 210, 305); /*this.GamespeedCap = new Checkbox(new Vector2((float)(this.MainOptionsRect.X + 20), (float)(this.MainOptionsRect.Y + 300)), Localizer.Token(2206), new Ref<bool>(() => GlobalStats.LimitSpeed, (bool x) => GlobalStats.LimitSpeed = x), Fonts.Arial12Bold) { Tip_Token = 2205 }; this.pauseOnNotification = new Checkbox(new Vector2((float)(this.MainOptionsRect.X + 20), (float)(this.MainOptionsRect.Y + 360)), Localizer.Token(6007), new Ref<bool>(() => GlobalStats.PauseOnNotification, (bool x) => GlobalStats.PauseOnNotification = x), Fonts.Arial12Bold) { Tip_Token = 7004 }; this.Resolution = new OptionsScreen.Option() { Name = "Resolution: ", NamePosition = new Vector2((float)(this.MainOptionsRect.X + 20), (float)this.MainOptionsRect.Y) }; string xResolution = base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth.ToString(); string yResolution = base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight.ToString(); this.xtoApply = base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth; this.ytoApply = base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight; string reso = string.Concat(xResolution, " x ", yResolution); this.Resolution.ClickableArea = new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width / 2 + 10, (int)this.Resolution.NamePosition.Y, (int)Fonts.Arial20Bold.MeasureString(reso).X, Fonts.Arial20Bold.LineSpacing); this.Resolution.Value = reso; this.Resolution.highlighted = false; this.FullScreen = new OptionsScreen.Option() { Name = "Screen Mode: ", NamePosition = new Vector2((float)(this.MainOptionsRect.X + 20), (float)(this.MainOptionsRect.Y + Fonts.Arial20Bold.LineSpacing * 2 + 2 + 20)), Value = Game1.Instance.CurrentMode, ClickableArea = new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width / 2 + 10, (int)this.FullScreen.NamePosition.Y, (int)Fonts.Arial20Bold.MeasureString(this.FullScreen.Value.ToString()).X, Fonts.Arial20Bold.LineSpacing) }; */ Rectangle ftlRect = new Rectangle(this.MainOptionsRect.X + 9, (int)this.FullScreen.NamePosition.Y + 65, 270, 50); this.MusicVolumeSlider = new FloatSlider(ftlRect, "Music Volume"); this.MusicVolumeSlider.SetAmount(GlobalStats.Config.MusicVolume); this.MusicVolumeSlider.amount = GlobalStats.Config.MusicVolume; ftlRect = new Rectangle(this.MainOptionsRect.X + 9, (int)ftlRect.Y + 50, 270, 50); this.EffectsVolumeSlider = new FloatSlider(ftlRect, "Effects Volume"); this.EffectsVolumeSlider.SetAmount(GlobalStats.Config.EffectsVolume); this.EffectsVolumeSlider.amount = GlobalStats.Config.EffectsVolume; //ftlRect = new Rectangle(this.MainOptionsRect.X + 20, (int)this.FullScreen.NamePosition.Y + 200, 270, 50); //this.IconSize = new FloatSlider(ftlRect, "Icon Sizes",0,20,GlobalStats.IconSize); //this.IconSize.SetAmount(GlobalStats.IconSize); //this.IconSize.amount = GlobalStats.IconSize; Vector2 Cursor = new Vector2((float)(this.SecondaryOptionsRect.X + 10), (float)(this.SecondaryOptionsRect.Y + 10)); this.ResolutionOptions.Clear(); //this.ResolutionDropDown = new DropOptions(new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width / 2 + 10, (int)this.Resolution.NamePosition.Y + 3, 105, 18)); this.ResolutionDropDown = new DropOptions(new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width / 2 + 10, (int)this.Resolution.NamePosition.Y - 2, 105, 18)); foreach (DisplayMode mode in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes) { if (mode.Width < 1280) { continue; } OptionsScreen.Option reso1 = new OptionsScreen.Option(); //{ //business as usual reso1.x = mode.Width; reso1.y = mode.Height; reso1.Name = string.Concat(reso1.x.ToString(), " x ", reso1.y.ToString()); reso1.NamePosition = Cursor; reso1.ClickableArea = new Rectangle((int)reso1.NamePosition.X, (int)reso1.NamePosition.Y, (int)Fonts.Arial12Bold.MeasureString(reso1.Name).X, Fonts.Arial12Bold.LineSpacing); //}; bool oktoadd = true; foreach (OptionsScreen.Option opt in this.ResolutionOptions) { if (opt.x != reso1.x || opt.y != reso1.y) { continue; } oktoadd = false; } if (!oktoadd) { continue; } this.ResolutionDropDown.AddOption(reso1.Name, reso1); this.ResolutionOptions.Add(reso1); Cursor.Y = Cursor.Y + (float)Fonts.Arial12Bold.LineSpacing; } foreach (OptionsScreen.Option resolut in this.ResolutionOptions) { if (base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth != resolut.x || base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight != resolut.y) { continue; } foreach (Entry e in this.ResolutionDropDown.Options) { if ((e.ReferencedObject as OptionsScreen.Option).Name != resolut.Name) { continue; } this.ResolutionDropDown.ActiveIndex = this.ResolutionDropDown.Options.IndexOf(e); } } Cursor = new Vector2((float)this.SecondaryOptionsRect.X, (float)(this.SecondaryOptionsRect.Y + this.SecondaryOptionsRect.Height + 60)); this.Apply.Rect = new Rectangle((int)Cursor.X, (int)Cursor.Y, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Width, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height); this.Apply.NormalTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"]; this.Apply.HoverTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_hover"]; this.Apply.PressedTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_pressed"]; this.Apply.Text = Localizer.Token(13); if (this.StartingMode != Game1.Instance.CurrentMode || this.startingx != this.xtoApply || this.startingy != this.ytoApply) { MessageBoxScreen messageBox = new MessageBoxScreen(Localizer.Token(14), 10f); messageBox.Accepted += new EventHandler<EventArgs>(this.AcceptChanges); messageBox.Cancelled += new EventHandler<EventArgs>(this.CancelChanges); base.ScreenManager.AddScreen(messageBox); } else { this.AcceptChanges(this, EventArgs.Empty); } System.Configuration.ConfigurationManager.AppSettings.Set("IconSize",GlobalStats.IconSize.ToString()); System.Configuration.ConfigurationManager.AppSettings.Set("PauseOnNotification", GlobalStats.PauseOnNotification.ToString()); System.Configuration.ConfigurationManager.AppSettings.Set("MemoryLimiter", GlobalStats.MemoryLimiter.ToString()); System.Configuration.ConfigurationManager.AppSettings.Set("shipcountlimit", GlobalStats.ShipCountLimit.ToString()); } catch { this.CancelChanges(this, EventArgs.Empty); } }
public override void LoadContent() { base.LoadContent(); this.MainOptionsRect = new Rectangle(this.r.X + 20, this.r.Y + 175, 300, 375); this.Resolution = new OptionsScreen.Option(); this.Resolution.Name = Localizer.Token(9) + ":"; this.Resolution.NamePosition = new Vector2((float)(this.MainOptionsRect.X + 20), (float)this.MainOptionsRect.Y); this.GamespeedCap = new Checkbox(new Vector2((float)(this.MainOptionsRect.X + this.MainOptionsRect.Width + 5), (float)(this.Resolution.NamePosition.Y)), Localizer.Token(2206), new Ref<bool>((Func<bool>)(() => GlobalStats.LimitSpeed), (Action<bool>)(x => GlobalStats.LimitSpeed = x)), Fonts.Arial12Bold); this.GamespeedCap.Tip_Token = 2205; this.ForceFullSim = new Checkbox(new Vector2((float)(this.MainOptionsRect.X + this.MainOptionsRect.Width + 5), (float)(this.Resolution.NamePosition.Y + 30)), "Force Full Simulation", new Ref<bool>((Func<bool>)(() => GlobalStats.ForceFullSim), (Action<bool>)(x => GlobalStats.ForceFullSim = x)), Fonts.Arial12Bold); this.ForceFullSim.Tip_Token = 2205; this.pauseOnNotification = new Checkbox(new Vector2((float)(this.MainOptionsRect.X + this.MainOptionsRect.Width + 5), (float)(this.Resolution.NamePosition.Y + 60)), Localizer.Token(6007), new Ref<bool>((Func<bool>)(() => GlobalStats.PauseOnNotification), (Action<bool>)(x => GlobalStats.PauseOnNotification = x)), Fonts.Arial12Bold); this.pauseOnNotification.Tip_Token = 7004; this.KeyboardArc = new Checkbox(new Vector2((float)(this.MainOptionsRect.X + this.MainOptionsRect.Width + 5), (float)(this.Resolution.NamePosition.Y + 90)), Localizer.Token(6184), new Ref<bool>((Func<bool>)(() => GlobalStats.AltArcControl), (Action<bool>)(x => GlobalStats.AltArcControl = x)), Fonts.Arial12Bold); this.KeyboardArc.Tip_Token = 7081; this.SecondaryOptionsRect = new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width + 20, this.MainOptionsRect.Y, 210, 305); string str1 = this.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth.ToString(); string str2 = this.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight.ToString(); this.startingx = this.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth; this.startingy = this.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight; this.startingfullscreen = Game1.Instance.graphics.IsFullScreen; this.xtoApply = this.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth; this.ytoApply = this.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight; string text = str1 + " x " + str2; this.Resolution.ClickableArea = new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width / 2 + 10, (int)this.Resolution.NamePosition.Y, (int)Fonts.Arial20Bold.MeasureString(text).X, Fonts.Arial20Bold.LineSpacing); this.Resolution.Value = (object)text; this.Resolution.highlighted = false; this.FullScreen = new OptionsScreen.Option(); this.FullScreen.Name = Localizer.Token(10) + ":"; this.FullScreen.NamePosition = new Vector2((float)(this.MainOptionsRect.X + 20), (float)(this.MainOptionsRect.Y + Fonts.Arial20Bold.LineSpacing * 2 + 2 + 17)); this.FullScreen.Value = (object)((object)Game1.Instance.CurrentMode).ToString(); this.FullScreen.ClickableArea = new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width / 2 + 10, (int)this.FullScreen.NamePosition.Y, (int)Fonts.Arial20Bold.MeasureString(this.FullScreen.Value.ToString()).X, Fonts.Arial20Bold.LineSpacing); Rectangle r = new Rectangle(this.MainOptionsRect.X + 9, (int)this.FullScreen.NamePosition.Y + 65, 270, 50); this.MusicVolumeSlider = new FloatSlider(r, "Music Volume"); this.MusicVolumeSlider.SetAmount(GlobalStats.Config.MusicVolume); this.MusicVolumeSlider.amount = GlobalStats.Config.MusicVolume; r = new Rectangle(this.MainOptionsRect.X + 9, (int)r.Y + 50, 270, 50); this.EffectsVolumeSlider = new FloatSlider(r, "Effects Volume"); this.EffectsVolumeSlider.SetAmount(GlobalStats.Config.EffectsVolume); this.EffectsVolumeSlider.amount = GlobalStats.Config.EffectsVolume; r = new Rectangle(this.MainOptionsRect.X + 9, (int)this.FullScreen.NamePosition.Y + 185, 225, 50); this.IconSize = new FloatSlider(r, "Icon Sizes", 0, 30, GlobalStats.IconSize); r = new Rectangle(this.MainOptionsRect.X + 9, (int)this.FullScreen.NamePosition.Y + 235, 225, 50); this.memoryLimit = new FloatSlider(r, string.Concat("Memory limit. KBs In Use: ",(int)(GC.GetTotalMemory(true)/1000f)), 150000, 300000, GlobalStats.MemoryLimiter); int ships =0; if (Empire.universeScreen != null ) ships= Empire.universeScreen.globalshipCount; r = new Rectangle(this.MainOptionsRect.X - 9 + this.MainOptionsRect.Width, (int)this.FullScreen.NamePosition.Y + 235, 225, 50); this.ShipLimiter = new FloatSlider(r, string.Concat("All AI Ship Limit. AI Ships: ", ships), 500, 3500, GlobalStats.ShipCountLimit); r = new Rectangle(this.MainOptionsRect.X - 9 + this.MainOptionsRect.Width, (int)this.FullScreen.NamePosition.Y + 185, 225, 50); this.FreighterLimiter = new FloatSlider(r, string.Concat("Per AI Freighter Limit."), 25, 125, GlobalStats.freighterlimit); Vector2 vector2 = new Vector2((float)(this.SecondaryOptionsRect.X + 10), (float)(this.SecondaryOptionsRect.Y + 10)); this.ResolutionDropDown = new DropOptions(new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width / 2 + 10, (int)this.Resolution.NamePosition.Y - 2, 105, 18)); foreach (DisplayMode displayMode in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes) { if (displayMode.Width >= 1280) { OptionsScreen.Option option1 = new OptionsScreen.Option(); option1.x = displayMode.Width; option1.y = displayMode.Height; option1.Name = option1.x.ToString() + " x " + option1.y.ToString(); option1.NamePosition = vector2; option1.ClickableArea = new Rectangle((int)option1.NamePosition.X, (int)option1.NamePosition.Y, (int)Fonts.Arial12Bold.MeasureString(option1.Name).X, Fonts.Arial12Bold.LineSpacing); bool flag = true; foreach (OptionsScreen.Option option2 in this.ResolutionOptions) { if (option2.x == option1.x && option2.y == option1.y) flag = false; } if (flag) { this.ResolutionDropDown.AddOption(option1.Name, (object)option1); this.ResolutionOptions.Add(option1); vector2.Y += (float)Fonts.Arial12Bold.LineSpacing; } } } int qualityLevels = 0; //this.AntiAliasingDD = new DropOptions(new Rectangle(this.MainOptionsRect.X + this.MainOptionsRect.Width / 2 + 10, (int)this.Resolution.NamePosition.Y + 26, 105, 18)); //if (GraphicsAdapter.DefaultAdapter.CheckDeviceMultiSampleType(DeviceType.Hardware, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, false, MultiSampleType.EightSamples, out qualityLevels)) // this.AntiAliasingDD.AddOption("8x AA", 8); //if (GraphicsAdapter.DefaultAdapter.CheckDeviceMultiSampleType(DeviceType.Hardware, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, false, MultiSampleType.EightSamples, out qualityLevels)) // this.AntiAliasingDD.AddOption("4x AA", 4); //if (GraphicsAdapter.DefaultAdapter.CheckDeviceMultiSampleType(DeviceType.Hardware, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, false, MultiSampleType.EightSamples, out qualityLevels)) // this.AntiAliasingDD.AddOption("2x AA", 2); //this.AntiAliasingDD.AddOption("No AA", 0); //this.AntiAliasingDD.ActiveIndex = 0; //switch (GlobalStats.Config.AASamples) //{ // case 0: // this.AntiAliasingDD.ActiveIndex = 3; // break; // case 2: // this.AntiAliasingDD.ActiveIndex = 2; // break; // case 4: // this.AntiAliasingDD.ActiveIndex = 1; // break; // case 8: // this.AntiAliasingDD.ActiveIndex = 0; // break; //} foreach (OptionsScreen.Option option in this.ResolutionOptions) { if (this.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth == option.x && this.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight == option.y) { foreach (Entry entry in this.ResolutionDropDown.Options) { if ((entry.ReferencedObject as OptionsScreen.Option).Name == option.Name) this.ResolutionDropDown.ActiveIndex = this.ResolutionDropDown.Options.IndexOf(entry); } } } vector2 = new Vector2((float)this.SecondaryOptionsRect.X, (float)(this.SecondaryOptionsRect.Y + this.SecondaryOptionsRect.Height + 60)); this.Apply = new UIButton(); this.Apply.Rect = new Rectangle((int)vector2.X, (int)vector2.Y, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Width, ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"].Height); this.Apply.NormalTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px"]; this.Apply.HoverTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_hover"]; this.Apply.PressedTexture = ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_168px_pressed"]; this.Apply.Text = Localizer.Token(13); this.Apply.Launches = "Apply Settings"; this.Buttons.Add(this.Apply); }
public override void LoadContent() { this.close = new CloseButton(new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 38, 97, 20, 20)); LightRig rig = base.ScreenManager.Content.Load<LightRig>("example/ShipyardLightrig"); lock (GlobalStats.ObjectManagerLocker) { base.ScreenManager.inter.LightManager.Clear(); base.ScreenManager.inter.LightManager.Submit(rig); } this.starfield = new Starfield(Vector2.Zero, base.ScreenManager.GraphicsDevice, base.ScreenManager.Content); this.starfield.LoadContent(); Rectangle titleRect = new Rectangle(2, 44, 250, 80); this.TitleBar = new Menu2(base.ScreenManager, titleRect); this.TitlePos = new Vector2((float)(titleRect.X + titleRect.Width / 2) - Fonts.Laserian14.MeasureString("Fleet Hotkeys").X / 2f, (float)(titleRect.Y + titleRect.Height / 2 - Fonts.Laserian14.LineSpacing / 2)); Rectangle leftRect = new Rectangle(2, titleRect.Y + titleRect.Height + 5, titleRect.Width, 500); this.LeftMenu = new Menu1(base.ScreenManager, leftRect, true); this.FleetSL = new ScrollList(this.LeftMenu.subMenu, 40); int i = 0; foreach (KeyValuePair<int, Ship_Game.Gameplay.Fleet> Fleet in EmpireManager.GetEmpireByName(this.EmpireUI.screen.PlayerLoyalty).GetFleetsDict()) { this.FleetsRects.Add(Fleet.Key, new Rectangle(leftRect.X + 2, leftRect.Y + i * 53, 52, 48)); i++; } Rectangle shipRect = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 282, 140, 280, 80); this.ShipDesigns = new Menu2(base.ScreenManager, shipRect); this.ShipDesignsTitlePos = new Vector2((float)(shipRect.X + shipRect.Width / 2) - Fonts.Laserian14.MeasureString("Ship Designs").X / 2f, (float)(shipRect.Y + shipRect.Height / 2 - Fonts.Laserian14.LineSpacing / 2)); Rectangle shipDesignsRect = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - shipRect.Width - 2, shipRect.Y + shipRect.Height + 5, shipRect.Width, 500); this.RightMenu = new Menu1(base.ScreenManager, shipDesignsRect); this.sub_ships = new Submenu(base.ScreenManager, shipDesignsRect); this.ShipSL = new ScrollList(this.sub_ships, 40); this.sub_ships.AddTab("Designs"); this.sub_ships.AddTab("Owned"); foreach (Ship ship in EmpireManager.GetEmpireByName(this.EmpireUI.screen.PlayerLoyalty).GetShips()) { if (ship.fleet != null || !ship.Active) { continue; } this.AvailableShips.Add(ship); } this.PopulateShipSL(); this.SelectedStuffRect = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 220, -13 + base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - 200, 440, 210); Vector2 OrdersBarPos = new Vector2((float)(this.SelectedStuffRect.X + 20), (float)(this.SelectedStuffRect.Y + 65)); 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") { Action = "attack", HasToolTip = true, WhichToolTip = 1 }; OrdersBarPos.X = OrdersBarPos.X + 29f; 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") { Action = "arty", HasToolTip = true, WhichToolTip = 2 }; OrdersBarPos.X = OrdersBarPos.X + 29f; 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") { Action = "hold", HasToolTip = true, WhichToolTip = 65 }; OrdersBarPos.X = OrdersBarPos.X + 29f; 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") { Action = "orbit_left", HasToolTip = true, WhichToolTip = 3 }; OrdersBarPos.Y = OrdersBarPos.Y + 29f; 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") { Action = "broadside_left", HasToolTip = true, WhichToolTip = 159 }; OrdersBarPos.Y = OrdersBarPos.Y - 29f; OrdersBarPos.X = OrdersBarPos.X + 29f; 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") { Action = "orbit_right", HasToolTip = true, WhichToolTip = 4 }; OrdersBarPos.Y = OrdersBarPos.Y + 29f; 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") { Action = "broadside_right", HasToolTip = true, WhichToolTip = 160 }; OrdersBarPos.Y = OrdersBarPos.Y - 29f; OrdersBarPos.X = OrdersBarPos.X + 29f; 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") { Action = "evade", HasToolTip = true, WhichToolTip = 6 }; this.OrdersButtons.Add(Artillery); this.OrdersButtons.Add(HoldPos); this.OrdersButtons.Add(OrbitLeft); this.OrdersButtons.Add(BroadsideLeft); this.OrdersButtons.Add(OrbitRight); this.OrdersButtons.Add(BroadsideRight); this.OrdersButtons.Add(Evade); this.OrdersButtons.Add(AttackRuns); this.RequisitionForces = new BlueButton(new Vector2((float)(this.SelectedStuffRect.X + 240), (float)(this.SelectedStuffRect.Y + Fonts.Arial20Bold.LineSpacing + 20)), "Requisition..."); this.SaveDesign = new BlueButton(new Vector2((float)(this.SelectedStuffRect.X + 240), (float)(this.SelectedStuffRect.Y + Fonts.Arial20Bold.LineSpacing + 20 + 50)), "Save Design..."); this.LoadDesign = new BlueButton(new Vector2((float)(this.SelectedStuffRect.X + 240), (float)(this.SelectedStuffRect.Y + Fonts.Arial20Bold.LineSpacing + 20 + 100)), "Load Design..."); this.RequisitionForces.ToggleOn = true; this.SaveDesign.ToggleOn = true; this.LoadDesign.ToggleOn = true; this.OperationsRect = new Rectangle(this.SelectedStuffRect.X + this.SelectedStuffRect.Width + 2, this.SelectedStuffRect.Y + 30, 360, this.SelectedStuffRect.Height - 30); Rectangle AssistRect = new Rectangle(this.OperationsRect.X + 15, this.OperationsRect.Y + Fonts.Arial12Bold.LineSpacing + 20, 150, 40); this.Slider_Assist = new WeightSlider(AssistRect, "Assist Nearby Weight") { Tip_ID = 7 }; Rectangle DefenderRect = new Rectangle(this.OperationsRect.X + 15, this.OperationsRect.Y + Fonts.Arial12Bold.LineSpacing + 70, 150, 40); this.Slider_Defend = new WeightSlider(DefenderRect, "Defend Nearby Weight") { Tip_ID = 8 }; Rectangle VultureRect = new Rectangle(this.OperationsRect.X + 15, this.OperationsRect.Y + Fonts.Arial12Bold.LineSpacing + 120, 150, 40); this.Slider_Vulture = new WeightSlider(VultureRect, "Target Damaged Weight") { Tip_ID = 9 }; Rectangle ArmoredRect = new Rectangle(this.OperationsRect.X + 15 + 180, this.OperationsRect.Y + Fonts.Arial12Bold.LineSpacing + 20, 150, 40); this.Slider_Armor = new WeightSlider(ArmoredRect, "Target Armored Weight") { Tip_ID = 10 }; Rectangle ShieldedRect = new Rectangle(this.OperationsRect.X + 15 + 180, this.OperationsRect.Y + Fonts.Arial12Bold.LineSpacing + 70, 150, 40); this.Slider_Shield = new WeightSlider(ShieldedRect, "Target Shielded Weight") { Tip_ID = 11 }; Rectangle DPSRect = new Rectangle(this.OperationsRect.X + 15 + 180, this.OperationsRect.Y + Fonts.Arial12Bold.LineSpacing + 120, 150, 40); this.Slider_DPS = new WeightSlider(DPSRect, "Target DPS Weight") { Tip_ID = 12 }; this.PrioritiesRect = new Rectangle(this.SelectedStuffRect.X - this.OperationsRect.Width - 2, this.OperationsRect.Y, this.OperationsRect.Width, this.OperationsRect.Height); Rectangle oprect = new Rectangle(this.PrioritiesRect.X + 15, this.PrioritiesRect.Y + Fonts.Arial12Bold.LineSpacing + 20, 300, 40); this.OperationalRadius = new FloatSlider(oprect, "Operational Radius"); this.OperationalRadius.SetAmount(0.2f); this.OperationalRadius.Tip_ID = 13; Rectangle sizerect = new Rectangle(this.PrioritiesRect.X + 15, this.PrioritiesRect.Y + Fonts.Arial12Bold.LineSpacing + 70, 300, 40); this.Slider_Size = new SizeSlider(sizerect, "Target Size Preference"); this.Slider_Size.SetAmount(0.5f); this.Slider_Size.Tip_ID = 14; this.starfield = new Starfield(Vector2.Zero, base.ScreenManager.GraphicsDevice, base.ScreenManager.Content); this.starfield.LoadContent(); this.bg = new Background(); float width = (float)base.ScreenManager.GraphicsDevice.Viewport.Width; Viewport viewport = base.ScreenManager.GraphicsDevice.Viewport; float aspectRatio = width / (float)viewport.Height; this.projection = Matrix.CreatePerspectiveFieldOfView(0.7853982f, aspectRatio, 100f, 15000f); foreach (Ship ship in this.fleet.Ships) { ship.GetSO().World = Matrix.CreateTranslation(new Vector3(ship.RelativeFleetOffset, 0f)); } base.LoadContent(); }