private MudData.FormulaAction PopulateActionDictionary() { MudData.FormulaAction action = null; if (ActionComboBox.Text == "AddToList") { var ctl = ContainerPanel.Controls[0] as ScriptActionControlAddToList; action = ctl.GenerateMudDataAction(); } else if (ActionComboBox.Text == "CreateListMember") { var ctl = ContainerPanel.Controls[0] as ScriptActionControlCreateListMember; action = ctl.GenerateMudDataAction(); } else if (ActionComboBox.Text == "foreach") { var ctl = ContainerPanel.Controls[0] as ScriptActionControlForEach; action = ctl.GenerateMudDataAction(); } else if (ActionComboBox.Text == "if") { var ctl = ContainerPanel.Controls[0] as ScriptActionControlIf; action = ctl.GenerateMudDataAction(); } else if (ActionComboBox.Text == "ListTransfer") { var ctl = ContainerPanel.Controls[0] as ScriptActionControlListTransfer; action = ctl.GenerateMudDataAction(); } else if (ActionComboBox.Text == "ListRemove") { var ctl = ContainerPanel.Controls[0] as ScriptActionControlListRemove; action = ctl.GenerateMudDataAction(); } else if (ActionComboBox.Text == "RepeatEvent") { var ctl = ContainerPanel.Controls[0] as ScriptActionControlRepeatEvent; action = ctl.GenerateMudDataAction(); } else if (ActionComboBox.Text == "SetGoalState") { var ctl = ContainerPanel.Controls[0] as ScriptActionControlSetGoalState; action = ctl.GenerateMudDataAction(); } else if (ActionComboBox.Text == "SetProperty") { var ctl = ContainerPanel.Controls[0] as ScriptActionControlSetProperty; action = ctl.GenerateMudDataAction(); } else if (ActionComboBox.Text == "TriggerEvent") { var ctl = ContainerPanel.Controls[0] as ScriptActionControlTriggerEvent; action = ctl.GenerateMudDataAction(); } else { action = null; } var ret = new MudData.FormulaAction(); ret.action = ActionComboBox.Text; ret.InternalAction = action; return ret; }
private void RoomAddButton_Click(object sender, EventArgs e) { var room = new MudData.Room(); room.name = "Unnamed"; room.description = "This is an undescribed room."; room.editorPath = BuildFolderString(RoomTree.SelectedNode); var onEnterEvent = new MudData.FormulaEvent(); onEnterEvent.name = "OnUserEnter"; var sendDescAction = new MudData.FormulaActionSetGoalState(); sendDescAction.action = "SetGoalState"; sendDescAction.binding = "User"; sendDescAction.property = "SendRoomDescription"; sendDescAction.value = "0"; var wrapAction = new MudData.FormulaAction(); wrapAction.action = "SetGoalState"; wrapAction.InternalAction = sendDescAction; onEnterEvent.actions.Add(wrapAction); room.events.Add(onEnterEvent); MudData.Current.Rooms.Add(room); RefreshRoomsTab(); RoomTree.SelectedNode = RoomTree.Nodes.Find(room.name, true)[0]; RoomInternalName.Focus(); RoomInternalName.SelectAll(); }
private MudData.FormulaAction GetRawActionFromDropdownSelection() { MudData.FormulaAction action = null; if (ActionComboBox.Text == "AddToList") { action = new MudData.FormulaActionAddToList(); } else if (ActionComboBox.Text == "CreateListMember") { action = new MudData.FormulaActionCreateListMember(); } else if (ActionComboBox.Text == "foreach") { action = new MudData.FormulaActionForEach(); } else if (ActionComboBox.Text == "if") { action = new MudData.FormulaActionIf(); } else if (ActionComboBox.Text == "ListTransfer") { action = new MudData.FormulaActionListTransfer(); } else if (ActionComboBox.Text == "ListRemove") { action = new MudData.FormulaActionListRemove(); } else if (ActionComboBox.Text == "RepeatEvent") { action = new MudData.FormulaActionRepeatEvent(); } else if (ActionComboBox.Text == "SetGoalState") { action = new MudData.FormulaActionSetGoalState(); } else if (ActionComboBox.Text == "SetProperty") { action = new MudData.FormulaActionSetProperty(); } else if (ActionComboBox.Text == "TriggerEvent") { action = new MudData.FormulaActionTriggerEvent(); } else { action = new MudData.FormulaAction(); } return action; }