public void ProcessGame(float frameDeltaTime) { bool skipUpdate = false; bool handleTaskBar = false; if (_currentScreen != Screen.MainMenu && _currentScreen != Screen.NewGame && _currentScreen != Screen.Battle) { handleTaskBar = true; } if (handleTaskBar) { if (_situationReport.Update(MousePos.X, MousePos.Y, frameDeltaTime)) { skipUpdate = true; } } if (!skipUpdate) { _screenInterface.Update(MousePos.X, MousePos.Y, frameDeltaTime); } _screenInterface.DrawScreen(); if (handleTaskBar) { _situationReport.DrawSitRep(); } Cursor.Draw(MousePos.X, MousePos.Y); Cursor.Update(frameDeltaTime, Random); }
public override void Draw() { if (!_colonizing) { base.Draw(); _instructionLabel.Draw(); for (int i = 0; i < _maxShips; i++) { _shipButtons[i].Draw(); } _systemNameLabel.Draw(); _starSystem.Planets[0].SmallSprite.Draw(_xPos + 285, _yPos + 80); _cancelButton.Draw(); _colonizeButton.Draw(); } else { _groundViewBackground.Draw(); _groundView.Draw(_gameMain.ScreenWidth / 2 - 400, _gameMain.ScreenHeight / 2 - 300); _landingShip.Draw(_gameMain.ScreenWidth / 2 + 50, _landingShipPos); if (_showingText) { _nameBackground.Draw(); _nameTextBox.Draw(); } } }
public override void Draw() { base.Draw(); _empireBackground.Draw(); _empireNameLabel.Draw(); _previousFleet.Draw(); _nextFleet.Draw(); for (int i = 0; i < _maxVisible; i++) { _shipBackground[i].Draw(); _shipLabels[i].Draw(); if (!_isTransports) { _shipSliders[i].Draw(); } } if (_showingPreview) { _shipPreview.Draw(); GorgonLibrary.Gorgon.CurrentShader = _gameMain.ShipShader; _gameMain.ShipShader.Parameters["EmpireColor"].SetValue(_empireColor); _shipSprite.Draw(_shipPoint.X, _shipPoint.Y); GorgonLibrary.Gorgon.CurrentShader = null; } }
public void DrawScreen() { for (int i = 0; i < _gameMain.ScreenWidth; i += (int)_nebulaBackground.Width) { for (int j = 0; j < _gameMain.ScreenHeight; j += (int)_nebulaBackground.Height) { _nebulaBackground.Draw(i, j); } } _background.Draw(); _playerBackground.Draw(); _playerInfoBackground.Draw(); for (int i = 0; i < _playerLabels.Length; i++) { _playerLabels[i].Draw(); } _playerRaceButton.Draw(); _raceSprites[0].Draw(_xPos + 350, _yPos + 51); _playerRaceDescription.Draw(); _playerEmperorName.Draw(); _playerHomeworldName.Draw(); _AIBackground.Draw(); _difficultyLabel.Draw(); _numberOfAILabel.Draw(); _numericUpDownAI.Draw(); for (int i = 0; i < _numericUpDownAI.Value; i++) { _AIRaceButtons[i].Draw(); _raceSprites[i + 1].Draw(_xPos + 51 + (i * 155), _yPos + 271); } _galaxyBackground.Draw(); //if (GameConfiguration.AllowGalaxyPreview) { DrawGalaxyPreview(); } _okButton.Draw(); _cancelButton.Draw(); //Comboboxes should be drawn last, due to their "drop-down" feature _galaxyComboBox.Draw(); _difficultyComboBox.Draw(); if (_showingSelection) { _raceSelection.Draw(); } if (_generatingGalaxy) { _busyImage.Draw(); _busyText.Draw(); } }
public override void Draw() { base.Draw(); for (int i = 0; i < _maxVisible; i++) { _shipBackgrounds[i].Draw(); _shipNameLabels[i].Draw(); _scrapButtons[i].Draw(); _beamBackgrounds[i].Draw(); _beamDefLabels[i].Draw(); _beamDefValueLabels[i].Draw(); _missileBackgrounds[i].Draw(); _missileDefLabels[i].Draw(); _missileDefValueLabels[i].Draw(); _attackBackgrounds[i].Draw(); _attackLevelLabels[i].Draw(); _attackLevelValueLabels[i].Draw(); _hitPointsBackgrounds[i].Draw(); _hitPointsLabels[i].Draw(); _hitPointsValueLabels[i].Draw(); _shieldBackgrounds[i].Draw(); _shieldLabels[i].Draw(); _shieldValueLabels[i].Draw(); _galaxySpeedBackgrounds[i].Draw(); _galaxySpeedLabels[i].Draw(); _galaxySpeedValueLabels[i].Draw(); _combatSpeedBackgrounds[i].Draw(); _combatSpeedLabels[i].Draw(); _combatSpeedValueLabels[i].Draw(); _weaponsBackgrounds[i].Draw(); _specialsBackgrounds[i].Draw(); for (int j = 0; j < 4; j++) { _weaponLabels[i][j].Draw(); } for (int j = 0; j < 3; j++) { _specialLabels[i][j].Draw(); } _amountLabels[i].Draw(); _amountValueLabels[i].Draw(); _costLabels[i].Draw(); _costValueLabels[i].Draw(); } if (_previewVisible) { _shipBackground.Draw(); GorgonLibrary.Gorgon.CurrentShader = _gameMain.ShipShader; _gameMain.ShipShader.Parameters["EmpireColor"].SetValue(_empireColor); _shipSprite.Draw(_shipPoint.X, _shipPoint.Y); GorgonLibrary.Gorgon.CurrentShader = null; } }
public void DrawScreen() { _background.Draw(0, 0, _gameMain.ScreenWidth / _background.Width, _gameMain.ScreenHeight / _background.Height); _planet.Draw(_x, _y); _title.Draw(_x, _y); foreach (BBButton button in _buttons) { button.Draw(); } if (_showingLoadMenu) { _loadBackground.Draw(); foreach (var button in _saveGameButtons) { button.Draw(); } _scrollBar.Draw(); } _versionLabel.Draw(); }
public override void Draw() { base.Draw(); _techDescriptionBackground.Draw(); _availableTechsToResearchBackground.Draw(); _techIcon.Draw(_xPos + 35, _yPos + 38); _techDescription.Draw(); _instructionLabel.Draw(); for (int i = 0; i < _maxVisible; i++) { _availableTechsToResearchButtons[i].Draw(); _researchCosts[i].Draw(); } _scrollBar.Draw(); for (int i = 0; i < _maxVisible; i++) { _availableTechsToResearchButtons[i].DrawToolTip(); } }
public override void Draw() { base.Draw(); _raceBackground.Draw(); for (int i = 0; i < _maxVisible; i++) { _raceButtons[i].Draw(); } _raceScrollBar.Draw(); if (_whichRaceSelected == null) { _randomSprite.Draw(_xPos + 315, _yPos + 15, 300 / _randomSprite.Width, 300 / _randomSprite.Height); } else { _whichRaceSelected.NeutralAvatar.Draw(_xPos + 315, _yPos + 15, 300 / _whichRaceSelected.NeutralAvatar.Width, 300 / _whichRaceSelected.NeutralAvatar.Height); } _raceDescription.Draw(); _okButton.Draw(); }
public override void Draw() { base.Draw(); _name.Draw(); if (_isExplored) { _currentSystem.Planets[0].SmallSprite.Draw(_xPos + 10, _yPos + 60); _popLabel.Draw(); _terrainLabel.Draw(); if (_isOwnedSystem) { if (IsTransferring) { _generalPurposeBackground.Draw(); _generalPurposeText.Draw(); _popTransferSlider.Draw(); _transferLabel.Draw(); _transferToButton.Draw(); _transferToButton.DrawToolTip(); } else if (IsRelocating) { _generalPurposeBackground.Draw(); _generalPurposeText.Draw(); _relocateToButton.Draw(); _relocateToButton.DrawToolTip(); } else { _productionLabel.Draw(); _infrastructureBackground.Draw(); _researchBackground.Draw(); _environmentBackground.Draw(); _defenseBackground.Draw(); _constructionProjectButton.Draw(); _infrastructureIcon.Draw(_xPos + 20, _yPos + 140); _researchIcon.Draw(_xPos + 20, _yPos + 200); _environmentIcon.Draw(_xPos + 20, _yPos + 260); _defenseIcon.Draw(_xPos + 20, _yPos + 320); _constructionIcon.Draw(_xPos + 20, _yPos + 380); _infrastructureLabel.Draw(); _infrastructureSlider.Draw(); _infrastructureLockButton.Draw(); _researchLabel.Draw(); _researchSlider.Draw(); _researchLockButton.Draw(); _environmentLabel.Draw(); _environmentSlider.Draw(); _environmentLockButton.Draw(); _defenseLabel.Draw(); _defenseSlider.Draw(); _defenseLockButton.Draw(); _constructionLabel.Draw(); _constructionSlider.Draw(); _constructionLockButton.Draw(); _relocateToButton.Draw(); _transferToButton.Draw(); _relocateToButton.DrawToolTip(); _transferToButton.DrawToolTip(); if (_currentSystem.Planets[0].TransferSystem.Key.StarSystem != null) { _transferLabel.Draw(); } } } else { _generalPurposeBackground.Draw(); _generalPurposeText.Draw(); } } else { _generalPurposeBackground.Draw(); _generalPurposeText.Draw(); } }
//Used when other non-combat screens are open, to fill in the blank areas public void DrawGalaxy() { Empire currentEmpire = _gameMain.EmpireManager.CurrentEmpire; StarSystem selectedSystem = currentEmpire.SelectedSystem; FleetGroup selectedFleetGroup = currentEmpire.SelectedFleetGroup; List <StarSystem> systems = _gameMain.Galaxy.GetAllStars(); bool displayName = _camera.ZoomDistance > 0.8f; if (_showingFuelRange) { // TODO: Optimize this by going through an empire's owned systems, instead of all stars float scale = (currentEmpire.TechnologyManager.FuelRange / 3.0f) * _camera.ZoomDistance; float extendedScale = ((currentEmpire.TechnologyManager.FuelRange + 3) / 3.0f) * _camera.ZoomDistance; _backBuffer.Clear(Color.Black); _oldTarget = GorgonLibrary.Gorgon.CurrentRenderTarget; GorgonLibrary.Gorgon.CurrentRenderTarget = _backBuffer; List <StarSystem> ownedSystems = new List <StarSystem>(); foreach (StarSystem system in systems) { if (system.Planets[0].Owner == currentEmpire) { _fuelCircle.Draw((system.X - _camera.CameraX) * _camera.ZoomDistance, (system.Y - _camera.CameraY) * _camera.ZoomDistance, extendedScale, extendedScale, Color.LimeGreen); ownedSystems.Add(system); } } GorgonLibrary.Gorgon.CurrentRenderTarget = _oldTarget; _backBuffer.Blit(0, 0, _gameMain.ScreenWidth, _gameMain.ScreenHeight, Color.FromArgb(75, Color.White), BlitterSizeMode.Crop); _backBuffer.Clear(Color.Black); GorgonLibrary.Gorgon.CurrentRenderTarget = _backBuffer; foreach (StarSystem system in ownedSystems) { _fuelCircle.Draw((system.X - _camera.CameraX) * _camera.ZoomDistance, (system.Y - _camera.CameraY) * _camera.ZoomDistance, scale, scale, Color.LimeGreen); } GorgonLibrary.Gorgon.CurrentRenderTarget = _oldTarget; _backBuffer.Blit(0, 0, _gameMain.ScreenWidth, _gameMain.ScreenHeight, Color.FromArgb(75, Color.White), BlitterSizeMode.Crop); } else if (_showingRadarRange) { // TODO: Optimize this by going through an empire's owned systems, instead of all stars float planetScale = (currentEmpire.TechnologyManager.PlanetRadarRange / 3.0f) * _camera.ZoomDistance; float fleetScale = (currentEmpire.TechnologyManager.FleetRadarRange / 3.0f) * _camera.ZoomDistance; _backBuffer.Clear(Color.Black); _oldTarget = GorgonLibrary.Gorgon.CurrentRenderTarget; GorgonLibrary.Gorgon.CurrentRenderTarget = _backBuffer; foreach (StarSystem system in systems) { if (system.Planets[0].Owner == currentEmpire) { _fuelCircle.Draw((system.X - _camera.CameraX) * _camera.ZoomDistance, (system.Y - _camera.CameraY) * _camera.ZoomDistance, planetScale, planetScale, Color.Tomato); } } if (currentEmpire.TechnologyManager.FleetRadarRange > 0) { foreach (var fleet in currentEmpire.FleetManager.GetFleets()) { _fuelCircle.Draw((fleet.GalaxyX - _camera.CameraX) * _camera.ZoomDistance, (fleet.GalaxyY - _camera.CameraY) * _camera.ZoomDistance, fleetScale, fleetScale, Color.Tomato); } } GorgonLibrary.Gorgon.CurrentRenderTarget = _oldTarget; _backBuffer.Blit(0, 0, _gameMain.ScreenWidth, _gameMain.ScreenHeight, Color.FromArgb(75, Color.White), BlitterSizeMode.Crop); } if (selectedSystem != null) { if (selectedSystem.Planets[0].TransferSystem.Key.StarSystem != selectedSystem) { _pathSprite.Draw((selectedSystem.X - _camera.CameraX) * _camera.ZoomDistance, (selectedSystem.Y - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance * (selectedSystem.Planets[0].TransferSystem.Key.Length / _pathSprite.Width), _camera.ZoomDistance, Color.Green, selectedSystem.Planets[0].TransferSystem.Key.Angle); } if (selectedSystem.Planets[0].RelocateToSystem != null) { _pathSprite.Draw((selectedSystem.X - _camera.CameraX) * _camera.ZoomDistance, (selectedSystem.Y - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance * (selectedSystem.Planets[0].RelocateToSystem.Length / _pathSprite.Width), _camera.ZoomDistance, Color.Blue, selectedSystem.Planets[0].RelocateToSystem.Angle); } if (_systemView.IsTransferring && _systemView.TransferSystem != null) { _pathSprite.Draw((selectedSystem.X - _camera.CameraX) * _camera.ZoomDistance, (selectedSystem.Y - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance * (_systemView.TransferSystem.Length / _pathSprite.Width), _camera.ZoomDistance, _systemView.TransferSystem.IsValid ? Color.LightGreen : Color.Red, _systemView.TransferSystem.Angle); } if (_systemView.IsRelocating && _systemView.RelocateSystem != null) { _pathSprite.Draw((selectedSystem.X - _camera.CameraX) * _camera.ZoomDistance, (selectedSystem.Y - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance * (_systemView.RelocateSystem.Length / _pathSprite.Width), _camera.ZoomDistance, _systemView.RelocateSystem.IsValid ? Color.LightSkyBlue : Color.Red, _systemView.RelocateSystem.Angle); } } foreach (StarSystem system in systems) { GorgonLibrary.Gorgon.CurrentShader = _gameMain.StarShader; if (_showingOwners) { var darkGray = new [] { 0.25f, 0.25f, 0.25f, 1 }; if (system.IsThisSystemExploredByEmpire(currentEmpire)) { _gameMain.StarShader.Parameters["StarColor"].SetValue(system.Planets[0].Owner == null ? darkGray : system.Planets[0].Owner.ConvertedColor); } else { _gameMain.StarShader.Parameters["StarColor"].SetValue(darkGray); } } else { _gameMain.StarShader.Parameters["StarColor"].SetValue(system.StarColor); } system.Sprite.Draw((int)((system.X - _camera.CameraX) * _camera.ZoomDistance), (int)((system.Y - _camera.CameraY) * _camera.ZoomDistance), _camera.ZoomDistance, _camera.ZoomDistance); GorgonLibrary.Gorgon.CurrentShader = null; if (system == currentEmpire.SelectedSystem) { _selectionSprites[0].Draw(((system.X - 16) - _camera.CameraX) * _camera.ZoomDistance, ((system.Y - 16) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); _selectionSprites[1].Draw(((system.X) - _camera.CameraX) * _camera.ZoomDistance, ((system.Y - 16) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); _selectionSprites[2].Draw(((system.X - 16) - _camera.CameraX) * _camera.ZoomDistance, ((system.Y) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); _selectionSprites[3].Draw(((system.X) - _camera.CameraX) * _camera.ZoomDistance, ((system.Y) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); } if (displayName && (_gameMain.EmpireManager.CurrentEmpire.ContactManager.IsContacted(system.DominantEmpire) || system.IsThisSystemExploredByEmpire(_gameMain.EmpireManager.CurrentEmpire))) { float x = (system.X - _camera.CameraX) * _camera.ZoomDistance; x -= (system.StarName.GetWidth() / 2); float y = ((system.Y + (system.Size * 16)) - _camera.CameraY) * _camera.ZoomDistance; system.StarName.MoveTo((int)x, (int)y); if (system.DominantEmpire != null) { // TODO: Optimize this by moving the text sprite and color shader to StarSystem, where it's updated when ownership changes float percentage = 1.0f; _oldTarget = GorgonLibrary.Gorgon.CurrentRenderTarget; _starName.Width = (int)system.StarName.GetWidth(); _starName.Height = (int)system.StarName.GetHeight(); GorgonLibrary.Gorgon.CurrentRenderTarget = _starName; system.StarName.MoveTo(0, 0); system.StarName.Draw(); GorgonLibrary.Gorgon.CurrentRenderTarget = _oldTarget; //GorgonLibrary.Gorgon.CurrentShader = _gameMain.NameShader; foreach (Empire empire in system.EmpiresWithPlanetsInThisSystem) { /*_gameMain.NameShader.Parameters["EmpireColor"].SetValue(empire.ConvertedColor); * _gameMain.NameShader.Parameters["startPos"].SetValue(percentage); * _gameMain.NameShader.Parameters["endPos"].SetValue(percentage + system.OwnerPercentage[empire]);*/ _starName.Blit(x, y, _starName.Width * percentage, _starName.Height, empire.EmpireColor, GorgonLibrary.Graphics.BlitterSizeMode.Crop); percentage -= system.OwnerPercentage[empire]; } //GorgonLibrary.Gorgon.CurrentShader = null; } else { system.StarName.Draw(); } } } if (selectedFleetGroup != null && selectedFleetGroup.SelectedFleet.TravelNodes != null) { if (selectedFleetGroup.SelectedFleet.Empire == currentEmpire) { for (int i = 0; i < selectedFleetGroup.SelectedFleet.TravelNodes.Count; i++) { if (i == 0) { var travelNode = selectedFleetGroup.FleetToSplit.TravelNodes[0]; if (selectedFleetGroup.SelectedFleet.AdjacentSystem != null) { //Haven't left yet, so calculate custom path from left side of star float x = travelNode.StarSystem.X - (selectedFleetGroup.FleetToSplit.GalaxyX - 32); float y = travelNode.StarSystem.Y - selectedFleetGroup.FleetToSplit.GalaxyY; float length = (float)Math.Sqrt((x * x) + (y * y)); float angle = (float)(Math.Atan2(y, x) * (180 / Math.PI)); _pathSprite.Draw((selectedFleetGroup.SelectedFleet.GalaxyX - _camera.CameraX - 32) * _camera.ZoomDistance, (selectedFleetGroup.SelectedFleet.GalaxyY - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance * (length / _pathSprite.Width), _camera.ZoomDistance, Color.Green, angle); } else { _pathSprite.Draw((selectedFleetGroup.SelectedFleet.GalaxyX - _camera.CameraX) * _camera.ZoomDistance, (selectedFleetGroup.SelectedFleet.GalaxyY - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance * (travelNode.Length / _pathSprite.Width), _camera.ZoomDistance, Color.Green, travelNode.Angle); } if (selectedFleetGroup.SelectedFleet.TravelNodes.Count == 1) { //Only one node, so draw ETA at this star DrawETA(travelNode, false); } } else { _pathSprite.Draw((selectedFleetGroup.SelectedFleet.TravelNodes[i - 1].StarSystem.X - _camera.CameraX) * _camera.ZoomDistance, (selectedFleetGroup.SelectedFleet.TravelNodes[i - 1].StarSystem.Y - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance * (selectedFleetGroup.SelectedFleet.TravelNodes[i].Length / _pathSprite.Width), _camera.ZoomDistance, Color.Green, selectedFleetGroup.SelectedFleet.TravelNodes[i].Angle); if (i == selectedFleetGroup.SelectedFleet.TravelNodes.Count - 1) { //Last node, so draw ETA here DrawETA(selectedFleetGroup.FleetToSplit.TravelNodes[i], false); } } } } else if (currentEmpire.TechnologyManager.ShowEnemyETA && selectedFleetGroup.SelectedFleet.TravelNodes.Count > 0) { _pathSprite.Draw((selectedFleetGroup.SelectedFleet.GalaxyX - _camera.CameraX) * _camera.ZoomDistance, (selectedFleetGroup.SelectedFleet.GalaxyY - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance * (selectedFleetGroup.SelectedFleet.TravelNodes[0].Length / _pathSprite.Width), _camera.ZoomDistance, Color.Red, selectedFleetGroup.SelectedFleet.TravelNodes[0].Angle); //Player do not know if there's other stops, so draw ETA for first one DrawETA(selectedFleetGroup.FleetToSplit.TravelNodes[0], false); } } if (selectedFleetGroup != null && selectedFleetGroup.FleetToSplit.TentativeNodes != null) { for (int i = 0; i < selectedFleetGroup.FleetToSplit.TentativeNodes.Count; i++) { if (i == 0) { var travelNode = selectedFleetGroup.FleetToSplit.TentativeNodes[0]; if (selectedFleetGroup.FleetToSplit.AdjacentSystem != null && selectedFleetGroup.FleetToSplit.TravelNodes != null) { //Haven't left yet, so calculate custom path from left side of star float x = travelNode.StarSystem.X - (selectedFleetGroup.FleetToSplit.GalaxyX - 32); float y = travelNode.StarSystem.Y - selectedFleetGroup.FleetToSplit.GalaxyY; float length = (float)Math.Sqrt((x * x) + (y * y)); float angle = (float)(Math.Atan2(y, x) * (180 / Math.PI)); _pathSprite.Draw((selectedFleetGroup.FleetToSplit.GalaxyX - _camera.CameraX - 32) * _camera.ZoomDistance, (selectedFleetGroup.FleetToSplit.GalaxyY - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance * (length / _pathSprite.Width), _camera.ZoomDistance, travelNode.IsValid ? Color.LightGreen : Color.Red, angle); } else if (selectedFleetGroup.FleetToSplit.AdjacentSystem != null) { //Haven't left, and not on enroute already, so calculate path from right side of star float x = travelNode.StarSystem.X - (selectedFleetGroup.FleetToSplit.GalaxyX + 32); float y = travelNode.StarSystem.Y - selectedFleetGroup.FleetToSplit.GalaxyY; float length = (float)Math.Sqrt((x * x) + (y * y)); float angle = (float)(Math.Atan2(y, x) * (180 / Math.PI)); _pathSprite.Draw((selectedFleetGroup.FleetToSplit.GalaxyX - _camera.CameraX + 32) * _camera.ZoomDistance, (selectedFleetGroup.FleetToSplit.GalaxyY - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance * (length / _pathSprite.Width), _camera.ZoomDistance, travelNode.IsValid ? Color.LightGreen : Color.Red, angle); } else { _pathSprite.Draw((selectedFleetGroup.FleetToSplit.GalaxyX - _camera.CameraX) * _camera.ZoomDistance, (selectedFleetGroup.FleetToSplit.GalaxyY - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance * (selectedFleetGroup.FleetToSplit.TentativeNodes[0].Length / _pathSprite.Width), _camera.ZoomDistance, Color.LightGreen, selectedFleetGroup.FleetToSplit.TentativeNodes[0].Angle); } if (selectedFleetGroup.FleetToSplit.TentativeNodes.Count == 1) { //Only one node, so draw ETA at this star DrawETA(travelNode, true); } } else { _pathSprite.Draw((selectedFleetGroup.FleetToSplit.TentativeNodes[i - 1].StarSystem.X - _camera.CameraX) * _camera.ZoomDistance, (selectedFleetGroup.FleetToSplit.TentativeNodes[i - 1].StarSystem.Y - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance * (selectedFleetGroup.FleetToSplit.TentativeNodes[i].Length / _pathSprite.Width), _camera.ZoomDistance, selectedFleetGroup.FleetToSplit.TentativeNodes[i].IsValid ? Color.LightGreen : Color.Red, selectedFleetGroup.FleetToSplit.TentativeNodes[i].Angle); if (i == selectedFleetGroup.FleetToSplit.TentativeNodes.Count - 1) { //Last node, so draw ETA here DrawETA(selectedFleetGroup.FleetToSplit.TentativeNodes[i], true); } } } } foreach (Fleet fleet in _gameMain.EmpireManager.GetFleetsWithinArea(_camera.CameraX, _camera.CameraY, _gameMain.ScreenWidth / _camera.ZoomDistance, _gameMain.ScreenHeight / _camera.ZoomDistance)) { BBSprite fleetIcon = fleet.Ships.Count > 0 ? fleet.Empire.EmpireRace.FleetIcon : fleet.Empire.EmpireRace.TransportIcon; if (fleet.AdjacentSystem != null) { if (fleet.TravelNodes != null && fleet.TravelNodes.Count > 0) { //Adjacent to a system, but is heading to another system if (selectedFleetGroup != null && selectedFleetGroup.Fleets.Contains(fleet)) { _selectionSprites[0].Draw(((fleet.GalaxyX - 48) - _camera.CameraX) * _camera.ZoomDistance, ((fleet.GalaxyY - 16) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); _selectionSprites[1].Draw(((fleet.GalaxyX - 32) - _camera.CameraX) * _camera.ZoomDistance, ((fleet.GalaxyY - 16) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); _selectionSprites[2].Draw(((fleet.GalaxyX - 48) - _camera.CameraX) * _camera.ZoomDistance, ((fleet.GalaxyY) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); _selectionSprites[3].Draw(((fleet.GalaxyX - 32) - _camera.CameraX) * _camera.ZoomDistance, ((fleet.GalaxyY) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); } fleetIcon.Draw((int)(((fleet.GalaxyX - 32) - _camera.CameraX) * _camera.ZoomDistance), (int)((fleet.GalaxyY - _camera.CameraY) * _camera.ZoomDistance), _camera.ZoomDistance, _camera.ZoomDistance, fleet.Empire.EmpireColor); } else { //Adjacent to a system, just chilling if (selectedFleetGroup != null && selectedFleetGroup.Fleets.Contains(fleet)) { _selectionSprites[0].Draw(((fleet.GalaxyX + 16) - _camera.CameraX) * _camera.ZoomDistance, ((fleet.GalaxyY - 16) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); _selectionSprites[1].Draw(((fleet.GalaxyX + 32) - _camera.CameraX) * _camera.ZoomDistance, ((fleet.GalaxyY - 16) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); _selectionSprites[2].Draw(((fleet.GalaxyX + 16) - _camera.CameraX) * _camera.ZoomDistance, ((fleet.GalaxyY) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); _selectionSprites[3].Draw(((fleet.GalaxyX + 32) - _camera.CameraX) * _camera.ZoomDistance, ((fleet.GalaxyY) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); } fleetIcon.Draw((int)(((fleet.GalaxyX + 32) - _camera.CameraX) * _camera.ZoomDistance), (int)((fleet.GalaxyY - _camera.CameraY) * _camera.ZoomDistance), _camera.ZoomDistance, _camera.ZoomDistance, fleet.Empire.EmpireColor); } } else { //Fleet is enroute, no moving of icon needed if (selectedFleetGroup != null && selectedFleetGroup.Fleets.Contains(fleet)) { _selectionSprites[0].Draw(((fleet.GalaxyX - 16) - _camera.CameraX) * _camera.ZoomDistance, ((fleet.GalaxyY - 16) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); _selectionSprites[1].Draw(((fleet.GalaxyX) - _camera.CameraX) * _camera.ZoomDistance, ((fleet.GalaxyY - 16) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); _selectionSprites[2].Draw(((fleet.GalaxyX - 16) - _camera.CameraX) * _camera.ZoomDistance, ((fleet.GalaxyY) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); _selectionSprites[3].Draw(((fleet.GalaxyX) - _camera.CameraX) * _camera.ZoomDistance, ((fleet.GalaxyY) - _camera.CameraY) * _camera.ZoomDistance, _camera.ZoomDistance, _camera.ZoomDistance, Color.Green); } fleetIcon.Draw((int)((fleet.GalaxyX - _camera.CameraX) * _camera.ZoomDistance), (int)((fleet.GalaxyY - _camera.CameraY) * _camera.ZoomDistance), _camera.ZoomDistance, _camera.ZoomDistance, fleet.Empire.EmpireColor); } } }