Esempio n. 1
0
        public BlockingVolumeNode(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor)
            : base(idx, p, grapheditor)
        {
            string s = export.ObjectName;

            if (grapheditor.showVolumeBrushes && grapheditor.showVolume_BlockingVolume)
            {
                var TShape = get3DBrushShape();
                if (TShape != null)
                {
                    shape = PPath.CreatePolygon(TShape);
                }
                else
                {
                    shape = PPath.CreateRectangle(0, 0, 50, 50);
                }
            }
            else
            {
                shape = PPath.CreateRectangle(0, 0, 50, 50);
            }
            outlinePen     = new Pen(color);
            shape.Pen      = outlinePen;
            shape.Brush    = actorNodeBrush;
            shape.Pickable = false;
            this.AddChild(shape);
            this.Bounds       = new RectangleF(0, 0, 50, 50);
            val               = new SText(idx.ToString());
            val.Pickable      = false;
            val.TextAlignment = StringAlignment.Center;
            val.X             = 50 / 2 - val.Width / 2;
            val.Y             = 50 / 2 - val.Height / 2;
            this.AddChild(val);
            this.TranslateBy(x, y);
        }
Esempio n. 2
0
        public SFXNav_TurretPoint(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor)
            : base(idx, p, grapheditor)
        {
            string s = export.ObjectName;

            // = getType(s);
            float w         = 50;
            float h         = 50;
            PPath nodeShape = PPath.CreatePolygon(diamondshape);

            shape          = nodeShape;
            outlinePen     = new Pen(color);
            shape.Pen      = outlinePen;
            shape.Brush    = actorNodeBrush;
            shape.Pickable = false;
            this.AddChild(shape);
            this.Bounds       = new RectangleF(0, 0, w, h);
            val               = new SText(idx.ToString());
            val.Pickable      = false;
            val.TextAlignment = StringAlignment.Center;
            val.X             = w / 2 - val.Width / 2;
            val.Y             = h / 2 - val.Height / 2;
            this.AddChild(val);
            var props = export.GetProperties();

            this.TranslateBy(x, y);
        }
Esempio n. 3
0
        public InterpGroup(int idx, PCCObject pccobj)
            : base()
        {
            index = idx;
            pcc   = pccobj;

            title = new SText("");
            if (pcc.Exports[index].ClassName == "InterpGroupDirector")
            {
                GroupName = "DirGroup";
            }
            listEntry       = PPath.CreateRectangle(0, 0, Timeline.ListWidth, Timeline.TrackHeight);
            listEntry.Brush = GroupBrush;
            listEntry.Pen   = null;
            PPath p = PPath.CreatePolygon(7, 5, 12, 10, 7, 15);

            p.Brush = Brushes.Black;
            listEntry.AddChild(p);
            listEntry.AddChild(PPath.CreateLine(0, listEntry.Bounds.Bottom, Timeline.ListWidth, listEntry.Bounds.Bottom));
            colorAccent        = new PNode();
            colorAccent.Brush  = null;
            colorAccent.Bounds = new RectangleF(Timeline.ListWidth - 10, 0, 10, listEntry.Bounds.Bottom);
            listEntry.AddChild(colorAccent);
            title.TranslateBy(20, 3);
            listEntry.AddChild(title);
            listEntry.MouseDown += listEntry_MouseDown;
            collapsed            = true;
            InterpTracks         = new List <InterpTrack>();

            LoadData();
        }
