public ShipListInfoUIElement(Rectangle r, Ship_Game.ScreenManager sm, UniverseScreen screen) { this.Housing = r; this.screen = screen; this.ScreenManager = sm; this.ElementRect = r; 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.LeftRect = new Rectangle(r.X, r.Y + 44, 180, r.Height - 44); this.sliding_element = new SlidingElement(this.SliderRect); this.RightRect = new Rectangle(this.LeftRect.X + this.LeftRect.Width, this.LeftRect.Y, 220, this.LeftRect.Height); float spacing = (float)(this.LeftRect.Height - 26 - 96); this.Power = new Rectangle(this.RightRect.X, this.LeftRect.Y + 12, 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" }; ShipListInfoUIElement.TippedItem ti = new ShipListInfoUIElement.TippedItem() { r = this.Power, TIP_ID = 27 }; this.Shields = new Rectangle(this.RightRect.X, this.LeftRect.Y + 12 + 20 + (int)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 ShipListInfoUIElement.TippedItem() { r = this.Shields, TIP_ID = 28 }; this.DefenseRect = new Rectangle(this.Housing.X + 13, this.Housing.Y + 112, 22, 22); ti = new ShipListInfoUIElement.TippedItem() { r = this.DefenseRect, TIP_ID = 30 }; this.TroopRect = new Rectangle(this.Housing.X + 13, this.Housing.Y + 137, 22, 22); ti = new ShipListInfoUIElement.TippedItem() { r = this.TroopRect, TIP_ID = 37 }; 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 }; this.clickRect = new Rectangle(this.ElementRect.X + this.ElementRect.Width - 16, this.ElementRect.Y + this.ElementRect.Height / 2 - 11, 11, 22); this.ShipInfoRect = new Rectangle(this.Housing.X + 60, this.Housing.Y + 110, 115, 115); Rectangle rectangle = new Rectangle(this.Housing.X + 187, this.Housing.Y + 120 + 20 + (int)spacing + 20 + (int)spacing, 20, 20); Vector2 OrdersBarPos = new Vector2((float)(this.Power.X + 12), (float)(this.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - 45)); 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 + 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"); this.CombatStatusButtons.Add(Artillery); Artillery.Action = "arty"; Artillery.HasToolTip = true; Artillery.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"); this.CombatStatusButtons.Add(HoldPos); HoldPos.Action = "hold"; HoldPos.HasToolTip = true; HoldPos.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"); this.CombatStatusButtons.Add(OrbitLeft); OrbitLeft.Action = "orbit_left"; OrbitLeft.HasToolTip = true; OrbitLeft.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"); this.CombatStatusButtons.Add(BroadsideLeft); BroadsideLeft.Action = "broadside_left"; BroadsideLeft.HasToolTip = true; BroadsideLeft.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"); this.CombatStatusButtons.Add(OrbitRight); OrbitRight.Action = "orbit_right"; OrbitRight.HasToolTip = true; OrbitRight.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"); this.CombatStatusButtons.Add(BroadsideRight); BroadsideRight.Action = "broadside_right"; BroadsideRight.HasToolTip = true; BroadsideRight.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"); this.CombatStatusButtons.Add(Evade); Evade.Action = "evade"; Evade.HasToolTip = true; Evade.WhichToolTip = 6; Rectangle slsubRect = new Rectangle(this.RightRect.X, this.Housing.Y + 110 - 35, this.RightRect.Width - 5, 140); Submenu shipssub = new Submenu(this.ScreenManager, slsubRect); this.SelectedShipsSL = new ScrollList(shipssub, 24); }
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; }