コード例 #1
0
        public InterpGroup(int idx, ME3Package 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();
            if (bIsParented)
            {
                listEntry.TranslateBy(10, 0);
            }
        }
コード例 #2
0
        public override void Initialize()
        {
            PCanvas c   = Canvas;
            PLayer  l   = c.Layer;
            PCamera cam = c.Camera;

            cam.ScaleViewBy(2.0f);
            PPath path = PPath.CreateRectangle(0, 0, 100, 100);

            l.AddChild(path);
            path.TranslateBy(100, 10);
            path.ScaleBy(0.2f);
            cam.AnimateViewToCenterBounds(path.GlobalFullBounds, true, 1000);
        }
コード例 #3
0
ファイル: Timeline.cs プロジェクト: solarisstar/ME3Explorer
 public InterpData()
     : base()
 {
     InterpGroups = new List <InterpGroup>();
     TimelineView = new PNode();
     AddChild(TimelineView);
     TimelineView.MoveToBack();
     TimelineView.Pickable = false;
     //TimelineView.Brush = new SolidBrush(Color.FromArgb(60, 60, 60));
     TimelineView.SetBounds(0, 0, 3600, Height);
     TimelineView.TranslateBy(Timeline.ListWidth, 0);
     TimeScale = PPath.CreateRectangle(0, 0, 3600, Timeline.InfoHeight);
     TimeScale.TranslateBy(Timeline.ListWidth, 0);
     TimeScale.Pickable = false;
     TimeScale.Brush    = new SolidBrush(Color.FromArgb(80, 80, 80));
     AddChild(TimeScale);
     TimeScale.MoveToFront();
     //seperationLine = PPath.CreateLine(Timeline.ListWidth, 0, Timeline.ListWidth, 10);
     //seperationLine.Pickable = false;
     //AddChild(seperationLine);
 }
コード例 #4
0
        public override void Initialize()
        {
            PLayer l = new PLayer();
            PPath  n = PPath.CreateEllipse(0, 0, 100, 80);

            n.Brush = Brushes.Red;
            n.Pen   = null;
            PBoundsHandle.AddBoundsHandlesTo(n);
            l.AddChild(n);
            n.TranslateBy(200, 200);

            PCamera c = new PCamera();

            c.SetBounds(0, 0, 100, 80);
            c.ScaleViewBy(0.1f);
            c.AddLayer(l);
            PBoundsHandle.AddBoundsHandlesTo(c);
            c.Brush = Brushes.Yellow;

            Canvas.Layer.AddChild(l);
            Canvas.Layer.AddChild(c);
        }
コード例 #5
0
        public DStart(DialogueEditorWPF editor, int orderKey, int StartNbr, float x, float y, ConvGraphEditor ConvGraphEditor)
            : base(ConvGraphEditor)
        {
            NodeUID = 2000 + StartNbr;
            Editor  = editor;
            Order   = orderKey;
            string ordinal = DialogueEditorWPF.AddOrdinal(orderKey + 1);

            StartNumber = StartNbr;
            outlinePen  = new Pen(EventColor);
            listname    = $"{ordinal} Start Node: {StartNbr}";;

            float starty = 0;
            float w      = 15;
            float midW   = 50;

            GetTitleBox(listname, 20);

            w += titleBox.Width;
            OutputLink l = new OutputLink
            {
                Links        = new List <int>(StartNbr),
                InputIndices = new int(),
                Edges        = new List <DiagEdEdge>(),
                Desc         = $"Out {StartNbr}",
                RCat         = EReplyCategory.REPLY_CATEGORY_DEFAULT
            };
            int linkedOp = StartNbr;

            l.Links.Add(linkedOp);
            l.InputIndices  = 0;
            l.node          = CreateActionLinkBox();
            l.node.Brush    = outputBrush;
            l.node.Pickable = false;

            PPath dragger = CreateActionLinkBox();

            dragger.Brush = mostlyTransparentBrush;
            dragger.X     = l.node.X;
            dragger.Y     = l.node.Y;
            dragger.AddInputEventListener(outputDragHandler);
            l.node.AddChild(dragger);
            Outlinks.Add(l);
            outLinkBox = new PPath();
            DText t2 = new DText($"{StartNbr} :");

            if (t2.Width + 10 > midW)
            {
                midW = t2.Width + 10;
            }
            t2.X        = 0 - t2.Width;
            t2.Y        = starty - 10;
            t2.Pickable = false;
            t2.AddChild(l.node);
            outLinkBox.AddChild(t2);
            outLinkBox.AddPolygon(new[] { new PointF(0, 0), new PointF(0, starty), new PointF(-0.5f * midW, starty + 30), new PointF(0 - midW, starty), new PointF(0 - midW, 0), new PointF(midW / -2, -30) });
            outLinkBox.Pickable = false;
            outLinkBox.Pen      = outlinePen;
            outLinkBox.Brush    = nodeBrush;
            float h = titleBox.Height + 1;

            outLinkBox.TranslateBy(titleBox.Width / 2 + midW / 2, h + 30);

            h     += outLinkBox.Height + 1;
            bounds = new RectangleF(0, 0, w, h);
            AddChild(titleBox);
            AddChild(outLinkBox);
            Pickable = true;
            SetOffset(x, y);
            MouseEnter += OnMouseEnter;
            MouseLeave += OnMouseLeave;
        }
