Exemple #1
0
        public DialogResult ShowDialog(string actionContext, AbilityActionCollection actionCollection)
        {
            actionGrammerEditor1.ActionContext = actionContext;
            actionGrammerEditor1.Variables = actionCollection.Variables;

            return base.ShowDialog();
        }
Exemple #2
0
        public override void LoadFromKeyValues(KeyValue kv)
        {
            base.LoadFromKeyValues(kv);

            ActionList = new AbilityActionCollection();

            foreach(string key in ActionList.Actions.Keys)
            {
                KeyValue kvActions = kv[key];
                if (kvActions == null) continue; //We don't have any actions there so skip
                foreach(KeyValue actionChild in kvActions.Children)
                {
                    if (!actionChild.HasChildren) continue; //TODO: Handle the Dontdestroy key
                    BaseAction action = DotaActionFactory.CreateNewAction(actionChild.Key);
                    if(action == null)
                    {
                        MessageBox.Show("WARNING: Action " + actionChild.Key + " not found in factory when creating ability: " + this.ClassName, "Loading Warning", MessageBoxButtons.OK);
                        continue;
                    }

                    action.LoadFromKeyValues(actionChild);
                    ActionList.Actions[key].Add(action);
                }
            }
        }