Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="city"></param>
        /// <param name="page"></param>
        /// <param name="session"></param>
        private KinCityControlGump(KinFactionCities city, int page, GumpSession session, Mobile from)
            : base(page, session, from)
        {
            //This ctor gets called the first time the gump is opened
            m_Data = KinCityManager.GetCityData(city);
            if (m_Data == null)
            {
                return;
            }

            Session["City"] = city;

            //If in the vote stage, sett page to 5 now
            if (m_Data.IsVotingStage)
            {
                Page = 5;
            }

            SetCurrentPage();
            if (MasterPage != null)
            {
                MasterPage.Create();
                if (CurrentPage != null)
                {
                    this.AddPage(1);
                }
            }
            if (CurrentPage != null)
            {
                CurrentPage.Create();
            }
        }
Example #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="city"></param>
 /// <param name="page"></param>
 /// <param name="session"></param>
 private KinGuardPostGump(KinGuardPost guardPost, int page, GumpSession session, Mobile from)
     : base(page, session, from)
 {
     if (Session["GuardPost"] == null)
     {
         Session["GuardPost"] = guardPost;
         SetCurrentPage();
         if (CurrentPage != null)
         {
             CurrentPage.Create();
         }
     }
 }
        public CommitGumpBase(int page, GumpSession session, Mobile from)
            : base(25, 25)
        {
            this.Closable   = true;
            this.Disposable = true;
            this.Dragable   = true;
            this.Resizable  = true;
            m_Page          = page;
            m_From          = from;
            if (session == null)
            {
                //First time creation
                //Create session object and populate entity register
                m_EntityRegister = new Dictionary <int, Type>();
                m_GumpSession    = new GumpSession();
                RegisterEntities();

                m_GumpSession["COMMIT_ENTITY_REGISTER"] = m_EntityRegister;

                //Let the subclass create the pages the first time so its ctor has a chance to fire
            }
            else
            {
                //Restore session and entity register
                m_GumpSession    = session;
                m_EntityRegister = m_GumpSession["COMMIT_ENTITY_REGISTER"] as Dictionary <int, Type>;
                //Set the type of current page to be created
                SetCurrentPage();
                //Create master and current if they exist
                if (MasterPage != null)
                {
                    MasterPage.Create();
                    if (CurrentPage != null)
                    {
                        this.AddPage(1);
                    }
                }
                if (CurrentPage != null)
                {
                    CurrentPage.Create();
                }
            }
        }