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);
        }
        private void BuildScriptEventView(ScriptEvent p_Event, Framework.ContextVar p_Parent, bool p_First = false)
        {
            string  l_Name = "";
            var     l_Type = Game.EventTypes.Instance.GetType(p_Event.EventType);

            if (!p_First)
                l_Name = "[EVENT.ID=" + p_Event.ID.ToString() + "][" + l_Type.Name + "] => " + p_Event.Comment.Replace("\\n", " | ");

            Framework.ContextVar l_Var = p_First ? p_Parent : new Framework.ContextVar();

            l_Var.SetValue("Type", l_Type.Name);
            l_Var.SetValue("Chance", p_Event.Chance.ToString() + " %");
            l_Var.SetValue("Phase Mask", p_Event.PhaseMask.ToString());

            string l_Flags = "";

            foreach (var l_Flag in Game.EventFlags.Instance.Flags)
            {
                if ((p_Event.EventFlags & l_Flag.Value) != 0)
                    l_Flags += (l_Flags == "" ? "" : ", ") + l_Flag.Name;
            }

            l_Var.SetValue("Flags", l_Flags);
            l_Var.SetValue("Parameter 1 (" + l_Type.Param1 + ")", p_Event.Params[0].ToString());
            l_Var.SetValue("Parameter 2 (" + l_Type.Param2 + ")", p_Event.Params[1].ToString());
            l_Var.SetValue("Parameter 3 (" + l_Type.Param3 + ")", p_Event.Params[2].ToString());
            l_Var.SetValue("Parameter 4 (" + l_Type.Param4 + ")", p_Event.Params[3].ToString());
            l_Var.SetValue("Comment", p_Event.Comment.Replace("\\n", "\n"));

            l_Var.SetValue("Sub Events", new Framework.ContextVar());
            l_Var.SetValue("Actions", new Framework.ContextVar());

            foreach (var l_SubEvent in p_Event.SubEvents)
                BuildScriptEventView(l_SubEvent, l_Var.Nodes["Sub Events"]);

            foreach (var l_Action in p_Event.Actions)
                BuildScriptActionView(l_Action, l_Var.Nodes["Actions"]);

            if (!p_First)
                p_Parent.SetValue(l_Name, l_Var);
        }