private void btNewPrecond_Click(object sender, RoutedEventArgs e)
        {
            List <string> newChoices = new List <string>();

            newChoices.Add("Character Constraint");
            newChoices.Add("Environment Constraint");

            foreach (PlotPointType pp in _currentStoryData.PlotPointTypes)
            {
                newChoices.Add(pp.Description + " Constraint");
            }

            int result = -1;

            result = Utilities.MakeListChoiceDialog("What type of constraint would you like to create?", newChoices, this);


            if (result < 0)
            {
                return;
            }


            //ASK FOR EXISTENCE OR NONEXISTENCE - THIS CANNOT BE CHANGED IN THE EDITOR
            //changes would result in the editor having to wipe out variable saves within constraints and generally it would be extra work
            //to maintain

            List <string> existNonExistChoices = new List <string>();

            existNonExistChoices.Add("The object must exist");
            existNonExistChoices.Add("The object must NOT exist");

            int resultExistence = Utilities.MakeListChoiceDialog("Would like the object you are matching to exist or not exist in the story world?", existNonExistChoices, this);


            if (resultExistence < 0)
            {
                return;
            }

            bool objectExists = (resultExistence == 0);

            if (result == 0) //Character
            {
                if (Utilities.getGlobalCharacterList(_currentStoryData).Count == 0)
                {
                    Utilities.MakeErrorDialog("Please make a new Character, either in the Character editor, or within a Create Object action, before creating Character-matching precondition statements.", this);
                    return;
                }
                PreconditionStatementCharacter newPrecond = new PreconditionStatementCharacter(_currentEntity.Id, _currentStoryData);
                newPrecond.ObjectExists = objectExists;
                _currentEntity.PrecStatements.Add(newPrecond);
                clearDataBindings();
                dataBind();

                Window newWin = new WindowPreconditionEditor(_currentEntity, newPrecond, _currentStoryData);
                newWin.Owner = this;
                newWin.ShowDialog();
            }
            else if (result == 1) //Environment
            {
                if (Utilities.getGlobalEnvironmentList(_currentStoryData).Count == 0)
                {
                    Utilities.MakeErrorDialog("Please make a new Environment, either in the Environment editor, or within a Create Environment action, before creating Environment-matching precondition statements.", this);
                    return;
                }
                PreconditionStatementEnvironment newPrecond = new PreconditionStatementEnvironment(_currentEntity.Id, _currentStoryData);
                newPrecond.ObjectExists = objectExists;
                _currentEntity.PrecStatements.Add(newPrecond);
                clearDataBindings();
                dataBind();

                Window newWin = new WindowPreconditionEditor(_currentEntity, newPrecond, _currentStoryData);
                newWin.Owner = this;
                newWin.ShowDialog();
            }
            else if (result > 1) //PlotPointType
            {
                int           plotPointIndex = result - 2;
                PlotPointType currType       = _currentStoryData.PlotPointTypes[plotPointIndex];

                if (currType.Traits.Count == 0)
                {
                    Utilities.MakeErrorDialog("The " + currType.Description + " type has no traits to save or compare, and therefore cannot be used in a Precondition statement", this);
                    return;
                }
                PreconditionStatementPlotPoint newPrecond = new PreconditionStatementPlotPoint(_currentEntity.Id, currType, _currentStoryData);
                newPrecond.ObjectExists = objectExists;
                _currentEntity.PrecStatements.Add(newPrecond);
                clearDataBindings();
                dataBind();
                Window newWin = new WindowPreconditionEditor(_currentEntity, newPrecond, _currentStoryData);
                newWin.Owner = this;
                newWin.ShowDialog();
            }
            clearDataBindings();
            dataBind();
        }
        private void btNewPrecond_Click(object sender, RoutedEventArgs e)
        {
            List<string> newChoices = new List<string>();
            newChoices.Add("Character Constraint");
            newChoices.Add("Environment Constraint");

            foreach (PlotPointType pp in _currentStoryData.PlotPointTypes)
            {
                newChoices.Add(pp.Description + " Constraint");
            }

            int result = -1;

            result = Utilities.MakeListChoiceDialog("What type of constraint would you like to create?", newChoices, this);

            if(result < 0)
            {
                return;
            }

            //ASK FOR EXISTENCE OR NONEXISTENCE - THIS CANNOT BE CHANGED IN THE EDITOR
            //changes would result in the editor having to wipe out variable saves within constraints and generally it would be extra work
            //to maintain

            List<string> existNonExistChoices = new List<string>();
            existNonExistChoices.Add("The object must exist");
            existNonExistChoices.Add("The object must NOT exist");

            int resultExistence = Utilities.MakeListChoiceDialog("Would like the object you are matching to exist or not exist in the story world?", existNonExistChoices, this);

            if (resultExistence < 0)
            {
                return;
            }

            bool objectExists = (resultExistence == 0);

            if (result == 0) //Character
            {
                if(Utilities.getGlobalCharacterList(_currentStoryData).Count == 0)
                {
                    Utilities.MakeErrorDialog("Please make a new Character, either in the Character editor, or within a Create Object action, before creating Character-matching precondition statements.", this);
                    return;
                }
                PreconditionStatementCharacter newPrecond = new PreconditionStatementCharacter(_currentEntity.Id, _currentStoryData);
                newPrecond.ObjectExists = objectExists;
                _currentEntity.PrecStatements.Add(newPrecond);
                clearDataBindings();
                dataBind();

                Window newWin = new WindowPreconditionEditor(_currentEntity, newPrecond, _currentStoryData);
                newWin.Owner = this;
                newWin.ShowDialog();

            }
            else if (result == 1) //Environment
            {
                if (Utilities.getGlobalEnvironmentList(_currentStoryData).Count == 0)
                {
                    Utilities.MakeErrorDialog("Please make a new Environment, either in the Environment editor, or within a Create Environment action, before creating Environment-matching precondition statements.", this);
                    return;
                }
                PreconditionStatementEnvironment newPrecond = new PreconditionStatementEnvironment(_currentEntity.Id, _currentStoryData);
                newPrecond.ObjectExists = objectExists;
                _currentEntity.PrecStatements.Add(newPrecond);
                clearDataBindings();
                dataBind();

                Window newWin = new WindowPreconditionEditor(_currentEntity, newPrecond, _currentStoryData);
                newWin.Owner = this;
                newWin.ShowDialog();

            }
            else if (result > 1) //PlotPointType
            {
                int plotPointIndex = result - 2;
                PlotPointType currType = _currentStoryData.PlotPointTypes[plotPointIndex];

                if(currType.Traits.Count == 0)
                {
                    Utilities.MakeErrorDialog("The " + currType.Description + " type has no traits to save or compare, and therefore cannot be used in a Precondition statement", this);
                    return;
                }
                PreconditionStatementPlotPoint newPrecond = new PreconditionStatementPlotPoint(_currentEntity.Id, currType, _currentStoryData);
                newPrecond.ObjectExists = objectExists;
                _currentEntity.PrecStatements.Add(newPrecond);
                clearDataBindings();
                dataBind();
                Window newWin = new WindowPreconditionEditor(_currentEntity, newPrecond, _currentStoryData);
                newWin.Owner = this;
                newWin.ShowDialog();

            }
            clearDataBindings();
            dataBind();
        }