Esempio n. 4
0
        public SFXNav_LadderNode(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor)
            : base(idx, p, grapheditor)
        {
            string s = export.ObjectName;

            // = getType(s);
            float        w        = 50;
            float        h        = 50;
            BoolProperty bTopNode = export.GetProperty <BoolProperty>("bTopNode");

            PointF[] shapetouse = laddertopshape;
            if (bTopNode == null || bTopNode.Value == false)
            {
                shapetouse = ladderbottomshape;
            }
            shape          = PPath.CreatePolygon(shapetouse);
            outlinePen     = new Pen(color);
            shape.Pen      = outlinePen;
            shape.Brush    = pathfindingNodeBrush;
            shape.Pickable = false;
            this.AddChild(shape);
            this.Bounds       = new RectangleF(0, 0, w, h);
            val               = new SText(idx.ToString());
            val.Pickable      = false;
            val.TextAlignment = StringAlignment.Center;
            val.X             = w / 2 - val.Width / 2;
            val.Y             = h / 2 - val.Height / 2;
            this.AddChild(val);
            var props = export.GetProperties();

            this.TranslateBy(x, y);
        }
Esempio n. 5
0
        public SplineActorNode(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor)
            : base(idx, p, grapheditor)
        {
            var splprop = export.GetProperty <ArrayProperty <StructProperty> >("Connections");

            if (splprop != null)
            {
                foreach (var prop in splprop)
                {
                    var spcomp  = prop.GetProp <ObjectProperty>("SplineComponent");
                    var cmpidx  = spcomp?.Value ?? 0;
                    var cntcomp = prop.GetProp <ObjectProperty>("ConnectTo");
                    pcc.TryGetUExport(cntcomp?.Value ?? 0, out ExportEntry cnctn);
                    if (spcomp != null && cmpidx > 0)
                    {
                        var component = pcc.GetUExport(cmpidx);
                        var spline    = new Spline(component, grapheditor, cnctn);
                        Splines.Add(spline);

                        spline.Pickable = false;
                        g.nodeLayer.AddChild(spline);
                    }
                    connections.Add(cnctn);
                }
            }

            Vector3 tangent = CommonStructs.GetVector3(export, "SplineActorTangent", new Vector3(300f, 0f, 0f));

            //(float controlPointX, float controlPointY, _) = tangent;

            (float controlPointX, float controlPointY, float controlPointZ) = ActorUtils.GetLocalToWorld(export).TransformNormal(tangent);

            LeaveTangentControlNode  = new SplinePointControlNode(this, controlPointX, controlPointY, controlPointZ, UpdateMode.LeaveTangent);
            ArriveTangentControlNode = new SplinePointControlNode(this, -controlPointX, -controlPointY, controlPointZ, UpdateMode.ArriveTangent);
            AddChild(LeaveTangentControlNode);
            AddChild(ArriveTangentControlNode);

            shape          = PPath.CreatePolygon(edgeShape);
            outlinePen     = new Pen(color);
            shape.Pen      = outlinePen;
            shape.Brush    = splineNodeBrush;
            shape.Pickable = false;
            AddChild(shape);
            float w = shape.Width;
            float h = shape.Height;

            Bounds = new RectangleF(0, 0, w, h);
            SText val = new SText(idx.ToString())
            {
                Pickable      = false,
                TextAlignment = StringAlignment.Center
            };

            val.X = w / 2 - val.Width / 2;
            val.Y = h / 2 - val.Height / 2;
            AddChild(val);
            SetOffset(x, y);
        }
Esempio n. 6
0
        public void SetShape(bool polygon)
        {
            if (shape != null)
            {
                RemoveChild(shape);
            }
            bool addVal = val == null;

            if (val == null)
            {
                val = new SText(index.ToString())
                {
                    Pickable      = false,
                    TextAlignment = StringAlignment.Center
                };
            }

            ShowAsPolygon = polygon;
            outlinePen    = new Pen(GetDefaultShapeColor()); //Can't put this in a class variable becuase it doesn't seem to work for some reason.
            if (polygon)
            {
                PointF[] polygonShape     = get3DBrushShape();
                int      calculatedHeight = get3DBrushHeight();
                if (polygonShape != null)
                {
                    shape = PPath.CreatePolygon(polygonShape);
                    var AveragePoint = GetAveragePoint(polygonShape);
                    val.X = AveragePoint.X - val.Width / 2;
                    val.Y = AveragePoint.Y - val.Height / 2;
                    if (calculatedHeight >= 0)
                    {
                        SText brushText = new SText($"Brush total height: {calculatedHeight}");
                        brushText.X             = AveragePoint.X - brushText.Width / 2;
                        brushText.Y             = AveragePoint.Y + 20 - brushText.Height / 2;
                        brushText.Pickable      = false;
                        brushText.TextAlignment = StringAlignment.Center;
                        shape.AddChild(brushText);
                    }
                    shape.Pen      = Selected ? selectedPen : outlinePen;
                    shape.Brush    = actorNodeBrush;
                    shape.Pickable = false;
                }
                else
                {
                    SetDefaultShape();
                }
            }
            else
            {
                SetDefaultShape();
            }
            AddChild(0, shape);
            if (addVal)
            {
                AddChild(val);
            }
        }
