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(); }
public override void LoadContent() { this.FleetStatsRect = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 172, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - 300, 345, 600); this.AssignNow = new BlueButton(new Vector2((float)(this.FleetStatsRect.X + 85), (float)(this.FleetStatsRect.Y + 225)), "Assign Now") { ToggleOn = true }; this.BuildNow = new BlueButton(new Vector2((float)(this.FleetStatsRect.X + 85), (float)(this.FleetStatsRect.Y + 365)), "Build Now") { ToggleOn = true }; this.UpdateRequisitionStatus(); foreach (FleetDataNode node in this.f.DataNodes) { foreach (Goal g in this.f.Owner.GetGSAI().Goals) { if (g.guid != node.GoalGUID) { continue; } RequisitionScreen requisitionScreen = this; requisitionScreen.numBeingBuilt = requisitionScreen.numBeingBuilt + 1; } } }