コード例 #1
0
        /// <summary>
        /// This Constructor should be used for all values in ChatTabs
        /// </summary>
        public ChatTab(ChatTabs tab, EOChatRenderer parentRenderer, bool selected = false)
            : base(null, null, parentRenderer)
        {
            WhichTab = tab;

            tabLabel = new XNALabel(new Rectangle(14, 2, 1, 1), "Microsoft Sans Serif", 8.0f);
            tabLabel.SetParent(this);

            switch (WhichTab)
            {
            case ChatTabs.Local: tabLabel.Text = "scr";  break;

            case ChatTabs.Global: tabLabel.Text = "glb"; break;

            case ChatTabs.Group: tabLabel.Text = "grp"; break;

            case ChatTabs.System: tabLabel.Text = "sys"; break;

            case ChatTabs.Private1:
            case ChatTabs.Private2:
                tabLabel.Text = "[priv " + ((int)WhichTab + 1) + "]";
                break;
            }
            _selected = selected;

            relativeTextPos = new Vector2(20, 3);

            //enable close button based on which tab was specified
            switch (WhichTab)
            {
            case ChatTabs.Private1:
            case ChatTabs.Private2:
            {
                closeRect = new Rectangle(3, 3, 11, 11);
                drawArea  = new Rectangle(drawArea.X, drawArea.Y, 132, 16);
                Visible   = false;
            } break;

            default:
            {
                closeRect = null;
                drawArea  = new Rectangle(drawArea.X, drawArea.Y, 43, 16);
                Visible   = true;
            } break;
            }

            //568 331
            scrollBar = new EOScrollBar(parent, new Vector2(467, 2), new Vector2(16, 97), EOScrollBar.ScrollColors.LightOnMed)
            {
                Visible       = selected,
                LinesToRender = 7
            };
            scrollBar.IgnoreDialog(typeof(EOPaperdollDialog));
            scrollBar.IgnoreDialog(typeof(EOChestDialog));
        }
コード例 #2
0
        /// <summary>
        /// This constructor should be used for the news rendering
        /// </summary>
        public ChatTab(XNAControl parentControl)
            : base(null, null, parentControl)
        {
            WhichTab  = ChatTabs.None;
            _selected = true;
            tabLabel  = null;

            relativeTextPos = new Vector2(20, 23);
            //568 331
            scrollBar = new EOScrollBar(parent, new Vector2(467, 20), new Vector2(16, 97), EOScrollBar.ScrollColors.LightOnMed)
            {
                LinesToRender = 7,
                Visible       = true
            };
            scrollBar.IgnoreDialog(typeof(EOPaperdollDialog));
            scrollBar.IgnoreDialog(typeof(EOChestDialog));
        }
コード例 #3
0
        public EOOnlineList(XNAPanel parent)
            : base(null, null, parent)
        {
            m_onlineList = new List <ClientOnlineEntry>();
            //this enables scrolling with mouse wheel and mouseover for parent
            _setSize(parent.BackgroundImage.Width, parent.BackgroundImage.Height);

            m_totalNumPlayers = new XNALabel(new Rectangle(455, 2, 27, 14), "Microsoft Sans Serif", 8.5f)
            {
                AutoSize  = false,
                ForeColor = System.Drawing.Color.FromArgb(0xff, 0xc8, 0xc8, 0xc8),
                TextAlign = System.Drawing.ContentAlignment.MiddleRight
            };
            m_totalNumPlayers.SetParent(this);

            m_scrollBar = new EOScrollBar(this, new Vector2(467, 20), new Vector2(16, 97), EOScrollBar.ScrollColors.LightOnMed)
            {
                LinesToRender = 7,
                Visible       = true
            };
            m_scrollBar.SetParent(this);
            m_scrollBar.IgnoreDialog(typeof(EOPaperdollDialog));
            m_scrollBar.IgnoreDialog(typeof(EOChestDialog));

            m_filterClick = new Rectangle(2 + DrawAreaWithOffset.X, 2 + DrawAreaWithOffset.Y, 14, 14);

            Texture2D weirdOffsets = GFXLoader.TextureFromResource(GFXTypes.PostLoginUI, 27, true);

            for (int i = 0; i < m_filterTextures.Length; ++i)
            {
                Rectangle offsetsSource = new Rectangle(i % 2 == 0 ? 0 : 12, i >= 2 ? 246 : 233, 12, 13);

                m_filterTextures[i] = new Texture2D(EOGame.Instance.GraphicsDevice, 12, 13);
                Color[] dat = new Color[12 * 13];
                weirdOffsets.GetData(0, offsetsSource, dat, 0, dat.Length);
                m_filterTextures[i].SetData(dat);
            }
        }