Esempio n. 7
0
        public override PPath GetDefaultShape()
        {
            BoolProperty bTopNode = export.GetProperty <BoolProperty>("bTopNode");

            PointF[] shapetouse = ladderbottomshape;
            if (bTopNode?.Value == true)
            {
                shapetouse = laddertopshape;
            }
            return(PPath.CreatePolygon(shapetouse));
        }
Esempio n. 8
0
        private void SetDefaultShape()
        {
            PPath defaultShape = PPath.CreatePolygon(GetDefaultShapePoints());

            shape          = defaultShape;
            shape.Pen      = Selected ? selectedPen : outlinePen;
            shape.Brush    = actorNodeBrush;
            shape.Pickable = false;
            val.X          = 50f / 2 - val.Width / 2;
            val.Y          = 50f / 2 - val.Height / 2;
        }
Esempio n. 9
0
        public BioTriggerVolume(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor)
            : base(idx, p, grapheditor)
        {
            string s = export.ObjectName;
            float  w = 50;
            float  h = 50;

            if (grapheditor.showVolumeBrushes && grapheditor.showVolume_BioTriggerVolume)
            {
                var brushShape = get3DBrushShape();
                if (brushShape != null)
                {
                    shape = PPath.CreatePolygon(brushShape);
                }
                else
                {
                    shape = PPath.CreatePolygon(TShape);
                }
            }
            else
            {
                shape = PPath.CreatePolygon(TShape);
            }

            outlinePen     = new Pen(color);
            shape.Pen      = outlinePen;
            shape.Brush    = actorNodeBrush;
            shape.Pickable = false;
            this.AddChild(shape);
            this.Bounds       = new RectangleF(0, 0, w, h);
            val               = new SText(idx.ToString());
            val.Pickable      = false;
            val.TextAlignment = StringAlignment.Center;
            val.X             = w / 2 - val.Width / 2;
            val.Y             = h / 2 - val.Height / 2;
            this.AddChild(val);
            var props = export.GetProperties();

            this.TranslateBy(x, y);


            /*if (comment != null)
             * {
             *  NameProperty tagProp = export.GetProperty<NameProperty>("Tag");
             *  if (tagProp != null)
             *  {
             *      string name = tagProp.Value;
             *      if (name != export.ObjectName)
             *      {
             *          comment.Text = name;
             *      }
             *  }
             * }*/
        }
Esempio n. 10
0
        public SplineParambleNode(float x, float y, bool arrow = false)
        {
            const float w     = 5;
            PPath       shape = arrow ? PPath.CreatePolygon(0, 0, 3 * w, 3 * w, 0, w, -3 * w, 3 * w) : PPath.CreateRectangle(0, 0, w, w);

            shape.Pen      = new Pen(color);
            shape.Brush    = new SolidBrush(color);
            shape.Pickable = false;
            AddChild(shape);
            TranslateBy(x, y);
            Pickable = false;
        }
