public override void Draw(GameTime gameTime)
        {
            if (!Visible)
            {
                return;
            }

            int scrollOff = m_scrollBar.ScrollOffset;

            SpriteBatch.Begin();

            SpriteBatch.Draw(m_filterTextures[(int)m_filter], new Vector2(DrawAreaWithOffset.X + 4, DrawAreaWithOffset.Y + 2), Color.White);

            List <ClientOnlineEntry> filtered = m_onlineList;

            if (m_filter != Filter.All)
            {
                switch (m_filter)
                {
                case Filter.Friends:
                    filtered = m_onlineList.Where(oe => m_friendList.Contains(oe.Name)).ToList();
                    break;

                case Filter.Admins:                         //show admins only for the admins view: other types will be continue'd
                    filtered = m_onlineList.Where(oe =>
                    {
                        switch (oe.Icon)
                        {
                        case PaperdollIconType.Normal:
                        case PaperdollIconType.Party:
                        case PaperdollIconType.SLNBot:
                            return(false);
                        }
                        return(true);
                    }).ToList();
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }

            for (int i = scrollOff; i < scrollOff + m_scrollBar.LinesToRender && i < filtered.Count; ++i)
            {
                int yCoord = DRAW_OFFSET_Y + DrawAreaWithOffset.Y + (i - m_scrollBar.ScrollOffset) * 13;
                //draw icon
                SpriteBatch.Draw(ChatTab.GetChatIcon(EOChatRenderer.GetChatTypeFromPaperdollIcon(filtered[i].Icon)), new Vector2(DrawAreaWithOffset.X + DRAW_ICON_X, yCoord), Color.White);
                //drawtext name
                SpriteBatch.DrawString(EOGame.Instance.DBGFont, filtered[i].Name, new Vector2(DrawAreaWithOffset.X + DRAW_NAME_X, yCoord), Color.Black);
                //drawtext title
                SpriteBatch.DrawString(EOGame.Instance.DBGFont, filtered[i].Title, new Vector2(DrawAreaWithOffset.X + DRAW_TITLE_X, yCoord), Color.Black);
                //drawtext guild
                SpriteBatch.DrawString(EOGame.Instance.DBGFont, filtered[i].Guild, new Vector2(DrawAreaWithOffset.X + DRAW_GUILD_X, yCoord), Color.Black);
                //drawtext class
                SpriteBatch.DrawString(EOGame.Instance.DBGFont, filtered[i].ClassString, new Vector2(DrawAreaWithOffset.X + DRAW_CLASS_X, yCoord), Color.Black);
            }
            SpriteBatch.End();

            base.Draw(gameTime);
        }
Example #2
0
        public override void Draw(GameTime gameTime)
        {
            if (!Visible)
            {
                base.Draw(gameTime);
                return;
            }

            if (m_members != null)
            {
                SpriteBatch.Begin();
                for (int i = m_scrollBar.ScrollOffset; i < m_scrollBar.LinesToRender + m_scrollBar.ScrollOffset && i < m_members.Count; ++i)
                {
                    PartyMember member = m_members[i];
                    int         yCoord = DRAW_OFFSET_Y + DrawAreaWithOffset.Y + (i - m_scrollBar.ScrollOffset) * 13;
                    m_buttons[i].DrawLocation = new Vector2(DRAW_REMOVE_X, yCoord - DrawAreaWithOffset.Y + 1);
                    SpriteBatch.Draw(ChatTab.GetChatIcon(member.IsLeader ? ChatType.Star : ChatType.Player), new Vector2(DrawAreaWithOffset.X + DRAW_ICON_X, yCoord), Color.White);
                    SpriteBatch.DrawString(((EOGame)Game).DBGFont, member.Name, new Vector2(DrawAreaWithOffset.X + DRAW_NAME_X, yCoord), Color.Black);
                    SpriteBatch.DrawString(((EOGame)Game).DBGFont, "" + member.Level, new Vector2(DrawAreaWithOffset.X + DRAW_LEVEL_X, yCoord), Color.Black);
                    SpriteBatch.DrawString(((EOGame)Game).DBGFont, "HP", new Vector2(DrawAreaWithOffset.X + DRAW_HP_X, yCoord), Color.Black);
                    _drawHealthBar(member.PercentHealth, yCoord);
                }
                SpriteBatch.End();
            }

            base.Draw(gameTime);
        }