Example #1
0
        public ThreadGump(Mobile pm, ThreadEntry te) : base(0, 0)
        {
            m_ThreadEntry = te;
            m_Player      = pm;
            if (m_ThreadEntry != null && !m_ThreadEntry.Deleted)
            {
                m_ThreadEntry.AddViewer(pm);
            }

            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;
            AddPage(0);
            AddBackground(9, 15, 477, 412, 9200);
            AddButton(450, 20, 1151, 1151, ( int )Buttons.Close, GumpButtonType.Reply, 0);
            AddLabel(22, 24, 0, @"Subject:");

            if (m_ThreadEntry != null && !m_ThreadEntry.Deleted)
            {
                AddLabel(22, 64, 0, @"Author: " + ((m_ThreadEntry.ThreadCreator == null) ? "unknown author" : m_ThreadEntry.ThreadCreator.Name));
            }

            if (m_ThreadEntry != null && !m_ThreadEntry.Deleted)
            {
                AddLabel(306, 64, 0, @"Date: " + m_ThreadEntry.CreationTime.ToShortDateString() + m_ThreadEntry.CreationTime.ToShortTimeString());
            }

            AddImageTiled(21, 44, 447, 21, 2624);
//            AddAlphaRegion( 21, 44, 446, 20 );
            AddImageTiled(21, 44, 446, 20, 2624);

            if (m_ThreadEntry != null && !m_ThreadEntry.Deleted)
            {
                AddHtml(23, 46, 446, 20, Color(m_ThreadEntry.Subject, LabelColor), false, false);
            }

            AddImageTiled(22, 88, 446, 302, 2624);
//            AddAlphaRegion( 22, 87, 446, 302 );
            AddImageTiled(22, 87, 446, 302, 2624);

            if (m_ThreadEntry != null && !m_ThreadEntry.Deleted)
            {
                AddHtml(24, 89, 446, 302, Color(m_ThreadEntry.GetThreadInfo(), LabelColor), false, true);
            }

            AddButton(22, 395, 4029, 4029, ( int )Buttons.Reply, GumpButtonType.Reply, 0);
            AddLabel(54, 395, 0, @"Reply");
            if (m_Player.AccessLevel >= ForumCore.ThreadDeleteAccessLevel || ForumCore.Moderators.Contains(m_Player))
            {
                AddLabel(149, 395, 0, @"Delete");
                AddButton(117, 395, 4020, 4020, ( int )Buttons.Delete, GumpButtonType.Reply, 0);
            }
            if (m_Player.AccessLevel >= ForumCore.ThreadLockAccesLevel || ForumCore.Moderators.Contains(m_Player))
            {
                AddButton(219, 395, 4017, 4017, ( int )Buttons.Lock, GumpButtonType.Reply, 0);
                AddLabel(253, 396, 0, m_ThreadEntry.Locked ? "Unlock" : "Lock");
            }
        }
        public ThreadGump( Mobile pm, ThreadEntry te ) : base( 0, 0 )
		{
            m_ThreadEntry = te;
            m_Player = pm;
            if( m_ThreadEntry != null && !m_ThreadEntry.Deleted )
                m_ThreadEntry.AddViewer( pm );

            Closable = true;
            Disposable = true;
            Dragable = true;
            Resizable = false;
            AddPage( 0 );
            AddBackground( 9, 15, 477, 412, 9200 );
            AddButton( 450, 20, 1151, 1151, ( int )Buttons.Close, GumpButtonType.Reply, 0 );
            AddLabel( 22, 24, 0, @"Subject:" );

            if( m_ThreadEntry != null && !m_ThreadEntry.Deleted )
                AddLabel( 22, 64, 0, @"Author: " + (( m_ThreadEntry.ThreadCreator == null ) ? "unknown author" : m_ThreadEntry.ThreadCreator.Name));

            if( m_ThreadEntry != null && !m_ThreadEntry.Deleted )
                AddLabel( 306, 64, 0, @"Date: " + m_ThreadEntry.CreationTime.ToShortDateString() + m_ThreadEntry.CreationTime.ToShortTimeString() );

            AddImageTiled( 21, 44, 447, 21, 2624 );
//            AddAlphaRegion( 21, 44, 446, 20 );
			AddImageTiled(21, 44, 446, 20, 2624);

            if( m_ThreadEntry != null && !m_ThreadEntry.Deleted )
                AddHtml( 23, 46, 446, 20, Color( m_ThreadEntry.Subject, LabelColor ), false, false );

            AddImageTiled( 22, 88, 446, 302, 2624 );
//            AddAlphaRegion( 22, 87, 446, 302 );
			AddImageTiled(22, 87, 446, 302, 2624);

            if( m_ThreadEntry != null && !m_ThreadEntry.Deleted )
                AddHtml( 24, 89, 446, 302, Color( m_ThreadEntry.GetThreadInfo(), LabelColor ), false, true );

            AddButton( 22, 395, 4029, 4029, ( int )Buttons.Reply, GumpButtonType.Reply, 0 );
            AddLabel( 54, 395, 0, @"Reply" );
            if( m_Player.AccessLevel >= ForumCore.ThreadDeleteAccessLevel || ForumCore.Moderators.Contains( m_Player ) )
            {
                AddLabel( 149, 395, 0, @"Delete" );
                AddButton( 117, 395, 4020, 4020, ( int )Buttons.Delete, GumpButtonType.Reply, 0 );
            }
            if( m_Player.AccessLevel >= ForumCore.ThreadLockAccesLevel || ForumCore.Moderators.Contains( m_Player ) )
            {
                AddButton( 219, 395, 4017, 4017, ( int )Buttons.Lock, GumpButtonType.Reply, 0 );
                AddLabel( 253, 396, 0, m_ThreadEntry.Locked ? "Unlock" : "Lock" );
            }
		}