Esempio n. 11
0
        public SFXObjectiveSpawnPoint(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor)
            : base(idx, p, grapheditor)
        {
            string s           = export.ObjectName;
            string commentText = comment.Text + "\nSpawnLocation: ";

            var spawnLocation = export.GetProperty <EnumProperty>("SpawnLocation");

            if (spawnLocation == null)
            {
                commentText += "Table";
            }
            else
            {
                commentText += spawnLocation.Value;
            }
            commentText += "\n";
            var spawnTagsProp = export.GetProperty <ArrayProperty <StrProperty> >("SupportedSpawnTags");

            if (spawnTagsProp != null)
            {
                foreach (string str in spawnTagsProp)
                {
                    commentText += str + "\n";
                }
            }
            // = getType(s);
            float w = 50;
            float h = 50;

            shape          = PPath.CreatePolygon(triangleshape);
            outlinePen     = new Pen(color);
            shape.Pen      = outlinePen;
            shape.Brush    = pathfindingNodeBrush;
            shape.Pickable = false;
            this.AddChild(shape);
            this.Bounds       = new RectangleF(0, 0, w, h);
            val               = new SText(idx.ToString());
            val.Pickable      = false;
            val.TextAlignment = StringAlignment.Center;
            val.X             = w / 2 - val.Width / 2;
            val.Y             = h / 2 - val.Height / 2;
            comment.Text      = commentText;

            this.AddChild(val);
            this.TranslateBy(x, y);
        }
Esempio n. 12
0
        protected ActorNode(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor, bool drawAsPolygon = false, bool drawRotationLine = false, bool drawAsCylinder = false)
        {
            pcc     = p;
            g       = grapheditor;
            index   = idx;
            export  = pcc.GetUExport(index);
            comment = new SText(GetComment(), commentColor, false)
            {
                X = 0
            };
            comment.Y        = 52 + comment.Height;
            comment.Pickable = false;

            if (drawRotationLine)
            {
                float theta = 0;
                if (export.GetProperty <StructProperty>("Rotation") is StructProperty rotation)
                {
                    theta = rotation.GetProp <IntProperty>("Yaw").Value.UnrealRotationUnitsToDegrees();
                }

                float circleX1 = (float)(25 + 20 * Math.Cos((theta + 5) * Math.PI / 180));
                float circleY1 = (float)(25 + 20 * Math.Sin((theta + 5) * Math.PI / 180));
                float circleX2 = (float)(25 + 20 * Math.Cos((theta - 5) * Math.PI / 180));
                float circleY2 = (float)(25 + 20 * Math.Sin((theta - 5) * Math.PI / 180));

                float circleTipX     = (float)(25 + 25 * Math.Cos(theta * Math.PI / 180));
                float circleTipY     = (float)(25 + 25 * Math.Sin(theta * Math.PI / 180));
                PPath directionShape = PPath.CreatePolygon(new[] { new PointF(25, 25), new PointF(circleX1, circleY1), new PointF(circleTipX, circleTipY), new PointF(circleX2, circleY2) });
                directionShape.Pen      = Pens.BlanchedAlmond;
                directionShape.Brush    = directionBrush;
                directionShape.Pickable = false;
                AddChild(directionShape);
            }
            this.AddChild(comment);
            this.Pickable = true;
            Bounds        = new RectangleF(0, 0, 50, 50);
            SetShape(drawAsPolygon, drawAsCylinder);
            if (drawAsPolygon && export.GetProperty <StructProperty>("PrePivot") is StructProperty pivotvector)
            {
                x = x - pivotvector.Properties.GetProp <FloatProperty>("X");
                y = y - pivotvector.Properties.GetProp <FloatProperty>("Y");
            }
            TranslateBy(x, y);
        }
