Esempio n. 1
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            state.Mobile.CloseGump(typeof(TopicGump));
            int topic, subtopic;
            int m_Choice = info.ButtonID;

            if (m_Choice > 499)
            {
                topic    = (m_Choice - 500) / 1000;
                subtopic = (m_Choice % 1000) - 500;
                m_Bible.SetPassage(TopicReader.GetTopicVerse((Topic)topic, subtopic));
                state.Mobile.SendGump(new BibleGump(m_GM, m_Bible));
            }
            else if (m_Choice < 400)
            {
                state.Mobile.SendGump(new TopicGump(m_GM, m_Bible, m_Choice));
            }
            else if (m_Choice == 400)
            {
                state.Mobile.SendGump(new BibleGump(m_GM, m_Bible));
            }
        }
Esempio n. 2
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            int ibook, ichap, ifver, ilver, chapnum, versnum;
            int topic;
            int m_Choice = info.ButtonID;

            if (m_Choice > 99)
            {
                topic = m_Choice - 100;                 /*
                                                         * if ( topic > 250 ) state.Mobile.SendGump( new TopicGumpF( m_GM, m_Bible, topic ) );
                                                         * else if ( topic > 200 ) state.Mobile.SendGump( new TopicGumpE( m_GM, m_Bible, topic ) );
                                                         * else if ( topic > 150 ) state.Mobile.SendGump( new TopicGumpD( m_GM, m_Bible, topic ) );
                                                         * else if ( topic > 100 ) state.Mobile.SendGump( new TopicGumpC( m_GM, m_Bible, topic ) );
                                                         * else if ( topic > 50 ) state.Mobile.SendGump( new TopicGumpB( m_GM, m_Bible, topic ) );
                                                         * else  state.Mobile.SendGump( new TopicGumpA( m_GM, m_Bible, topic ) );  */
                state.Mobile.SendGump(new TopicGump(m_GM, m_Bible, topic));
            }
            else if (m_Choice > 1 && m_Choice < 68)
            {
                m_Bible.SetPassage(m_Choice - 1, 1, 1, BibleReader.GetNumVerses(m_Choice - 1, 1));
                state.Mobile.SendGump(new BibleGump(m_GM, m_Bible));
            }
            else if (m_Choice == 1)
            {
                ibook = BibleReader.GetBook((info.GetTextEntry(0)).Text);
                ichap = Utility.ToInt32((info.GetTextEntry(1)).Text);
                ifver = Utility.ToInt32((info.GetTextEntry(2)).Text);
                ilver = Utility.ToInt32((info.GetTextEntry(3)).Text);

                try
                {
                    chapnum      = BibleReader.GetNumChapters(ibook);
                    m_Bible.Book = (BookOf)ibook;
                    if (ichap > chapnum)
                    {
                        m_Bible.Chapter = chapnum;
                    }
                    else
                    {
                        m_Bible.Chapter = ichap;
                    }
                    versnum = BibleReader.GetNumVerses(ibook, m_Bible.Chapter);
                    if (ifver > versnum)
                    {
                        m_Bible.FirstVerse = versnum;
                        m_Bible.LastVerse  = versnum;
                    }
                    else if (ifver > ilver)
                    {
                        m_Bible.FirstVerse = ifver;
                        m_Bible.LastVerse  = ifver;
                    }
                    else if (ilver > versnum)
                    {
                        m_Bible.FirstVerse = ifver;
                        m_Bible.LastVerse  = versnum;
                    }
                    else
                    {
                        m_Bible.FirstVerse = ifver;
                        m_Bible.LastVerse  = ilver;
                    }
                }
                catch
                {
                }

                state.Mobile.CloseGump(typeof(BibleGump));
                state.Mobile.SendGump(new BibleGump(m_GM, m_Bible));
            }
            else
            {
                state.Mobile.CloseGump(typeof(BibleGump));
            }
        }