Example #3
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            m_Player = (Mobile)sender.Mobile;

            if (m_Player == null)
            {
                return;
            }

            switch (info.ButtonID)
            {
            default:    //Any Thread
            {
                ThreadEntry te = (ThreadEntry)m_PagedThreads[info.ButtonID];
                if (te != null && !te.Deleted)
                {
                    if (te.Deleted)
                    {
                        m_Player.SendMessage("That thread has been queued for deletion and may not be viewed!");
                        break;
                    }
                    te.AddViewerSinceUpdate(m_Player);
                    te.AddViewer(m_Player);

                    m_Player.CloseGump(typeof(ThreadGump));
                    m_Player.SendGump(new ThreadGump(m_Player, te));
                }
                break;
            }

            case 11:    //Credits
            {
                m_Player.CloseGump(typeof(ForumGump));
                m_Player.SendGump(new ForumGump(m_Player, m_Page));
                m_Player.CloseGump(typeof(CreditsGump));
                m_Player.SendGump(new CreditsGump());
                break;
            }

            case 12:    //Help
            {
                m_Player.CloseGump(typeof(ForumGump));
                m_Player.SendGump(new ForumGump(m_Player, m_Page));
                m_Player.CloseGump(typeof(HelpGump));
                m_Player.SendGump(new HelpGump());
                break;
            }

            case 13:    //New Post
            {
                m_Player.CloseGump(typeof(PostGump));
                m_Player.SendGump(new PostGump(m_Player));
                break;
            }

            case 14:    //Next Page
            {
                int page = m_Page + 1;
                m_Player.CloseGump(typeof(ForumGump));
                m_Player.SendGump(new ForumGump(m_Player, page));
                break;
            }

            case 15:    //Previous Page
            {
                int page = m_Page - 1;
                m_Player.CloseGump(typeof(ForumGump));
                m_Player.SendGump(new ForumGump(m_Player, page));
                break;
            }

            case 16:    //Cancel
            {
                break;
            }
            }
        }