示例#1
0
        private void drawAIScript(Graphics gr, AI_Script script)
        {
            int i;
            Pen pen = Pens.DarkSlateBlue;
            Brush brush = Brushes.DarkSlateBlue;
            Vector2 current = Vector2.Zero;
            Vector2 temp = Vector2.Zero;
            AI_ScriptNode node;

            for (i = 0; i < script.Count; i++)
            {
                if (script == SelectedAI)
                {
                    pen = new Pen(Color.GreenYellow, 2);
                    brush = Brushes.GreenYellow;
                }
                if (script.getNode(i) == SelectedAIScriptNode)
                    temp = current;
                drawScriptSegment(gr, brush, pen, ref current, script.getNode(i));
            }
            // if a node is selected and we are drawing the selected script
            if (SelectedAIScriptNode != null)
            {
                if (script == SelectedAI)
                    drawScriptSegment(gr, Brushes.Red, new Pen(Color.Red, 2), ref temp, SelectedAIScriptNode);
            }
        }
示例#2
0
 private void AddAIScriptToTree(AI_Script ai)
 {
     int i;
     TreeNode subNode;
     TreeNode scriptNode = new TreeNode("Script " + ai.ID);
     scriptNode.Tag = ai;
     for (i = 0; i < ai.Count; i++)
     {
         subNode = new TreeNode(ai.getNode(i).ToString());
         subNode.Tag = ai.getNode(i);
         scriptNode.Nodes.Add(subNode);
     }
     tvAIScripts.Nodes.Add(scriptNode);
 }