Пример #1
0
        /* -------------------------------------------------------------- *\
        *   m_NewMap()
        *
        *   - Creates a new map of the selected size.
        \* -------------------------------------------------------------- */
        private void NewMap()
        {
            frmNew       f;
            DialogResult result;
            bool         bResult;

            f = new frmNew();
            m_DObj.Clear();
            m_DMonstre.Clear();
            m_DItem.Clear();
            m_OBJ.Clear();
            m_li.Clear();
            m_Mons.Clear();
            m_CurrentWorld   = null;
            m_CurrentWorld   = new Monde();
            f.MapWidth       = m_Map.Width;
            f.MapHeight      = m_Map.Height;
            f.MapDescription = m_Map.Description;

            result = f.ShowDialog(this);
            if (result == DialogResult.OK)
            {
                m_bOpen        = false;
                picMap.Visible = false;
                this.Cursor    = Cursors.WaitCursor;
                try
                {
                    bResult = m_Map.CreateNew(f.MapWidth, f.MapHeight, f.MapDescription, 32);
                    m_CurrentWorld.LimiteX     = m_Map.Width;
                    m_CurrentWorld.LimiteY     = m_Map.Height;
                    m_CurrentWorld.Description = m_Map.Description;
                    m_worldNew = true;
                    if (bResult)
                    {
                        m_bOpen        = true;
                        m_bRefresh     = true;
                        m_bResize      = true;
                        picMap.Visible = true;
                    }
                }
                catch
                {
                    Console.WriteLine("Error Creating...");
                }
                m_MenuLogic();
                this.Cursor = Cursors.Default;
            }
        }
Пример #2
0
        /// <summary>
        /// Ouvre le form pour creer une map
        /// </summary>
        /// <returns></returns>
        private bool NewmapFrm()
        {
            DialogResult result;


            _frmnew           = new frmNew();
            _frmnew.MapWidth  = m_Map.Width;
            _frmnew.MapHeight = m_Map.Height;

            result = _frmnew.ShowDialog(this);
            if (result == DialogResult.OK)
            {
                return(true);
            }

            return(false);
        }
Пример #3
0
        /* -------------------------------------------------------------- *\
        *   m_NewMap()
        *
        *   - Creates a new map of the selected size.
        \* -------------------------------------------------------------- */
        private void NewMap()
        {
            frmNew       f;
            DialogResult result;
            bool         bResult;

            f             = new frmNew();
            f.MapWidth    = m_Map.Width;
            f.MapHeight   = m_Map.Height;
            f.DefaultTile = m_Map.DefaultTileID;


            result = f.ShowDialog(this);
            if (result == DialogResult.OK)
            {
                m_bOpen        = false;
                picMap.Visible = false;
                this.Cursor    = Cursors.WaitCursor;
                try
                {
                    bResult = m_Map.CreateNew(f.MapWidth, f.MapHeight, f.DefaultTile);

                    if (bResult)
                    {
                        m_bOpen        = true;
                        m_bRefresh     = true;
                        m_bResize      = true;
                        picMap.Visible = true;
                    }
                }
                catch
                {
                    Console.WriteLine("Error Creating...");
                }
                m_MenuLogic();
                world       = f.MyWorld;
                this.Cursor = Cursors.Default;
            }
            else
            {
                MessageBox.Show("You have cancelled the creation of a new world.", "Cancelled", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Пример #4
0
        /// <summary>
        /// Ouvre le form pour creer une map
        /// </summary>
        /// <returns></returns>
        private bool NewmapFrm()
        {
            DialogResult result;
            

            _frmnew = new frmNew();
            _frmnew.MapWidth = m_Map.Width;
            _frmnew.MapHeight = m_Map.Height;
            
            result = _frmnew.ShowDialog(this);
            if (result == DialogResult.OK)
            {
                return true;
            }

            return false;
        }
Пример #5
0
        /* -------------------------------------------------------------- *\
            m_NewMap()

            - Creates a new map of the selected size.
        \* -------------------------------------------------------------- */
        private void NewMap()
        {
            frmNew f;
            DialogResult result;
            bool bResult;

            f = new frmNew();
            f.MapWidth = m_Map.Width;
            f.MapHeight = m_Map.Height;

            result = f.ShowDialog(this);
            if (result == DialogResult.OK)
            {
                m_bOpen = false;
                picMap.Visible = false;
                this.Cursor = Cursors.WaitCursor;
                try
                {
                    bResult = m_Map.CreateNew(f.MapWidth, f.MapHeight, 32);
                    if (bResult)
                    {
                        m_bOpen = true;
                        m_bRefresh = true;
                        m_bResize = true;
                        picMap.Visible = true;
                    }
                }
                catch
                {
                    Console.WriteLine("Error Creating...");
                }
                m_MenuLogic();
                this.Cursor = Cursors.Default;
            }
        }