Ejemplo n.º 1
0
        private void BuildScriptActionView(ScriptAction p_Action, Framework.ContextVar p_Parent)
        {
            var     l_Type = Game.ActionTypes.Instance.GetType(p_Action.Type);
            string  l_Name = "[ACTION.ID=" + p_Action.ID.ToString() + "][" + l_Type.Name + "] => " + p_Action.Comment.Replace("\\n", " | ");

            Framework.ContextVar l_Var = new Framework.ContextVar();

            l_Var.SetValue("Type", l_Type.Name);
            l_Var.SetValue("Parameter 1 (" + l_Type.Param1 + ")", p_Action.Params[0].ToString());
            l_Var.SetValue("Parameter 2 (" + l_Type.Param2 + ")", p_Action.Params[1].ToString());
            l_Var.SetValue("Parameter 3 (" + l_Type.Param3 + ")", p_Action.Params[2].ToString());
            l_Var.SetValue("Parameter 4 (" + l_Type.Param4 + ")", p_Action.Params[3].ToString());
            l_Var.SetValue("Parameter 5 (" + l_Type.Param5 + ")", p_Action.Params[4].ToString());
            l_Var.SetValue("Parameter 6 (" + l_Type.Param6 + ")", p_Action.Params[5].ToString());

            l_Var.SetValue("Comment", p_Action.Comment.Replace("\\n", "\n"));

            var l_TargetType = Game.TargetTypes.Instance.GetType(p_Action.Type);

            l_Var.SetValue("Target Type", l_TargetType.Name);
            l_Var.SetValue("Target Parameter 1 (" + l_TargetType.Param1 + ")", p_Action.TargetParams[0].ToString());
            l_Var.SetValue("Target Parameter 2 (" + l_TargetType.Param2 + ")", p_Action.TargetParams[1].ToString());
            l_Var.SetValue("Target Parameter 3 (" + l_TargetType.Param3 + ")", p_Action.TargetParams[2].ToString());

            l_Var.SetValue("Target X", p_Action.TargetX.ToString());
            l_Var.SetValue("Target Y", p_Action.TargetY.ToString());
            l_Var.SetValue("Target Z", p_Action.TargetZ.ToString());
            l_Var.SetValue("Target O", p_Action.TargetO.ToString());

            p_Parent.SetValue(l_Name, l_Var);
        }
Ejemplo n.º 2
0
        private void RefreshEventList()
        {
            EventView.Nodes.Clear();

            List<String> l_AutoExpand = new List<String>();
            l_AutoExpand.Add("Sub Events");

            foreach (var l_Event in Script.Events)
            {
                Framework.ContextVar l_Data = new Framework.ContextVar();
                BuildScriptEventView(l_Event, l_Data, true);

                var     l_Type = Game.EventTypes.Instance.GetType(l_Event.EventType);
                string l_Name  = "[EVENT.ID=" + l_Event.ID.ToString() + "][" + l_Type.Name + "] => " + l_Event.Comment;

                TreeNode l_Node = new TreeNode(l_Name);
                Framework.Formating.ContextVarToTreeNode("root", l_Data, l_Node, l_AutoExpand);

                l_Node.Expand();

                EventView.Nodes.Add(l_Node);
            }
        }