예제 #1
0
        public override bool MouseHover(int x, int y, float frameDeltaTime)
        {
            bool result = false;

            for (int i = 0; i < 6; i++)
            {
                result = _scrapButtons[i].MouseHover(x, y, frameDeltaTime) || result;
            }
            _previewVisible = false;
            if (x >= _x && x < _x + 860)
            {
                for (int i = 0; i < _maxVisible; i++)
                {
                    if (y >= _y + (i * 100) && y < _y + ((i + 1) * 100))
                    {
                        var ship = _fleetManager.CurrentDesigns[i];
                        _shipSprite     = ship.Owner.EmpireRace.GetShip(ship.Size, ship.WhichStyle);
                        _empireColor    = ship.Owner.ConvertedColor;
                        _previewVisible = true;
                        _shipBackground.MoveTo(_x - 170, _y + (i * 100) - 35);
                        _shipPoint.X = _x - 85;
                        _shipPoint.Y = _y + (i * 100) + 50;
                    }
                }
            }
            return(result);
        }
예제 #2
0
        public override bool MouseHover(int x, int y, float frameDeltaTime)
        {
            bool result = false;

            _previousFleet.MouseHover(x, y, frameDeltaTime);
            _nextFleet.MouseHover(x, y, frameDeltaTime);
            bool withinX        = (x >= _xPos + 10 && x < _xPos + 290);
            bool showingPreview = false;

            for (int i = 0; i < _maxVisible; i++)
            {
                if (_shipSliders[i].MouseHover(x, y, frameDeltaTime))
                {
                    result = true;
                    if (!_isTransports)
                    {
                        Ship ship = _selectedFleet.OrderedShips[i];
                        _selectedFleetGroup.FleetToSplit.Ships[ship] = _shipSliders[i].TopIndex;
                        _shipLabels[i].SetText(_shipSliders[i].TopIndex + " x " + ship.Name);
                    }
                }
                int tempY = _yPos + 55 + (i * 55);
                if (!_isTransports && withinX && y >= tempY && y < tempY + 55)
                {
                    var ship = _selectedFleet.OrderedShips[i];
                    _shipSprite  = ship.Owner.EmpireRace.GetShip(ship.Size, ship.WhichStyle);
                    _empireColor = ship.Owner.ConvertedColor;
                    //Show ship preview for this ship
                    if (_xPos > 170)
                    {
                        _shipPreview.MoveTo(_xPos - 170, tempY - 62);
                        _shipPoint.X   = _xPos - 85;
                        _shipPoint.Y   = tempY + 23;
                        showingPreview = true;
                    }
                    else
                    {
                        _shipPreview.MoveTo(_xPos + 300, tempY - 62);
                        _shipPoint.X   = _xPos + 385;
                        _shipPoint.Y   = tempY + 23;
                        showingPreview = true;
                    }
                }
            }
            _showingPreview = showingPreview;
            return(base.MouseHover(x, y, frameDeltaTime) || result);
        }
예제 #3
0
        public override void MoveWindow()
        {
            base.MoveWindow();

            _empireBackground.MoveTo(_xPos + 10, _yPos + 10);
            _empireNameLabel.MoveTo(_xPos + 150 - (int)(_empireNameLabel.GetWidth() / 2), _yPos + 30 - (int)(_empireNameLabel.GetHeight() / 2));
            _previousFleet.MoveTo(_xPos + 18, _yPos + 22);
            _nextFleet.MoveTo(_xPos + 266, _yPos + 22);

            for (int i = 0; i < _shipBackground.Length; i++)
            {
                _shipBackground[i].MoveTo(_xPos + 10, _yPos + 55 + (i * 55));
                _shipLabels[i].MoveTo(_xPos + 15, _yPos + 65 + (i * 55));
                _shipSliders[i].MoveTo(_xPos + 15, _yPos + 85 + (i * 55));
            }
        }
예제 #4
0
 public override void MoveWindow()
 {
     base.MoveWindow();
     _name.MoveTo(_xPos + 10, _yPos + 15);
     _terrainLabel.MoveTo(_xPos + 55, _yPos + 60);
     _popLabel.MoveTo(_xPos + 55, _yPos + 80);
     _infrastructureBackground.MoveTo(_xPos + 10, _yPos + 130);
     _researchBackground.MoveTo(_xPos + 10, _yPos + 190);
     _environmentBackground.MoveTo(_xPos + 10, _yPos + 250);
     _defenseBackground.MoveTo(_xPos + 10, _yPos + 310);
     _constructionProjectButton.MoveTo(_xPos + 10, _yPos + 370);
     _productionLabel.MoveTo(_xPos + 55, _yPos + 100);
     _infrastructureLabel.MoveTo(_xPos + 65, _yPos + 140);
     _infrastructureSlider.MoveTo(_xPos + 65, _yPos + 160);
     _infrastructureLockButton.MoveTo(_xPos + 267, _yPos + 160);
     _researchLabel.MoveTo(_xPos + 65, _yPos + 200);
     _researchSlider.MoveTo(_xPos + 65, _yPos + 220);
     _researchLockButton.MoveTo(_xPos + 267, _yPos + 220);
     _environmentLabel.MoveTo(_xPos + 65, _yPos + 260);
     _environmentSlider.MoveTo(_xPos + 65, _yPos + 280);
     _environmentLockButton.MoveTo(_xPos + 267, _yPos + 280);
     _defenseLabel.MoveTo(_xPos + 65, _yPos + 320);
     _defenseSlider.MoveTo(_xPos + 65, _yPos + 340);
     _defenseLockButton.MoveTo(_xPos + 267, _yPos + 340);
     _constructionLabel.MoveTo(_xPos + 65, _yPos + 380);
     _constructionSlider.MoveTo(_xPos + 65, _yPos + 400);
     _constructionLockButton.MoveTo(_xPos + 267, _yPos + 400);
     if (IsRelocating)
     {
         _relocateToButton.MoveTo(_xPos + 215, _yPos + 435);
     }
     else
     {
         _relocateToButton.MoveTo(_xPos + 130, _yPos + 435);
     }
     _transferToButton.MoveTo(_xPos + 215, _yPos + 435);
 }
예제 #5
0
 public virtual void MoveWindow()
 {
     _backGroundImage.MoveTo(_xPos, _yPos);
 }