Ejemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e) // Duplicate Action
        {
            var index = dataGridViewEventTemplates.SelectedRows[0].Index;

            var eventTemp = LoadedAsset.GetAllActions().ElementAt(index).Item1;

            //Cant add events with the same name so I have to rework their variables

            string newActionName = "Duplicate" + eventTemp.GetNTerm(3).ToString();


            var newEventTemp = WellFormedNames.Name.BuildName(
                (Name)AMConsts.EVENT,
                (Name)"Action-End",
                eventTemp.GetNTerm(2),
                (Name)newActionName,
                eventTemp.GetNTerm(4));

            var priority = LoadedAsset.GetAllActions().ElementAt(index).Item2;

            LoadedAsset.addActionTemplate((Name)newEventTemp, priority);

            LoadedAsset.AddActionEffects((Name)newEventTemp, LoadedAsset.GetAllEventEffects()[eventTemp].ToList());

            SetModified();

            RefreshEventList();
        }