Exemplo n.º 1
0
		public static int NewBubble(int emoticon, WorldUIAnchor bubbleAnchor, int time)
		{
			EmoteBubble emoteBubble = new EmoteBubble(emoticon, bubbleAnchor, time);
			emoteBubble.ID = EmoteBubble.AssignNewID();
			EmoteBubble.byID[emoteBubble.ID] = emoteBubble;
			if (Main.netMode == 2)
			{
				Tuple<int, int> tuple = EmoteBubble.SerializeNetAnchor(bubbleAnchor);
				NetMessage.SendData(91, -1, -1, "", emoteBubble.ID, (float)tuple.Item1, (float)tuple.Item2, (float)time, emoticon, 0, 0);
			}
			return emoteBubble.ID;
		}
Exemplo n.º 2
0
        public static int NewBubble(int emoticon, WorldUIAnchor bubbleAnchor, int time)
        {
            EmoteBubble emoteBubble = new EmoteBubble(emoticon, bubbleAnchor, time);

            emoteBubble.ID = EmoteBubble.AssignNewID();
            EmoteBubble.byID[emoteBubble.ID] = emoteBubble;
            if (Main.netMode == 2)
            {
                Tuple <int, int> tuple = EmoteBubble.SerializeNetAnchor(bubbleAnchor);
                NetMessage.SendData(91, -1, -1, (NetworkText)null, emoteBubble.ID, (float)tuple.Item1, (float)tuple.Item2, (float)time, emoticon, 0, 0);
            }
            return(emoteBubble.ID);
        }
Exemplo n.º 3
0
        public static int NewBubble(int emoticon, WorldUIAnchor bubbleAnchor, int time)
        {
            EmoteBubble emoteBubble = new EmoteBubble(emoticon, bubbleAnchor, time);

            emoteBubble.ID       = AssignNewID();
            byID[emoteBubble.ID] = emoteBubble;
            if (Main.netMode == 2)
            {
                Tuple <int, int> tuple = SerializeNetAnchor(bubbleAnchor);
                NetMessage.SendData(91, -1, -1, "", emoteBubble.ID, tuple.Item1, tuple.Item2, time, emoticon);
            }
            return(emoteBubble.ID);
        }
Exemplo n.º 4
0
 public static int NewBubbleNPC(WorldUIAnchor bubbleAnchor, int time, WorldUIAnchor other = null)
 {
     EmoteBubble emoteBubble = new EmoteBubble(0, bubbleAnchor, time);
     emoteBubble.ID = EmoteBubble.AssignNewID();
     EmoteBubble.byID[emoteBubble.ID] = emoteBubble;
     emoteBubble.PickNPCEmote(other);
     if (Main.netMode == 2)
     {
         Tuple<int, int> tuple = EmoteBubble.SerializeNetAnchor(bubbleAnchor);
         NetMessage.SendData((int)PacketTypes.EmoteBubble, -1, -1, "", emoteBubble.ID, (float)tuple.Item1, (float)tuple.Item2, (float)time, emoteBubble.emote, emoteBubble.metadata, 0);
     }
     return emoteBubble.ID;
 }
Exemplo n.º 5
0
        public static int NewBubbleNPC(WorldUIAnchor bubbleAnchor, int time, WorldUIAnchor other = null)
        {
            EmoteBubble emoteBubble = new EmoteBubble(0, bubbleAnchor, time);

            emoteBubble.ID = EmoteBubble.AssignNewID();
            EmoteBubble.byID[emoteBubble.ID] = emoteBubble;
            emoteBubble.PickNPCEmote(other);
            if (Main.netMode == 2)
            {
                Tuple <int, int> tuple = EmoteBubble.SerializeNetAnchor(bubbleAnchor);
                NetMessage.SendData(91, -1, -1, (NetworkText)null, emoteBubble.ID, (float)tuple.Item1, (float)tuple.Item2, (float)time, emoteBubble.emote, emoteBubble.metadata, 0);
            }
            return(emoteBubble.ID);
        }
Exemplo n.º 6
0
        public static void OnBubbleChange(int bubbleID)
        {
            EmoteBubble emoteBubble1 = EmoteBubble.byID[bubbleID];

            if (emoteBubble1.anchor.type != WorldUIAnchor.AnchorType.Entity || !(emoteBubble1.anchor.entity is Player entity))
            {
                return;
            }
            foreach (EmoteBubble emoteBubble2 in EmoteBubble.byID.Values)
            {
                if (emoteBubble2.anchor.type == WorldUIAnchor.AnchorType.Entity && emoteBubble2.anchor.entity == entity && emoteBubble2.ID != bubbleID)
                {
                    emoteBubble2.lifeTime = 6;
                }
            }
        }
Exemplo n.º 7
0
        public static void OnBubbleChange(int bubbleID)
        {
            EmoteBubble emoteBubble = byID[bubbleID];

            if (emoteBubble.anchor.type == WorldUIAnchor.AnchorType.Entity)
            {
                Player player = emoteBubble.anchor.entity as Player;
                if (player != null)
                {
                    foreach (EmoteBubble value in byID.Values)
                    {
                        if (value.anchor.type == WorldUIAnchor.AnchorType.Entity && value.anchor.entity == player && value.ID != bubbleID)
                        {
                            value.lifeTime = 6;
                        }
                    }
                }
            }
        }