Exemplo n.º 1
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();
                }
            }
        }
        private void WatchForReadyCheckChanges(Dictionary <long, HashSet <string> > readyPlayersBefore)
        {
            foreach (var player in readyPlayersBefore.Keys)
            {
                if (player == Game1.player.UniqueMultiplayerID)
                {
                    continue;                                             /* Don't care about current player */
                }
                ReadyPlayers.GetOrCreateDefault(player);

                var checksBefore = readyPlayersBefore[player];
                var checksNow    = ReadyPlayers[player];

                var newCheck     = checksNow.FirstOrDefault(c => !checksBefore.Contains(c));
                var removedCheck = checksBefore.FirstOrDefault(c => !checksNow.Contains(c));

                var playerName = PlayerHelpers.GetPlayerWithUniqueId(player).Name;

                var options = ConfigHelper.GetOptions();

                if (newCheck != null && newCheck != "wakeup")
                {
                    if (options.ShowReadyInfoInChatBox)
                    {
                        _helper.SelfInfoMessage($"{playerName} is now ready {GetFriendlyReadyCheckName(newCheck)}.");
                    }

                    if (options.ShowLastPlayerReadyInfoInChatBox)
                    {
                        WarnIfIAmLastPlayerReady(newCheck);
                    }
                }

                if (removedCheck != null && removedCheck != "wakeup" && options.ShowReadyInfoInChatBox)
                {
                    _helper.SelfInfoMessage($"{playerName} is no longer ready {GetFriendlyReadyCheckName(removedCheck)}.");
                }
            }
        }
Exemplo n.º 3
0
        private void PlayerIconClicked(object sender, PlayerIconClickedArgs input)
        {
            var player = PlayerHelpers.GetPlayerWithUniqueId(input.PlayerId);

            Game1.activeClickableMenu = new PlayerInformationMenu(player.UniqueMultiplayerID, _helper);
        }