Esempio n. 13
0
        public SMAC_ActorNode(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor)
            : base(idx, p, grapheditor)
        {
            string s = export.ObjectName;

            // = getType(s);
            float w = 50;
            float h = 50;

            shape          = PPath.CreatePolygon(SShape);
            outlinePen     = new Pen(color);
            shape.Pen      = outlinePen;
            shape.Brush    = actorNodeBrush;
            shape.Pickable = false;
            this.AddChild(shape);
            this.Bounds       = new RectangleF(0, 0, w, h);
            val               = new SText(idx.ToString());
            val.Pickable      = false;
            val.TextAlignment = StringAlignment.Center;
            val.X             = w / 2 - val.Width / 2;
            val.Y             = h / 2 - val.Height / 2;
            this.AddChild(val);
            var props = export.GetProperties();

            this.TranslateBy(x, y);


            ObjectProperty sm = export.GetProperty <ObjectProperty>("StaticMesh");

            if (sm != null)
            {
                IEntry meshexp = pcc.getEntry(sm.Value);
                string text    = comment.Text;
                if (text != "")
                {
                    text += "\n";
                }
                comment.Text = text + meshexp.ObjectName;
            }
        }
Esempio n. 14
0
        public SFXAmmoContainer(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) : base(idx, p, grapheditor)
        {
            string s = export.ObjectName;

            // = getType(s);
            float w = 50;
            float h = 50;

            shape          = PPath.CreatePolygon(ammoShape);
            outlinePen     = new Pen(color);
            shape.Pen      = outlinePen;
            shape.Brush    = actorNodeBrush;
            shape.Pickable = false;
            this.AddChild(shape);
            this.Bounds       = new RectangleF(0, 0, w, h);
            val               = new SText(idx.ToString());
            val.Pickable      = false;
            val.TextAlignment = StringAlignment.Center;
            val.X             = w / 2 - val.Width / 2;
            val.Y             = h / 2 - val.Height / 2;
            this.AddChild(val);
            this.TranslateBy(x, y);

            var    bRespawns   = export.GetProperty <BoolProperty>("bRespawns");
            var    respawnTime = export.GetProperty <IntProperty>("RespawnTime");
            string commentText = "Respawns: ";

            commentText += bRespawns != null?bRespawns.Value.ToString() : "False";

            if (respawnTime != null)
            {
                commentText += "\nRespawn time: " + respawnTime.Value + "s";
            }
            else if (bRespawns != null && bRespawns.Value == true)
            {
                commentText += "\nRespawn time: 20s";
            }

            comment.Text = commentText;
        }
Esempio n. 15
0
        public SFXCombatZone(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) : base(idx, p, grapheditor)
        {
            string s = export.ObjectName;

            // = getType(s);
            float w = 50;
            float h = 50;

            if (grapheditor.showVolumeBrushes && grapheditor.showVolume_SFXCombatZones)
            {
                var brushShape = get3DBrushShape();
                if (brushShape != null)
                {
                    shape = PPath.CreatePolygon(brushShape);
                }
                else
                {
                    shape = PPath.CreatePolygon(cShape);
                }
            }
            else
            {
                shape = PPath.CreatePolygon(cShape);
            }

            outlinePen     = new Pen(color);
            shape.Pen      = outlinePen;
            shape.Brush    = actorNodeBrush;
            shape.Pickable = false;
            this.AddChild(shape);
            this.Bounds       = new RectangleF(0, 0, w, h);
            val               = new SText(idx.ToString());
            val.Pickable      = false;
            val.TextAlignment = StringAlignment.Center;
            val.X             = w / 2 - val.Width / 2;
            val.Y             = h / 2 - val.Height / 2;
            this.AddChild(val);
            this.TranslateBy(x, y);
        }
Esempio n. 16
0
        public SplineActorNode(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor)
            : base(idx, p, grapheditor)
        {
            const float w = 50;
            const float h = 50;

            shape          = PPath.CreatePolygon(edgeShape);
            outlinePen     = new Pen(color);
            shape.Pen      = outlinePen;
            shape.Brush    = splineNodeBrush;
            shape.Pickable = false;
            this.AddChild(shape);
            this.Bounds = new RectangleF(0, 0, w, h);
            SText val = new SText(idx.ToString());

            val.Pickable      = false;
            val.TextAlignment = StringAlignment.Center;
            val.X             = w / 2 - val.Width / 2;
            val.Y             = h / 2 - val.Height / 2;
            this.AddChild(val);
            this.TranslateBy(x, y);
        }
