コード例 #1
0
ファイル: NewActionDialog.cs プロジェクト: hex6/WorldSmith
        public DialogResult ShowDialog(string actionContext, AbilityActionCollection actionCollection)
        {
            actionGrammerEditor1.ActionContext = actionContext;
            actionGrammerEditor1.Variables = actionCollection.Variables;

            return base.ShowDialog();
        }
コード例 #2
0
ファイル: DotaAbilityParser.cs プロジェクト: hex6/WorldSmith
        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);
                }
            }
        }