public string BuildResetString( Reset reset ) { string str = String.Empty; switch( reset.Command ) { case 'M': str = "Load a mobile"; break; case 'O': str = "Load an object"; break; case 'P': str = "Put object inside object"; break; case 'G': str = "Give object to mobile"; break; case 'E': str = "Equip mobile with object"; break; case 'D': str = "Set door state"; break; case 'R': str = "Randomize room exits"; break; case 'F': str = "Set mob following"; break; case '*': str = "Comment"; break; } return str; }
void UpdateWindowContents(Reset reset) { cbCommand.Text = reset.Command.ToString(); txtArg0.Text = reset.Arg0.ToString(); txtArg1.Text = reset.Arg1.ToString(); txtArg2.Text = reset.Arg2.ToString(); txtArg3.Text = reset.Arg3.ToString(); txtArg4.Text = reset.Arg4.ToString(); txtArg5.Text = reset.Arg5.ToString(); txtArg6.Text = reset.Arg6.ToString(); txtArg7.Text = reset.Arg7.ToString(); lblDescription.Text = reset.ToString(); }
private void UpdateResetDescriptionWithoutCommittingChanges() { Reset reset = new Reset(); int value = 0; if (Int32.TryParse(txtArg0.Text, out value)) reset.Arg0 = value; if (Int32.TryParse(txtArg1.Text, out value)) reset.Arg1 = value; if (Int32.TryParse(txtArg2.Text, out value)) reset.Arg2 = value; if (Int32.TryParse(txtArg3.Text, out value)) reset.Arg3 = value; if (Int32.TryParse(txtArg4.Text, out value)) reset.Arg4 = value; if (Int32.TryParse(txtArg5.Text, out value)) reset.Arg5 = value; if (Int32.TryParse(txtArg6.Text, out value)) reset.Arg6 = value; if (Int32.TryParse(txtArg7.Text, out value)) reset.Arg7 = value; string cmd = (string)cbCommand.Text; if (!String.IsNullOrEmpty(cmd)) { reset.Command = cmd[0]; } lblDescription.Text = reset.ToString(); }
private void btnNew_Click(object sender, EventArgs e) { ApplyWindowContents(); Reset reset = new Reset(); _area.Resets.Add( reset ); UpdateResetList(); SetControlAvailability(); resetList.SelectedIndex = resetList.Items.Count - 1; UpdateWindowContents(reset); _parent.UpdateStatusBar(); }