Esempio n. 17
0
        public StaticMeshActorNode(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor)
            : base(idx, p, grapheditor)
        {
            string s = export.ObjectName;

            // = getType(s);
            float w = 50;
            float h = 50;

            shape          = PPath.CreatePolygon(aShape);
            outlinePen     = new Pen(color);
            shape.Pen      = outlinePen;
            shape.Brush    = actorNodeBrush;
            shape.Pickable = false;
            this.AddChild(shape);
            this.Bounds       = new RectangleF(0, 0, w, h);
            val               = new SText(idx.ToString());
            val.Pickable      = false;
            val.TextAlignment = StringAlignment.Center;
            val.X             = w / 2 - val.Width / 2;
            val.Y             = h / 2 - val.Height / 2;
            this.AddChild(val);
            this.TranslateBy(x, y);

            ObjectProperty smc = export.GetProperty <ObjectProperty>("StaticMeshComponent");

            if (smc != null)
            {
                IExportEntry smce = pcc.Exports[smc.Value - 1];
                //smce.GetProperty<ObjectProperty>("St")
                var meshObj = smce.GetProperty <ObjectProperty>("StaticMesh");
                if (meshObj != null)
                {
                    IExportEntry sme = pcc.Exports[meshObj.Value - 1];
                    comment.Text = sme.ObjectName;
                }
            }
        }
Esempio n. 18
0
        public SFXTreasureNode(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) : base(idx, p, grapheditor)
        {
            string s = export.ObjectName;

            // = getType(s);
            float w = 50;
            float h = 50;

            shape = PPath.CreatePolygon(soundShape);

            outlinePen     = new Pen(color);
            shape.Pen      = outlinePen;
            shape.Brush    = backgroundBrush;
            shape.Pickable = false;
            this.AddChild(shape);
            this.Bounds       = new RectangleF(0, 0, w, h);
            val               = new SText(idx.ToString());
            val.Pickable      = false;
            val.TextAlignment = StringAlignment.Center;
            val.X             = w / 2 - val.Width / 2;
            val.Y             = h / 2 - val.Height / 2;
            this.AddChild(val);
            this.TranslateBy(x, y);
        }
Esempio n. 19
0
        public void SetShape(bool polygon, bool cylinder = false)
        {
            if (shape != null)
            {
                RemoveChild(shape);
            }
            bool addVal = val == null;

            if (val == null)
            {
                val = new SText(index.ToString())
                {
                    Pickable      = false,
                    TextAlignment = StringAlignment.Center
                };
            }

            ShowAsPolygon  = polygon;
            ShowAsCylinder = cylinder;
            outlinePen     = new Pen(GetDefaultShapeColor()); //Can't put this in a class variable becuase it doesn't seem to work for some reason.
            if (polygon)
            {
                PointF[] polygonShape     = get3DBrushShape();
                int      calculatedHeight = get3DBrushHeight();
                if (polygonShape != null)
                {
                    shape = PPath.CreatePolygon(polygonShape);
                    var AveragePoint = GetAveragePoint(polygonShape);
                    val.X = AveragePoint.X - val.Width / 2;
                    val.Y = AveragePoint.Y - val.Height / 2;
                    if (calculatedHeight >= 0)
                    {
                        SText brushText = new SText($"Brush total height: {calculatedHeight}");
                        brushText.X             = AveragePoint.X - brushText.Width / 2;
                        brushText.Y             = AveragePoint.Y + 20 - brushText.Height / 2;
                        brushText.Pickable      = false;
                        brushText.TextAlignment = StringAlignment.Center;
                        shape.AddChild(brushText);
                    }
                    shape.Pen      = Selected ? selectedPen : outlinePen;
                    shape.Brush    = actorNodeBrush;
                    shape.Pickable = false;
                }
                else
                {
                    SetDefaultShape();
                }
            }
            else if (cylinder)
            {
                Tuple <float, float, float> dimensions = getCylinderDimensions();
                if (dimensions != null)
                {
                    var cylinderX = this.X - dimensions.Item1;
                    var cylinderY = this.Y - dimensions.Item2;
                    shape = PPath.CreateEllipse(cylinderX, cylinderY, dimensions.Item1 * 2, dimensions.Item2 * 2);
                    if (dimensions.Item3 >= 0)
                    {
                        SText heightText = new SText($"Cylinder total height: {dimensions.Item3}");
                        var   tw         = heightText.Width / 2;
                        var   th         = heightText.Height / 2;
                        heightText.X             = this.X - tw;
                        heightText.Y             = this.Y - th;
                        heightText.Pickable      = false;
                        heightText.TextAlignment = StringAlignment.Center;
                        shape.AddChild(heightText);
                    }
                    shape.Pen      = Selected ? selectedPen : outlinePen;
                    shape.Brush    = new SolidBrush(Color.FromArgb(80, 80, 0, 0));
                    shape.Pickable = false;
                }
                else
                {
                    SetDefaultShape();
                }
            }
            else
            {
                SetDefaultShape();
            }
            AddChild(0, shape);
            if (addVal)
            {
                AddChild(val);
            }
        }
