public WindowActionSubgoalEditor(bool interactionMode, PlotFragment frag, ActionSubgoal currEntity, StoryData currStoryData) { InitializeComponent(); _currentEntity = currEntity; _currentStoryData = currStoryData; _parentPlotFragment = frag; _currentlySelectedParameter = null; //_previouslySlectedParameter = null; _validData = true; _interactionMode = interactionMode; txtBoxNumberInput.NullValue = 0.0; _currentEntity.syncParametersWithSubgoal(); dataBind(); }
override public Object Clone() { ActionSubgoal newClone = (ActionSubgoal)MemberwiseClone(); newClone.Id = StoryWorldDataProvider.getStoryData().getNewId(); newClone.ParametersToPass = new List <Parameter>(); foreach (Parameter param in _parametersToPass) { newClone.ParametersToPass.Add((Parameter)param.Clone()); } return(newClone); }
private void btAddNew_Click(object sender, RoutedEventArgs e) { if (_currentStoryData.AuthorGoals.Count == 0) { Utilities.MakeErrorDialog("There must be at least one Author Goal in this story for you to make a new Interactive Action.", this); return; } interactionsDataGrid.EndEdit(); string newName = Utilities.MakeTextDialog("Please enter a title for this new Interactive Action:", this); if (newName != null) { List <string> goalChoices = new List <string>(); //Get author goal to activate foreach (AuthorGoal goal in _currentStoryData.AuthorGoals) { goalChoices.Add(goal.Description); } int result = Utilities.MakeListChoiceDialog("Choose the Author Goal you would like to activate for this Interactive Action.", goalChoices, this); if (result < 0) { return; } AuthorGoal authorGoalSelection = _currentStoryData.AuthorGoals[result]; ActionSubgoal newSubGoal = new ActionSubgoal(0, authorGoalSelection.Id, _currentStoryData); Interaction newInteraction = new Interaction(newName, newSubGoal, _currentStoryData); _currentStoryData.Interactions.Add(newInteraction); dataBind(); WindowActionSubgoalEditor newWin = new WindowActionSubgoalEditor(true, null, newSubGoal, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } }
private void btAddNew_Click(object sender, RoutedEventArgs e) { if(_currentStoryData.AuthorGoals.Count == 0) { Utilities.MakeErrorDialog("There must be at least one Author Goal in this story for you to make a new Interactive Action.", this); return; } interactionsDataGrid.EndEdit(); string newName = Utilities.MakeTextDialog("Please enter a title for this new Interactive Action:", this); if (newName != null) { List<string> goalChoices = new List<string>(); //Get author goal to activate foreach (AuthorGoal goal in _currentStoryData.AuthorGoals) { goalChoices.Add(goal.Description); } int result = Utilities.MakeListChoiceDialog("Choose the Author Goal you would like to activate for this Interactive Action.", goalChoices, this); if (result < 0) { return; } AuthorGoal authorGoalSelection = _currentStoryData.AuthorGoals[result]; ActionSubgoal newSubGoal = new ActionSubgoal(0, authorGoalSelection.Id, _currentStoryData); Interaction newInteraction = new Interaction(newName, newSubGoal, _currentStoryData); _currentStoryData.Interactions.Add(newInteraction); dataBind(); WindowActionSubgoalEditor newWin = new WindowActionSubgoalEditor(true, null, newSubGoal, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } }
private void btNewAction_Click(object sender, RoutedEventArgs e) { List <string> editChoices = new List <string>(); editChoices.Add("Output Text"); editChoices.Add("Pursue a Subgoal"); editChoices.Add("Make a Calculation"); editChoices.Add("Create a new Character/Environment/Plot Point"); editChoices.Add("Edit a saved Character/Environment/Plot Point"); editChoices.Add("Delete a saved Character/Environment/Plot Point"); int result = -1; result = Utilities.MakeListChoiceDialog("What type of Action would you like to create?", editChoices, this); if (result < 0) { return; } else if (result == 0) //Output Text { ActionTextOutput newTextOutputAction = new ActionTextOutput(_currentEntity.Id, "", _currentStoryData); _currentEntity.Actions.Add(newTextOutputAction); Window newWin = new WindowActionTextOutput(_currentEntity, newTextOutputAction); newWin.Owner = this; newWin.ShowDialog(); } else if (result == 1) //Pursue Subgoal { List <string> choiceList = new List <string>(); foreach (AuthorGoal goal in _currentStoryData.AuthorGoals) { choiceList.Add(goal.Description); } result = Utilities.MakeListChoiceDialog("Select an Author Goal to pursue", choiceList, this); if (result > -1) { AuthorGoal goalToPursue = _currentStoryData.AuthorGoals[result]; ActionSubgoal newAction = new ActionSubgoal(_currentEntity.Id, goalToPursue.Id, _currentStoryData); _currentEntity.Actions.Add(newAction); if (goalToPursue.Parameters.Count > 0) { Window newWin = new WindowActionSubgoalEditor(false, _currentEntity, newAction, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } } } else if (result == 2) //Make a calculation { Action nullAction = null; List <string> existingVarNames = _currentEntity.getAllPreviouslyBoundVariableNames(nullAction, true); string varName = Utilities.MakeConstrainedTextDialog( "Please enter a name for the variable that will store the data in this calculation:", "That variable name has already been used.", existingVarNames, this); if (varName != null) { ActionCalculation newCalc = new ActionCalculation(_currentEntity.Id, varName, _currentStoryData); _currentEntity.Actions.Add(newCalc); Window newWin = new WindowActionCalculationEditor(_currentEntity, newCalc, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } } else if (result == 3) //Create a new object { List <string> newObjectChoices = new List <string>(); newObjectChoices.Add("Character"); newObjectChoices.Add("Environment"); foreach (PlotPointType pp in _currentStoryData.PlotPointTypes) { newObjectChoices.Add(pp.Description); } int resultCreateObject = Utilities.MakeListChoiceDialog("What type of object would you like to create?", newObjectChoices, this); if (resultCreateObject < 0) { return; } Action nullAction = null; List <string> existingVarNames = _currentEntity.getAllPreviouslyBoundVariableNames(nullAction, true); string varName = Utilities.MakeConstrainedTextDialog( "Please enter a name for the variable that will store your new Object", "That variable name has already been used.", existingVarNames, this); if (varName == null) { return; } if (resultCreateObject == 0) { string entityName = Utilities.MakeTextDialog("Please enter a name for the new Character:", this); if (entityName == null) { return; } ActionCreateCharacter newCreateEntityAction = new ActionCreateCharacter(_currentEntity.Id, entityName, varName, _currentStoryData); _currentEntity.Actions.Add(newCreateEntityAction); //Synchronize all traits and relationships if (_currentStoryData.Characters.Count > 1) { Utilities.SynchronizeTwoCharacters(_currentStoryData.Characters[0], newCreateEntityAction.NewCharacter, _currentStoryData); } clearDataBindings(); dataBind(); Window newWin = new WindowCharacterEditor(newCreateEntityAction.NewCharacter, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } else if (resultCreateObject == 1) { string entityName = Utilities.MakeTextDialog("Please enter a name for the new Environment:", this); if (entityName == null) { return; } ActionCreateEnvironment newCreateEntityAction = new ActionCreateEnvironment(_currentEntity.Id, entityName, varName, _currentStoryData); _currentEntity.Actions.Add(newCreateEntityAction); //Synchronize all traits and relationships if (_currentStoryData.Environments.Count > 1) { Utilities.SynchronizeTwoEnvironments(_currentStoryData.Environments[0], newCreateEntityAction.NewEnvironment, _currentStoryData); } clearDataBindings(); dataBind(); Window newWin = new WindowEnvironmentEditor(newCreateEntityAction.NewEnvironment, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } else { int plotPointIndex = resultCreateObject - 2; PlotPointType currType = _currentStoryData.PlotPointTypes[plotPointIndex]; ActionCreatePlotPoint newCreateEntityAction = new ActionCreatePlotPoint(_currentEntity.Id, currType, varName, _currentStoryData); _currentEntity.Actions.Add(newCreateEntityAction); clearDataBindings(); dataBind(); Window newWin = new WindowPlotPointEditor(newCreateEntityAction.NewPlotPoint, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } } else if (result == 4) //Edit a saved object { List <string> editObjectChoices = new List <string>(); editObjectChoices.Add("Character"); editObjectChoices.Add("Environment"); foreach (PlotPointType pp in _currentStoryData.PlotPointTypes) { editObjectChoices.Add(pp.Description); } int resultEditObject = Utilities.MakeListChoiceDialog("What type of object would you like to edit?", editObjectChoices, this); if (resultEditObject < 0) { return; } else if (resultEditObject == 0) //Edit character { List <string> editObjVarChoices = _currentEntity.getPreviouslyBoundCharacterVarNames(null); if (editObjVarChoices.Count == 0) { Utilities.MakeErrorDialog("There are no saved Character variables to edit", this); return; } int resultChooseEditTarget = Utilities.MakeListChoiceDialog( "What saved Character would you like to edit?", editObjVarChoices, this); if (resultChooseEditTarget < 0) { return; } ActionEditObject newEditObj = new ActionEditObject( _currentEntity.Id, editObjVarChoices[resultChooseEditTarget], _currentStoryData.CharTypeId, ObjectEditingMode.Trait, _currentStoryData); _currentEntity.Actions.Add(newEditObj); clearDataBindings(); dataBind(); Window newWin = new WindowActionEditEntity(_currentEntity, newEditObj, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } else if (resultEditObject == 1) //Edit Environment { List <string> editObjVarChoices = _currentEntity.getPreviouslyBoundEnvironmentVarNames(null); if (editObjVarChoices.Count == 0) { Utilities.MakeErrorDialog("There are no saved Environment variables to edit", this); return; } int resultChooseEditTarget = Utilities.MakeListChoiceDialog( "What saved Environment would you like to edit?", editObjVarChoices, this); if (resultChooseEditTarget < 0) { return; } ActionEditObject newEditObj = new ActionEditObject( _currentEntity.Id, editObjVarChoices[resultChooseEditTarget], _currentStoryData.EnvTypeId, ObjectEditingMode.Trait, _currentStoryData); _currentEntity.Actions.Add(newEditObj); clearDataBindings(); dataBind(); Window newWin = new WindowActionEditEntity(_currentEntity, newEditObj, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } else if (resultEditObject > 1) //Edit a Plot Point { int plotPointIndex = resultEditObject - 2; PlotPointType currType = _currentStoryData.PlotPointTypes[plotPointIndex]; if (currType.Traits.Count == 0) { Utilities.MakeErrorDialog("The " + currType.Description + " type has no traits to edit.", this); return; } List <string> editObjVarChoices = _currentEntity.getPreviouslyBoundPlotPointTypeVarNames(currType, null); if (editObjVarChoices.Count == 0) { Utilities.MakeErrorDialog("There are no saved " + currType.Description + " variables to edit", this); return; } int resultChooseEditTarget = Utilities.MakeListChoiceDialog( "What saved " + currType.Description + " would you like to edit?", editObjVarChoices, this); if (resultChooseEditTarget < 0) { return; } ActionEditObject newEditObj = new ActionEditObject( _currentEntity.Id, editObjVarChoices[resultChooseEditTarget], currType.Id, ObjectEditingMode.Trait, _currentStoryData); _currentEntity.Actions.Add(newEditObj); clearDataBindings(); dataBind(); Window newWin = new WindowActionEditEntity(_currentEntity, newEditObj, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } } else if (result == 5) //Delete a saved object { List <string> editObjectChoices = new List <string>(); editObjectChoices.Add("Character"); editObjectChoices.Add("Environment"); foreach (PlotPointType pp in _currentStoryData.PlotPointTypes) { editObjectChoices.Add("Plot Point: " + pp.Name); } int resultDelObject = Utilities.MakeListChoiceDialog("What type of object would you like to delete?", editObjectChoices, this); if (resultDelObject < 0) { return; } else if (resultDelObject == 0) //Delete character { List <string> deleteObjectChoices = _currentEntity.getPreviouslyBoundCharacterVarNames(null); if (deleteObjectChoices.Count == 0) { Utilities.MakeErrorDialog("There are no saved Character variables to delete", this); return; } int resultChooseDeletionTarget = Utilities.MakeListChoiceDialog( "What saved Character would you like to delete?", deleteObjectChoices, this); if (resultChooseDeletionTarget < 0) { return; } ActionDeleteEntity newDelEntity = new ActionDeleteEntity( _currentEntity.Id, deleteObjectChoices[resultChooseDeletionTarget], _currentStoryData.CharTypeId, _currentStoryData); _currentEntity.Actions.Add(newDelEntity); } else if (resultDelObject == 1) //Delete Environment { List <string> deleteObjectChoices = _currentEntity.getPreviouslyBoundEnvironmentVarNames(null); if (deleteObjectChoices.Count == 0) { Utilities.MakeErrorDialog("There are no saved Environment variables to delete", this); return; } int resultChooseDeletionTarget = Utilities.MakeListChoiceDialog( "What saved Environment would you like to delete?", deleteObjectChoices, this); if (resultChooseDeletionTarget < 0) { return; } ActionDeleteEntity newDelEntity = new ActionDeleteEntity( _currentEntity.Id, deleteObjectChoices[resultChooseDeletionTarget], _currentStoryData.EnvTypeId, _currentStoryData); _currentEntity.Actions.Add(newDelEntity); } else if (resultDelObject > 1) //Delete a Plot Point { int plotPointIndex = resultDelObject - 2; PlotPointType currType = _currentStoryData.PlotPointTypes[plotPointIndex]; List <string> deleteObjectChoices = _currentEntity.getPreviouslyBoundPlotPointTypeVarNames(currType, null); if (deleteObjectChoices.Count == 0) { Utilities.MakeErrorDialog("There are no saved " + currType.Description + " variables to delete", this); return; } int resultChooseDeletionTarget = Utilities.MakeListChoiceDialog( "What saved " + currType.Description + " would you like to delete?", deleteObjectChoices, this); if (resultChooseDeletionTarget < 0) { return; } ActionDeleteEntity newDelEntity = new ActionDeleteEntity( _currentEntity.Id, deleteObjectChoices[resultChooseDeletionTarget], currType.Id, _currentStoryData); _currentEntity.Actions.Add(newDelEntity); } } clearDataBindings(); dataBind(); }
public Interaction(string title, ActionSubgoal interactionGoal, StoryData world) { _title = title; _id = world.getNewId(); _interactionGoal = interactionGoal; }
private void btNewAction_Click(object sender, RoutedEventArgs e) { List<string> editChoices = new List<string>(); editChoices.Add("Output Text"); editChoices.Add("Pursue a Subgoal"); editChoices.Add("Make a Calculation"); editChoices.Add("Create a new Character/Environment/Plot Point"); editChoices.Add("Edit a saved Character/Environment/Plot Point"); editChoices.Add("Delete a saved Character/Environment/Plot Point"); int result = -1; result = Utilities.MakeListChoiceDialog("What type of Action would you like to create?", editChoices, this); if (result < 0) { return; } else if (result == 0) //Output Text { ActionTextOutput newTextOutputAction = new ActionTextOutput(_currentEntity.Id, "", _currentStoryData); _currentEntity.Actions.Add(newTextOutputAction); Window newWin = new WindowActionTextOutput(_currentEntity, newTextOutputAction); newWin.Owner = this; newWin.ShowDialog(); } else if (result == 1) //Pursue Subgoal { List<string> choiceList = new List<string>(); foreach (AuthorGoal goal in _currentStoryData.AuthorGoals) { choiceList.Add(goal.Description); } result = Utilities.MakeListChoiceDialog("Select an Author Goal to pursue", choiceList, this); if (result > -1) { AuthorGoal goalToPursue = _currentStoryData.AuthorGoals[result]; ActionSubgoal newAction = new ActionSubgoal(_currentEntity.Id, goalToPursue.Id, _currentStoryData); _currentEntity.Actions.Add(newAction); if(goalToPursue.Parameters.Count > 0) { Window newWin = new WindowActionSubgoalEditor(false, _currentEntity, newAction, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } } } else if (result == 2) //Make a calculation { Action nullAction = null; List<string> existingVarNames = _currentEntity.getAllPreviouslyBoundVariableNames(nullAction, true); string varName = Utilities.MakeConstrainedTextDialog( "Please enter a name for the variable that will store the data in this calculation:", "That variable name has already been used.", existingVarNames, this); if(varName != null) { ActionCalculation newCalc = new ActionCalculation(_currentEntity.Id, varName, _currentStoryData); _currentEntity.Actions.Add(newCalc); Window newWin = new WindowActionCalculationEditor(_currentEntity, newCalc, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } } else if (result == 3) //Create a new object { List<string> newObjectChoices = new List<string>(); newObjectChoices.Add("Character"); newObjectChoices.Add("Environment"); foreach (PlotPointType pp in _currentStoryData.PlotPointTypes) { newObjectChoices.Add(pp.Description); } int resultCreateObject = Utilities.MakeListChoiceDialog("What type of object would you like to create?", newObjectChoices, this); if (resultCreateObject < 0) { return; } Action nullAction = null; List<string> existingVarNames = _currentEntity.getAllPreviouslyBoundVariableNames(nullAction, true); string varName = Utilities.MakeConstrainedTextDialog( "Please enter a name for the variable that will store your new Object", "That variable name has already been used.", existingVarNames, this); if(varName == null) return; if(resultCreateObject == 0) { string entityName = Utilities.MakeTextDialog("Please enter a name for the new Character:", this); if (entityName == null) return; ActionCreateCharacter newCreateEntityAction = new ActionCreateCharacter(_currentEntity.Id, entityName, varName, _currentStoryData); _currentEntity.Actions.Add(newCreateEntityAction); //Synchronize all traits and relationships if (_currentStoryData.Characters.Count > 1) { Utilities.SynchronizeTwoCharacters(_currentStoryData.Characters[0], newCreateEntityAction.NewCharacter, _currentStoryData); } clearDataBindings(); dataBind(); Window newWin = new WindowCharacterEditor(newCreateEntityAction.NewCharacter, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } else if(resultCreateObject == 1) { string entityName = Utilities.MakeTextDialog("Please enter a name for the new Environment:", this); if (entityName == null) return; ActionCreateEnvironment newCreateEntityAction = new ActionCreateEnvironment(_currentEntity.Id, entityName, varName, _currentStoryData); _currentEntity.Actions.Add(newCreateEntityAction); //Synchronize all traits and relationships if (_currentStoryData.Environments.Count > 1) { Utilities.SynchronizeTwoEnvironments(_currentStoryData.Environments[0], newCreateEntityAction.NewEnvironment, _currentStoryData); } clearDataBindings(); dataBind(); Window newWin = new WindowEnvironmentEditor(newCreateEntityAction.NewEnvironment, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } else { int plotPointIndex = resultCreateObject - 2; PlotPointType currType = _currentStoryData.PlotPointTypes[plotPointIndex]; ActionCreatePlotPoint newCreateEntityAction = new ActionCreatePlotPoint(_currentEntity.Id, currType, varName, _currentStoryData); _currentEntity.Actions.Add(newCreateEntityAction); clearDataBindings(); dataBind(); Window newWin = new WindowPlotPointEditor(newCreateEntityAction.NewPlotPoint, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } } else if (result == 4) //Edit a saved object { List<string> editObjectChoices = new List<string>(); editObjectChoices.Add("Character"); editObjectChoices.Add("Environment"); foreach (PlotPointType pp in _currentStoryData.PlotPointTypes) { editObjectChoices.Add(pp.Description); } int resultEditObject = Utilities.MakeListChoiceDialog("What type of object would you like to edit?", editObjectChoices, this); if (resultEditObject < 0) { return; } else if (resultEditObject == 0) //Edit character { List<string> editObjVarChoices = _currentEntity.getPreviouslyBoundCharacterVarNames(null); if (editObjVarChoices.Count == 0) { Utilities.MakeErrorDialog("There are no saved Character variables to edit", this); return; } int resultChooseEditTarget = Utilities.MakeListChoiceDialog( "What saved Character would you like to edit?", editObjVarChoices, this); if (resultChooseEditTarget < 0) { return; } ActionEditObject newEditObj = new ActionEditObject( _currentEntity.Id, editObjVarChoices[resultChooseEditTarget], _currentStoryData.CharTypeId, ObjectEditingMode.Trait, _currentStoryData); _currentEntity.Actions.Add(newEditObj); clearDataBindings(); dataBind(); Window newWin = new WindowActionEditEntity(_currentEntity, newEditObj, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } else if (resultEditObject == 1) //Edit Environment { List<string> editObjVarChoices = _currentEntity.getPreviouslyBoundEnvironmentVarNames(null); if (editObjVarChoices.Count == 0) { Utilities.MakeErrorDialog("There are no saved Environment variables to edit", this); return; } int resultChooseEditTarget = Utilities.MakeListChoiceDialog( "What saved Environment would you like to edit?", editObjVarChoices, this); if (resultChooseEditTarget < 0) { return; } ActionEditObject newEditObj = new ActionEditObject( _currentEntity.Id, editObjVarChoices[resultChooseEditTarget], _currentStoryData.EnvTypeId, ObjectEditingMode.Trait, _currentStoryData); _currentEntity.Actions.Add(newEditObj); clearDataBindings(); dataBind(); Window newWin = new WindowActionEditEntity(_currentEntity, newEditObj, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } else if (resultEditObject > 1) //Edit a Plot Point { int plotPointIndex = resultEditObject - 2; PlotPointType currType = _currentStoryData.PlotPointTypes[plotPointIndex]; if(currType.Traits.Count == 0) { Utilities.MakeErrorDialog("The " + currType.Description + " type has no traits to edit.", this); return; } List<string> editObjVarChoices = _currentEntity.getPreviouslyBoundPlotPointTypeVarNames(currType, null); if (editObjVarChoices.Count == 0) { Utilities.MakeErrorDialog("There are no saved " + currType.Description + " variables to edit", this); return; } int resultChooseEditTarget = Utilities.MakeListChoiceDialog( "What saved " + currType.Description + " would you like to edit?", editObjVarChoices, this); if (resultChooseEditTarget < 0) { return; } ActionEditObject newEditObj = new ActionEditObject( _currentEntity.Id, editObjVarChoices[resultChooseEditTarget], currType.Id, ObjectEditingMode.Trait, _currentStoryData); _currentEntity.Actions.Add(newEditObj); clearDataBindings(); dataBind(); Window newWin = new WindowActionEditEntity(_currentEntity, newEditObj, _currentStoryData); newWin.Owner = this; newWin.ShowDialog(); } } else if (result == 5) //Delete a saved object { List<string> editObjectChoices = new List<string>(); editObjectChoices.Add("Character"); editObjectChoices.Add("Environment"); foreach (PlotPointType pp in _currentStoryData.PlotPointTypes) { editObjectChoices.Add("Plot Point: " + pp.Name); } int resultDelObject = Utilities.MakeListChoiceDialog("What type of object would you like to delete?", editObjectChoices, this); if (resultDelObject < 0) { return; } else if (resultDelObject == 0) //Delete character { List<string> deleteObjectChoices = _currentEntity.getPreviouslyBoundCharacterVarNames(null); if (deleteObjectChoices.Count == 0) { Utilities.MakeErrorDialog("There are no saved Character variables to delete", this); return; } int resultChooseDeletionTarget = Utilities.MakeListChoiceDialog( "What saved Character would you like to delete?", deleteObjectChoices, this); if (resultChooseDeletionTarget < 0) { return; } ActionDeleteEntity newDelEntity = new ActionDeleteEntity( _currentEntity.Id, deleteObjectChoices[resultChooseDeletionTarget], _currentStoryData.CharTypeId, _currentStoryData); _currentEntity.Actions.Add(newDelEntity); } else if (resultDelObject == 1) //Delete Environment { List<string> deleteObjectChoices = _currentEntity.getPreviouslyBoundEnvironmentVarNames(null); if (deleteObjectChoices.Count == 0) { Utilities.MakeErrorDialog("There are no saved Environment variables to delete", this); return; } int resultChooseDeletionTarget = Utilities.MakeListChoiceDialog( "What saved Environment would you like to delete?", deleteObjectChoices, this); if (resultChooseDeletionTarget < 0) { return; } ActionDeleteEntity newDelEntity = new ActionDeleteEntity( _currentEntity.Id, deleteObjectChoices[resultChooseDeletionTarget], _currentStoryData.EnvTypeId, _currentStoryData); _currentEntity.Actions.Add(newDelEntity); } else if (resultDelObject > 1) //Delete a Plot Point { int plotPointIndex = resultDelObject - 2; PlotPointType currType = _currentStoryData.PlotPointTypes[plotPointIndex]; List<string> deleteObjectChoices = _currentEntity.getPreviouslyBoundPlotPointTypeVarNames(currType,null); if (deleteObjectChoices.Count == 0) { Utilities.MakeErrorDialog("There are no saved " + currType.Description + " variables to delete", this); return; } int resultChooseDeletionTarget = Utilities.MakeListChoiceDialog( "What saved " + currType.Description + " would you like to delete?", deleteObjectChoices, this); if (resultChooseDeletionTarget < 0) { return; } ActionDeleteEntity newDelEntity = new ActionDeleteEntity( _currentEntity.Id, deleteObjectChoices[resultChooseDeletionTarget], currType.Id, _currentStoryData); _currentEntity.Actions.Add(newDelEntity); } } clearDataBindings(); dataBind(); }