public NewLevelWindow( ) { InitializeComponent( ); levelNameText.GotFocus += new EventHandler( levelNameText_GotFocus ); levelNameText.LostFocus += new EventHandler( levelNameText_LostFocus ); _level = new LevelEd( ); }
public LevelTabPage( LevelEd level ) { viewport = new ViewportControl( ); this.BorderStyle = BorderStyle.FixedSingle; this.Controls.Add( viewport ); viewport.Dock = DockStyle.Fill; this.Text = level.Name; this._level = level; }
private void createButton_Click( object sender, EventArgs e ) { levelNameText.Text = Helper.CheckLetterDigitInput( levelNameText.Text ); if( Global.World.LevelExists( levelNameText.Text ) ) { MessageBox.Show( Global.EditorTxt.LevelWithSameNameExists, "", MessageBoxButtons.OK, MessageBoxIcon.Information ); levelNameText.Focus( ); levelNameText.SelectAll( ); return; } string fullPath = Path.Combine( Global.World.LevelsFolderPath, levelNameText.Text + Consts.Files.LEVEL_EXTENSION ); _level = new LevelEd( ); _level.FilePath = fullPath; _level.Name = levelNameText.Text; _level.NewLayer( ); this.Close( ); }
private void cancelButton_Click( object sender, EventArgs e ) { _level = null; this.Close( ); }