Esempio n. 1
0
 private void Speak(string text)
 {
     //TODO use the actual chat api when it allows it!
     Chat.AddLocalMsgToChat(
         text,
         gameObject,
         MobName);
     ShowChatBubbleMessage.SendToNearby(gameObject, text);
 }
    public void ServerToggleChatIcon(bool turnOn, string message, ChatChannel chatChannel, ChatModifier chatModifier)
    {
        if (!playerScript.pushPull.VisibleState || (playerScript.mind.occupation.JobType == JobType.NULL ||
                                                    playerScript.playerHealth.IsDead || playerScript.playerHealth.IsCrit))
        {
            //Don't do anything with chat icon if player is invisible or not spawned in
            //This will also prevent clients from snooping other players local chat messages that aren't visible to them
            return;
        }

        // Cancel right away if the player cannot speak.
        if ((chatModifier & ChatModifier.Mute) == ChatModifier.Mute)
        {
            return;
        }

        ShowChatBubbleMessage.SendToNearby(gameObject, message, true, chatModifier);
    }