Ejemplo n.º 1
0
        public Overhead AddOverhead(MessageTypes msgType, string text, int fontID, int hue, bool asUnicode)
        {
            Overhead overhead;

            text = string.Format("<outline style='font-family: {2}{0};'>{1}", fontID, text, asUnicode ? "uni" : "ascii");

            for (int i = 0; i < m_Overheads.Count; i++)
            {
                overhead = m_Overheads[i];
                // is this overhead an already active label?
                if ((msgType == MessageTypes.Label) && (overhead.Text == text) && (overhead.MessageType == msgType) && !(overhead.IsDisposed))
                {
                    // reset the timer for the object so it lasts longer.
                    overhead.ResetTimer();
                    // update hue?
                    overhead.Hue = hue;
                    // insert it at the bottom of the queue so it displays closest to the player.
                    m_Overheads.RemoveAt(i);
                    InternalInsertOverhead(overhead);
                    return(overhead);
                }
            }

            overhead     = new Overhead(this, msgType, text);
            overhead.Hue = hue;
            InternalInsertOverhead(overhead);
            return(overhead);
        }
Ejemplo n.º 2
0
 private void InternalInsertOverhead(Overhead overhead)
 {
     if (m_Overheads.Count == 0 || (m_Overheads[0].MessageType != MessageTypes.Label))
     {
         m_Overheads.Insert(0, overhead);
     }
     else
     {
         m_Overheads.Insert(1, overhead);
     }
 }
Ejemplo n.º 3
0
 private void InternalInsertOverhead(Overhead overhead)
 {
     if (m_Overheads.Count == 0 || (m_Overheads[0].MessageType != MessageTypes.Label))
         m_Overheads.Insert(0, overhead);
     else
         m_Overheads.Insert(1, overhead);
 }
Ejemplo n.º 4
0
        public Overhead AddOverhead(MessageTypes msgType, string text, int fontID, int hue)
        {
            Overhead overhead;

            for (int i = 0; i < m_Overheads.Count; i++)
            {
                overhead = m_Overheads[i];
                // is this overhead an already active label?
                if ((msgType  == MessageTypes.Label) && (overhead.Text == text) && (overhead.MessageType == msgType) && !(overhead.IsDisposed))
                {
                    // reset the timer for the object so it lasts longer.
                    overhead.ResetTimer();
                    // update hue?
                    overhead.Hue = hue;
                    // insert it at the bottom of the queue so it displays closest to the player.
                    m_Overheads.RemoveAt(i);
                    InternalInsertOverhead(overhead);
                    return overhead;
                }
            }

            overhead = new Overhead(this, msgType, text);
            overhead.Hue = hue;
            InternalInsertOverhead(overhead);
            return overhead;
        }
Ejemplo n.º 5
0
 public OverheadView(Overhead entity)
     : base(entity)
 {
     m_Texture = new RenderedText(Entity.Text, collapseContent: true);
     DrawTexture = m_Texture.Texture;
 }
Ejemplo n.º 6
0
 public OverheadView(Overhead entity)
     : base(entity)
 {
     m_Texture = new RenderedText(Entity.Text);
     DrawTexture = m_Texture.Texture;
 }