コード例 #1
0
        public override void Draw(Structures.EntityRenderProp Properties)
        {
            DevicePanel d = Properties.Graphics;

            Classes.Scene.EditorEntity entity = Properties.EditorObject;

            int x            = Properties.DrawX;
            int y            = Properties.DrawY;
            int Transparency = Properties.Transparency;

            int  type       = (int)entity.attributesMap["type"].ValueEnum;
            int  amplitudeX = (int)(entity.attributesMap["amplitude"].ValueVector2.X.High);
            int  amplitudeY = (int)(entity.attributesMap["amplitude"].ValueVector2.Y.High);
            bool fliph      = false;
            bool flipv      = false;
            int  animID     = 0;

            switch (type)
            {
            case 0:
                break;

            case 1:
                flipv = true;
                break;

            case 2:
                animID = 3;
                break;

            case 3:
                animID = 3;
                fliph  = true;
                break;

            default:
                break;
            }

            if (amplitudeX != 0 || amplitudeY != 0)
            {
                d.DrawArrow(x, y, x - amplitudeX, y - amplitudeY, System.Drawing.Color.YellowGreen, 2);
                d.DrawArrow(x, y, x + amplitudeX, y + amplitudeY, System.Drawing.Color.YellowGreen, 2);
            }

            var editorAnim = LoadAnimation("CPZ/StickyPlatform.bin", d, animID, 0);

            DrawTexturePivotNormal(d, editorAnim, editorAnim.RequestedAnimID, editorAnim.RequestedFrameID, x, y, Transparency, fliph, flipv);
        }
コード例 #2
0
        public void DrawLinkArrow(DevicePanel d, EditorEntity start, EditorEntity end)
        {
            if (SetFilter(end) == true)
            {
                return;
            }
            int startX = start.Position.X.High;
            int startY = start.Position.Y.High;
            int endX   = end.Position.X.High;
            int endY   = end.Position.Y.High;

            int dx = endX - startX;
            int dy = endY - startY;

            int offsetX            = 0;
            int offsetY            = 0;
            int offsetDestinationX = 0;
            int offsetDestinationY = 0;

            if (Math.Abs(dx) > Math.Abs(dy))
            {
                // horizontal difference greater than vertical difference
                offsetY            = Methods.Solution.SolutionConstants.ENTITY_NAME_BOX_HALF_HEIGHT;
                offsetDestinationY = Methods.Solution.SolutionConstants.ENTITY_NAME_BOX_HALF_HEIGHT;

                if (dx > 0)
                {
                    offsetX = Methods.Solution.SolutionConstants.ENTITY_NAME_BOX_WIDTH;
                }
                else
                {
                    offsetDestinationX = Methods.Solution.SolutionConstants.ENTITY_NAME_BOX_WIDTH;
                }
            }
            else
            {
                // vertical difference greater than horizontal difference
                offsetX            = Methods.Solution.SolutionConstants.ENTITY_NAME_BOX_HALF_WIDTH;
                offsetDestinationX = Methods.Solution.SolutionConstants.ENTITY_NAME_BOX_HALF_WIDTH;

                if (dy > 0)
                {
                    offsetY = Methods.Solution.SolutionConstants.ENTITY_NAME_BOX_HEIGHT;
                }
                else
                {
                    offsetDestinationY = Methods.Solution.SolutionConstants.ENTITY_NAME_BOX_HEIGHT;
                }
            }

            d.DrawArrow(startX + offsetX,
                        startY + offsetY,
                        end.Position.X.High + offsetDestinationX,
                        end.Position.Y.High + offsetDestinationY,
                        Color.GreenYellow);
        }
コード例 #3
0
        public void DrawLinkArrowTransportTubes(DevicePanel Graphics, ManiacEditor.Classes.Scene.EditorEntity start, ManiacEditor.Classes.Scene.EditorEntity end, int destType, int sourceType)
        {
            Color color = Color.Transparent;

            switch (destType)
            {
            case 4:
                color = Color.Yellow;
                break;

            case 3:
                color = Color.Red;
                break;
            }
            if (sourceType == 2)
            {
                switch (destType)
                {
                case 4:
                    color = Color.Green;
                    break;

                case 3:
                    color = Color.Red;
                    break;
                }
            }
            int startX = start.Position.X.High;
            int startY = start.Position.Y.High;
            int endX   = end.Position.X.High;
            int endY   = end.Position.Y.High;

            int dx = endX - startX;
            int dy = endY - startY;

            int offsetX            = 0;
            int offsetY            = 0;
            int offsetDestinationX = 0;
            int offsetDestinationY = 0;

            Graphics.DrawArrow(startX + offsetX,
                               startY + offsetY,
                               end.Position.X.High + offsetDestinationX,
                               end.Position.Y.High + offsetDestinationY,
                               color);
        }
コード例 #4
0
        public void DrawCenteredLinkArrow(DevicePanel d, EditorEntity start, EditorEntity end, Color?colur = null)
        {
            //if (SetFilter(end) == true) return;
            Color color  = (colur != null ? colur.Value : Color.GreenYellow);
            int   startX = start.Position.X.High;
            int   startY = start.Position.Y.High;
            int   endX   = end.Position.X.High;
            int   endY   = end.Position.Y.High;

            int dx = endX - startX;
            int dy = endY - startY;

            int offsetX            = 0;
            int offsetY            = 0;
            int offsetDestinationX = 0;
            int offsetDestinationY = 0;

            d.DrawArrow(startX + offsetX,
                        startY + offsetY,
                        end.Position.X.High + offsetDestinationX,
                        end.Position.Y.High + offsetDestinationY,
                        color, 2);
        }
コード例 #5
0
        public override void Draw(Structures.EntityRenderProp Properties)
        {
            DevicePanel d = Properties.Graphics;

            Classes.Scene.EditorEntity e = Properties.EditorObject;
            int x            = Properties.DrawX;
            int y            = Properties.DrawY;
            int Transparency = Properties.Transparency;

            bool fliph = false;
            bool flipv = false;

            int distance = (int)e.attributesMap["distance"].ValueInt32;

            if (distance != 0)
            {
                d.DrawArrow(x, y, x, y - distance, SystemColors.Yellow, 2);
            }

            var Animation = LoadAnimation("SSZ2/Firework.bin", d, 0, 0);

            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x, y, Transparency, fliph, flipv);
        }