コード例 #1
0
        private void RandomNameBtn_Click(object sender, EventArgs e)
        {
            string str = "";

            while (str == "")
            {
                str = RoomBuilder.Name();
            }
            this.NameBox.Text = str;
        }
コード例 #2
0
        private void RandomNameBtn_Click(object sender, EventArgs e)
        {
            string name = "";

            while (name == "")
            {
                name = RoomBuilder.Name();
            }

            NameBox.Text = name;
        }
コード例 #3
0
        public MapBuilderForm(Map m, bool autobuild)
        {
            InitializeComponent();

            Application.Idle += new EventHandler(Application_Idle);

            List <Library> libs = new List <Library>();

            libs.AddRange(Session.Libraries);
            if (Session.Project != null)
            {
                libs.Add(Session.Project.Library);
            }
            int tiles_shown = 0;

            foreach (Library lib in libs)
            {
                if (Session.Preferences.TileLibraries != null)
                {
                    fTileSets[lib.ID] = Session.Preferences.TileLibraries.Contains(lib.ID);
                }
                else
                {
                    fTileSets[lib.ID] = true;
                }

                if (fTileSets[lib.ID])
                {
                    tiles_shown = lib.Tiles.Count;
                }
            }
            if (tiles_shown == 0)
            {
                foreach (Library lib in libs)
                {
                    fTileSets[lib.ID] = true;
                }
            }

            MapFilterPanel.Visible = false;
            populate_tiles();

            fMap         = m.Copy();
            MapView.Map  = fMap;
            NameBox.Text = fMap.Name;

            if (autobuild)
            {
                Cursor.Current = Cursors.WaitCursor;

                ToolsAutoBuild_Click(null, null);

                foreach (MapArea area in fMap.Areas)
                {
                    area.Name    = RoomBuilder.Name();
                    area.Details = RoomBuilder.Details();
                }

                Cursor.Current = Cursors.Default;
            }

            update_areas();
        }