Esempio n. 20
0
        public void LoadInterpData(int idx, PCCObject pccobject)
        {
            TimeScale.RemoveAllChildren();
            TimeScale.Width = 3600;
            TimelineView.RemoveAllChildren();
            TimelineView.Width = 3600;
            scrollbarH.Maximum = 3600;
            PPath line;
            SText text;

            for (int i = 0; i < TimeScale.Width; i += 60)
            {
                line          = PPath.CreateLine(i, 1, i, Timeline.InfoHeight);
                line.Pickable = false;
                line.Pen      = new Pen(Color.FromArgb(110, 110, 110));
                TimeScale.AddChild(line);
                text          = new SText(i / 60 - 1 + ".00", Color.FromArgb(175, 175, 175), false);
                text.Pickable = false;
                text.TranslateBy(i + 2, Timeline.InfoHeight - text.Height);
                TimeScale.AddChild(text);
            }

            pcc   = pccobject;
            index = idx;
            foreach (InterpGroup g in InterpGroups)
            {
                RemoveChild(g.listEntry);
            }
            InterpGroups.Clear();

            BitConverter.IsLittleEndian = true;
            List <PropertyReader.Property> props = PropertyReader.getPropList(pcc, pcc.Exports[index]);
            List <int> groups = new List <int>();

            foreach (PropertyReader.Property p in props)
            {
                if (pcc.getNameEntry(p.Name) == "InterpLength")
                {
                    InterpLength = BitConverter.ToSingle(p.raw, 24);
                }
                if (pcc.getNameEntry(p.Name) == "EdSectionStart")
                {
                    EdSectionStart = BitConverter.ToSingle(p.raw, 24);
                }
                if (pcc.getNameEntry(p.Name) == "EdSectionEnd")
                {
                    EdSectionEnd = BitConverter.ToSingle(p.raw, 24);
                }
                if (pcc.getNameEntry(p.Name) == "m_nBioCutSceneVersion")
                {
                    m_nBioCutSceneVersion = p.Value.IntValue;
                }
                if (pcc.getNameEntry(p.Name) == "m_pSFXSceneData")
                {
                    m_pSFXSceneData = p.Value.IntValue;
                }
                if (pcc.getNameEntry(p.Name) == "ObjInstanceVersion")
                {
                    ObjInstanceVersion = p.Value.IntValue;
                }
                if (pcc.getNameEntry(p.Name) == "ParentSequence")
                {
                    ParentSequence = p.Value.IntValue;
                }
                if (pcc.getNameEntry(p.Name) == "InterpGroups")
                {
                    for (int i = 0; i < p.Value.Array.Count; i += 4)
                    {
                        groups.Add(BitConverter.ToInt32(new byte[] { (byte)p.Value.Array[i].IntValue, (byte)p.Value.Array[i + 1].IntValue, (byte)p.Value.Array[i + 2].IntValue, (byte)p.Value.Array[i + 3].IntValue }, 0) - 1);
                    }
                }
            }
            foreach (int i in groups)
            {
                if (pcc.Exports[i].ClassName.StartsWith("InterpGroup"))
                {
                    addGroup(new InterpGroup(i, pcc));
                }
            }
            TimeScale.MoveToFront();
            PPath startmark = PPath.CreatePolygon(53, 1, 61, 1, 61, 9);

            startmark.Pen      = null;
            startmark.Brush    = new SolidBrush(Color.FromArgb(255, 80, 80));
            startmark.Pickable = false;
            TimeScale.AddChild(startmark);
            endmark       = PPath.CreatePolygon(InterpLength * 60 + 61, 1, InterpLength * 60 + 69, 1, InterpLength * 60 + 61, 9);
            endmark.Pen   = null;
            endmark.Brush = startmark.Brush;
            TimeScale.AddChild(endmark);
            foreach (InterpGroup g in InterpGroups)
            {
                foreach (InterpTrack t in g.InterpTracks)
                {
                    t.GetKeyFrames();
                    t.DrawKeyFrames();
                    TimelineView.AddChild(t.timelineEntry);
                }
            }
        }
