예제 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Map.Pid = int.Parse(txtPID.Text);
            if (newmap && MapParser.MapExists(Map))
            {
                Message.Show("PID " + Map.Pid + " already used by another map. Choose another one.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (string.IsNullOrEmpty(txtFileName.Text))
            {
                Message.Show("Filename can't be null.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            Map.Name        = txtName.Text;
            Map.FileName    = txtFileName.Text;
            Map.ScriptName  = txtScript.Text;
            Map.SoundString = txtSound.Text;
            Map.NoLogout    = chkNologout.Checked;
            Map.Time        = txtTime.Text;
            Map.Modified    = true;
            Map.AutoMap     = chkAutomap.Checked;
            save            = true;
            this.Close();
        }