コード例 #6
0
        public WEvent(WwiseBank.Event hircEvent, float x, float y, WwiseGraphEditor grapheditor)
            : base(hircEvent, grapheditor)
        {
            outlinePen = new Pen(EventColor);
            const string s      = "Event";
            float        starty = 0;
            float        w      = 15;
            float        midW   = 0;

            varLinkBox = new PPath();
            GetLinks();
            foreach (var varLink in Varlinks)
            {
                string d  = string.Join(",", varLink.Links.Select(l => $"#{l}"));
                SText  t2 = new SText(d + "\n" + varLink.Desc)
                {
                    X        = w,
                    Y        = 0,
                    Pickable = false
                };
                w += t2.Width + 20;
                varLink.node.TranslateBy(t2.X + t2.Width / 2, t2.Y + t2.Height);
                t2.AddChild(varLink.node);
                varLinkBox.AddChild(t2);
            }
            if (Varlinks.Count != 0)
            {
                varLinkBox.AddRectangle(0, 0, w, varLinkBox[0].Height);
            }
            varLinkBox.Pickable = false;
            varLinkBox.Pen      = outlinePen;
            varLinkBox.Brush    = nodeBrush;
            outLinkBox          = new PPath();
            for (int i = 0; i < Outlinks.Count; i++)
            {
                string linkDesc = Outlinks[i].Desc;
                if (OutputNumbers && Outlinks[i].Links.Any())
                {
                    linkDesc += $": {string.Join(",", Outlinks[i].Links.Select(l => $"#{l}"))}";
                }
                SText t2 = new SText(linkDesc);
                if (t2.Width + 10 > midW)
                {
                    midW = t2.Width + 10;
                }
                //t2.TextAlignment = StringAlignment.Far;
                //t2.ConstrainWidthToTextWidth = false;
                t2.X        = 0 - t2.Width;
                t2.Y        = starty + 3;
                starty     += t2.Height + 6;
                t2.Pickable = false;
                Outlinks[i].node.TranslateBy(0, t2.Y + t2.Height / 2);
                t2.AddChild(Outlinks[i].node);
                outLinkBox.AddChild(t2);
            }
            outLinkBox.AddPolygon(new[] { new PointF(0, 0), new PointF(0, starty), new PointF(-0.5f * midW, starty + 30), new PointF(0 - midW, starty), new PointF(0 - midW, 0), new PointF(midW / -2, -30) });
            outLinkBox.Pickable = false;
            outLinkBox.Pen      = outlinePen;
            outLinkBox.Brush    = nodeBrush;
            float tW = GetTitleBox(s, w);

            if (tW > w)
            {
                if (midW > tW)
                {
                    w = midW;
                    titleBox.Width = w;
                }
                else
                {
                    w = tW;
                }
                varLinkBox.Width = w;
            }
            float h = titleBox.Height + 1;

            outLinkBox.TranslateBy(titleBox.Width / 2 + midW / 2, h + 30);
            h += outLinkBox.Height + 1;
            varLinkBox.TranslateBy(0, h);
            h     += varLinkBox.Height;
            bounds = new RectangleF(0, 0, w, h);
            AddChild(titleBox);
            AddChild(varLinkBox);
            AddChild(outLinkBox);
            SetOffset(x, y);
        }