Esempio n. 21
0
        public BioTriggerStream(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor)
            : base(idx, p, grapheditor)
        {
            string s = export.ObjectName;

            // = getType(s);
            float w = 50;
            float h = 50;

            outlinePen = new Pen(color);
            if (grapheditor.showVolumeBrushes && grapheditor.showVolume_BioTriggerStream)
            {
                var brushShape = get3DBrushShape();
                if (brushShape != null)
                {
                    shape = PPath.CreatePolygon(brushShape);
                }
                else
                {
                    shape = PPath.CreatePolygon(TShape);
                }
            }
            else
            {
                shape = PPath.CreatePolygon(TShape);
            }

            shape.Pen      = outlinePen;
            shape.Brush    = actorNodeBrush;
            shape.Pickable = false;
            this.AddChild(shape);

            this.Bounds       = new RectangleF(0, 0, w, h);
            val               = new SText(idx.ToString());
            val.Pickable      = false;
            val.TextAlignment = StringAlignment.Center;
            val.X             = w / 2 - val.Width / 2;
            val.Y             = h / 2 - val.Height / 2;
            this.AddChild(val);
            var props = export.GetProperties();

            this.TranslateBy(x, y);


            var exportProps = export.GetProperties();


            var streamingStates = exportProps.GetProp <ArrayProperty <StructProperty> >("StreamingStates");

            if (streamingStates != null)
            {
                string commentText = "";
                var    tierName    = exportProps.GetProp <NameProperty>("TierName");
                commentText += "Tier: " + tierName + "\n";
                foreach (StructProperty state in streamingStates)
                {
                    //List<string> visibleItems =
                    var stateName = state.GetProp <NameProperty>("StateName");
                    var items     = new List <string>();
                    commentText += "State: " + stateName + "\n";
                    var inChunkName = state.GetProp <NameProperty>("InChunkName");
                    commentText += "InChunkName: " + inChunkName + "\n";
                    var visibleChunkNames = state.GetProp <ArrayProperty <NameProperty> >("VisibleChunkNames");
                    if (visibleChunkNames != null)
                    {
                        foreach (NameProperty name in visibleChunkNames)
                        {
                            items.Add(name.Value);
                        }
                        items.Sort();
                        foreach (string item in items)
                        {
                            commentText += "   " + item + "\n";
                        }
                    }
                }
                comment.Text = commentText;
            }
        }
Esempio n. 22
0
 public override PPath GetDefaultShape() => PPath.CreatePolygon(outlineShape);