public override void LoadContent() { float screenWidth = (float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth; float screenHeight = (float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight; Rectangle titleRect = new Rectangle((int)screenWidth / 2 - 200, 44, 400, 80); this.TitleBar = new Menu2(base.ScreenManager, titleRect); this.TitlePos = new Vector2((float)(titleRect.X + titleRect.Width / 2) - Fonts.Laserian14.MeasureString(Localizer.Token(6089)).X / 2f, (float)(titleRect.Y + titleRect.Height / 2 - Fonts.Laserian14.LineSpacing / 2)); Rectangle leftRect = new Rectangle((int)screenWidth / 2 - 640, (screenHeight > 768f ? titleRect.Y + titleRect.Height + 5 : 44), 1280, 660); this.DMenu = new Menu2(base.ScreenManager, leftRect); this.close = new CloseButton(new Rectangle(leftRect.X + leftRect.Width - 40, leftRect.Y + 20, 20, 20)); this.SelectedInfoRect = new Rectangle(leftRect.X + 60, leftRect.Y + 250, 368, 376); this.IntelligenceRect = new Rectangle(this.SelectedInfoRect.X + this.SelectedInfoRect.Width + 30, this.SelectedInfoRect.Y, 368, 376); this.OperationsRect = new Rectangle(this.IntelligenceRect.X + this.IntelligenceRect.Width + 30, this.SelectedInfoRect.Y, 368, 376); this.OpSLRect = new Rectangle(this.OperationsRect.X + 20, this.OperationsRect.Y + 20, this.OperationsRect.Width - 40, this.OperationsRect.Height - 45); Submenu OpSub = new Submenu(base.ScreenManager, this.OpSLRect); this.OperationsSL = new ScrollList(OpSub, Fonts.Arial12Bold.LineSpacing + 5); Vector2 ExecutePos = new Vector2((float)(this.OperationsRect.X + this.OperationsRect.Width / 2 - 91), (float)(this.OperationsRect.Y + this.OperationsRect.Height - 60)); this.ExecuteOperation = new DanButton(ExecutePos, "Execute Op") { Toggled = true }; Rectangle ComponentRect = new Rectangle(this.SelectedInfoRect.X + 20, this.SelectedInfoRect.Y + 35, this.SelectedInfoRect.Width - 40, this.SelectedInfoRect.Height - 95); this.AgentComponent = new Ship_Game.AgentComponent(ComponentRect, this); foreach (Empire e in EmpireManager.EmpireList) { if (e != EmpireManager.GetEmpireByName(this.screen.PlayerLoyalty)) { if (e.isFaction || e.MinorRace) { continue; } RaceEntry re = new RaceEntry() { e = e }; this.Races.Add(re); } else { RaceEntry re = new RaceEntry() { e = e }; this.SelectedEmpire = e; this.Races.Add(re); } } Vector2 Cursor = new Vector2(screenWidth / 2f - (float)(148 * this.Races.Count / 2), (float)(leftRect.Y + 10)); int j = 0; foreach (RaceEntry re in this.Races) { re.container = new Rectangle((int)Cursor.X + 10 + j * 148, leftRect.Y + 40, 124, 148); j++; } Rectangle rectangle = new Rectangle(); this.SpyBudgetSlider = new GenericSlider(rectangle, Localizer.Token(1637), 0f, 100f) { amount = 0f }; Rectangle rectangle1 = new Rectangle(); this.CounterSpySlider = new GenericSlider(rectangle1, Localizer.Token(1637), 0f, 100f) { amount = 0f }; base.ScreenManager.racialMusic.SetVolume(0f); }
public override void LoadContent() { float screenWidth = (float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth; float screenHeight = (float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight; Rectangle titleRect = new Rectangle((int)screenWidth / 2 - 200, 44, 400, 80); this.TitleBar = new Menu2(base.ScreenManager, titleRect); this.TitlePos = new Vector2((float)(titleRect.X + titleRect.Width / 2) - Fonts.Laserian14.MeasureString(Localizer.Token(1600)).X / 2f, (float)(titleRect.Y + titleRect.Height / 2 - Fonts.Laserian14.LineSpacing / 2)); Rectangle leftRect = new Rectangle((int)screenWidth / 2 - 640, (screenHeight > 768f ? titleRect.Y + titleRect.Height + 5 : 44), 1280, 660); this.DMenu = new Menu2(base.ScreenManager, leftRect); this.close = new CloseButton(new Rectangle(leftRect.X + leftRect.Width - 40, leftRect.Y + 20, 20, 20)); this.SelectedInfoRect = new Rectangle(leftRect.X + 60, leftRect.Y + 250, 368, 376); this.IntelligenceRect = new Rectangle(this.SelectedInfoRect.X + this.SelectedInfoRect.Width + 30, this.SelectedInfoRect.Y, 368, 376); this.OperationsRect = new Rectangle(this.IntelligenceRect.X + this.IntelligenceRect.Width + 30, this.SelectedInfoRect.Y, 368, 376); this.ArtifactsRect = new Rectangle(this.SelectedInfoRect.X + 20, this.SelectedInfoRect.Y + 180, this.SelectedInfoRect.Width - 40, 130); Submenu ArtifactsSub = new Submenu(base.ScreenManager, this.ArtifactsRect); this.ArtifactsSL = new ScrollList(ArtifactsSub, 40); this.Contact = new DanButton(new Vector2((float)(this.SelectedInfoRect.X + this.SelectedInfoRect.Width / 2 - 91), (float)(this.SelectedInfoRect.Y + this.SelectedInfoRect.Height - 45)), Localizer.Token(1644)) { Toggled = true }; foreach (Empire e in EmpireManager.EmpireList) { if (e != EmpireManager.GetEmpireByName(this.screen.PlayerLoyalty)) { if (e.isFaction || e.MinorRace) { continue; } RaceEntry re = new RaceEntry() { e = e }; this.Races.Add(re); } else { RaceEntry re = new RaceEntry() { e = e }; this.SelectedEmpire = e; this.ArtifactsSL.Entries.Clear(); this.ArtifactsSL.indexAtTop = 0; ArtifactEntry entry = new ArtifactEntry(); for (int i = 0; i < e.data.OwnedArtifacts.Count; i++) { Artifact art = e.data.OwnedArtifacts[i]; SkinnableButton button = new SkinnableButton(new Rectangle(0, 0, 32, 32), string.Concat("Artifact Icons/", art.Name)) { IsToggle = false, ReferenceObject = art, BaseColor = Color.White }; if (entry.ArtifactButtons.Count < 5) { entry.ArtifactButtons.Add(button); } if (entry.ArtifactButtons.Count == 5 || i == e.data.OwnedArtifacts.Count - 1) { this.ArtifactsSL.AddItem(entry); entry = new ArtifactEntry(); } } this.Races.Add(re); } } Vector2 Cursor = new Vector2(screenWidth / 2f - (float)(148 * this.Races.Count / 2), (float)(leftRect.Y + 10)); int j = 0; foreach (RaceEntry re in this.Races) { re.container = new Rectangle((int)Cursor.X + 10 + j * 148, leftRect.Y + 40, 124, 148); j++; } base.ScreenManager.racialMusic.SetVolume(0f); }