コード例 #1
0
        public virtual void DrawEntry(T o, int index, int itemNumber)
        {
            int width = 0;

            for (int j = 0; j < m_Fields.Length; j++)
            {
                InfoField <T> f = m_Fields[j];

                AddImageTiled(65 + width, 138 + itemNumber * 28, f.Width + 10, 26, 0xA40);
                AddImageTiled(67 + width, 140 + itemNumber * 28, f.Width + 6, 22, 0xBBC);
                AddHtmlText(70 + width, 141 + itemNumber * 28, f.Width, 20, GetValuesFor(o, m_Fields.Length)[j], false,
                            false);

                width += f.Width + 12;
            }

            if (HasRelationship(o))
            {
                AddButton(40, 143 + itemNumber * 28, 0x8AF, 0x8AF, 200 + index); // Info Button
            }
            else
            {
                AddButton(40, 143 + itemNumber * 28, 0x4B9, 0x4BA, 200 + index); // Info Button
            }
        }
コード例 #2
0
ファイル: BaseGuildListGump.cs プロジェクト: pallop/Servuo
        public virtual void DrawEntry(T o, int index, int itemNumber)
        {
            int width = 0;

            for (int j = 0; j < this.m_Fields.Length; j++)
            {
                InfoField <T> f = this.m_Fields[j];

                this.AddImageTiled(65 + width, 138 + itemNumber * 28, f.Width + 10, 26, 0xA40);
                this.AddImageTiled(67 + width, 140 + itemNumber * 28, f.Width + 6, 22, 0xBBC);
                this.AddHtmlText(70 + width, 141 + itemNumber * 28, f.Width, 20, this.GetValuesFor(o, this.m_Fields.Length)[j], false, false);

                width += (f.Width + 12);
            }

            if (this.HasRelationship(o))
            {
                this.AddButton(40, 143 + itemNumber * 28, 0x8AF, 0x8AF, 200 + index, GumpButtonType.Reply, 0);  //Info Button
            }
            else
            {
                this.AddButton(40, 143 + itemNumber * 28, 0x4B9, 0x4BA, 200 + index, GumpButtonType.Reply, 0);  //Info Button
            }
        }
コード例 #3
0
        public override void PopulateGump()
        {
            base.PopulateGump();

            List <T> list = m_List;

            if (WillFilter)
            {
                m_List = new List <T>();
                for (int i = 0; i < list.Count; i++)
                {
                    if (!IsFiltered(list[i], m_Filter))
                    {
                        m_List.Add(list[i]);
                    }
                }
            }
            else
            {
                m_List = new List <T>(list);
            }

            m_List.Sort(m_Comparer);
            m_StartNumber = Math.Max(Math.Min(m_StartNumber, m_List.Count - 1), 0);



            AddBackground(130, 75, 385, 30, 0xBB8);
            AddTextEntry(135, 80, 375, 30, 0x481, 1, m_Filter);
            AddButton(520, 75, 0x867, 0x868, 5, GumpButtonType.Reply, 0);               //Filter Button

            int width = 0;

            for (int i = 0; i < m_Fields.Length; i++)
            {
                InfoField <T> f = m_Fields[i];

                AddImageTiled(65 + width, 110, f.Width + 10, 26, 0xA40);
                AddImageTiled(67 + width, 112, f.Width + 6, 22, 0xBBC);
                AddHtmlText(70 + width, 113, f.Width, 20, f.Name, false, false);

                bool isComparer = (m_Fields[i].Comparer.GetType() == m_Comparer.GetType());

                int ButtonID = (isComparer) ? (m_Ascending ? 0x983 : 0x985) : 0x2716;

                AddButton(59 + width + f.Width, 117, ButtonID, ButtonID + (isComparer ? 1 : 0), 100 + i, GumpButtonType.Reply, 0);

                width += (f.Width + 12);
            }

            if (m_StartNumber <= 0)
            {
                AddButton(65, 80, 0x15E3, 0x15E7, 0, GumpButtonType.Page, 0);
            }
            else
            {
                AddButton(65, 80, 0x15E3, 0x15E7, 6, GumpButtonType.Reply, 0);                          // Back
            }
            if (m_StartNumber + itemsPerPage > m_List.Count)
            {
                AddButton(95, 80, 0x15E1, 0x15E5, 0, GumpButtonType.Page, 0);
            }
            else
            {
                AddButton(95, 80, 0x15E1, 0x15E5, 7, GumpButtonType.Reply, 0);                          // Forward
            }
            int itemNumber = 0;

            if (m_Ascending)
            {
                for (int i = m_StartNumber; i < m_StartNumber + itemsPerPage && i < m_List.Count; i++)
                {
                    DrawEntry(m_List[i], i, itemNumber++);
                }
            }
            else             //descending, go from bottom of list to the top
            {
                for (int i = m_List.Count - 1 - m_StartNumber; i >= 0 && i >= (m_List.Count - itemsPerPage - m_StartNumber); i--)
                {
                    DrawEntry(m_List[i], i, itemNumber++);
                }
            }

            DrawEndingEntry(itemNumber);
        }