Exemplo n.º 1
0
        private void DrawLastActionInfo(SpriteBatch b)
        {
            if (PlayerHelpers.IsPlayerOffline(PlayerId))
            {
                return;
            }

            var font = Game1.smallFont;

            var yPos   = _locationPos.Y + font.LineSpacing + GenericHeightSpacing;
            var action = PlayerStateWatcher.GetLastActionForPlayer(PlayerId);

            var text = action.GetDisplayText();

            var textWidth = font.MeasureString(text).X;

            var xPos = _inventory.xPositionOnScreen + (_inventory.width * 3 / 4);

            _lastActionPos = new Vector2(xPos - (textWidth / 2), yPos);

            b.DrawString(font, text, _lastActionPos, Color.Black);

            var lastActionTimeText = action.GetWhenDisplay();

            var timeTextWidth = font.MeasureString(lastActionTimeText).X;

            yPos += font.LineSpacing;

            _lastActionTimePos = new Vector2(xPos - (timeTextWidth / 2), yPos);

            b.DrawString(font, lastActionTimeText, _lastActionTimePos, Color.Black);
        }
Exemplo n.º 2
0
        private void DrawPlayerIcons()
        {
            foreach (var icon in Icons)
            {
                var player = PlayerHelpers.GetPlayerWithUniqueId(icon.PlayerId);

                player.FarmerRenderer.drawMiniPortrat(Game1.spriteBatch, new Vector2(icon.HeadshotPosition.X, icon.HeadshotPosition.Y), 0.5f, 0.75f * Game1.pixelZoom, 1, player);

                var miniPortraitBounds = new Rectangle(Convert.ToInt32(icon.HeadshotPosition.X) + 8, Convert.ToInt32(icon.HeadshotPosition.Y) + 8, icon.HeadshotPosition.Width, icon.HeadshotPosition.Height);

                if (_readyCheckHandler.IsPlayerWaiting(icon.PlayerId))
                {
                    DrawWaitingIcon(icon);
                }

                if (PlayerHelpers.IsPlayerOffline(icon.PlayerId))
                {
                    DrawOfflineIcon(icon);
                }


                if (miniPortraitBounds.Contains(Game1.getMouseX(), Game1.getMouseY()))
                {
                    DrawHoverTextForPlayer(player);
                    UpdateMouseTypeToCursor();
                }
            }
        }
Exemplo n.º 3
0
        private void DrawHoverTextForPlayer(Farmer player)
        {
            var text = player.Name;

            if (PlayerHelpers.IsPlayerOffline(player.UniqueMultiplayerID))
            {
                text += " (Offline)";
            }
            else if (_readyCheckHandler.IsPlayerWaiting(player.UniqueMultiplayerID))
            {
                text += " (Awaiting Players)";
            }
            IClickableMenu.drawHoverText(Game1.spriteBatch, text, Game1.dialogueFont);
        }
Exemplo n.º 4
0
        private void DrawLocationInfo(SpriteBatch b)
        {
            var yPos = _inventory.yPositionOnScreen + _inventory.height + GenericHeightSpacing;

            var text = $"Location: {LocationHelper.GetFriendlyLocationName(Player.currentLocation.Name)} ";

            if (PlayerHelpers.IsPlayerOffline(PlayerId))
            {
                text = "(Offline)";
            }

            var font = Game1.smallFont;

            var textWidth = font.MeasureString(text).X;

            var xPos = _inventory.xPositionOnScreen + (_inventory.width * 3 / 4) - (textWidth / 2);

            _locationPos = new Vector2(xPos, yPos);

            b.DrawString(font, text, _locationPos, Color.Black);
        }