private void responseType_SelectedIndexChanged(object sender, System.EventArgs e) { if (Response.SelectedIndex == -1 || Value.SelectedIndex == -1 || Properties.SelectedIndex == -1) { MessageBox.Show(this, "You need to select a property, a value and a response first."); return; } ObjProperty prop = (ObjProperty)m_properties[Properties.SelectedIndex]; ObjValue val = (ObjValue)prop.Values[Value.SelectedIndex]; ObjResponse resp = (ObjResponse)val.Responses[Response.SelectedIndex]; Opcode code = (Opcode)responseType.SelectedIndex; resp.Operation = code; switch (code) { case Opcode.none: argument1.Visible = false; argument2.Visible = false; break; case Opcode.textout: case Opcode.increment: argument1.Visible = true; argument2.Visible = false; if (resp.Arguments.Count < 1) { resp.Arguments.Add(""); } argument1.Text = (string)resp.Arguments[0]; break; } }
private void argument1_TextChanged(object sender, System.EventArgs e) { ObjProperty prop = (ObjProperty)m_properties[Properties.SelectedIndex]; ObjValue val = (ObjValue)prop.Values[Value.SelectedIndex]; ObjResponse resp = (ObjResponse)val.Responses[Response.SelectedIndex]; resp.Arguments[0] = argument1.Text; }
private void Response_SelectedIndexChanged(object sender, System.EventArgs e) { if (Response.SelectedIndex == -1 || Value.SelectedIndex == -1) { MessageBox.Show(this, "You need to select a property and a value first."); return; } ObjProperty prop = (ObjProperty)m_properties[Properties.SelectedIndex]; ObjValue val = (ObjValue)prop.Values[Value.SelectedIndex]; ObjResponse resp = (ObjResponse)val.Responses[Response.SelectedIndex]; responseType.SelectedIndex = (int)resp.Operation; argument1.Text = (string)resp.Arguments[0]; argument2.Text = (string)resp.Arguments[1]; }
private void button_response_edit_Click(object sender, System.EventArgs e) { if (textbox_add.Text.Length == 0) { return; } if (Response.SelectedIndex == -1 || Value.SelectedIndex == -1 || Properties.SelectedIndex == -1) { MessageBox.Show(this, "You need to select a property, a value and a response first."); return; } ObjProperty prop = (ObjProperty)m_properties[Properties.SelectedIndex]; ObjValue val = (ObjValue)prop.Values[Value.SelectedIndex]; ObjResponse resp = (ObjResponse)val.Responses[Response.SelectedIndex]; resp.Name = textbox_add.Text; Response.Items[Response.SelectedIndex] = textbox_add.Text; }
private void button_response_Click(object sender, System.EventArgs e) { if (textbox_add.Text.Length == 0) { return; } if (Value.SelectedIndex == -1) { MessageBox.Show(this, "You need to select a value first."); return; } ObjResponse resp = new ObjResponse(textbox_add.Text); ObjProperty prop = (ObjProperty)m_properties[Properties.SelectedIndex]; ObjValue val = (ObjValue)prop.Values[Value.SelectedIndex]; val.Responses.Add(resp); Response.Items.Add(resp.Name); }
public Room(Point p) : base(p) { m_name = "Raum"; m_type = Factory.ObjectType.Room; ObjProperty prop = new ObjProperty("description"); m_properties.Add(prop); ObjValue val = new ObjValue(0); prop.Values.Add(val); ObjResponse resp = new ObjResponse("text"); resp.Operation = Opcode.textout; resp.Arguments[0] = "Raumbeschreibung"; val.Responses.Add(resp); ObjProperty state = new ObjProperty("state"); m_properties.Add(state); ObjValue stateval = new ObjValue(0); state.Values.Add(stateval); }
private void button_response_Click(object sender, System.EventArgs e) { if (textbox_add.Text.Length == 0) return; if (Value.SelectedIndex == -1) { MessageBox.Show(this, "You need to select a value first."); return; } ObjResponse resp = new ObjResponse(textbox_add.Text); ObjProperty prop = (ObjProperty)m_properties[Properties.SelectedIndex]; ObjValue val = (ObjValue)prop.Values[Value.SelectedIndex]; val.Responses.Add(resp); Response.Items.Add(resp.Name); }